Struct jsonrpc_http_server::SuspendableStream[][src]

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) -> SuspendableStream<S>[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 = I, Error = Error>, 
[src]

type Item = I

The type of item this stream will yield on success.

type Error = ()

The type of error this stream may generate.

Auto Trait Implementations

impl<S> !RefUnwindSafe for SuspendableStream<S>

impl<S> Send for SuspendableStream<S> where
    S: Send

impl<S> Sync for SuspendableStream<S> where
    S: Sync

impl<S> Unpin for SuspendableStream<S> where
    S: Unpin

impl<S> !UnwindSafe for SuspendableStream<S>

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<T> StreamExt for T where
    T: Stream + ?Sized
[src]

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.