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

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

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

Required methods

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

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

fn ratelimit_sink_with_jitter<D: DirectStateStore, C: ReasonablyRealtime>(
    self,
    limiter: &RateLimiter<NotKeyed, D, C>,
    jitter: Jitter
) -> RatelimitedSink<'_, Item, S, D, C> where
    Self: Sized
[src]

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...