Skip to main content

RateLimitStore

Trait RateLimitStore 

Source
pub trait RateLimitStore:
    Send
    + Sync
    + 'static {
    // Required method
    fn consume<'a>(
        &'a self,
        input: RateLimitConsumeInput,
    ) -> Pin<Box<dyn Future<Output = Result<RateLimitDecision, OpenAuthError>> + Send + 'a>>;
}
Expand description

Atomic rate limit storage contract.

Implementations must make the check-and-increment decision in one atomic operation when used for cross-process or distributed enforcement.

Required Methods§

Source

fn consume<'a>( &'a self, input: RateLimitConsumeInput, ) -> Pin<Box<dyn Future<Output = Result<RateLimitDecision, OpenAuthError>> + Send + 'a>>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§