pub struct U256 {
left: u128,
right: u128,
}Expand description
Duct tape two u128 together to make a 256 bit wide integer.
Fields§
§left: u128§right: u128Implementations§
Source§impl U256
impl U256
fn bit_set(&mut self, offset: usize)
fn non_zero(self) -> bool
Sourcefn left_roll(self, width: usize) -> Self
fn left_roll(self, width: usize) -> Self
Perform a rotate_left where the width can be different from 256 bits.
Sourcefn right_roll(self, width: usize) -> Self
fn right_roll(self, width: usize) -> Self
Perform a rotate_right where the width can be different from 256 bits.
Trait Implementations§
Source§impl BitAnd for U256
Implement operator bitwise logic so that we can use the regular &, | and ! notation.
impl BitAnd for U256
Implement operator bitwise logic so that we can use the regular &, | and ! notation.
impl Copy for U256
Auto Trait Implementations§
impl Freeze 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