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. However, you should give preference to utilizing AccountChangesWithTx for merging, when possible.
§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
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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
Source§fn deep_size_of(&self) -> usize
fn deep_size_of(&self) -> usize
Source§impl Default for AccountDelta
impl Default for AccountDelta
Source§fn default() -> AccountDelta
fn default() -> AccountDelta
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>,
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
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 UnwindSafe for AccountDelta
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)