Trait cgp_error::ErrorRaiser

source ·
pub trait ErrorRaiser<Context, E>
where Context: HasErrorType,
{ // Required method fn raise_error(e: E) -> Context::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) -> Context::Error

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<Component, Context, E> ErrorRaiser<Context, E> for Component
where Context: HasErrorType, Component: DelegateComponent<ErrorRaiserComponent>, Component::Delegate: 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.

source§

impl<Context, Error, Components, Delegate> ErrorRaiser<Context, Error> for DelegateErrorRaiser<Components>
where Context: HasErrorType, Components: DelegateComponent<Error, Delegate = Delegate>, Delegate: ErrorRaiser<Context, Error>,