pub struct Socks5UdpSocket { /* private fields */ }Expand description
A virtual UDP socket that handles SOCKS5 UDP headers It parses incoming SOCKS5 UDP packets and strips the headers, and adds SOCKS5 headers to outgoing packets
Implementations§
Source§impl Socks5UdpSocket
impl Socks5UdpSocket
pub fn new(sock: UdpSocket) -> Result<Self>
Sourcepub fn source_addr(&self) -> SocketAddr
pub fn source_addr(&self) -> SocketAddr
Get the currently stored source address
Trait Implementations§
Source§impl AbstractUdpSocket for Socks5UdpSocket
impl AbstractUdpSocket for Socks5UdpSocket
Source§fn create_io_poller(self: Arc<Self>) -> Pin<Box<dyn UdpPoller>>
fn create_io_poller(self: Arc<Self>) -> Pin<Box<dyn UdpPoller>>
Required methods
Creates a UDP socket I/O poller.
Source§fn try_send(&self, transmit: &Transmit<'_>) -> Result<()>
fn try_send(&self, transmit: &Transmit<'_>) -> Result<()>
Tries to send a UDP datagram to the specified destination.
Source§fn poll_recv(
&self,
cx: &mut Context<'_>,
bufs: &mut [IoSliceMut<'_>],
meta: &mut [RecvMeta],
) -> Poll<Result<usize>>
fn poll_recv( &self, cx: &mut Context<'_>, bufs: &mut [IoSliceMut<'_>], meta: &mut [RecvMeta], ) -> Poll<Result<usize>>
Poll to receive a UDP datagram.
Source§fn local_addr(&self) -> Result<SocketAddr>
fn local_addr(&self) -> Result<SocketAddr>
Returns the local socket address.
Source§fn may_fragment(&self) -> bool
fn may_fragment(&self) -> bool
Returns whether the socket may fragment packets.
Source§fn max_transmit_segments(&self) -> usize
fn max_transmit_segments(&self) -> usize
Maximum number of segments that can be transmitted in one call.
Source§fn max_receive_segments(&self) -> usize
fn max_receive_segments(&self) -> usize
Maximum number of segments that can be received in one call.
Source§fn recv(
&self,
bufs: &mut [IoSliceMut<'_>],
meta: &mut [RecvMeta],
) -> impl Future<Output = Result<usize, Error>> + Send
fn recv( &self, bufs: &mut [IoSliceMut<'_>], meta: &mut [RecvMeta], ) -> impl Future<Output = Result<usize, Error>> + Send
Supplied methods
Receive a UDP datagram.
meta is the returned metadata for each buffer in bufs.Auto Trait Implementations§
impl !Freeze for Socks5UdpSocket
impl RefUnwindSafe for Socks5UdpSocket
impl Send for Socks5UdpSocket
impl Sync for Socks5UdpSocket
impl Unpin for Socks5UdpSocket
impl UnsafeUnpin for Socks5UdpSocket
impl UnwindSafe for Socks5UdpSocket
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