pub struct StorageSlotId { /* private fields */ }Expand description
The partial hash of a storage slot name.
A slot id consists of two field elements: a prefix and a suffix.
Slot ids uniquely identify slots in account storage and are used by the host functions exposed
via miden::protocol::*.
Implementations§
Source§impl StorageSlotId
impl StorageSlotId
Sourcepub fn new(suffix: Felt, prefix: Felt) -> Self
pub fn new(suffix: Felt, prefix: Felt) -> Self
Creates a new StorageSlotId from the provided felts.
Note: this constructor takes (suffix, prefix) to match the values returned by
miden_protocol::account::StorageSlotId::{suffix,prefix}.
Sourcepub fn from_prefix_suffix(prefix: Felt, suffix: Felt) -> Self
pub fn from_prefix_suffix(prefix: Felt, suffix: Felt) -> Self
Creates a new StorageSlotId from the provided felts in host-call order.
Host functions take the prefix first and then the suffix.
Sourcepub fn to_prefix_suffix(&self) -> (Felt, Felt)
pub fn to_prefix_suffix(&self) -> (Felt, Felt)
Returns the (prefix, suffix) pair in host-call order.
Sourcepub fn suffix(&self) -> Felt
pub fn suffix(&self) -> Felt
Returns the suffix of the StorageSlotId.
Sourcepub fn prefix(&self) -> Felt
pub fn prefix(&self) -> Felt
Returns the prefix of the StorageSlotId.
Trait Implementations§
Source§impl Clone for StorageSlotId
impl Clone for StorageSlotId
Source§fn clone(&self) -> StorageSlotId
fn clone(&self) -> StorageSlotId
Returns a duplicate 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 moreSource§impl Debug for StorageSlotId
impl Debug for StorageSlotId
Source§impl Hash for StorageSlotId
impl Hash for StorageSlotId
Source§impl PartialEq for StorageSlotId
impl PartialEq for StorageSlotId
impl Copy for StorageSlotId
impl Eq for StorageSlotId
impl StructuralPartialEq for StorageSlotId
Auto Trait Implementations§
impl Freeze for StorageSlotId
impl RefUnwindSafe for StorageSlotId
impl Send for StorageSlotId
impl Sync for StorageSlotId
impl Unpin for StorageSlotId
impl UnwindSafe for StorageSlotId
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