Struct ipaddr::Ipv6Mask[][src]

pub struct Ipv6Mask(_);

Methods

impl Ipv6Mask
[src]

Return the prefix length that correspond to this mask.

let mask = Ipv6Mask::from_str("ffff:ffff:ffff:ffff::").unwrap();
assert_eq!(mask.prefixlen(), 64);

Create an Ipv6Mask corresponding to the given prefix length

let mask = Ipv6Mask::from_prefixlen(64).unwrap();
assert_eq!(u128::from(mask), 0xffff_ffff_ffff_ffff_0000_0000_0000_0000);

Create a formatter to stringify this IPv6 mask. See Ipv6Formatter<'a, W> for more details.

Return a string representation of this IPv6 address. There are several ways to represent an IPv6 address. This method uses the convention documented in RFC5952:

  • lower case
  • the longest sequence of zeros is replaced by ::
  • no leading zero (fe80::123 instead of fe80::0123)

For other formatting options, use formatter().

let mask = Ipv6Mask::from_prefixlen(64).unwrap();
assert_eq!(mask.to_string(), "ffff:ffff:ffff:ffff::");

// the same representation is used in the Display implementation
assert_eq!(format!("{}", mask), "ffff:ffff:ffff:ffff::");

Trait Implementations

impl From<Ipv6Mask> for Ipv6Address
[src]

Performs the conversion.

impl<'a> From<&'a Ipv6Mask> for Ipv6Address
[src]

Performs the conversion.

impl Copy for Ipv6Mask
[src]

impl Clone for Ipv6Mask
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for Ipv6Mask
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for Ipv6Mask
[src]

impl Hash for Ipv6Mask
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl Display for Ipv6Mask
[src]

Formats the value using the given formatter. Read more

impl Debug for Ipv6Mask
[src]

Formats the value using the given formatter. Read more

impl AsRef<u128> for Ipv6Mask
[src]

Performs the conversion.

impl From<Ipv6Mask> for u128
[src]

Performs the conversion.

impl<'a> From<&'a Ipv6Mask> for u128
[src]

Performs the conversion.

impl TryFrom<u128> for Ipv6Mask
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<'a> TryFrom<&'a u128> for Ipv6Mask
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl TryFrom<Ipv6Address> for Ipv6Mask
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<'a> TryFrom<&'a Ipv6Address> for Ipv6Mask
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl Not for Ipv6Mask
[src]

The resulting type after applying the ! operator.

Performs the unary ! operation.

impl<'a> Not for &'a Ipv6Mask
[src]

The resulting type after applying the ! operator.

Performs the unary ! operation.

impl LowerHex for Ipv6Mask
[src]

Formats the value using the given formatter.

impl UpperHex for Ipv6Mask
[src]

Formats the value using the given formatter.

impl Binary for Ipv6Mask
[src]

Formats the value using the given formatter.

impl BitAnd<Ipv6Mask> for Ipv6Address
[src]

The resulting type after applying the & operator.

Performs the & operation.

impl<'a> BitAnd<Ipv6Mask> for &'a Ipv6Address
[src]

The resulting type after applying the & operator.

Performs the & operation.

impl<'a> BitAnd<&'a Ipv6Mask> for Ipv6Address
[src]

The resulting type after applying the & operator.

Performs the & operation.

impl<'a, 'b> BitAnd<&'a Ipv6Mask> for &'b Ipv6Address
[src]

The resulting type after applying the & operator.

Performs the & operation.

impl FromStr for Ipv6Mask
[src]

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

Auto Trait Implementations

impl Send for Ipv6Mask

impl Sync for Ipv6Mask