Struct miden_objects::accounts::delta::AccountStorageDelta
source · pub struct AccountStorageDelta {
pub cleared_items: Vec<u8>,
pub updated_items: Vec<(u8, Word)>,
pub updated_maps: Vec<(u8, StorageMapDelta)>,
}Expand description
AccountStorageDelta stores the differences between two states of account storage.
The differences are represented as follows:
- item updates: represented by
cleared_itemsandupdated_itemsfield.
Fields§
§cleared_items: Vec<u8>§updated_items: Vec<(u8, Word)>§updated_maps: Vec<(u8, StorageMapDelta)>Implementations§
source§impl AccountStorageDelta
impl AccountStorageDelta
sourcepub fn validate(&self) -> Result<(), AccountDeltaError>
pub fn validate(&self) -> Result<(), AccountDeltaError>
Checks whether this storage delta is valid.
§Errors
Returns an error if:
- The number of cleared or updated items is greater than 255.
- Any of cleared or updated items are at slot 255 (i.e., immutable slot).
- Any of the cleared or updated items is referenced more than once (e.g., updated twice).
- There is a storage map delta without a corresponding storage item update.
Trait Implementations§
source§impl Clone for AccountStorageDelta
impl Clone for AccountStorageDelta
source§fn clone(&self) -> AccountStorageDelta
fn clone(&self) -> AccountStorageDelta
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 moresource§impl Debug for AccountStorageDelta
impl Debug for AccountStorageDelta
source§impl Default for AccountStorageDelta
impl Default for AccountStorageDelta
source§fn default() -> AccountStorageDelta
fn default() -> AccountStorageDelta
Returns the “default value” for a type. Read more
source§impl Deserializable for AccountStorageDelta
impl Deserializable for AccountStorageDelta
source§fn read_from<R: ByteReader>(
source: &mut R,
) -> Result<Self, DeserializationError>
fn read_from<R: ByteReader>( source: &mut R, ) -> Result<Self, DeserializationError>
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 PartialEq for AccountStorageDelta
impl PartialEq for AccountStorageDelta
source§fn eq(&self, other: &AccountStorageDelta) -> bool
fn eq(&self, other: &AccountStorageDelta) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl Serializable for AccountStorageDelta
impl Serializable for AccountStorageDelta
source§fn write_into<W: ByteWriter>(&self, target: &mut W)
fn write_into<W: ByteWriter>(&self, target: &mut W)
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
impl Eq for AccountStorageDelta
impl StructuralPartialEq for AccountStorageDelta
Auto Trait Implementations§
impl Freeze for AccountStorageDelta
impl RefUnwindSafe for AccountStorageDelta
impl Send for AccountStorageDelta
impl Sync for AccountStorageDelta
impl Unpin for AccountStorageDelta
impl UnwindSafe for AccountStorageDelta
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)