pub struct MemoryRateLimitStorage { /* private fields */ }Expand description
Bounded rolling in-memory storage. Share an Arc between auth instances
when they must consume the same client/path quotas.
Implementations§
Trait Implementations§
Source§impl Debug for MemoryRateLimitStorage
impl Debug for MemoryRateLimitStorage
Source§impl RateLimitStorage for MemoryRateLimitStorage
impl RateLimitStorage for MemoryRateLimitStorage
fn consume<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
rule: &'life2 EndpointRateLimit,
) -> Pin<Box<dyn Future<Output = AuthResult<RateLimitDecision>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn observe_window(&self, _window_seconds: f64)
fn observe_window(&self, _window_seconds: f64)
Publish configured windows before serving requests, so persistent
storage can prune without retiring a longer-lived configured quota.
Auto Trait Implementations§
impl !Freeze for MemoryRateLimitStorage
impl RefUnwindSafe for MemoryRateLimitStorage
impl Send for MemoryRateLimitStorage
impl Sync for MemoryRateLimitStorage
impl Unpin for MemoryRateLimitStorage
impl UnsafeUnpin for MemoryRateLimitStorage
impl UnwindSafe for MemoryRateLimitStorage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more