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
hi: u64
lo: u64
Methods
impl emu128
[src]
fn min_value() -> emu128
fn max_value() -> emu128
fn saturating_add(self, other: emu128) -> emu128
fn saturating_sub(self, other: emu128) -> emu128
fn leading_zeros(self) -> u32
fn trailing_zeros(self) -> u32
Trait Implementations
impl Debug for emu128
[src]
impl Clone for emu128
[src]
fn clone(&self) -> emu128
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Copy for emu128
[src]
impl PartialEq for emu128
[src]
fn eq(&self, __arg_0: &emu128) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &emu128) -> bool
This method tests for !=
.
impl Eq for emu128
[src]
impl PartialOrd for emu128
[src]
fn partial_cmp(&self, __arg_0: &emu128) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &emu128) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &emu128) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &emu128) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &emu128) -> bool
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]
fn cmp(&self, __arg_0: &emu128) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
ord_max_min
)Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
ord_max_min
)Compares and returns the minimum of two values. Read more
impl Shl<u8> for emu128
[src]
type Output = Self
The resulting type after applying the <<
operator
fn shl(self, rhs: u8) -> emu128
The method for the <<
operator
impl Shr<u8> for emu128
[src]
type Output = Self
The resulting type after applying the >>
operator
fn shr(self, rhs: u8) -> emu128
The method for the >>
operator
impl BitAnd for emu128
[src]
type Output = Self
The resulting type after applying the &
operator
fn bitand(self, rhs: emu128) -> emu128
The method for the &
operator
impl BitOr for emu128
[src]
type Output = Self
The resulting type after applying the |
operator
fn bitor(self, rhs: emu128) -> emu128
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));
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));