pub struct u121(_);Expand description
The 121-bit unsigned integer type.
Implementations§
source§impl u121
impl u121
sourcepub const MIN: u121 = _
pub const MIN: u121 = _
The smallest value that can be represented by this integer type.
Examples
Basic usage:
assert_eq!(u121::MIN, u121::try_from(0u128).unwrap());sourcepub const MAX: u121 = _
pub const MAX: u121 = _
The largest value that can be represented by this integer type.
Examples
Basic usage:
assert_eq!(u121::MAX, u121::try_from(2658455991569831745807614120560689151u128).unwrap());sourcepub fn from_be_bytes(bytes: [u8; 16]) -> Self
pub fn from_be_bytes(bytes: [u8; 16]) -> Self
Create a native endian integer value from its representation as a byte array in big endian.
sourcepub fn from_le_bytes(bytes: [u8; 16]) -> Self
pub fn from_le_bytes(bytes: [u8; 16]) -> Self
Create a native endian integer value from its representation as a byte array in little endian.
sourcepub fn from_ne_bytes(bytes: [u8; 16]) -> Self
pub fn from_ne_bytes(bytes: [u8; 16]) -> Self
Create a native endian integer value from its memory representation as a byte array in native endianness.
As the target platform’s native endianness is used, portable code likely
wants to use from_be_bytes or from_le_bytes, as appropriate instead.
sourcepub fn to_be_bytes(self) -> [u8; 16]
pub fn to_be_bytes(self) -> [u8; 16]
Return the memory representation of this integer as a byte array in big-endian (network) byte order.
sourcepub fn to_le_bytes(self) -> [u8; 16]
pub fn to_le_bytes(self) -> [u8; 16]
Return the memory representation of this integer as a byte array in little-endian byte order.
sourcepub fn to_ne_bytes(self) -> [u8; 16]
pub fn to_ne_bytes(self) -> [u8; 16]
Return the memory representation of this integer as a byte array in native byte order.
As the target platform’s native endianness is used, portable code should
use to_be_bytes or to_le_bytes, as appropriate, instead.
sourcepub fn from_str_radix(src: &str, radix: u32) -> Result<u121, ParseIntError>
pub fn from_str_radix(src: &str, radix: u32) -> Result<u121, ParseIntError>
Converts a string slice in a given base to an integer.
The string is expected to be an optional + sign followed by digits. Leading and trailing whitespace represent an error. Digits are a subset of these characters, depending on radix:
0-9a-zA-Z
Panics
This function panics if radix is not in the range from 2 to 36.
Trait Implementations§
source§impl Ord for u121
impl Ord for u121
source§impl PartialEq<u121> for u121
impl PartialEq<u121> for u121
source§impl PartialOrd<u121> for u121
impl PartialOrd<u121> for u121
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read more