pub struct Chainwork(/* private fields */);Expand description
Unsigned 256-bit chainwork in little-endian 64-bit limbs.
Implementations§
Source§impl Chainwork
impl Chainwork
pub const ZERO: Self
pub const fn from_limbs_le(limbs: [u64; 4]) -> Self
pub const fn limbs_le(self) -> [u64; 4]
pub fn from_be_bytes(bytes: [u8; 32]) -> Self
pub fn to_be_bytes(self) -> [u8; 32]
pub fn checked_add(self, other: Self) -> Result<Self, ArithmeticError>
pub fn checked_sub(self, other: Self) -> Result<Self, ArithmeticError>
pub fn checked_mul_u64(self, multiplier: u64) -> Result<Self, ArithmeticError>
pub fn checked_div_u64(self, divisor: u64) -> Result<Self, ArithmeticError>
Trait Implementations§
impl Copy for Chainwork
impl Eq for Chainwork
Source§impl Ord for Chainwork
impl Ord for Chainwork
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
Source§impl PartialOrd for Chainwork
impl PartialOrd for Chainwork
impl StructuralPartialEq for Chainwork
Auto Trait Implementations§
impl Freeze for Chainwork
impl RefUnwindSafe for Chainwork
impl Send for Chainwork
impl Sync for Chainwork
impl Unpin for Chainwork
impl UnsafeUnpin for Chainwork
impl UnwindSafe for Chainwork
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