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.

  • Functions implementing this trait must accept a Arc<String> as an error message, return a Future, and satisfy FnOnce(Arc<String>) -> Future + Send + Sync + 'static.

Required Associated Types§

Source

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

Required Methods§

Source

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

Handles an error asynchronously.

  • error: The error message to handle.

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