RecoveryStrategy

Trait RecoveryStrategy 

Source
pub trait RecoveryStrategy: Send + Sync {
    // Required methods
    fn can_recover<'life0, 'life1, 'async_trait>(
        &'life0 self,
        error: &'life1 AiLibError,
    ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn recover<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        error: &'life1 AiLibError,
        context: &'life2 ErrorContext,
    ) -> Pin<Box<dyn Future<Output = Result<(), AiLibError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Trait for implementing recovery strategies

Required Methods§

Source

fn can_recover<'life0, 'life1, 'async_trait>( &'life0 self, error: &'life1 AiLibError, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Check if this strategy can recover from the given error

Source

fn recover<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, error: &'life1 AiLibError, context: &'life2 ErrorContext, ) -> Pin<Box<dyn Future<Output = Result<(), AiLibError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Attempt to recover from the error

Implementors§