From 4bc7ab6fe77ddc600e770d131f5d2aecaccb414c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=A3rebe=20-=20Romain=20GERARD?= Date: Wed, 2 Oct 2024 21:30:06 +0200 Subject: [PATCH] Add inline --- src/tunnel/client/l4_transport_stream.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/tunnel/client/l4_transport_stream.rs b/src/tunnel/client/l4_transport_stream.rs index bc1368d..e152ee8 100644 --- a/src/tunnel/client/l4_transport_stream.rs +++ b/src/tunnel/client/l4_transport_stream.rs @@ -74,24 +74,29 @@ pub enum TransportWriteHalf { } impl AsyncRead for TransportStream { + #[inline] fn poll_read(self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &mut ReadBuf<'_>) -> Poll> { unsafe { self.map_unchecked_mut(|s| &mut s.read).poll_read(cx, buf) } } } impl AsyncWrite for TransportStream { + #[inline] fn poll_write(self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8]) -> Poll> { 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> { unsafe { self.map_unchecked_mut(|s| &mut s.write).poll_flush(cx) } } + #[inline] fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { unsafe { self.map_unchecked_mut(|s| &mut s.write).poll_shutdown(cx) } } + #[inline] fn poll_write_vectored( self: Pin<&mut Self>, 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) } } + #[inline] fn is_write_vectored(&self) -> bool { self.write.is_write_vectored() }