Trait Stream

Source
pub trait Stream:
    AsyncRead
    + AsyncWrite
    + StreamMetadata
    + Send
    + Unpin
    + AsHandle
    + 'static {
    // Provided methods
    fn downcast<S: Stream + 'static>(self) -> Result<S, Self>
       where Self: Sized + 'static { ... }
    fn boxed(self) -> Box<dyn Stream + Send>
       where Self: Sized + 'static { ... }
}
Expand description

A convenience trait for streams from this crate.

Provided Methods§

Source

fn downcast<S: Stream + 'static>(self) -> Result<S, Self>
where Self: Sized + 'static,

Attempt to downcast a generic stream to a specific stream type.

Source

fn boxed(self) -> Box<dyn Stream + Send>
where Self: Sized + 'static,

Box the stream as a Box<dyn Stream + Send>.

Trait Implementations§

Implementors§

Source§

impl<T> Stream for T
where T: AsyncRead + AsyncWrite + StreamMetadata + AsHandle + Unpin + Send + 'static,