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

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

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

Required methods

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

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

Implementors