pub struct UdpTunnel { /* private fields */ }Implementations§
Source§impl UdpTunnel
impl UdpTunnel
pub fn done(&mut self)
pub fn local_addr(&self) -> SocketAddr
pub fn sender(&self) -> Result<WeakUdpTunnelSender>
Source§impl UdpTunnel
impl UdpTunnel
Sourcepub async fn send_to<A: Into<SocketAddr>>(
&self,
buf: &[u8],
addr: A,
) -> Result<()>
pub async fn send_to<A: Into<SocketAddr>>( &self, buf: &[u8], addr: A, ) -> Result<()>
Writing buf to the target denoted by SocketAddr via this tunnel
Sourcepub fn try_send_to<A: Into<SocketAddr>>(
&self,
buf: &[u8],
addr: A,
) -> Result<()>
pub fn try_send_to<A: Into<SocketAddr>>( &self, buf: &[u8], addr: A, ) -> Result<()>
Try to write buf to the target denoted by SocketAddr via this tunnel
pub async fn send_bytes_to<A: Into<SocketAddr>>( &self, buf: BytesMut, addr: A, ) -> Result<()>
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)>>
Receving buf from this 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>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for UdpTunnel
impl !RefUnwindSafe for UdpTunnel
impl Send for UdpTunnel
impl Sync for UdpTunnel
impl Unpin for UdpTunnel
impl !UnwindSafe for UdpTunnel
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