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§

source

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

Wraps the error value with additional context.

source

fn with_context<C>(self, f: impl FnOnce(&Error) -> C) -> Self
where 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.

Implementations on Foreign Types§

source§

impl<T> ErrorContext for Result<T, Error>

source§

fn context<C>(self, context: C) -> Result<T, Error>
where C: Display,

source§

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

Implementors§