[][src]Trait async_coap::SocketAddrExt

pub trait SocketAddrExt: Sized + ToSocketAddrs + Copy + Display + Debug + Send + Eq + Hash {
    fn is_multicast(&self) -> bool;
fn port(&self) -> u16;
fn addr_to_string(&self) -> String; fn conforming_to(&self, local: Self) -> Option<Self> { ... }
fn as_uri_buf(&self, scheme: &str) -> UriBuf { ... } }

Extension trait for SocketAddr types that allows the local endpoint get the information it needs.

Required methods

fn is_multicast(&self) -> bool

Determines if the address in this SocketAddr is a multicast/broadcast address or not.

fn port(&self) -> u16

Returns the port number for this socket.

A value of zero indicates no specific value.

fn addr_to_string(&self) -> String

Renders the address portion to a string.

Loading content...

Provided methods

fn conforming_to(&self, local: Self) -> Option<Self>

Returns a version of this socket address that conforms to the address type of local, or None if such a conversion is not possible.

This method is useful in mixed ipv6/ipv4 environments.

fn as_uri_buf(&self, scheme: &str) -> UriBuf

Creates a URI from this SocketAddr using the given scheme.

Loading content...

Implementations on Foreign Types

impl SocketAddrExt for SocketAddr[src]

Loading content...

Implementors

impl SocketAddrExt for LoopbackSocketAddr[src]

impl SocketAddrExt for NullSocketAddr[src]

Loading content...