[][src]Struct leaky_bucket::Builder

pub struct Builder<'a> { /* fields omitted */ }

Builder for a leaky bucket.

Implementations

impl Builder<'_>[src]

pub fn max(self, max: usize) -> Self[src]

Set the max value for the builder.

pub fn tokens(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(self, refill_interval: Duration) -> Self[src]

Set the max value for the builder.

pub fn refill_amount(self, refill_amount: usize) -> Self[src]

Set the refill amount to use.

pub fn build(self) -> Result<LeakyBucket, Error>[src]

Construct a new leaky bucket.

Auto Trait Implementations

impl<'a> !RefUnwindSafe for Builder<'a>[src]

impl<'a> Send for Builder<'a>[src]

impl<'a> Sync for Builder<'a>[src]

impl<'a> Unpin for Builder<'a>[src]

impl<'a> !UnwindSafe for Builder<'a>[src]

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.