Skip to main content

AsyncReadCustomExt

Trait AsyncReadCustomExt 

Source
pub trait AsyncReadCustomExt: AsyncReadExt + Unpin {
    // Provided method
    fn drain<'a, 'async_trait>(
        &'a mut self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: Send + 'async_trait,
             'a: 'async_trait { ... }
}
Expand description

An extension trait for AsyncRead that provides additional methods beyond the normal AsyncReadExt.

Provided Methods§

Source

fn drain<'a, 'async_trait>( &'a mut self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'a: 'async_trait,

Reads all data from the stream until EOF and discards it.

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§