Skip to main content

Result

Type Alias Result 

Source
pub type Result<T> = Result<T, Error>;
Expand description

Convenience type alias of std::result::Result with error type Error.

This type alias is also re-exported in libgm::prelude.

Aliased Type§

pub enum Result<T> {
    Ok(T),
    Err(Error),
}

Variants§

§1.0.0

Ok(T)

Contains the success value

§1.0.0

Err(Error)

Contains the error value

Trait Implementations§

Source§

impl<T> Context<T> for Result<T>

Source§

fn context(self, context: &str) -> Self

Adds context to this Result. This pushes a string to the end of the error context chain in case of Err and is a no-op in case of Ok. Read more
Source§

fn with_context(self, f: impl FnOnce() -> String) -> Self

Adds context to this Result using the given closure that returns a String. Read more