[][src]Trait libra_state_view::StateView

pub trait StateView {
    fn get(&self, access_path: &AccessPath) -> Result<Option<Vec<u8>>>;
fn multi_get(
        access_paths: &[AccessPath]
    ) -> Result<Vec<Option<Vec<u8>>>>;
fn is_genesis(&self) -> bool; fn id(&self) -> StateViewId { ... } }

StateView is a trait that defines a read-only snapshot of the global state. It is passed to the VM for transaction execution, during which the VM is guaranteed to read anything at the given state.

Required methods

fn get(&self, access_path: &AccessPath) -> Result<Option<Vec<u8>>>

Gets the state for a single access path.

fn multi_get(&self, access_paths: &[AccessPath]) -> Result<Vec<Option<Vec<u8>>>>

Gets states for a list of access paths.

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.

Loading content...

Provided methods

fn id(&self) -> StateViewId

For logging and debugging purpose, identifies what this view is for.

Loading content...


Loading content...