Skip to main content

AsyncErrorHandlerFunction

Trait AsyncErrorHandlerFunction 

Source
pub trait AsyncErrorHandlerFunction:
    Send
    + Sync
    + 'static {
    type Future: Future<Output = ()> + Send;

    // Required method
    fn call(self, error: Arc<String>) -> Self::Future;
}
Expand description

Trait alias for asynchronous error-handling functions used in a recoverable context.

§Arguments

  • Arc<String> - The error message to handle.

§Returns

  • Future - The asynchronous error handling result.

Required Associated Types§

Source

type Future: Future<Output = ()> + Send

Required Methods§

Source

fn call(self, error: Arc<String>) -> Self::Future

Handles an error asynchronously.

§Arguments
  • Arc<String> - The error message to handle.
§Returns
  • Self::Future - The future that resolves once the error has been handled.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<F, Fut> AsyncErrorHandlerFunction for F
where F: FnOnce(Arc<String>) -> Fut + Send + Sync + 'static, Fut: Future<Output = ()> + Send + 'static,

Source§

type Future = Fut