[][src]Trait governor::prelude::SinkRateLimitExt

pub trait SinkRateLimitExt<Item, S>: Sink<Item> where
    S: Sink<Item>, 
{ fn ratelimit_sink<'a>(
        self,
        limiter: &'a DirectRateLimiter<MonotonicClock>
    ) -> RatelimitedSink<'a, Item, S>
    where
        Self: Sized
;
fn ratelimit_sink_with_jitter<'a>(
        self,
        limiter: &'a DirectRateLimiter<MonotonicClock>,
        jitter: Jitter
    ) -> RatelimitedSink<'a, Item, S>
    where
        Self: Sized
; }

Allows converting a futures::Sink combinator into a rate-limited sink.

Required methods

fn ratelimit_sink<'a>(
    self,
    limiter: &'a DirectRateLimiter<MonotonicClock>
) -> RatelimitedSink<'a, Item, S> where
    Self: Sized

Limits the rate at which items can be put into the current sink.

fn ratelimit_sink_with_jitter<'a>(
    self,
    limiter: &'a DirectRateLimiter<MonotonicClock>,
    jitter: Jitter
) -> RatelimitedSink<'a, Item, S> where
    Self: Sized

Limits the rate at which items can be put into the current sink, with a randomized wait period.

Loading content...

Implementors

impl<Item, S: Sink<Item>> SinkRateLimitExt<Item, S> for S[src]

Loading content...