Struct rotor::mio::Ipv6Addr 1.0.0
[−]
[src]
pub struct Ipv6Addr { // some fields omitted }
Representation of an IPv6 address.
Methods
impl Ipv6Addr
fn new(a: u16, b: u16, c: u16, d: u16, e: u16, f: u16, g: u16, h: u16) -> Ipv6Addr
Creates a new IPv6 address from eight 16-bit segments.
The result will represent the IP address a:b:c:d:e:f:g:h.
fn segments(&self) -> [u16; 8]
Returns the eight 16-bit segments that make up this address.
fn is_unspecified(&self) -> bool
1.7.0
Returns true for the special 'unspecified' address (::).
This property is defined in RFC 4291.
fn is_loopback(&self) -> bool
1.7.0
Returns true if this is a loopback address (::1).
This property is defined in RFC 4291.
fn is_global(&self) -> bool
ip
): extra functionality has not been scrutinized to the level that it should be stable
Returns true if the address appears to be globally routable.
The following return false:
- the loopback address
- link-local, site-local, and unique local unicast addresses
- interface-, link-, realm-, admin- and site-local multicast addresses
fn is_unique_local(&self) -> bool
ip
): extra functionality has not been scrutinized to the level that it should be stable
Returns true if this is a unique local address (fc00::/7).
This property is defined in RFC 4193.
fn is_unicast_link_local(&self) -> bool
ip
): extra functionality has not been scrutinized to the level that it should be stable
Returns true if the address is unicast and link-local (fe80::/10).
This property is defined in RFC 4291.
fn is_unicast_site_local(&self) -> bool
ip
): extra functionality has not been scrutinized to the level that it should be stable
Returns true if this is a deprecated unicast site-local address (fec0::/10).
fn is_documentation(&self) -> bool
ip
): extra functionality has not been scrutinized to the level that it should be stable
Returns true if this is an address reserved for documentation (2001:db8::/32).
This property is defined in RFC 3849.
fn is_unicast_global(&self) -> bool
ip
): extra functionality has not been scrutinized to the level that it should be stable
Returns true if the address is a globally routable unicast address.
The following return false:
- the loopback address
- the link-local addresses
- the (deprecated) site-local addresses
- unique local addresses
- the unspecified address
- the address range reserved for documentation
fn multicast_scope(&self) -> Option<Ipv6MulticastScope>
ip
): extra functionality has not been scrutinized to the level that it should be stable
Returns the address's multicast scope if the address is multicast.
fn is_multicast(&self) -> bool
1.7.0
Returns true if this is a multicast address (ff00::/8).
This property is defined by RFC 4291.
fn to_ipv4(&self) -> Option<Ipv4Addr>
Converts this address to an IPv4 address. Returns None if this address is neither IPv4-compatible or IPv4-mapped.
::a.b.c.d and ::ffff:a.b.c.d become a.b.c.d
fn octets(&self) -> [u8; 16]
ipv6_to_octets
): needs some testing
Returns the sixteen eight-bit integers the IPv6 address consists of.
Trait Implementations
impl Copy for Ipv6Addr
impl Display for Ipv6Addr
fn fmt(&self, fmt: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter.
impl Debug for Ipv6Addr
fn fmt(&self, fmt: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter.
impl Clone for Ipv6Addr
fn clone(&self) -> Ipv6Addr
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl PartialEq<Ipv6Addr> for Ipv6Addr
fn eq(&self, other: &Ipv6Addr) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl Eq for Ipv6Addr
impl Hash for Ipv6Addr
impl PartialOrd<Ipv6Addr> for Ipv6Addr
fn partial_cmp(&self, other: &Ipv6Addr) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> 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: &Rhs) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for Ipv6Addr
fn cmp(&self, other: &Ipv6Addr) -> Ordering
This method returns an Ordering
between self
and other
. Read more