Skip to main content

HandlerResultExt

Trait HandlerResultExt 

Source
pub trait HandlerResultExt<T> {
    // Required methods
    fn benign_err(self) -> Result<T, HandlerError>;
    fn recoverable_err(self) -> Result<T, HandlerError>;
    fn unrecoverable_err(self) -> Result<T, HandlerError>;
}
Expand description

Extension helpers for classifying fallible results in component handlers.

These methods keep error classification local to the handler call site while still allowing convenient use of the ? operator.

§Example


fn handler() -> HandlerResult {
    lookup().recoverable_err()?;
    Handled::OK
}

Required Methods§

Source

fn benign_err(self) -> Result<T, HandlerError>

Classify an Err value as HandlerError::Benign.

Source

fn recoverable_err(self) -> Result<T, HandlerError>

Classify an Err value as HandlerError::Recoverable.

Source

fn unrecoverable_err(self) -> Result<T, HandlerError>

Classify an Err value as HandlerError::Unrecoverable.

Implementations on Foreign Types§

Source§

impl<T, E> HandlerResultExt<T> for Result<T, E>
where E: Error + Send + 'static,

Implementors§