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> { ... }
}
Provided Methods§
sourcefn 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_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.
sourcefn max_concurrent_requests_per_channel(
self,
n: usize
) -> MaxRequestsPerChannel<Self>
fn max_concurrent_requests_per_channel( self, n: usize ) -> MaxRequestsPerChannel<Self>
Caps the number of concurrent requests per channel.
sourcefn execute<S>(self, serve: S) -> TokioServerExecutor<Self, S> ⓘwhere
S: Serve<C::Req, Resp = C::Resp>,
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.