Skip to main content

Stream

Trait Stream 

Source
pub trait Stream {
    type Item;

    // Required method
    fn next(&mut self) -> impl Future<Output = Option<Self::Item>> + Send;
}
Expand description

A stream of incremental responses.

Required Associated Types§

Source

type Item

The type of items yielded by the stream.

Required Methods§

Source

fn next(&mut self) -> impl Future<Output = Option<Self::Item>> + Send

Attempts to pull out the next value of this stream, returning None if the stream is exhausted.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<S, F, Fut, T, E> Stream for ReconnectableStream<S, F>
where S: Stream<Item = Result<T, E>> + Send, F: FnMut() -> Fut + Send, Fut: Future<Output = Result<S, E>> + Send, T: Send, E: Send,

Source§

type Item = Result<T, E>