pub struct U256(/* private fields */);Expand description
Unsigned 256-bit integer, encoded as a hexadecimal quantity by Serde.
Implementations§
Source§impl U256
impl U256
Sourcepub const fn into_words(self) -> (u128, u128)
pub const fn into_words(self) -> (u128, u128)
Return the high and low 128-bit words.
Sourcepub const fn from_words(high: u128, low: u128) -> Self
pub const fn from_words(high: u128, low: u128) -> Self
Construct from high and low 128-bit words.
Sourcepub fn from_be_bytes(bytes: [u8; 32]) -> Self
pub fn from_be_bytes(bytes: [u8; 32]) -> Self
Construct from exactly 32 big-endian bytes.
Sourcepub fn to_be_bytes(self) -> [u8; 32]
pub fn to_be_bytes(self) -> [u8; 32]
Return exactly 32 big-endian bytes.
Sourcepub fn checked_add(self, rhs: Self) -> Option<Self>
pub fn checked_add(self, rhs: Self) -> Option<Self>
Add two values, returning None on overflow.
Trait Implementations§
impl Copy for U256
Source§impl<'de> Deserialize<'de> for U256
impl<'de> Deserialize<'de> for U256
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for U256
Source§impl From<U256> for IndexValue<'_>
impl From<U256> for IndexValue<'_>
Source§impl Ord for U256
impl Ord for U256
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for U256
impl PartialOrd for U256
impl PrimaryKey for U256
impl StructuralPartialEq for U256
Auto Trait Implementations§
impl Forget for U256
impl Freeze for U256
impl Move for U256
impl RefUnwindSafe for U256
impl Send for U256
impl Sync for U256
impl Unpin for U256
impl UnsafeUnpin for U256
impl UnwindSafe for U256
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more