Struct network_endian::NetworkEndianU128 [−][src]
#[repr(C, packed)]pub struct NetworkEndianU128(_);
Modelled as a packed 16-byte array rather than u128 because (a) it is not native endian and (b) its alignment is not necessary 16 bytes (it's actually 1).
Methods
impl NetworkEndianU128
[src]
impl NetworkEndianU128
pub const Zero: Self
Zero: Self = NetworkEndianU128([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
Zero.
pub const Maximum: Self
Maximum: Self = NetworkEndianU128([255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255])
Maximum.
pub const fn from_network_endian(network_endian: [u8; 16]) -> Self
[src]
pub const fn from_network_endian(network_endian: [u8; 16]) -> Self
From network endian.
pub fn to_network_endian(self) -> u128
[src]
pub fn to_network_endian(self) -> u128
To network endian.
pub fn to_native_endian(self) -> u128
[src]
pub fn to_native_endian(self) -> u128
To native endian.
pub fn from_native_endian(native_endian: u128) -> Self
[src]
pub fn from_native_endian(native_endian: u128) -> Self
From native endian.
pub fn is_not_zero(self) -> bool
[src]
pub fn is_not_zero(self) -> bool
Is not zero.
Trait Implementations
impl Default for NetworkEndianU128
[src]
impl Default for NetworkEndianU128
fn default() -> NetworkEndianU128
[src]
fn default() -> NetworkEndianU128
Returns the "default value" for a type. Read more
impl Debug for NetworkEndianU128
[src]
impl Debug for NetworkEndianU128
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Copy for NetworkEndianU128
[src]
impl Copy for NetworkEndianU128
impl Clone for NetworkEndianU128
[src]
impl Clone for NetworkEndianU128
fn clone(&self) -> NetworkEndianU128
[src]
fn clone(&self) -> NetworkEndianU128
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Eq for NetworkEndianU128
[src]
impl Eq for NetworkEndianU128
impl PartialEq for NetworkEndianU128
[src]
impl PartialEq for NetworkEndianU128
fn eq(&self, other: &NetworkEndianU128) -> bool
[src]
fn eq(&self, other: &NetworkEndianU128) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &NetworkEndianU128) -> bool
[src]
fn ne(&self, other: &NetworkEndianU128) -> bool
This method tests for !=
.
impl Hash for NetworkEndianU128
[src]
impl Hash for NetworkEndianU128
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl PartialOrd for NetworkEndianU128
[src]
impl PartialOrd for NetworkEndianU128
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
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
1.0.0[src]
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
1.0.0[src]
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
1.0.0[src]
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 NetworkEndianU128
[src]
impl Ord for NetworkEndianU128
fn cmp(&self, other: &Self) -> Ordering
[src]
fn cmp(&self, other: &Self) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl Into<[u8; 16]> for NetworkEndianU128
[src]
impl Into<[u8; 16]> for NetworkEndianU128
impl From<[u8; 16]> for NetworkEndianU128
[src]
impl From<[u8; 16]> for NetworkEndianU128
impl NetworkEndian for NetworkEndianU128
[src]
impl NetworkEndian for NetworkEndianU128
const Length: usize
Length: usize = 16
Length in bytes.
type Bytes = [u8; 16]
Implements [u8; Self::Length]
but this can not yet be expressed in Rust.
fn to_bytes(self) -> Self::Bytes
[src]
fn to_bytes(self) -> Self::Bytes
Convert into bytes.
fn bytes(&self) -> &[u8]
[src]
fn bytes(&self) -> &[u8]
Underlying bytes.
fn write_to_hash<H: Hasher>(&self, hasher: &mut H)
[src]
fn write_to_hash<H: Hasher>(&self, hasher: &mut H)
Writes to a hasher creating a hash.
impl Display for NetworkEndianU128
[src]
impl Display for NetworkEndianU128
Auto Trait Implementations
impl Send for NetworkEndianU128
impl Send for NetworkEndianU128
impl Sync for NetworkEndianU128
impl Sync for NetworkEndianU128