[][src]Struct jsonrpc_server_utils::SuspendableStream

pub struct SuspendableStream<S> { /* fields omitted */ }

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:

  1. Runs for every Ok(socket)
  2. 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

impl<S, I> Stream for SuspendableStream<S> where
    S: Stream<Item = Result<I>> + Unpin
[src]

type Item = I

Values yielded by the stream.

Auto Trait Implementations

impl<S> !RefUnwindSafe for SuspendableStream<S>[src]

impl<S> Send for SuspendableStream<S> where
    S: Send
[src]

impl<S> Sync for SuspendableStream<S> where
    S: Sync
[src]

impl<S> Unpin for SuspendableStream<S> where
    S: Unpin
[src]

impl<S> !UnwindSafe for SuspendableStream<S>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<St> StreamExt for St where
    St: Stream + ?Sized
[src]

impl<T> StreamExt for T where
    T: Stream + ?Sized

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<S, T, E> TryStream for S where
    S: Stream<Item = Result<T, E>> + ?Sized

type Ok = T

The type of successful values yielded by this future

type Error = E

The type of failures yielded by this future

impl<S> TryStreamExt for S where
    S: TryStream + ?Sized