Trait cgp_error::CanRaiseError

source ·
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§

source

fn raise_error(e: E) -> Self::Error

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<Context, E> CanRaiseError<E> for Context
where Context: HasErrorType + HasComponents, Context::Components: ErrorRaiser<Context, E>,

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.