pub struct U224 { /* private fields */ }
Expand description
224-bit unsigned integer represented as little-endian byte order.
use un_prim::*;
let x: U224 = 100u8.into();
assert_eq!(100u8, x.into());
Implementations§
Source§impl U224
impl U224
Sourcepub fn to_str_radix(&self, radix: u32) -> String
pub fn to_str_radix(&self, radix: u32) -> String
convert this type into radix string.
Source§impl U224
impl U224
Sourcepub fn from_le_bytes(bytes: [u8; 28]) -> Self
pub fn from_le_bytes(bytes: [u8; 28]) -> Self
Create this type from little endian bytes.
Sourcepub fn from_be_bytes(bytes: [u8; 28]) -> Self
pub fn from_be_bytes(bytes: [u8; 28]) -> Self
Create this type from big endian bytes.
Sourcepub fn to_le_bytes(&self) -> [u8; 28]
pub fn to_le_bytes(&self) -> [u8; 28]
Return the little endian representation of this type.
Sourcepub fn to_be_bytes(&self) -> [u8; 28]
pub fn to_be_bytes(&self) -> [u8; 28]
Return the big endian representation of this type.
Sourcepub fn leading_zeros(&self) -> u32
pub fn leading_zeros(&self) -> u32
Return count of leading zeros.
Sourcepub fn trailing_zeros(&self) -> u32
pub fn trailing_zeros(&self) -> u32
Return count of trailing zeros.
Sourcepub fn leading_ones(&self) -> u32
pub fn leading_ones(&self) -> u32
Return count of leading ones.
Sourcepub fn trailing_ones(&self) -> u32
pub fn trailing_ones(&self) -> u32
Return count of trailing ones.
Sourcepub fn overflowing_add(&self, other: Self) -> (Self, bool)
pub fn overflowing_add(&self, other: Self) -> (Self, bool)
Add two number and return the sum along with the carry.
Sourcepub fn overflowing_sub(&self, other: Self) -> (Self, bool)
pub fn overflowing_sub(&self, other: Self) -> (Self, bool)
Subtract two number and return the sum along with the borrow.
Sourcepub fn overflowing_mul(&self, other: Self) -> (Self, bool)
pub fn overflowing_mul(&self, other: Self) -> (Self, bool)
Return product of two number after multiplication and bool indicating overflow.
Sourcepub fn div_rem(&self, rhs: Self) -> (Self, Self)
pub fn div_rem(&self, rhs: Self) -> (Self, Self)
Divide two numbers and return tuple of the quotient and remainder.
Sourcepub fn overflowing_shl(&self, n: u32) -> (Self, bool)
pub fn overflowing_shl(&self, n: u32) -> (Self, bool)
Shift left and return the result along with boolean indicating overflow.
Sourcepub fn overflowing_shr(&self, n: u32) -> (Self, bool)
pub fn overflowing_shr(&self, n: u32) -> (Self, bool)
Shift right and return the result along with boolean indicating overflow.
Trait Implementations§
Source§impl AddAssign for U224
impl AddAssign for U224
Source§fn add_assign(&mut self, other: U224)
fn add_assign(&mut self, other: U224)
+=
operation. Read moreSource§impl BitAndAssign for U224
impl BitAndAssign for U224
Source§fn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
&=
operation. Read moreSource§impl BitOrAssign for U224
impl BitOrAssign for U224
Source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
|=
operation. Read moreSource§impl BitXorAssign for U224
impl BitXorAssign for U224
Source§fn bitxor_assign(&mut self, rhs: Self)
fn bitxor_assign(&mut self, rhs: Self)
^=
operation. Read moreSource§impl<'de> Deserialize<'de> for U224
impl<'de> Deserialize<'de> for U224
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Source§impl DivAssign for U224
impl DivAssign for U224
Source§fn div_assign(&mut self, other: U224)
fn div_assign(&mut self, other: U224)
/=
operation. Read moreSource§impl MulAssign for U224
impl MulAssign for U224
Source§fn mul_assign(&mut self, other: U224)
fn mul_assign(&mut self, other: U224)
*=
operation. Read moreSource§impl Ord for U224
impl Ord for U224
Source§impl PartialOrd for U224
impl PartialOrd for U224
Source§impl RemAssign for U224
impl RemAssign for U224
Source§fn rem_assign(&mut self, other: U224)
fn rem_assign(&mut self, other: U224)
%=
operation. Read moreSource§impl ShlAssign<u32> for U224
impl ShlAssign<u32> for U224
Source§fn shl_assign(&mut self, n: u32)
fn shl_assign(&mut self, n: u32)
<<=
operation. Read moreSource§impl ShrAssign<u32> for U224
impl ShrAssign<u32> for U224
Source§fn shr_assign(&mut self, n: u32)
fn shr_assign(&mut self, n: u32)
>>=
operation. Read moreSource§impl SubAssign for U224
impl SubAssign for U224
Source§fn sub_assign(&mut self, other: U224)
fn sub_assign(&mut self, other: U224)
-=
operation. Read more