lumina_node_wasm::error

Trait Context

Source
pub trait Context<T> {
    // Required method
    fn context<C>(self, context: C) -> Result<T, Error>
       where C: Display;

    // Provided method
    fn with_context<F, C>(self, context_fn: F) -> Result<T, Error>
       where C: Display,
             F: FnOnce() -> C,
             Self: Sized { ... }
}
Expand description

Utility to add more context to the Error.

Required Methods§

Source

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

Adds more context to the Error.

Provided Methods§

Source

fn with_context<F, C>(self, context_fn: F) -> Result<T, Error>
where C: Display, F: FnOnce() -> C, Self: Sized,

Adds more context to the Error that is evaluated lazily.

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.

Implementations on Foreign Types§

Source§

impl<T> Context<T> for Option<T>

Source§

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

Implementors§

Source§

impl<T, E> Context<T> for Result<T, E>
where E: Into<Error>,