Enum addr::Host [−][src]
pub enum Host { Ip(IpAddr), Domain(DomainName), }
Holds information about a particular host
Variants
Ip(IpAddr)
Domain(DomainName)
Methods
impl Host
[src]
impl Host
pub fn is_ip(&self) -> bool
[src]
pub fn is_ip(&self) -> bool
A convenient method to simply check if a host is an IP address
pub fn is_domain(&self) -> bool
[src]
pub fn is_domain(&self) -> bool
A convenient method to simply check if a host is a domain name
Trait Implementations
impl FromStr for Host
[src]
impl FromStr for Host
type Err = Error
The associated error which can be returned from parsing.
fn from_str(host: &str) -> Result<Host>
[src]
fn from_str(host: &str) -> Result<Host>
Parses a string s
to return a value of this type. Read more
impl Display for Host
[src]
impl Display for Host
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl PartialEq<str> for Host
[src]
impl PartialEq<str> for Host
fn eq(&self, other: &str) -> bool
[src]
fn eq(&self, other: &str) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl Eq for Host
[src]
impl Eq for Host
impl PartialEq for Host
[src]
impl PartialEq for Host
fn eq(&self, other: &Host) -> bool
[src]
fn eq(&self, other: &Host) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Host) -> bool
[src]
fn ne(&self, other: &Host) -> bool
This method tests for !=
.
impl Ord for Host
[src]
impl Ord for Host
fn cmp(&self, other: &Host) -> Ordering
[src]
fn cmp(&self, other: &Host) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl PartialOrd for Host
[src]
impl PartialOrd for Host
fn partial_cmp(&self, other: &Host) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Host) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Host) -> bool
[src]
fn lt(&self, other: &Host) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Host) -> bool
[src]
fn le(&self, other: &Host) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Host) -> bool
[src]
fn gt(&self, other: &Host) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Host) -> bool
[src]
fn ge(&self, other: &Host) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Hash for Host
[src]
impl Hash for Host
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Debug for Host
[src]
impl Debug for Host