mlua

Trait ErrorContext

source
pub trait ErrorContext: Sealed {
    // Required methods
    fn context<C: Display>(self, context: C) -> Self;
    fn with_context<C: Display>(self, f: impl FnOnce(&Error) -> C) -> Self;
}
Expand description

Provides the context method for Error and Result<T, Error>.

Required Methods§

source

fn context<C: Display>(self, context: C) -> Self

Wraps the error value with additional context.

source

fn with_context<C: Display>(self, f: impl FnOnce(&Error) -> C) -> Self

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.

Implementors§