mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
aquatic_ws: impl read_vectored and write_vectored for Stream
This commit is contained in:
parent
a471d97620
commit
138e501599
1 changed files with 24 additions and 0 deletions
|
|
@ -55,6 +55,18 @@ impl Read for Stream {
|
||||||
Self::TlsStream(stream) => stream.read(buf),
|
Self::TlsStream(stream) => stream.read(buf),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Not used but provided for completeness
|
||||||
|
#[inline]
|
||||||
|
fn read_vectored(
|
||||||
|
&mut self,
|
||||||
|
bufs: &mut [::std::io::IoSliceMut<'_>]
|
||||||
|
) -> ::std::io::Result<usize> {
|
||||||
|
match self {
|
||||||
|
Self::TcpStream(stream) => stream.read_vectored(bufs),
|
||||||
|
Self::TlsStream(stream) => stream.read_vectored(bufs),
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -67,6 +79,18 @@ impl Write for Stream {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Not used but provided for completeness
|
||||||
|
#[inline]
|
||||||
|
fn write_vectored(
|
||||||
|
&mut self,
|
||||||
|
bufs: &[::std::io::IoSlice<'_>]
|
||||||
|
) -> ::std::io::Result<usize> {
|
||||||
|
match self {
|
||||||
|
Self::TcpStream(stream) => stream.write_vectored(bufs),
|
||||||
|
Self::TlsStream(stream) => stream.write_vectored(bufs),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn flush(&mut self) -> ::std::io::Result<()> {
|
fn flush(&mut self) -> ::std::io::Result<()> {
|
||||||
match self {
|
match self {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue