Trait LuaErrorContext
pub trait LuaErrorContext: Sealed {
// Required methods
fn context<C>(self, context: C) -> Self
where C: Display;
fn with_context<C>(self, f: impl FnOnce(&Error) -> C) -> Self
where C: Display;
}Expand description
Provides the context method for Error and Result<T, Error>.
Required Methods§
fn context<C>(self, context: C) -> Selfwhere
C: Display,
fn context<C>(self, context: C) -> Selfwhere
C: Display,
Wraps the error value with additional context.
fn with_context<C>(self, f: impl FnOnce(&Error) -> C) -> Selfwhere
C: Display,
fn with_context<C>(self, f: impl FnOnce(&Error) -> C) -> Selfwhere
C: Display,
Wrap the error value with additional context that is evaluated lazily only once an error does occur.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.