Union nibble::pair::u4x2
[−]
[src]
#[repr(C)]pub union u4x2 { // some fields omitted }
A u8
split into its component nibbles.
Methods
impl u4x2
[src]
fn from_hi(hi: u4hi) -> Self
[src]
Creates a pair with an empty low-order nibble.
fn from_lo(lo: u4lo) -> Self
[src]
Creates a pair with an empty high-order nibble.
fn from_both(hi: u4hi, lo: u4lo) -> Self
[src]
Creates a pair from its components.
fn from_byte(byte: u8) -> u4x2
[src]
Creates a pair from an already-combined byte.
fn hi(&self) -> &u4hi
[src]
The high-order nibble.
fn lo(&self) -> &u4lo
[src]
The low-order nibble.
fn both(&self) -> (&u4hi, &u4lo)
[src]
Both nibbles.
fn byte(&self) -> &u8
[src]
Both nibbles as a byte.
fn hi_mut(&mut self) -> &U4HiCell
[src]
Mutable access to the high-order nibble in a cell.
fn lo_mut(&mut self) -> &U4LoCell
[src]
Mutable access to the low-order nibble in a cell.
fn both_mut(&mut self) -> (&U4HiCell, &U4LoCell)
[src]
Mutable access to both nibbles in cells.
fn byte_mut(&mut self) -> &mut u8
[src]
Mutable access to the whole byte.
fn from_ref(byte: &u8) -> &u4x2
[src]
Provides access to the nibbles in a byte.
fn from_mut(byte: &mut u8) -> &mut u4x2
[src]
Provides access to the nibbles in a byte.
fn set_lo<T: u4>(&mut self, lo: T)
[src]
Sets the low-order nibble.
fn set_hi<T: u4>(&mut self, hi: T)
[src]
Sets the low-order nibble.
fn swap_pairs(&mut self)
[src]
Swaps the nibbles in the pair.
fn iter(&self) -> Iter
[src]
Iterator over the nibble pair.
fn iter_mut(&mut self) -> IterMut
[src]
Mutable iterator over the nibble pair.
fn from_ascii_digits(lo: u8, hi: u8) -> Option<u4x2>
[src]
Converts an ASCII hex digit into a nibble.
fn to_lower_ascii_digits(&self) -> (u8, u8)
[src]
Converts a nibble into a lowercase ASCII hex digit.
fn to_upper_ascii_digit(&self) -> (u8, u8)
[src]
Converts a nibble into an uppercase ASCII hex digit.
fn from_digits(lo: char, hi: char) -> Option<u4x2>
[src]
Converts a hex digit into a nibble.
fn to_lower_digits(&self) -> (char, char)
[src]
Converts a nibble into a lowercase hex digit.
fn to_upper_digits(&self) -> (char, char)
[src]
Converts a nibble into an uppercase hex digit.
fn to_padded_lower_hex(&self) -> ArrayString<[u8; 2]>
[src]
Converts a nibble into a lowercase hex string.
fn to_padded_upper_hex(&self) -> ArrayString<[u8; 2]>
[src]
Converts a nibble into an uppercase hex string.
fn to_padded_binary(&self) -> ArrayString<[u8; 8]>
[src]
Converts a nibble into a binary string.
Trait Implementations
impl PartialEq<u4x2> for u4x2
[src]
fn eq(&self, rhs: &u4x2) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl PartialEq<u8> for u4x2
[src]
fn eq(&self, rhs: &u8) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl PartialOrd<u4x2> for u4x2
[src]
fn partial_cmp(&self, rhs: &u4x2) -> Option<Ordering>
[src]
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]
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]
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]
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]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl PartialOrd<u8> for u4x2
[src]
fn partial_cmp(&self, rhs: &u8) -> Option<Ordering>
[src]
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]
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]
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]
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]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Hash for u4x2
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
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]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Eq for u4x2
[src]
impl Ord for u4x2
[src]
fn cmp(&self, rhs: &u4x2) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.22.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.22.0[src]
Compares and returns the minimum of two values. Read more
impl Binary for u4x2
[src]
impl LowerHex for u4x2
[src]
impl UpperHex for u4x2
[src]
impl Debug for u4x2
[src]
impl Display for u4x2
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Clone for u4x2
[src]
fn clone(&self) -> u4x2
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more