Trait Localhost

Source
pub trait Localhost: Host {
    // Required method
    fn localhost() -> Self;
}
Expand description

Trait for address types which can represent a localhost address.

Required Methods§

Source

fn localhost() -> Self

Returns a localhost address expressed by the means of this specofic address type.

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 Localhost for IpAddr

Source§

fn localhost() -> Self

Source§

impl Localhost for Ipv4Addr

Source§

fn localhost() -> Self

Source§

impl Localhost for Ipv6Addr

Source§

fn localhost() -> Self

Implementors§

Source§

impl Localhost for HostName

Source§

impl Localhost for InetHost

Available on crate feature dns only.
Source§

impl<H, const DEFAULT_PORT: u16> Localhost for PartialAddr<H, DEFAULT_PORT>
where H: Localhost + Host,