Trait lumina_node_wasm::error::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.

Object Safety§

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>,