pub struct Word(/* private fields */);
Expand description
A unit of data consisting of 4 field elements.
Implementations§
Source§impl Word
impl Word
Sourcepub const SERIALIZED_SIZE: usize = 32usize
pub const SERIALIZED_SIZE: usize = 32usize
The serialized size of the word in bytes.
Sourcepub const fn new(value: [BaseElement; 4]) -> Word
pub const fn new(value: [BaseElement; 4]) -> Word
Creates a new Word from the given field elements.
Sourcepub fn as_elements(&self) -> &[BaseElement]
pub fn as_elements(&self) -> &[BaseElement]
Returns the word as a slice of field elements.
Sourcepub fn words_as_elements(words: &[Word]) -> &[BaseElement]
pub fn words_as_elements(words: &[Word]) -> &[BaseElement]
Returns all elements of multiple words as a slice.
Sourcepub fn to_hex(&self) -> String
pub fn to_hex(&self) -> String
Returns hexadecimal representation of this word prefixed with 0x
.
Sourcepub fn to_vec(&self) -> Vec<BaseElement>
pub fn to_vec(&self) -> Vec<BaseElement>
Returns internal elements of this word as a vector.
Trait Implementations§
Source§impl Deserializable for Word
impl Deserializable for Word
Source§fn read_from<R>(source: &mut R) -> Result<Word, DeserializationError>where
R: ByteReader,
fn read_from<R>(source: &mut R) -> Result<Word, DeserializationError>where
R: ByteReader,
Reads a sequence of bytes from the provided
source
, attempts to deserialize these bytes
into Self
, and returns the result. Read moreSource§fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>
fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>
Source§impl<T> From<LexicographicWord<T>> for Word
impl<T> From<LexicographicWord<T>> for Word
Source§fn from(key: LexicographicWord<T>) -> Word
fn from(key: LexicographicWord<T>) -> Word
Converts to this type from the input type.
Source§impl FromIterator<Word> for MerklePath
impl FromIterator<Word> for MerklePath
Source§fn from_iter<T>(iter: T) -> MerklePathwhere
T: IntoIterator<Item = Word>,
fn from_iter<T>(iter: T) -> MerklePathwhere
T: IntoIterator<Item = Word>,
Creates a value from an iterator. Read more
Source§impl IntoIterator for Word
impl IntoIterator for Word
Source§type Item = BaseElement
type Item = BaseElement
The type of the elements being iterated over.
Source§type IntoIter = <[BaseElement; 4] as IntoIterator>::IntoIter
type IntoIter = <[BaseElement; 4] as IntoIterator>::IntoIter
Which kind of iterator are we turning this into?
Source§impl KvMap<Word, Vec<BaseElement>> for AdviceMap
impl KvMap<Word, Vec<BaseElement>> for AdviceMap
fn get(&self, key: &Word) -> Option<&Vec<Felt>>
fn contains_key(&self, key: &Word) -> bool
fn len(&self) -> usize
fn insert(&mut self, key: Word, value: Vec<Felt>) -> Option<Vec<Felt>>
fn remove(&mut self, key: &Word) -> Option<Vec<Felt>>
fn iter(&self) -> Box<dyn Iterator<Item = (&Word, &Vec<Felt>)> + '_>
fn is_empty(&self) -> bool
Source§impl Ord for Word
impl Ord for Word
Source§impl PartialOrd for Word
impl PartialOrd for Word
Source§impl Randomizable for Word
impl Randomizable for Word
Source§impl Serializable for Word
impl Serializable for Word
Source§fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
Serializes
self
into bytes and writes these bytes into the target
.Source§fn get_size_hint(&self) -> usize
fn get_size_hint(&self) -> usize
Returns an estimate of how many bytes are needed to represent self. Read more
Source§impl TryFrom<&[BaseElement]> for Word
impl TryFrom<&[BaseElement]> for Word
impl Copy 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