Struct async_socks5::SocksDatagram
source · [−]pub struct SocksDatagram<S> { /* private fields */ }Expand description
A UDP socket that sends packets through a proxy.
Implementations
sourceimpl<S> SocksDatagram<S> where
S: AsyncWriteExt + AsyncReadExt + Send + Unpin,
impl<S> SocksDatagram<S> where
S: AsyncWriteExt + AsyncReadExt + Send + Unpin,
sourcepub async fn associate<A>(
proxy_stream: S,
socket: UdpSocket,
auth: Option<Auth>,
association_addr: Option<A>
) -> Result<Self> where
A: Into<AddrKind>,
pub async fn associate<A>(
proxy_stream: S,
socket: UdpSocket,
auth: Option<Auth>,
association_addr: Option<A>
) -> Result<Self> where
A: Into<AddrKind>,
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> where
A: Into<AddrKind>,
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more