[−][src]Struct ratelimit_meter::state::keyed::Builder
A constructor for keyed rate limiters.
Methods
impl<K, P, A, H> Builder<K, P, A, H> where
K: Eq + Hash + Clone,
P: Absolute,
A: Algorithm<P>,
A::BucketState: KeyableRateLimitState<A, P>,
H: BuildHasher,
[src]
K: Eq + Hash + Clone,
P: Absolute,
A: Algorithm<P>,
A::BucketState: KeyableRateLimitState<A, P>,
H: BuildHasher,
pub fn with_hasher<H2: BuildHasher>(
self,
hash_builder: H2
) -> Builder<K, P, A, H2>
[src]
self,
hash_builder: H2
) -> Builder<K, P, 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 build(self) -> Result<KeyedRateLimiter<K, A, P, H>, InconsistentCapacity> where
H: Clone,
[src]
H: Clone,
Constructs a keyed rate limiter with the given options.
Trait Implementations
impl<K, A, P> Default for Builder<K, P, A, RandomState> where
K: Eq + Hash + Clone,
P: Absolute,
A: Algorithm<P>,
A::BucketState: KeyableRateLimitState<A, P>,
[src]
K: Eq + Hash + Clone,
P: Absolute,
A: Algorithm<P>,
A::BucketState: KeyableRateLimitState<A, P>,
fn default() -> Builder<K, P, A, RandomState>
[src]
Auto Trait Implementations
impl<K, P, A, H> Send for Builder<K, P, A, H> where
H: Send,
K: Send,
H: Send,
K: Send,
impl<K, P, A, H> Sync for Builder<K, P, A, H> where
H: Sync,
K: Sync,
H: Sync,
K: Sync,
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom 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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
ⓘImportant traits for &'_ mut Rfn borrow_mut(&mut self) -> &mut T
[src]
ⓘImportant traits for &'_ mut R
impl<T, U> TryInto 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.