Skip to content

Commit 125e3ff

Browse files
committed
Add poll_read_exact impls to tokio-util
1 parent 4aee984 commit 125e3ff

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

tokio-util/src/either.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,14 @@ where
104104
) -> Poll<Result<()>> {
105105
delegate_call!(self.poll_read(cx, buf))
106106
}
107+
108+
fn poll_read_exact(
109+
self: Pin<&mut Self>,
110+
cx: &mut Context<'_>,
111+
buf: &mut ReadBuf<'_>,
112+
) -> Poll<std::io::Result<()>> {
113+
delegate_call!(self.poll_read_exact(cx, buf))
114+
}
107115
}
108116

109117
impl<L, R> AsyncBufRead for Either<L, R>

tokio-util/src/io/inspect.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,4 +176,12 @@ impl<W: AsyncRead, F> AsyncRead for InspectWriter<W, F> {
176176
) -> Poll<std::io::Result<()>> {
177177
self.project().writer.poll_read(cx, buf)
178178
}
179+
180+
fn poll_read_exact(
181+
self: Pin<&mut Self>,
182+
cx: &mut Context<'_>,
183+
buf: &mut ReadBuf<'_>,
184+
) -> Poll<std::io::Result<()>> {
185+
self.project().writer.poll_read_exact(cx, buf)
186+
}
179187
}

tokio-util/src/io/sink_writer.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,4 +131,12 @@ impl<S: AsyncRead> AsyncRead for SinkWriter<S> {
131131
) -> Poll<io::Result<()>> {
132132
self.project().inner.poll_read(cx, buf)
133133
}
134+
135+
fn poll_read_exact(
136+
self: Pin<&mut Self>,
137+
cx: &mut Context<'_>,
138+
buf: &mut tokio::io::ReadBuf<'_>,
139+
) -> Poll<io::Result<()>> {
140+
self.project().inner.poll_read_exact(cx, buf)
141+
}
134142
}

0 commit comments

Comments
 (0)