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§
Sourcefn remaining(&self) -> Option<Duration>
fn remaining(&self) -> Option<Duration>
The live cooldown’s remaining wait, measured monotonically.
Sourcefn 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,
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.