[−][src]Struct leaky_bucket::Builder
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]
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>,