Struct jsonrpc_server_utils::SuspendableStream [−][src]
Incoming
is a stream of incoming sockets
Polling the stream may return a temporary io::Error (for instance if we can’t open the connection because of “too many open files” limit)
we use for_each combinator which:
- Runs for every Ok(socket)
- Stops on the FIRST Err() So any temporary io::Error will cause the entire server to terminate. This wrapper type for tokio::Incoming stops accepting new connections for a specified amount of time once an io::Error is encountered
Implementations
impl<S> SuspendableStream<S>
[src][−]
pub fn new(stream: S) -> Self
[src][−]
construct a new Suspendable stream, given tokio::Incoming and the amount of time to pause for.
Trait Implementations
Auto Trait Implementations
impl<S> !RefUnwindSafe for SuspendableStream<S>
impl<S> Send for SuspendableStream<S> where
S: Send,
S: Send,
impl<S> Sync for SuspendableStream<S> where
S: Sync,
S: Sync,
impl<S> Unpin for SuspendableStream<S> where
S: Unpin,
S: Unpin,
impl<S> !UnwindSafe for SuspendableStream<S>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> StreamExt for T where
T: Stream + ?Sized,
[src][+]
T: Stream + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,