[−][src]Struct leaky_bucket_lite::Builder
Builder for a leaky bucket.
Implementations
impl Builder
[src]
pub fn new() -> Self
[src]
Create a new builder with all defaults.
pub fn max(mut self: Self, max: usize) -> Self
[src]
Set the max value for the builder.
pub fn tokens(mut self: Self, tokens: usize) -> Self
[src]
The number of tokens that the bucket should start with.
If set to larger than max
at build time, will only saturate to max.
pub fn refill_interval(mut self: Self, refill_interval: Duration) -> Self
[src]
Set the max value for the builder.
pub fn refill_amount(mut self: Self, refill_amount: usize) -> Self
[src]
Set the refill amount to use.
pub fn build(self) -> LeakyBucket
[src]
Construct a new leaky bucket.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Builder
[src]
impl Send for Builder
[src]
impl Sync for Builder
[src]
impl Unpin for Builder
[src]
impl UnwindSafe for Builder
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
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.
pub 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>,