pub trait UdpSocket {
    fn recv<'life0, 'life1, 'async_trait>(
        &'life0 self,
        buf: &'life1 mut [u8]
    ) -> Pin<Box<dyn Future<Output = IoResult<(usize, SocketAddr)>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: '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
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
;
fn local_addr(&self) -> IoResult<SocketAddr>; }
Expand description

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

These objects are returned by instances of UdpProvider.

Required methods

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

Send a datagram to the provided address.

Return the local address that this socket is bound to.

Implementors