[][src]Trait governor::state::direct::SinkRateLimitExt

pub trait SinkRateLimitExt<Item, S>: Sink<Item> where
    S: Sink<Item>, 
{ fn ratelimit_sink<'a, D: DirectStateStore, C: ReasonablyRealtime>(
        self,
        limiter: &'a RateLimiter<NotKeyed, D, C>
    ) -> RatelimitedSink<'a, Item, S, D, C>
    where
        Self: Sized
;
fn ratelimit_sink_with_jitter<'a, D: DirectStateStore, C: ReasonablyRealtime>(
        self,
        limiter: &'a RateLimiter<NotKeyed, D, C>,
        jitter: Jitter
    ) -> RatelimitedSink<'a, Item, S, D, C>
    where
        Self: Sized
; }

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

Required methods

fn ratelimit_sink<'a, D: DirectStateStore, C: ReasonablyRealtime>(
    self,
    limiter: &'a RateLimiter<NotKeyed, D, C>
) -> RatelimitedSink<'a, Item, S, D, C> where
    Self: Sized

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

fn ratelimit_sink_with_jitter<'a, D: DirectStateStore, C: ReasonablyRealtime>(
    self,
    limiter: &'a RateLimiter<NotKeyed, D, C>,
    jitter: Jitter
) -> RatelimitedSink<'a, Item, S, D, C> 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...