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§
Sourcefn benign_err(self) -> Result<T, HandlerError>
fn benign_err(self) -> Result<T, HandlerError>
Classify an Err value as HandlerError::Benign.
Sourcefn recoverable_err(self) -> Result<T, HandlerError>
fn recoverable_err(self) -> Result<T, HandlerError>
Classify an Err value as HandlerError::Recoverable.
Sourcefn unrecoverable_err(self) -> Result<T, HandlerError>
fn unrecoverable_err(self) -> Result<T, HandlerError>
Classify an Err value as HandlerError::Unrecoverable.