pub trait OrErr<T, E> {
// Required methods
fn or_err(self, et: ErrorType) -> Result<T, ExternalError>
where E: Into<Box<dyn ErrorTrait + Send + Sync>>;
fn or_context(
self,
et: ErrorType,
context: &'static str,
) -> Result<T, ExternalError>
where E: Into<Box<dyn ErrorTrait + Send + Sync>>;
}
Expand description
OrErr is the trait to extend the result with error.
Required Methods§
Sourcefn or_err(self, et: ErrorType) -> Result<T, ExternalError>
fn or_err(self, et: ErrorType) -> Result<T, ExternalError>
fn or_context( self, et: ErrorType, context: &'static str, ) -> Result<T, ExternalError>
Implementations on Foreign Types§
Source§impl<T, E> OrErr<T, E> for Result<T, E>
OrErr implements the OrErr for Result.
impl<T, E> OrErr<T, E> for Result<T, E>
OrErr implements the OrErr for Result.