[−][src]Struct carapax_ratelimit::KeyedRateLimitHandler
Limits updates accroding to given rules
Methods
impl<K> KeyedRateLimitHandler<K> where
K: RateLimitKey,
[src]
K: RateLimitKey,
pub fn new(
key: K,
on_missing: bool,
capacity: NonZeroU32,
duration: Duration
) -> Self
[src]
key: K,
on_missing: bool,
capacity: NonZeroU32,
duration: Duration
) -> Self
Creates a new handler
Arguments
- key - A key to filter updates
- capacity - Number of updates
- duration - Per time unit
- on_missing - Allow or deny update when key is missing
Trait Implementations
impl<K> Handler for KeyedRateLimitHandler<K> where
K: RateLimitKey,
[src]
K: RateLimitKey,
Auto Trait Implementations
impl<K> Send for KeyedRateLimitHandler<K> where
K: Send,
<K as RateLimitKey>::Key: Send,
K: Send,
<K as RateLimitKey>::Key: Send,
impl<K> Sync for KeyedRateLimitHandler<K> where
K: Sync,
<K as RateLimitKey>::Key: Send,
K: Sync,
<K as RateLimitKey>::Key: Send,
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
T: Any,