[][src]Struct leaky_bucket_lite::Builder

pub struct Builder { /* fields omitted */ }

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

impl Debug for Builder[src]

impl Default for Builder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.