Skip to main content

UdpBind

Trait UdpBind 

Source
pub trait UdpBind {
    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 bind(
        &self,
        local: SocketAddr,
    ) -> Result<Self::Socket<'_>, Self::Error>;
}
Expand description

Re-export the edge-nal crate This is a factory trait for binding 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 stack

Required Methods§

Source

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

Bind to a local socket address

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> UdpBind for &T
where T: UdpBind,

Source§

type Error = <T as UdpBind>::Error

Source§

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

Source§

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

Source§

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

Source§

type Error = <T as UdpBind>::Error

Source§

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

Source§

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

Implementors§