Trait UdpSocketFactory

Source
pub trait UdpSocketFactory: Sized {
    type Socket: UdpSocket;
    type Error: Error;

    // Required method
    fn bind<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        addr: &'life1 SocketAddr,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Socket, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

A trait used to create UdpSocket instances.

Required Associated Types§

Required Methods§

Source

fn bind<'life0, 'life1, 'async_trait>( &'life0 mut self, addr: &'life1 SocketAddr, ) -> Pin<Box<dyn Future<Output = Result<Self::Socket, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Creates a UDP socket from the given address.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§