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: u128
Implementations§
source§impl U256
impl U256
fn bit_set(&mut self, offset: usize)
fn non_zero(&self) -> bool
sourcefn left_roll(&self, width: usize) -> U256
fn left_roll(&self, width: usize) -> U256
Perform a rotate_left
where the width can be different from 256 bits.
sourcefn right_roll(&self, width: usize) -> U256
fn right_roll(&self, width: usize) -> U256
Perform a rotate_right
where the width can be different from 256 bits.
Trait Implementations§
source§impl BitAnd for U256
impl BitAnd for U256
Implement operator bitswise 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 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)