[][src]Struct governor::RatelimitedStream

pub struct RatelimitedStream<'a, S: Stream> { /* fields omitted */ }

A stream combinator which will limit the rate of items passing through.

This is produced by the StreamRateLimitExt::ratelimit_stream and StreamRateLimitExt::ratelimit_stream_with_jitter methods.

Methods

impl<'a, S: Stream> RatelimitedStream<'a, S>[src]

Conversion methods for the stream combinator.

Important traits for &'_ mut W
pub fn get_ref(&self) -> &S[src]

Acquires a reference to the underlying stream that this combinator is pulling from.

Important traits for &'_ mut W
pub fn get_mut(&mut self) -> &mut S[src]

Acquires a mutable reference to the underlying stream that this combinator is pulling from.

pub fn into_inner(self) -> (S, Option<S::Item>)[src]

Consumes this combinator, returning the underlying stream and any item which it has already produced but which is still being held back in order to abide by the limiter.

Trait Implementations

impl<'a, Item, S: Stream + Sink<Item>> Sink<Item> for RatelimitedStream<'a, S> where
    S: Unpin,
    S::Item: Unpin
[src]

Pass-through implementation for futures::Sink if the Stream also implements it.

type Error = <S as Sink<Item>>::Error

The type of value produced by the sink when an error occurs.

impl<'a, S: Stream> Stream for RatelimitedStream<'a, S> where
    S: Unpin,
    S::Item: Unpin,
    Self: Unpin
[src]

Implements the futures::Stream combinator.

type Item = S::Item

Values yielded by the stream.

Auto Trait Implementations

impl<'a, S> Send for RatelimitedStream<'a, S> where
    S: Send,
    <S as Stream>::Item: Send

impl<'a, S> Sync for RatelimitedStream<'a, S> where
    S: Sync,
    <S as Stream>::Item: Sync

impl<'a, S> Unpin for RatelimitedStream<'a, S> where
    S: Unpin,
    <S as Stream>::Item: Unpin

impl<'a, S> !UnwindSafe for RatelimitedStream<'a, S>

impl<'a, S> !RefUnwindSafe for RatelimitedStream<'a, S>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for 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<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<S, T, E> TryStream for S where
    S: Stream<Item = Result<T, E>> + ?Sized
[src]

type Ok = T

The type of successful values yielded by this future

type Error = E

The type of failures yielded by this future

impl<T> StreamExt for T where
    T: Stream + ?Sized
[src]

impl<S> TryStreamExt for S where
    S: TryStream + ?Sized
[src]

impl<T, Item> SinkExt<Item> for T where
    T: Sink<Item> + ?Sized
[src]

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