Skip to main content

AsyncBufRead

Trait AsyncBufRead 

Source
pub trait AsyncBufRead: AsyncRead {
    // Required methods
    fn poll_fill_buf(
        self: Pin<&mut Self>,
        cx: &mut Context<'_>,
    ) -> Poll<Result<&[u8], Error>>;
    fn consume(self: Pin<&mut Self>, amt: usize);
}
Expand description

Read bytes from a buffered source asynchronously.

Required Methods§

Source

fn poll_fill_buf( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<&[u8], Error>>

Returns the contents of the internal buffer, filling it with more data from the inner reader if necessary.

Source

fn consume(self: Pin<&mut Self>, amt: usize)

Consumes the specified amount of bytes from the internal buffer.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§