[][src]Struct tarpc_lib::server::Throttler

pub struct Throttler<C> { /* fields omitted */ }

A Channel that limits the number of concurrent requests by throttling.

Methods

impl<C> Throttler<C>[src]

pub fn get_ref(&self) -> &C[src]

Returns the inner channel.

impl<C> Throttler<C> where
    C: Channel
[src]

pub fn new(inner: C, max_in_flight_requests: usize) -> Self[src]

Returns a new Throttler that wraps the given channel and limits concurrent requests to max_in_flight_requests.

Trait Implementations

impl<C> Channel for Throttler<C> where
    C: Channel
[src]

type Req = <C as Channel>::Req

Type of request item.

type Resp = <C as Channel>::Resp

Type of response sink item.

impl<C> AsRef<C> for Throttler<C>[src]

impl<C: Debug> Debug for Throttler<C>[src]

impl<C> Sink<Response<<C as Channel>::Resp>> for Throttler<C> where
    C: Channel
[src]

type Error = Error

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

impl<C> Stream for Throttler<C> where
    C: Channel
[src]

type Item = <C as Stream>::Item

Values yielded by the stream.

Auto Trait Implementations

impl<C> Send for Throttler<C> where
    C: Send

impl<C> Unpin for Throttler<C> where
    C: Unpin

impl<C> Sync for Throttler<C> where
    C: Sync

impl<C> UnwindSafe for Throttler<C> where
    C: UnwindSafe

impl<C> RefUnwindSafe for Throttler<C> where
    C: RefUnwindSafe

Blanket Implementations

impl<S, C> Handler<C> for S where
    C: Channel,
    S: Stream<Item = C>, 
[src]

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

impl<T> Borrow<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>,