Trait tk_listen::ListenExt
[−]
[src]
pub trait ListenExt: Stream { fn sleep_on_error(
self,
delay: Duration,
handle: &Handle
) -> SleepOnError<Self>
where
Self: Sized, { ... } fn listen(self, max_connections: usize) -> Listen<Self>
where
Self: Sized,
Self::Item: IntoFuture<Item = (), Error = ()>, { ... } }
An extension trait that provides necessary combinators for turning
a stream of accept()
events into a full-featured connection listener
Usually both sleep_on_error
and listen
commbinators are used in pair
with .map()
in-between. See examples for full-featured example.
Provided Methods
fn sleep_on_error(self, delay: Duration, handle: &Handle) -> SleepOnError<Self> where
Self: Sized,
Self: Sized,
Turns a listening stream that you can get from TcpListener::incoming
into a stream that supresses errors and sleeps on resource shortage,
effectively allowing listening stream to resume on error.
fn listen(self, max_connections: usize) -> Listen<Self> where
Self: Sized,
Self::Item: IntoFuture<Item = (), Error = ()>,
Self: Sized,
Self::Item: IntoFuture<Item = (), Error = ()>,
Turns a stream of protocol handlers usually produced by mapping a stream of accepted cnnec
Implementors
impl<T: Stream> ListenExt for T