Struct AccountInfo
pub struct AccountInfo {
pub balance: Uint<256, 4>,
pub nonce: u64,
pub code_hash: FixedBytes<32>,
pub code: Option<Bytecode>,
pub extension: AccountExtension,
/* private fields */
}Expand description
Account information loaded from the backing database or emitted in a state transition.
Equality compares the persisted account fields, including the optional extension.
Self::code is a cache keyed by the code hash and may or may not be populated.
Fields§
§balance: Uint<256, 4>Account balance.
nonce: u64Account nonce.
code_hash: FixedBytes<32>Hash of the raw bytes in code, or the empty code hash.
code: Option<Bytecode>Bytecode associated with this account.
extension: AccountExtensionaccount-ext only.Raw chain-specific data committed to the account leaf by the state provider.
Empty extensions are omitted by Serde. Binary formats must delimit structs (e.g. MessagePack); bincode and Postcard account encodings are unsupported.
Implementations§
§impl AccountInfo
impl AccountInfo
pub const fn empty() -> AccountInfo
pub const fn empty() -> AccountInfo
Creates an empty account with zero balance and nonce, the empty code hash, and no cached bytecode.
pub const fn new(
balance: Uint<256, 4>,
nonce: u64,
code_hash: FixedBytes<32>,
code: Option<Bytecode>,
) -> AccountInfo
pub const fn new( balance: Uint<256, 4>, nonce: u64, code_hash: FixedBytes<32>, code: Option<Bytecode>, ) -> AccountInfo
Creates a new AccountInfo with the given fields and optional cached bytecode.
None means the bytecode is not cached; code_hash still identifies the account’s code.
The caller is responsible for code_hash matching the bytecode when it is provided.
pub fn with_code(self, code: Bytecode) -> AccountInfo
pub fn with_code(self, code: Bytecode) -> AccountInfo
Creates a new AccountInfo with the given code.
pub const fn with_balance(self, balance: Uint<256, 4>) -> AccountInfo
pub const fn with_balance(self, balance: Uint<256, 4>) -> AccountInfo
Creates a new AccountInfo with the given balance.
pub const fn with_nonce(self, nonce: u64) -> AccountInfo
pub const fn with_nonce(self, nonce: u64) -> AccountInfo
Creates a new AccountInfo with the given nonce.
pub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns whether this account is empty by the Spurious Dragon definition.
pub fn is_empty_code_hash(&self) -> bool
pub fn is_empty_code_hash(&self) -> bool
Returns whether the code hash is the empty code hash.
Trait Implementations§
§impl Clone for AccountInfo
impl Clone for AccountInfo
§fn clone(&self) -> AccountInfo
fn clone(&self) -> AccountInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for AccountInfo
impl Debug for AccountInfo
§impl Default for AccountInfo
impl Default for AccountInfo
§fn default() -> AccountInfo
fn default() -> AccountInfo
§impl<'de> Deserialize<'de> for AccountInfo
impl<'de> Deserialize<'de> for AccountInfo
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<AccountInfo, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<AccountInfo, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for AccountInfo
§impl From<Account> for AccountInfo
impl From<Account> for AccountInfo
§fn from(reth_acc: Account) -> AccountInfo
fn from(reth_acc: Account) -> AccountInfo
§impl Hash for AccountInfo
Hashes the Ethereum account fields. Extension-only differences may collide,
but equal accounts always hash equally.
impl Hash for AccountInfo
Hashes the Ethereum account fields. Extension-only differences may collide, but equal accounts always hash equally.
§impl PartialEq for AccountInfo
Compares AccountInfo by balance, nonce, and code_hash, skipping the
code field: code_hash already uniquely identifies the bytecode, so
comparing the bytecode itself is redundant.
impl PartialEq for AccountInfo
Compares AccountInfo by balance, nonce, and code_hash, skipping the
code field: code_hash already uniquely identifies the bytecode, so
comparing the bytecode itself is redundant.
§impl Serialize for AccountInfo
impl Serialize for AccountInfo
§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,
Auto Trait Implementations§
impl Forget for AccountInfo
impl Freeze for AccountInfo
impl Move for AccountInfo
impl RefUnwindSafe for AccountInfo
impl Send for AccountInfo
impl Sync for AccountInfo
impl Unpin for AccountInfo
impl UnsafeUnpin for AccountInfo
impl UnwindSafe for AccountInfo
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<'de, T> BorrowedRpcObject<'de> for Twhere
T: RpcBorrow<'de> + RpcSend,
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<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> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> 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<'de, T> RpcBorrow<'de> for T
impl<T> RpcObject for Twhere
T: RpcSend + RpcRecv,
impl<T> RpcRecv for T
impl<T> RpcSend for T
§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: 96 bytes