monoio/io/
async_buf_read.rs

1use std::future::Future;
2
3use crate::io::AsyncReadRent;
4
5/// AsyncBufRead: async read with buffered content
6pub trait AsyncBufRead: AsyncReadRent {
7    /// Try read data and get a reference to the internal buffer
8    fn fill_buf(&mut self) -> impl Future<Output = std::io::Result<&[u8]>>;
9    /// Mark how much data is read
10    fn consume(&mut self, amt: usize);
11}