Skip to main content

ErrorHandler

Trait ErrorHandler 

Source
pub trait ErrorHandler<E> {
    // Required method
    fn handle_error(
        self: Arc<Self>,
        error: E,
        deps: DependencyMap,
    ) -> BoxFuture<'static, ()>;
}
Expand description

An asynchronous handler of an error with dependencies.

See the module-level documentation for the design overview.

Required Methods§

Source

fn handle_error( self: Arc<Self>, error: E, deps: DependencyMap, ) -> BoxFuture<'static, ()>

Handles error with the dependencies available at the point of failure.

The map may be empty. Use DependencyMap::try_get if a dependency might not be present.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl ErrorHandler<!> for IgnoringErrorHandlerSafe

Source§

impl<E, F, Fut> ErrorHandler<E> for F
where F: Fn(E, DependencyMap) -> Fut + Send + Sync + 'static, E: Send + 'static, Fut: Future<Output = ()> + Send,

Source§

impl<E> ErrorHandler<E> for IgnoringErrorHandler

Source§

impl<E> ErrorHandler<E> for LoggingErrorHandler
where E: Debug,