pub trait UdpSocket: DnsUdpSocket {
    // Required methods
    fn connect<'async_trait>(
        addr: SocketAddr
    ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
       where Self: 'async_trait;
    fn connect_with_bind<'async_trait>(
        addr: SocketAddr,
        bind_addr: SocketAddr
    ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
       where Self: 'async_trait;
    fn bind<'async_trait>(
        addr: SocketAddr
    ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
       where Self: 'async_trait;
}
Expand description

Trait for UdpSocket

Required Methods§

source

fn connect<'async_trait>( addr: SocketAddr ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
where Self: 'async_trait,

setups up a “client” udp connection that will only receive packets from the associated address

source

fn connect_with_bind<'async_trait>( addr: SocketAddr, bind_addr: SocketAddr ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
where Self: 'async_trait,

same as connect, but binds to the specified local address for sending address

source

fn bind<'async_trait>( addr: SocketAddr ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
where Self: 'async_trait,

a “server” UDP socket, that bind to the local listening address, and unbound remote address (can receive from anything)

Object Safety§

This trait is not object safe.

Implementors§