Skip to main content

UdpConnect

Trait UdpConnect 

Source
pub trait UdpConnect {
    type Error: Error;
    type Socket<'a>: UdpReceive<Error = Self::Error, Error = Self::Error, Error = Self::Error, Error = Self::Error, Error = Self::Error, Error = Self::Error> + UdpSend + UdpSplitMulticast + MulticastV4 + MulticastV6 + Readable
       where Self: 'a;

    // Required method
    async fn connect(
        &self,
        local: SocketAddr,
        remote: SocketAddr,
    ) -> Result<Self::Socket<'_>, Self::Error>;
}
Expand description

Re-export the edge-nal crate This is a factory trait for creating connected UDP sockets

Required Associated Types§

Source

type Error: Error

Error type returned on socket creation failure

Source

type Socket<'a>: UdpReceive<Error = Self::Error, Error = Self::Error, Error = Self::Error, Error = Self::Error, Error = Self::Error, Error = Self::Error> + UdpSend + UdpSplitMulticast + MulticastV4 + MulticastV6 + Readable where Self: 'a

The socket type returned by the factory

Required Methods§

Source

async fn connect( &self, local: SocketAddr, remote: SocketAddr, ) -> Result<Self::Socket<'_>, Self::Error>

Connect to a remote socket

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T> UdpConnect for &T
where T: UdpConnect,

Source§

type Error = <T as UdpConnect>::Error

Source§

type Socket<'a> = <T as UdpConnect>::Socket<'a> where &T: 'a

Source§

async fn connect( &self, local: SocketAddr, remote: SocketAddr, ) -> Result<<&T as UdpConnect>::Socket<'_>, <&T as UdpConnect>::Error>

Source§

impl<T> UdpConnect for &mut T
where T: UdpConnect,

Source§

type Error = <T as UdpConnect>::Error

Source§

type Socket<'a> = <T as UdpConnect>::Socket<'a> where &mut T: 'a

Source§

async fn connect( &self, local: SocketAddr, remote: SocketAddr, ) -> Result<<&mut T as UdpConnect>::Socket<'_>, <&mut T as UdpConnect>::Error>

Implementors§