Trait rlua::prelude::LuaErrorContext
source · 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§
sourcefn context<C>(self, context: C) -> Selfwhere
C: Display,
fn context<C>(self, context: C) -> Selfwhere
C: Display,
Wraps the error value with additional context.
sourcefn 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.
Object Safety§
This trait is not object safe.