pub trait Incoming<C>where
    Self: Sized + Stream<Item = C>,
    C: Channel,{
    // Provided methods
    fn max_channels_per_key<K, KF>(
        self,
        n: u32,
        keymaker: KF
    ) -> MaxChannelsPerKey<Self, K, KF>
       where K: Display + Eq + Hash + Clone + Unpin,
             KF: Fn(&C) -> K { ... }
    fn max_concurrent_requests_per_channel(
        self,
        n: usize
    ) -> MaxRequestsPerChannel<Self> { ... }
    fn execute<S>(self, serve: S) -> TokioServerExecutor<Self, S> 
       where S: Serve<C::Req, Resp = C::Resp> { ... }
}
Expand description

An extension trait for streams of Channels.

Provided Methods§

source

fn max_channels_per_key<K, KF>( self, n: u32, keymaker: KF ) -> MaxChannelsPerKey<Self, K, KF>where K: Display + Eq + Hash + Clone + Unpin, KF: Fn(&C) -> K,

Enforces channel per-key limits.

source

fn max_concurrent_requests_per_channel( self, n: usize ) -> MaxRequestsPerChannel<Self>

Caps the number of concurrent requests per channel.

source

fn execute<S>(self, serve: S) -> TokioServerExecutor<Self, S> where S: Serve<C::Req, Resp = C::Resp>,

Available on crate feature tokio1 only.

Executes each incoming channel. Each channel will be handled concurrently by spawning on tokio’s default executor, and each request will be also be spawned on tokio’s default executor.

Implementors§

source§

impl<S, C> Incoming<C> for Swhere S: Sized + Stream<Item = C>, C: Channel,