pub struct AccountDelta {
pub chain: Chain,
pub address: Address,
pub slots: ContractStoreDeltas,
pub balance: Option<Balance>,
/* private fields */
}Fields§
§chain: Chain§address: Address§slots: ContractStoreDeltas§balance: Option<Balance>Implementations§
Source§impl AccountDelta
impl AccountDelta
pub fn deleted(chain: &Chain, address: &Address) -> Self
pub fn new( chain: Chain, address: Address, slots: ContractStoreDeltas, balance: Option<Balance>, code: Option<Code>, change: ChangeType, ) -> Self
pub fn contract_id(&self) -> ContractId
pub fn into_account(self, tx: &Transaction) -> Account
Sourcepub fn into_account_without_tx(self) -> Account
pub fn into_account_without_tx(self) -> Account
Convert the delta into an account. Note that data not present in the delta, such as creation_tx etc, will be initialized to default values.
pub fn ref_into_account(&self, tx: &Transaction) -> Account
Sourcepub fn merge(&mut self, other: AccountDelta) -> Result<(), MergeError>
pub fn merge(&mut self, other: AccountDelta) -> Result<(), MergeError>
Merge this update (self) with another one (other)
This function is utilized for aggregating multiple updates into a single
update. The attribute values of other are set on self.
Meanwhile, contract storage maps are merged, with keys from other taking precedence.
Be noted that, this function will mutate the state of the calling struct. An error will occur if merging updates from different accounts.
There are no further validation checks within this method, hence it could be used as needed.
§Errors
It returns an CoreError::MergeError error if self.address and
other.address are not identical.
§Arguments
other: An instance ofAccountUpdate. The attribute values and keys ofotherwill overwrite those ofself.
pub fn is_update(&self) -> bool
pub fn is_creation(&self) -> bool
pub fn change_type(&self) -> ChangeType
pub fn code(&self) -> &Option<Code>
pub fn set_code(&mut self, code: Bytes)
Trait Implementations§
Source§impl Clone for AccountDelta
impl Clone for AccountDelta
Source§fn clone(&self) -> AccountDelta
fn clone(&self) -> AccountDelta
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 AccountDelta
impl Debug for AccountDelta
Source§impl DeepSizeOf for AccountDelta
impl DeepSizeOf for AccountDelta
Source§fn deep_size_of_children(&self, context: &mut Context) -> usize
fn deep_size_of_children(&self, context: &mut Context) -> usize
Returns an estimation of the heap-managed storage of this object.
This does not include the size of the object itself. Read more
Source§fn deep_size_of(&self) -> usize
fn deep_size_of(&self) -> usize
Returns an estimation of a total size of memory owned by the
object, including heap-managed storage. Read more
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<'de> Deserialize<'de> for AccountDelta
impl<'de> Deserialize<'de> for AccountDelta
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<Account> for AccountDelta
impl From<Account> for AccountDelta
Source§impl From<AccountDelta> for AccountUpdate
impl From<AccountDelta> for AccountUpdate
Source§fn from(value: AccountDelta) -> Self
fn from(value: AccountDelta) -> Self
Converts to this type from the input type.
Source§impl PartialEq for AccountDelta
impl PartialEq for AccountDelta
Source§impl Serialize for AccountDelta
impl Serialize 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 UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more