Stream

Trait Stream 

Source
pub trait Stream {
    type Item;

    // Required method
    fn poll_next(
        self: Pin<&mut Self>,
        cx: &mut Context<'_>,
    ) -> Poll<Option<Self::Item>>;

    // Provided method
    fn next(&mut self) -> Next<'_, Self> 
       where Self: Unpin { ... }
}

Required Associated Types§

Required Methods§

Source

fn poll_next( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Option<Self::Item>>

Provided Methods§

Source

fn next(&mut self) -> Next<'_, Self>
where Self: Unpin,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§