pub trait CanRaiseError<E>: HasErrorType {
// Required method
fn raise_error(e: E) -> Self::Error;
}Expand description
Used for injecting external error types into Self::Error.
As an example, if Context: CanRaiseError<ParseIntError>, then we would be
able to call Context::raise_error(err) for an error value
err: ParseIntError and get back
a Context::Error value.
Required Methods§
fn raise_error(e: E) -> Self::Error
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl<Context, E> CanRaiseError<E> for Context
Used for injecting external error types into Self::Error.
As an example, if Context: CanRaiseError<ParseIntError>, then we would be
able to call Context::raise_error(err) for an error value
err: ParseIntError and get back
a Context::Error value.