pub struct TcpTunnel { /* private fields */ }Implementations§
Source§impl TcpTunnel
impl TcpTunnel
pub fn route_key(&self) -> RouteKey
pub fn local_addr(&self) -> SocketAddr
pub fn done(&mut self)
pub fn sender(&self) -> Result<WeakTcpTunnelSender>
Source§impl TcpTunnel
impl TcpTunnel
Sourcepub async fn send(&self, buf: BytesMut) -> Result<()>
pub async fn send(&self, buf: BytesMut) -> Result<()>
Writing buf to the target denoted by route_key via this tunnel
pub async fn recv(&mut self, buf: &mut [u8]) -> Result<usize>
pub async fn batch_recv<B: AsMut<[u8]>>( &mut self, bufs: &mut [B], sizes: &mut [usize], ) -> Result<usize>
Sourcepub async fn recv_from(&mut self, buf: &mut [u8]) -> Result<(usize, RouteKey)>
pub async fn recv_from(&mut self, buf: &mut [u8]) -> Result<(usize, RouteKey)>
Receive bytes from this tunnel, which the configured Decoder pre-processes
usize in the Ok branch indicates how many bytes are received
RouteKey in the Ok branch denotes the source where these bytes are received from
pub async fn batch_recv_from<B: AsMut<[u8]>>( &mut self, bufs: &mut [B], sizes: &mut [usize], ) -> Result<(usize, RouteKey)>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TcpTunnel
impl !RefUnwindSafe for TcpTunnel
impl Send for TcpTunnel
impl Sync for TcpTunnel
impl Unpin for TcpTunnel
impl !UnwindSafe for TcpTunnel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more