Skip to content

Commit

Permalink
perf: forward write-vectored calls
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar committed Sep 20, 2024
1 parent dc54bc0 commit 9e5e351
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,24 @@ impl<T: rt::Write + rt::Read + Unpin> rt::Write for MaybeHttpsStream<T> {
Self::Https(s) => Pin::new(s).poll_shutdown(cx),
}
}

#[inline]
fn is_write_vectored(&self) -> bool {
match self {
Self::Http(s) => s.is_write_vectored(),
Self::Https(s) => s.is_write_vectored(),
}
}

#[inline]
fn poll_write_vectored(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &[io::IoSlice<'_>],
) -> Poll<Result<usize, io::Error>> {
match Pin::get_mut(self) {
Self::Http(s) => Pin::new(s).poll_write_vectored(cx, bufs),
Self::Https(s) => Pin::new(s).poll_write_vectored(cx, bufs),
}
}
}

0 comments on commit 9e5e351

Please sign in to comment.