Skip to main content

ThrottleStore

Trait ThrottleStore 

Source
pub trait ThrottleStore:
    Send
    + Sync
    + 'static {
    // Required method
    fn increment<'a>(
        &'a self,
        key: &'a str,
        window: Duration,
    ) -> Pin<Box<dyn Future<Output = Result<ThrottleStoreRecord, HttpException>> + Send + 'a>>;
}
Expand description

Re-exported public API. Atomic storage used by the throttler.

Required Methods§

Source

fn increment<'a>( &'a self, key: &'a str, window: Duration, ) -> Pin<Box<dyn Future<Output = Result<ThrottleStoreRecord, HttpException>> + Send + 'a>>

Atomically increments key in its first-hit fixed window.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§