Trait nibble::base::u4 [] [src]

pub trait u4: Debug + Display + Binary + Octal + LowerHex + UpperHex + PartialEq<u4lo> + PartialEq<u4hi> + PartialOrd<u4lo> + PartialOrd<u4hi> {
    fn from_hi(lo_and_hi: u8) -> Self
    where
        Self: Sized
;
fn from_lo(lo_and_hi: u8) -> Self
    where
        Self: Sized
;
fn from_repeated(lo_and_hi: u8) -> Self
    where
        Self: Sized
;
fn to_hi(&self) -> u8;
fn to_lo(&self) -> u8; fn try_from_hi(lo_and_hi: u8) -> Option<Self>
    where
        Self: Sized
, { ... }
fn try_from_lo(lo_and_hi: u8) -> Option<Self>
    where
        Self: Sized
, { ... }
fn to_repeated(&self) -> u8 { ... }
fn to_u4hi(&self) -> u4hi { ... }
fn to_u4lo(&self) -> u4lo { ... }
fn from_ascii_digit(b: u8) -> Option<Self>
    where
        Self: Sized
, { ... }
fn to_lower_ascii_digit(&self) -> u8 { ... }
fn to_upper_ascii_digit(&self) -> u8 { ... }
fn from_digit(c: char) -> Option<Self>
    where
        Self: Sized
, { ... }
fn to_lower_digit(&self) -> char { ... }
fn to_upper_digit(&self) -> char { ... }
fn to_lower_hex(&self) -> ArrayString<[u8; 1]> { ... }
fn to_upper_hex(&self) -> ArrayString<[u8; 1]> { ... }
fn from_ascii_binary(s: ArrayVec<[u8; 4]>) -> Option<Self>
    where
        Self: Sized
, { ... }
fn from_binary(s: ArrayString<[u8; 4]>) -> Option<Self>
    where
        Self: Sized
, { ... }
fn to_padded_binary(&self) -> ArrayString<[u8; 4]> { ... }
fn to_binary(&self) -> ArrayString<[u8; 4]> { ... }
fn to_octal(&self) -> ArrayString<[u8; 2]> { ... }
fn to_decimal(&self) -> ArrayString<[u8; 2]> { ... }
fn from_ascii_radix(s: &[u8], radix: u32) -> Result<Self, ParseNibbleError>
    where
        Self: Sized
, { ... }
fn from_str_radix(s: &str, radix: u32) -> Result<Self, ParseNibbleError>
    where
        Self: Sized
, { ... } }

A nibble.

Required Methods

Constructs a nibble from the high-order bits the a given byte.

Constructs a nibble from the low-order bits the a given byte.

Constructs a nibble from a byte with the same data in the high- and low-order bits.

Converts this nibble into a byte with its high-order bits set and low-order bits zero.

Converts this nibble into a byte with its low-order bits set and high-order bits zero.

Provided Methods

Tries to constructs a nibble from the high-order bits the a given byte.

Fails if the low-order bits are nonzero.

Tries to constructs a nibble from the low-order bits the a given byte.

Fails if the high-order bits are nonzero.

Converts this nibble into a byte with the same data in the high- and low-order bits.

Converts this nibble into a high-order version.

Converts this nibble into a low-order version.

Converts an ASCII hex digit into a nibble.

Converts a nibble into a lowercase ASCII hex digit.

Converts a nibble into an uppercase ASCII hex digit.

Converts a hex digit into a nibble.

Converts a nibble into a lowercase hex digit.

Converts a nibble into an uppercase hex digit.

Converts a nibble into a lowercase hex string.

Converts a nibble into an uppercase hex string.

Converts an ASCII binary string into a nibble.

Converts an ASCII binary string into a nibble.

Converts a nibble into a 4-digit binary string.

Converts a nibble into a binary string.

Converts a nibble into an octal string.

Converts a nibble into a decimal string.

Converts an ASCII string of the given radix into a nibble.

Panics

Panics if radix > 36.

Converts a string of the given radix into a nibble.

Panics

Panics if radix > 36.

Implementors