Trait RecoverableTask

Source
pub trait RecoverableTask:
    Task
    + Send
    + Sync {
    // Required method
    fn recover_from_error<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        error: &'life1 BridgeError,
    ) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

A trait for tasks that can handle errors, required for BufferedErrors. Tasks that want to use into_buffered_errors() must implement this trait to define how they recover from errors.

Required Methods§

Source

fn recover_from_error<'life0, 'life1, 'async_trait>( &'life0 mut self, error: &'life1 BridgeError, ) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Recover from an error by attempting to handle it. If the error is handled, the task will continue running if error overflow limit is not reached.

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.

Implementors§