pub struct Word { /* private fields */ }
Expand description
A Simplicity word. A value of type TWO^(2^n)
for some 0 ≤ n < 32
.
Implementations§
Source§impl Word
impl Word
Sourcepub fn product(self, right: Self) -> Option<Self>
pub fn product(self, right: Self) -> Option<Self>
Concatenate two words into a larger word.
Both words have to have the same length, which is 2^n bits. The resulting word will be 2^(n + 1) bits long.
Returns None
if the words differ in length.
Returns None
if the words are already 2^31 bits long
(the resulting word would be longer than 2^31 bits, which is not supported).
Sourcepub fn shallow_clone(&self) -> Self
pub fn shallow_clone(&self) -> Self
Make a cheap copy of the word.
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Return the bit length of the word.
The word is of type TWO^(2^n)
. Return 2^n
.
Trait Implementations§
Source§impl Ord for Word
impl Ord for Word
Source§impl PartialOrd for Word
impl PartialOrd for Word
impl Eq for Word
impl StructuralPartialEq for Word
Auto Trait Implementations§
impl Freeze for Word
impl RefUnwindSafe for Word
impl Send for Word
impl Sync for Word
impl Unpin for Word
impl UnwindSafe for Word
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