Struct aptos_vm::data_cache::StateViewCache
source · [−]pub struct StateViewCache<'a, S> { /* private fields */ }
Expand description
A local cache for a given a StateView
. The cache is private to the Aptos layer
but can be used as a one shot cache for systems that need a simple RemoteCache
implementation (e.g. tests or benchmarks).
The cache is responsible to track all changes to the StateView
that are the result
of transaction execution. Those side effects are published at the end of a transaction
execution via StateViewCache::push_write_set
.
StateViewCache
is responsible to give an up to date view over the data store,
so that changes executed but not yet committed are visible to subsequent transactions.
If a system wishes to execute a block of transaction on a given view, a cache that keeps track of incremental changes is vital to the consistency of the data store and the system.
Implementations
Trait Implementations
sourceimpl<'block, S: StateView> StateView for StateViewCache<'block, S>
impl<'block, S: StateView> StateView for StateViewCache<'block, S>
sourcefn get_state_value(&self, state_key: &StateKey) -> Result<Option<Vec<u8>>>
fn get_state_value(&self, state_key: &StateKey) -> Result<Option<Vec<u8>>>
Gets the state value for a given state key.
sourcefn is_genesis(&self) -> bool
fn is_genesis(&self) -> bool
VM needs this method to know whether the current state view is for genesis state creation. Currently TransactionPayload::WriteSet is only valid for genesis state creation. Read more
sourcefn id(&self) -> StateViewId
fn id(&self) -> StateViewId
For logging and debugging purpose, identifies what this view is for.
Auto Trait Implementations
impl<'a, S> RefUnwindSafe for StateViewCache<'a, S> where
S: RefUnwindSafe,
impl<'a, S> Send for StateViewCache<'a, S> where
S: Sync,
impl<'a, S> Sync for StateViewCache<'a, S> where
S: Sync,
impl<'a, S> Unpin for StateViewCache<'a, S>
impl<'a, S> UnwindSafe for StateViewCache<'a, S> where
S: RefUnwindSafe,
Blanket Implementations
sourceimpl<'a, S> AsAccountWithStateView<'a> for S where
S: 'a + StateView,
impl<'a, S> AsAccountWithStateView<'a> for S where
S: 'a + StateView,
fn as_account_with_state_view(
&'a self,
account_address: &'a AccountAddress
) -> AccountWithStateView<'a>
sourceimpl<S> AsMoveResolver<S> for S where
S: StateView,
impl<S> AsMoveResolver<S> for S where
S: StateView,
fn as_move_resolver(&self) -> RemoteStorage<'_, S>
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<S> IntoMoveResolver<S> for S where
S: StateView,
impl<S> IntoMoveResolver<S> for S where
S: StateView,
fn into_move_resolver(self) -> RemoteStorageOwned<S>
impl<T> Pointable for T
impl<T> Pointable for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn 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>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more