[][src]Enum inet::host::Host

pub enum Host {
    Address(IPAddress),
    Name(Domain),
}

Represents an IP address or a domain name.

Variants

Address(IPAddress)

An IP Address

Name(Domain)

A Domain Name

Trait Implementations

impl ToString for Host[src]

fn to_string(&self) -> String[src]

use inet::domain::Domain;
use std::convert::TryFrom;
use inet::host::Host;
use inet::ip::{IPv4Address, IPAddress};

let ip: Host = Host::Address(IPAddress::V4(IPv4Address::LOCALHOST));
assert_eq!(ip.to_string(), "127.0.0.1");

let domain: Host = Host::Name(Domain::try_from("localhost".as_bytes()).ok().unwrap());
assert_eq!(domain.to_string(), "localhost");

impl Eq for Host[src]

impl Clone for Host[src]

impl PartialOrd<Host> for Host[src]

impl PartialEq<Host> for Host[src]

impl Ord for Host[src]

impl Hash for Host[src]

impl Debug for Host[src]

Auto Trait Implementations

impl Send for Host

impl Unpin for Host

impl Sync for Host

impl RefUnwindSafe for Host

impl UnwindSafe for Host

Blanket Implementations

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]