pub enum Tunnel {
Udp(UdpTunnel),
Tcp(TcpTunnel),
}Variants§
Implementations§
Source§impl Tunnel
impl Tunnel
Sourcepub async fn recv_from(
&mut self,
buf: &mut [u8],
) -> Option<Result<(usize, RouteKey)>>
pub async fn recv_from( &mut self, buf: &mut [u8], ) -> Option<Result<(usize, RouteKey)>>
Receiving buf from the associated tunnel
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], addrs: &mut [RouteKey], ) -> Option<Result<usize>>
pub async fn send_to<A: Into<SocketAddr>>( &self, buf: BytesMut, addr: A, ) -> Result<()>
pub fn done(&mut self)
Source§impl Tunnel
impl Tunnel
Sourcepub fn protocol(&self) -> ConnectProtocol
pub fn protocol(&self) -> ConnectProtocol
The protocol this tunnel is using
pub fn remote_addr(&self) -> Option<SocketAddr>
Auto Trait Implementations§
impl Freeze for Tunnel
impl !RefUnwindSafe for Tunnel
impl Send for Tunnel
impl Sync for Tunnel
impl Unpin for Tunnel
impl !UnwindSafe for Tunnel
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