Skip to main content

Result

Type Alias Result 

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

The crate’s result type: Result<T, CaptureError>. Mirrors anyhow::Result so a call site keeps its Result<T> signatures and only swaps the import.

Aliased Type§

pub enum Result<T, E = CaptureError> {
    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, E: StdError + Send + Sync + 'static> Context<T> for Result<T, E>

Source§

fn context(self, context: impl Into<String>) -> Result<T, CaptureError>

Wrap the error with a fixed context message.
Source§

fn with_context<S: Into<String>>( self, f: impl FnOnce() -> S, ) -> Result<T, CaptureError>

Wrap the error with a lazily-built context message (only computed on error).