pub struct Ipv6Addr { /* fields omitted */ }
An IPv6 address.
IPv6 addresses are defined as 128-bit integers in [IETF RFC 4291].
They are usually represented as eight 16-bit segments.
See IpAddr
for a type encompassing both IPv4 and IPv6 addresses.
The size of an Ipv6Addr
struct may vary depending on the target operating
system.
pub fn new( a: u16, b: u16, c: u16, d: u16, e: u16, f: u16, g: u16, h: u16 ) -> Ipv6Addr | [src] |
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.
Creates a new IPv6 address representing localhost: ::1
.
Creates a new IPv6 address representing the unspecified address: ::
Returns the eight 16-bit segments that make up this address.
Returns [true
] for the special 'unspecified' address (::).
This property is defined in [IETF RFC 4291].
Returns [true
] if this is a loopback address (::1).
This property is defined in [IETF RFC 4291].
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
Returns [true
] if this is a unique local address (fc00::/7).
This property is defined in [IETF RFC 4193].
Returns true
if the address is unicast and link-local (fe80::/10).
This property is defined in IETF RFC 4291.
Returns [true
] if this is a deprecated unicast site-local address
(fec0::/10).
Returns [true
] if this is an address reserved for documentation
(2001:db8::/32).
This property is defined in [IETF RFC 3849].
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
Returns the address's multicast scope if the address is multicast.
Returns [true
] if this is a multicast address (ff00::/8).
This property is defined by [IETF RFC 4291].
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
Returns the sixteen eight-bit integers the IPv6 address consists of.
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
Performs copy-assignment from source
. Read more
This method tests for self
and other
values to be equal, and is used by ==
. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool
| 1.0.0 [src] |
This method tests for !=
.
This method tests for self
and other
values to be equal, and is used by ==
. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool
| 1.0.0 [src] |
This method tests for !=
.
This method tests for self
and other
values to be equal, and is used by ==
. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool
| 1.0.0 [src] |
This method tests for !=
.
Feeds this value into the given [Hasher
]. Read more
Feeds a slice of this type into the given [Hasher
]. Read more
This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]
fn lt(&self, other: &Rhs) -> bool
| 1.0.0 [src] |
This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]
fn le(&self, other: &Rhs) -> bool
| 1.0.0 [src] |
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
#[must_use]
fn gt(&self, other: &Rhs) -> bool
| 1.0.0 [src] |
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
#[must_use]
fn ge(&self, other: &Rhs) -> bool
| 1.0.0 [src] |
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]
fn lt(&self, other: &Rhs) -> bool
| 1.0.0 [src] |
This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]
fn le(&self, other: &Rhs) -> bool
| 1.0.0 [src] |
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
#[must_use]
fn gt(&self, other: &Rhs) -> bool
| 1.0.0 [src] |
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
#[must_use]
fn ge(&self, other: &Rhs) -> bool
| 1.0.0 [src] |
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]
fn lt(&self, other: &Rhs) -> bool
| 1.0.0 [src] |
This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]
fn le(&self, other: &Rhs) -> bool
| 1.0.0 [src] |
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
#[must_use]
fn gt(&self, other: &Rhs) -> bool
| 1.0.0 [src] |
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
#[must_use]
fn ge(&self, other: &Rhs) -> bool
| 1.0.0 [src] |
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self | 1.21.0 [src] |
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self | 1.21.0 [src] |
Compares and returns the minimum of two values. Read more
The associated error which can be returned from parsing.
Parses a string s
to return a value of this type. Read more