Trait FramedRead

Source
pub trait FramedRead {
    type ReadFut<'read>: Future<Output = Result<usize>> + 'read
       where Self: 'read;

    // Required method
    fn read<'a>(&'a mut self, buf: &'a mut BytesMut) -> Self::ReadFut<'a>;
}

Required Associated Types§

Source

type ReadFut<'read>: Future<Output = Result<usize>> + 'read where Self: 'read

Required Methods§

Source

fn read<'a>(&'a mut self, buf: &'a mut BytesMut) -> Self::ReadFut<'a>

Reads from stream and fills internal buffer

§Cancel safety

This method is cancel safe. If you use it as the event in a tokio::select! statement and some other branch completes first, then it is guaranteed that no data was read.

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§