pub struct CacheRateLimiter { /* private fields */ }Expand description
Rate-limit counters kept in a Cache.
Implementations§
Source§impl CacheRateLimiter
impl CacheRateLimiter
Sourcepub fn with_prefix(self, prefix: impl Into<String>) -> Self
pub fn with_prefix(self, prefix: impl Into<String>) -> Self
Count under a different prefix.
Worth changing when the cache is shared with something else that might pick the same names.
Trait Implementations§
Source§impl Debug for CacheRateLimiter
impl Debug for CacheRateLimiter
Source§impl RateLimitStore for CacheRateLimiter
impl RateLimitStore for CacheRateLimiter
Source§fn peek<'a>(&'a self, key: &'a str) -> BoxFuture<'a, Result<Option<Hit>>>
fn peek<'a>(&'a self, key: &'a str) -> BoxFuture<'a, Result<Option<Hit>>>
The state of
key without recording anything. Read moreSource§fn clear<'a>(&'a self, key: &'a str) -> BoxFuture<'a, Result<()>>
fn clear<'a>(&'a self, key: &'a str) -> BoxFuture<'a, Result<()>>
Forget
key, restoring its full allowance. Read moreWhether other instances of this application see the same counters. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for CacheRateLimiter
impl !UnwindSafe for CacheRateLimiter
impl Freeze for CacheRateLimiter
impl Send for CacheRateLimiter
impl Sync for CacheRateLimiter
impl Unpin for CacheRateLimiter
impl UnsafeUnpin for CacheRateLimiter
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