Trait ErrorRaiser

Source
pub trait ErrorRaiser<Context, SourceError>: IsProviderFor<ErrorRaiserComponent, Context, SourceError>
where Context: HasErrorType,
{ // Required method fn raise_error(error: SourceError) -> 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(error: SourceError) -> Context::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.

Implementations on Foreign Types§

Source§

impl<Context, SourceError> ErrorRaiser<Context, SourceError> for UseContext
where Context: HasErrorType + CanRaiseError<SourceError>,

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§

fn raise_error(error: SourceError) -> Context::Error

Source§

impl<Context, SourceError, Components, Delegate> ErrorRaiser<Context, SourceError> for UseDelegate<Components>
where Context: HasErrorType, Components: DelegateComponent<SourceError, Delegate = Delegate>, Delegate: ErrorRaiser<Context, SourceError>,

Source§

fn raise_error(e: SourceError) -> Context::Error

Implementors§

Source§

impl<Component, Context, SourceError> ErrorRaiser<Context, SourceError> for Component
where Context: HasErrorType, Component: DelegateComponent<ErrorRaiserComponent> + IsProviderFor<ErrorRaiserComponent, Context, SourceError>, Component::Delegate: ErrorRaiser<Context, SourceError>,

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.