[][src]Struct slottle::ThrottleBuilder

pub struct ThrottleBuilder { /* fields omitted */ }

Use it to build a Throttle.

Implementations

impl ThrottleBuilder[src]

pub fn interval(&mut self, interval: Duration) -> &mut Self[src]

Set interval, default value is Duration::default().

pub fn concurrent(&mut self, concurrent: u32) -> &mut Self[src]

Set concurrent, default value is 1.

pub fn fuzzy_fn(
    &mut self,
    fuzzy_fn: Option<fn(_: Duration) -> Duration>
) -> &mut Self
[src]

Set fuzzy_fn to modify interval each run, default value is None.

pub fn build(&mut self) -> Option<Throttle>[src]

Create a new throttle. Return None if concurrent == 0 or larger than isize::MAX.

Trait Implementations

impl Debug for ThrottleBuilder[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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,