Struct miden_objects::accounts::StorageSlot
source · pub struct StorageSlot {
pub slot_type: StorageSlotType,
pub value: Word,
}Expand description
Represents a single storage slot entry.
Fields§
§slot_type: StorageSlotTypeThe type of the value
value: WordThe value itself.
The value can be a raw value or a commitment to the underlying data structure.
Implementations§
source§impl StorageSlot
impl StorageSlot
sourcepub fn new_value(value: Word) -> Self
pub fn new_value(value: Word) -> Self
Returns a new StorageSlot with the provided value.
The value arity for the slot is set to 0.
sourcepub fn new_map(root: Word) -> Self
pub fn new_map(root: Word) -> Self
Returns a new StorageSlot with a map defined by the provided root.
The value arity for the slot is set to 0.
sourcepub fn new_array(root: Word, log_n: u8) -> Self
pub fn new_array(root: Word, log_n: u8) -> Self
Returns a new StorageSlot with an array defined by the provided root and the number of elements.
The max size of the array is set to 2^log_n and the value arity for the slot is set to 0.
Trait Implementations§
source§impl Clone for StorageSlot
impl Clone for StorageSlot
source§fn clone(&self) -> StorageSlot
fn clone(&self) -> StorageSlot
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for StorageSlot
impl RefUnwindSafe for StorageSlot
impl Send for StorageSlot
impl Sync for StorageSlot
impl Unpin for StorageSlot
impl UnwindSafe for StorageSlot
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)