pub trait ResultChainError<T, O: ErrorCategory, Tag> {
// Required method
fn chain_err(self, error_code: O) -> Result<T, Error<O>>;
}Required Methods§
Sourcefn chain_err(self, error_code: O) -> Result<T, Error<O>>
fn chain_err(self, error_code: O) -> Result<T, Error<O>>
If the results contains an Err value, chain it with the supplied error_code
and return Err with the result, otherwise forward the Ok value.
§Panics
If this Result is an Err value and the error category O
is not linked with the ErrorCategory of the most recent error code in the
error, this function will panic.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".