Trait tor_rtcompat::UdpSocket

source ·
pub trait UdpSocket {
    // Required methods
    fn recv<'life0, 'life1, 'async_trait>(
        &'life0 self,
        buf: &'life1 mut [u8]
    ) -> Pin<Box<dyn Future<Output = IoResult<(usize, SocketAddr)>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn send<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        buf: &'life1 [u8],
        target: &'life2 SocketAddr
    ) -> Pin<Box<dyn Future<Output = IoResult<usize>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn local_addr(&self) -> IoResult<SocketAddr>;
}
Expand description

Trait for a locally bound Udp socket that can send and receive datagrams.

These objects are returned by instances of UdpProvider.

Required Methods§

source

fn recv<'life0, 'life1, 'async_trait>( &'life0 self, buf: &'life1 mut [u8] ) -> Pin<Box<dyn Future<Output = IoResult<(usize, SocketAddr)>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Wait for an incoming datagram; return it along its address.

source

fn send<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, buf: &'life1 [u8], target: &'life2 SocketAddr ) -> Pin<Box<dyn Future<Output = IoResult<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Send a datagram to the provided address.

source

fn local_addr(&self) -> IoResult<SocketAddr>

Return the local address that this socket is bound to.

Implementors§