Trait RetryStrategy

Source
pub trait RetryStrategy: Send + Sync {
    // Required methods
    fn execute_with_retry<'life0, 'async_trait, F, T, E>(
        &'life0 self,
        operation: F,
    ) -> Pin<Box<dyn Future<Output = Result<T>> + Send + 'async_trait>>
       where F: Fn() -> Result<T> + Send + Sync + 'async_trait,
             T: Send + 'async_trait,
             E: Error + Send + Sync + 'static + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait;
    fn get_retry_config(&self) -> RetryConfig;
}
Expand description

Retry strategy interface

Required Methods§

Source

fn execute_with_retry<'life0, 'async_trait, F, T, E>( &'life0 self, operation: F, ) -> Pin<Box<dyn Future<Output = Result<T>> + Send + 'async_trait>>
where F: Fn() -> Result<T> + Send + Sync + 'async_trait, T: Send + 'async_trait, E: Error + Send + Sync + 'static + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

Execute operation with retry

Source

fn get_retry_config(&self) -> RetryConfig

Get retry configuration

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§