pub struct Builder { /* private fields */ }
Expand description
A builder for a rate limiter.
Implementations
sourceimpl Builder
impl Builder
sourcepub fn quantum(self, quantum: u32) -> Self
pub fn quantum(self, quantum: u32) -> Self
Sets the number of tokens to add per interval.
Examples
let mut r = Limiter::configure()
.quantum(100)
.build();
sourcepub fn capacity(self, capacity: u32) -> Self
pub fn capacity(self, capacity: u32) -> Self
Sets the number of tokens that the bucket can hold.
Examples
let mut r = Limiter::configure()
.capacity(100)
.build();
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnwindSafe for Builder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more