[−][src]Struct ratelimit_meter::state::keyed::Builder
A constructor for keyed rate limiters.
Methods
impl<K, C, A, H> Builder<K, C, A, H> where
K: Eq + Hash + Clone,
C: Clock,
A: Algorithm<C::Instant>,
A::BucketState: KeyableRateLimitState<A, C::Instant>,
H: BuildHasher,
[src]
K: Eq + Hash + Clone,
C: Clock,
A: Algorithm<C::Instant>,
A::BucketState: KeyableRateLimitState<A, C::Instant>,
H: BuildHasher,
pub fn with_hasher<H2: BuildHasher>(
self,
hash_builder: H2
) -> Builder<K, C, A, H2>
[src]
self,
hash_builder: H2
) -> Builder<K, C, A, H2>
Sets the hashing method used for the map.
pub fn with_cell_weight(
self,
cell_weight: NonZeroU32
) -> Result<Self, InconsistentCapacity>
[src]
self,
cell_weight: NonZeroU32
) -> Result<Self, InconsistentCapacity>
Sets the "weight" of each cell that is checked against the bucket.
pub fn with_map_capacity(self, map_capacity: usize) -> Self
[src]
Sets the initial number of keys that the map can hold before rehashing.
pub fn using_clock(self, clock: C) -> Self
[src]
Sets the clock used by the bucket.
pub fn build(self) -> Result<KeyedRateLimiter<K, A, C, H>, InconsistentCapacity> where
H: Clone,
[src]
H: Clone,
Constructs a keyed rate limiter with the given options.
Trait Implementations
impl<K, A, C> Default for Builder<K, C, A, RandomState> where
K: Eq + Hash + Clone,
C: Clock,
A: Algorithm<C::Instant>,
A::BucketState: KeyableRateLimitState<A, C::Instant>,
[src]
K: Eq + Hash + Clone,
C: Clock,
A: Algorithm<C::Instant>,
A::BucketState: KeyableRateLimitState<A, C::Instant>,
fn default() -> Builder<K, C, A, RandomState>
[src]
Auto Trait Implementations
impl<K, C, A, H> Send for Builder<K, C, A, H> where
C: Send,
H: Send,
K: Send,
C: Send,
H: Send,
K: Send,
impl<K, C, A, H> Sync for Builder<K, C, A, H> where
C: Sync,
H: Sync,
K: Sync,
C: Sync,
H: Sync,
K: Sync,
impl<K, C, A, H> Unpin for Builder<K, C, A, H> where
A: Unpin,
C: Unpin,
H: Unpin,
K: Unpin,
A: Unpin,
C: Unpin,
H: Unpin,
K: Unpin,
impl<K, C, A, H> UnwindSafe for Builder<K, C, A, H> where
A: UnwindSafe,
C: UnwindSafe,
H: UnwindSafe,
K: UnwindSafe,
A: UnwindSafe,
C: UnwindSafe,
H: UnwindSafe,
K: UnwindSafe,
impl<K, C, A, H> RefUnwindSafe for Builder<K, C, A, H> where
A: RefUnwindSafe,
C: RefUnwindSafe,
H: RefUnwindSafe,
K: RefUnwindSafe,
A: RefUnwindSafe,
C: RefUnwindSafe,
H: RefUnwindSafe,
K: RefUnwindSafe,
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,
ⓘImportant traits for &'_ mut Wfn borrow_mut(&mut self) -> &mut T
[src]
ⓘImportant traits for &'_ mut W
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,