Struct Stateful

Source
pub struct Stateful<'a, D: 'a> { /* private fields */ }

Implementations§

Source§

impl<'a, D> Stateful<'a, D>

Source

pub fn new(database: &'a D, root: H256) -> Self

Source

pub fn empty(database: &'a D) -> Self

Source§

impl<'b, D: DatabaseOwned> Stateful<'b, D>

Source

pub fn database(&self) -> &'b D

Source

pub fn code(&self, hash: H256) -> Option<Vec<u8>>

Source

pub fn step<V: VM>( &self, vm: &mut V, block_number: U256, most_recent_block_hashes: &[H256], )

Source

pub fn call<M: Memory + Default, P: Patch>( &self, transaction: ValidTransaction, block: HeaderParams, most_recent_block_hashes: &[H256], ) -> TransactionVM<M, P>

Source

pub fn sets(&mut self, accounts: &[(Address, LiteralAccount)])

Source

pub fn transit(&mut self, accounts: &[AccountChange])

Source

pub fn execute<M: Memory + Default, P: Patch>( &mut self, transaction: ValidTransaction, block: HeaderParams, most_recent_block_hashes: &[H256], ) -> TransactionVM<M, P>

Source

pub fn to_valid<P: Patch>( &self, transaction: Transaction, ) -> Result<ValidTransaction, PreExecutionError>

Source

pub fn root(&self) -> H256

Source

pub fn state_of<'a>( &'a self, root: H256, ) -> FixedSecureTrie<<D as Database<'a>>::Guard, Address, Account>

Source

pub fn state<'a>( &'a self, ) -> FixedSecureTrie<<D as Database<'a>>::Guard, Address, Account>

Source

pub fn storage_state_of<'a>( &'a self, root: H256, ) -> FixedSecureTrie<<D as Database<'a>>::Guard, H256, M256>

Source

pub fn storage_state<'a>( &'a self, address: Address, ) -> Option<FixedSecureTrie<<D as Database<'a>>::Guard, H256, M256>>

Trait Implementations§

Source§

impl<'a, D: 'a> Clone for Stateful<'a, D>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a, D: Debug + 'a> Debug for Stateful<'a, D>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, D> Freeze for Stateful<'a, D>

§

impl<'a, D> RefUnwindSafe for Stateful<'a, D>
where D: RefUnwindSafe,

§

impl<'a, D> Send for Stateful<'a, D>
where D: Sync,

§

impl<'a, D> Sync for Stateful<'a, D>
where D: Sync,

§

impl<'a, D> Unpin for Stateful<'a, D>

§

impl<'a, D> UnwindSafe for Stateful<'a, D>
where D: RefUnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.