Struct miden_objects::accounts::delta::AccountDelta
source · pub struct AccountDelta { /* private fields */ }Expand description
AccountDelta stores the differences between two account states.
The differences are represented as follows:
- storage: an AccountStorageDelta that contains the changes to the account storage.
- vault: an AccountVaultDelta object that contains the changes to the account vault.
- nonce: if the nonce of the account has changed, the new nonce is stored here.
TODO: add ability to trace account code updates.
Implementations§
source§impl AccountDelta
impl AccountDelta
sourcepub fn new(
storage: AccountStorageDelta,
vault: AccountVaultDelta,
nonce: Option<Felt>
) -> Result<Self, AccountDeltaError>
pub fn new( storage: AccountStorageDelta, vault: AccountVaultDelta, nonce: Option<Felt> ) -> Result<Self, AccountDeltaError>
Returns new AccountDelta instantiated from the provided components.
§Errors
Returns an error if:
- Storage or vault deltas are invalid.
- Storage and vault deltas are empty, and the nonce was updated.
- Storage or vault deltas are not empty, but nonce was not updated.
sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true if this account delta does not contain any updates.
sourcepub fn storage(&self) -> &AccountStorageDelta
pub fn storage(&self) -> &AccountStorageDelta
Returns storage updates for this account delta.
sourcepub fn vault(&self) -> &AccountVaultDelta
pub fn vault(&self) -> &AccountVaultDelta
Returns vault updates for this account delta.
sourcepub fn into_parts(
self
) -> (AccountStorageDelta, AccountVaultDelta, Option<Felt>)
pub fn into_parts( self ) -> (AccountStorageDelta, AccountVaultDelta, Option<Felt>)
Converts this storage delta into individual delta components.
Trait Implementations§
source§impl Clone for AccountDelta
impl Clone for AccountDelta
source§fn clone(&self) -> AccountDelta
fn clone(&self) -> AccountDelta
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 AccountDelta
impl Debug for AccountDelta
source§impl Default for AccountDelta
impl Default for AccountDelta
source§fn default() -> AccountDelta
fn default() -> AccountDelta
Returns the “default value” for a type. Read more
source§impl Deserializable for AccountDelta
impl Deserializable for AccountDelta
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 AccountDelta
impl PartialEq for AccountDelta
source§fn eq(&self, other: &AccountDelta) -> bool
fn eq(&self, other: &AccountDelta) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl Serializable for AccountDelta
impl Serializable for AccountDelta
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 AccountDelta
impl StructuralPartialEq for AccountDelta
Auto Trait Implementations§
impl Freeze for AccountDelta
impl RefUnwindSafe for AccountDelta
impl Send for AccountDelta
impl Sync for AccountDelta
impl Unpin for AccountDelta
impl UnwindSafe for AccountDelta
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