Open
Description
Add the poll_read_buf
method to AsyncRead
based on the API proposed by rust-lang/rfcs#2930 (tracking issue: rust-lang/rust#78485).
pub trait AsyncRead {
fn poll_read_buf(self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &mut ReadBuf<'_>) -> Poll<io::Result<()>>;
}
pub struct ReadBuf<'a> {
buf: &'a mut [MaybeUninit<u8>],
filled: usize,
initialized: usize,
}
impl<'a> ReadBuf<'a> {
// ...
}
This replaces the existing read-initializer API, but it's not yet stable, so maybe it needs to added as an unstable feature.