Skip to main content

ResultExt

Trait ResultExt 

Source
pub trait ResultExt<T> {
    // Required method
    fn unrecoverable_error(
        self,
        context: &str,
    ) -> Result<T, InternalServerError>;
}
Expand description

Extension trait for Result that allows us to handle unrecoverable errors

Required Methods§

Source

fn unrecoverable_error(self, context: &str) -> Result<T, InternalServerError>

Equivalent to map_err, but always maps to InternalServerError, logging the error and context

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'a, T, E: Into<Box<dyn Error + 'a>>> ResultExt<T> for Result<T, E>

Source§

impl<T> ResultExt<T> for Option<T>

Implementors§