Skip to main content

SocketAddrExt

Trait SocketAddrExt 

Source
pub trait SocketAddrExt: Sized {
    // Required methods
    fn unspecified_v4() -> Self;
    fn unspecified_v6() -> Self;
    fn as_unspecified(&self) -> Self;
}
Expand description

Extension trait for SocketAddr.

Required Methods§

Source

fn unspecified_v4() -> Self

Returns the unspecified IPv4 socket address, bound to port 0.

Source

fn unspecified_v6() -> Self

Returns the unspecified IPv6 socket address, bound to port 0.

Source

fn as_unspecified(&self) -> Self

Returns the unspecified socket address of the same family as other, bound to port 0.

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.

Implementations on Foreign Types§

Source§

impl SocketAddrExt for SocketAddr

Source§

fn unspecified_v4() -> Self

Source§

fn unspecified_v6() -> Self

Source§

fn as_unspecified(&self) -> Self

Implementors§