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§
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 UseContextwhere
Context: HasErrorType + CanRaiseError<SourceError>,
Used for injecting external error types into Self::Error.
impl<Context, SourceError> ErrorRaiser<Context, SourceError> for UseContextwhere
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.
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>,
impl<Context, SourceError, Components, Delegate> ErrorRaiser<Context, SourceError> for UseDelegate<Components>where
Context: HasErrorType,
Components: DelegateComponent<SourceError, Delegate = Delegate>,
Delegate: ErrorRaiser<Context, SourceError>,
fn raise_error(e: SourceError) -> Context::Error
Implementors§
impl<Component, Context, SourceError> ErrorRaiser<Context, SourceError> for Componentwhere
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.