Skip to main content

AsyncRateLimitStore

Trait AsyncRateLimitStore 

Source
pub trait AsyncRateLimitStore: Send + Sync {
    // Required method
    fn check_and_record<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 [u8],
        max_per_window: u32,
        window_secs: u64,
    ) -> Pin<Box<dyn Future<Output = Result<bool, A1StorageError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided method
    fn health_check<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), A1StorageError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Available on crate feature async only.

Required Methods§

Source

fn check_and_record<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 [u8], max_per_window: u32, window_secs: u64, ) -> Pin<Box<dyn Future<Output = Result<bool, A1StorageError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Provided Methods§

Source

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

Implementors§