diff --git a/tokio/src/io/join.rs b/tokio/src/io/join.rs index dbc7043b6..6e41f89e8 100644 --- a/tokio/src/io/join.rs +++ b/tokio/src/io/join.rs @@ -1,6 +1,6 @@ //! Join two values implementing `AsyncRead` and `AsyncWrite` into a single one. -use crate::io::{AsyncRead, AsyncWrite, ReadBuf}; +use crate::io::{AsyncBufRead, AsyncRead, AsyncWrite, ReadBuf}; use std::io; use std::pin::Pin; @@ -115,3 +115,16 @@ where self.writer.is_write_vectored() } } + +impl AsyncBufRead for Join +where + R: AsyncBufRead, +{ + fn poll_fill_buf(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + self.project().reader.poll_fill_buf(cx) + } + + fn consume(self: Pin<&mut Self>, amt: usize) { + self.project().reader.consume(amt) + } +}