Struct async_socks5::SocksDatagram
source · pub struct SocksDatagram<S> { /* private fields */ }
Expand description
A UDP socket that sends packets through a proxy.
Implementations§
source§impl<S> SocksDatagram<S>
impl<S> SocksDatagram<S>
sourcepub async fn associate<A>(
proxy_stream: S,
socket: UdpSocket,
auth: Option<Auth>,
association_addr: Option<A>
) -> Result<Self>
pub async fn associate<A>( proxy_stream: S, socket: UdpSocket, auth: Option<Auth>, association_addr: Option<A> ) -> Result<Self>
Creates SocksDatagram
. Performs UDP ASSOCIATE
under the hood.
pub fn proxy_addr(&self) -> &AddrKind
pub fn get_ref(&self) -> &UdpSocket
pub fn get_mut(&mut self) -> &mut UdpSocket
pub fn into_inner(self) -> (S, UdpSocket)
pub async fn send_to<A>(&self, buf: &[u8], addr: A) -> Result<usize>
pub async fn recv_from(&self, buf: &mut [u8]) -> Result<(usize, AddrKind)>
Trait Implementations§
Auto Trait Implementations§
impl<S> RefUnwindSafe for SocksDatagram<S>where
S: RefUnwindSafe,
impl<S> Send for SocksDatagram<S>where
S: Send,
impl<S> Sync for SocksDatagram<S>where
S: Sync,
impl<S> Unpin for SocksDatagram<S>where
S: Unpin,
impl<S> UnwindSafe for SocksDatagram<S>where
S: UnwindSafe,
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