Struct ipnet::Emu128 [] [src]

pub struct Emu128 {
    pub hi: u64,
    pub lo: u64,
}

Emulate a 128 bit uint using two 64 bit uints. When the i128 feature is stable this can be removed.

Fields

Methods

impl emu128
[src]

Trait Implementations

impl Debug for emu128
[src]

Formats the value using the given formatter.

impl Clone for emu128
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for emu128
[src]

impl PartialEq for emu128
[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 emu128
[src]

impl PartialOrd for emu128
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Ord for emu128
[src]

This method returns an Ordering between self and other. Read more

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

Compares and returns the maximum of two values. Read more

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

Compares and returns the minimum of two values. Read more

impl Shl<u8> for emu128
[src]

The resulting type after applying the << operator

The method for the << operator

impl Shr<u8> for emu128
[src]

The resulting type after applying the >> operator

The method for the >> operator

impl BitAnd for emu128
[src]

The resulting type after applying the & operator

The method for the & operator

impl BitOr for emu128
[src]

The resulting type after applying the | operator

The method for the | operator

impl From<Ipv6Addr> for emu128
[src]

Convert an Ipv6Addr into an emu128.

Examples

use std::net::Ipv6Addr;
use std::str::FromStr;
use ipnet::Emu128;

let a = Ipv6Addr::from_str("fd00::1").unwrap();
let u = Emu128 { hi: 0xfd00_0000_0000_0000, lo: 1 };
let a2: Ipv6Addr = u.into();

assert_eq!(a, a2);
assert_eq!(u, a.into());
assert_eq!(u, Emu128::from(a));

Performs the conversion.

impl Into<Ipv6Addr> for emu128
[src]

Convert an emu128 into an Ipv6Addr.

Examples

use std::net::Ipv6Addr;
use std::str::FromStr;
use ipnet::Emu128;

let a = Ipv6Addr::from_str("fd00::1").unwrap();
let u = Emu128 { hi: 0xfd00_0000_0000_0000, lo: 1 };
let a2: Ipv6Addr = u.into();

assert_eq!(a, a2);
assert_eq!(u, a.into());
assert_eq!(u, Emu128::from(a));

Performs the conversion.