Add inline
This commit is contained in:
parent
8d7a0a2a96
commit
4bc7ab6fe7
1 changed files with 6 additions and 0 deletions
|
@ -74,24 +74,29 @@ pub enum TransportWriteHalf {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl AsyncRead for TransportStream {
|
impl AsyncRead for TransportStream {
|
||||||
|
#[inline]
|
||||||
fn poll_read(self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &mut ReadBuf<'_>) -> Poll<std::io::Result<()>> {
|
fn poll_read(self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &mut ReadBuf<'_>) -> Poll<std::io::Result<()>> {
|
||||||
unsafe { self.map_unchecked_mut(|s| &mut s.read).poll_read(cx, buf) }
|
unsafe { self.map_unchecked_mut(|s| &mut s.read).poll_read(cx, buf) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl AsyncWrite for TransportStream {
|
impl AsyncWrite for TransportStream {
|
||||||
|
#[inline]
|
||||||
fn poll_write(self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8]) -> Poll<Result<usize, Error>> {
|
fn poll_write(self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8]) -> Poll<Result<usize, Error>> {
|
||||||
unsafe { self.map_unchecked_mut(|s| &mut s.write).poll_write(cx, buf) }
|
unsafe { self.map_unchecked_mut(|s| &mut s.write).poll_write(cx, buf) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), Error>> {
|
fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), Error>> {
|
||||||
unsafe { self.map_unchecked_mut(|s| &mut s.write).poll_flush(cx) }
|
unsafe { self.map_unchecked_mut(|s| &mut s.write).poll_flush(cx) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), Error>> {
|
fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), Error>> {
|
||||||
unsafe { self.map_unchecked_mut(|s| &mut s.write).poll_shutdown(cx) }
|
unsafe { self.map_unchecked_mut(|s| &mut s.write).poll_shutdown(cx) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
fn poll_write_vectored(
|
fn poll_write_vectored(
|
||||||
self: Pin<&mut Self>,
|
self: Pin<&mut Self>,
|
||||||
cx: &mut Context<'_>,
|
cx: &mut Context<'_>,
|
||||||
|
@ -100,6 +105,7 @@ impl AsyncWrite for TransportStream {
|
||||||
unsafe { self.map_unchecked_mut(|s| &mut s.write).poll_write_vectored(cx, bufs) }
|
unsafe { self.map_unchecked_mut(|s| &mut s.write).poll_write_vectored(cx, bufs) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
fn is_write_vectored(&self) -> bool {
|
fn is_write_vectored(&self) -> bool {
|
||||||
self.write.is_write_vectored()
|
self.write.is_write_vectored()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue