Enum AccountStatus
pub enum AccountStatus {
LoadedNotExisting,
Loaded,
LoadedEmptyEIP161,
InMemoryChange,
Changed,
Destroyed,
DestroyedChanged,
DestroyedAgain,
}Expand description
AccountStatus represents the various states an account can be in after being loaded from the database.
After account get loaded from database it can be in a lot of different states while we execute multiple transaction and even blocks over account that is in memory. This structure models all possible states that account can be in.
§Variants
LoadedNotExisting: the account has been loaded but does not exist.Loaded: the account has been loaded and exists.LoadedEmptyEIP161: the account is loaded and empty, as per EIP-161.InMemoryChange: there are changes in the account that exist only in memory.Changed: the account has been modified.Destroyed: the account has been destroyed.DestroyedChanged: the account has been destroyed and then modified.DestroyedAgain: the account has been destroyed again.
Variants§
LoadedNotExisting
The account has been loaded but does not exist.
Loaded
The account has been loaded and exists.
LoadedEmptyEIP161
The account is loaded and empty, as per EIP-161.
InMemoryChange
There are changes in the account that exist only in memory.
Changed
The account has been modified.
Destroyed
The account has been destroyed.
DestroyedChanged
The account has been destroyed and then modified.
DestroyedAgain
The account has been destroyed again.
Implementations§
§impl AccountStatus
impl AccountStatus
pub const fn is_not_modified(&self) -> bool
pub const fn is_not_modified(&self) -> bool
Account is not modified and just loaded from database.
pub const fn was_destroyed(&self) -> bool
pub const fn was_destroyed(&self) -> bool
Account was destroyed by calling SELFDESTRUCT. This means that full account and storage are inside memory.
pub const fn is_storage_known(&self) -> bool
pub const fn is_storage_known(&self) -> bool
This means storage is known, it can be newly created or storage got destroyed.
pub const fn is_modified_and_not_destroyed(&self) -> bool
pub const fn is_modified_and_not_destroyed(&self) -> bool
Account is modified but not destroyed. This means that some storage values can be found in both memory and database.
pub const fn on_created(&self) -> AccountStatus
pub const fn on_created(&self) -> AccountStatus
Returns the next account status on creation.
pub const fn on_touched_empty_post_eip161(&self) -> AccountStatus
pub const fn on_touched_empty_post_eip161(&self) -> AccountStatus
Returns the next account status on touched empty account post state clear EIP (EIP-161).
pub const fn on_changed(&self, had_no_nonce_and_code: bool) -> AccountStatus
pub const fn on_changed(&self, had_no_nonce_and_code: bool) -> AccountStatus
Returns the next account status on change.
pub const fn on_selfdestructed(&self) -> AccountStatus
pub const fn on_selfdestructed(&self) -> AccountStatus
Returns the next account status on selfdestruct.
pub fn transition(&mut self, other: AccountStatus)
pub fn transition(&mut self, other: AccountStatus)
Transition to other state while preserving invariance of this state.
It this account was Destroyed and other account is not:
- We should mark extended account as destroyed too.
- And as other account had some changes, extended account should be marked as DestroyedChanged.
If both account are not destroyed and if this account is in memory:
- This means that extended account is in memory too.
Otherwise, if both are destroyed or other is destroyed:
- Sets other status to extended account.
Trait Implementations§
§impl Clone for AccountStatus
impl Clone for AccountStatus
§fn clone(&self) -> AccountStatus
fn clone(&self) -> AccountStatus
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for AccountStatus
§impl Debug for AccountStatus
impl Debug for AccountStatus
§impl Default for AccountStatus
impl Default for AccountStatus
§fn default() -> AccountStatus
fn default() -> AccountStatus
§impl<'de> Deserialize<'de> for AccountStatus
impl<'de> Deserialize<'de> for AccountStatus
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<AccountStatus, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<AccountStatus, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for AccountStatus
§impl Hash for AccountStatus
impl Hash for AccountStatus
§impl Ord for AccountStatus
impl Ord for AccountStatus
§fn cmp(&self, other: &AccountStatus) -> Ordering
fn cmp(&self, other: &AccountStatus) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
§impl PartialEq for AccountStatus
impl PartialEq for AccountStatus
§impl PartialOrd for AccountStatus
impl PartialOrd for AccountStatus
§impl Serialize for AccountStatus
impl Serialize for AccountStatus
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for AccountStatus
Auto Trait Implementations§
impl Freeze for AccountStatus
impl RefUnwindSafe for AccountStatus
impl Send for AccountStatus
impl Sync for AccountStatus
impl Unpin for AccountStatus
impl UnsafeUnpin for AccountStatus
impl UnwindSafe for AccountStatus
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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 moreimpl<T> MaybeDebug for Twhere
T: Debug,
impl<T> MaybeSerde for Twhere
T: Serialize + for<'de> Deserialize<'de>,
§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
Source§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 1 byte
Size for each variant:
LoadedNotExisting: 0 bytesLoaded: 0 bytesLoadedEmptyEIP161: 0 bytesInMemoryChange: 0 bytesChanged: 0 bytesDestroyed: 0 bytesDestroyedChanged: 0 bytesDestroyedAgain: 0 bytes