Skip to main content

Result

Type Alias Result 

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

Result type alias.

  • Result<T> = core::result::Result<T, Handled> (type-erased)
  • Result<T, Handled<io::Error>> = preserves concrete error type

Aliased Type§

pub enum Result<T, E = Handled> {
    Ok(T),
    Err(E),
}

Variants§

§1.0.0

Ok(T)

Contains the success value

§1.0.0

Err(E)

Contains the error value

Trait Implementations§

Source§

impl<T> HandleExt<T> for Result<T>

Source§

fn then<U, F>(self, f: F) -> Result<U>
where F: FnOnce(T) -> Result<U>,

Chain another operation, adding a frame on error.
Source§

fn then_with<U, F>(self, ctx: impl Into<String>, f: F) -> Result<U>
where F: FnOnce(T) -> Result<U>,

Chain another operation with context message.
Source§

fn context(self, ctx: impl Into<String>) -> Self

Add context message to error.
Source§

fn attach(self, key: &'static str, val: impl IntoValue) -> Self

Add key-value attachment to error with typed value.