Skip to main content

Cooldown

Trait Cooldown 

Source
pub trait Cooldown: Send + Sync {
    // Required methods
    fn remaining(&self) -> Option<Duration>;
    fn record<'life0, 'async_trait>(
        &'life0 self,
        wait: Duration,
    ) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

The store’s provider cooldown, shared by every consumer of its connection: sync passes, operations, file transfers and joining.

Required Methods§

Source

fn remaining(&self) -> Option<Duration>

The live cooldown’s remaining wait, measured monotonically.

Source

fn record<'life0, 'async_trait>( &'life0 self, wait: Duration, ) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Arm and persist a wait the provider requested, before any consumer can retry. A failure is returned; it never permits an immediate retry.

Implementors§