Struct fuel_vm::memory_client::MemoryStorage
source ·
[−]pub struct MemoryStorage { /* private fields */ }
Expand description
In-memory storage implementation for the interpreter.
It tracks 3 states:
- memory: the transactions will be applied to this state.
- transacted: will receive the committed
memory
state. - persisted: will receive the persisted
transacted
state.
Implementations
Fetch a mapping from the contract state.
Trait Implementations
Performs the conversion.
Performs the conversion.
Performs the conversion.
type DataError = Infallible
type DataError = Infallible
Error implementation for reasons unspecified in the protocol.
Provide the current block height in which the transactions should be executed. Read more
Provide the block hash from a given height.
Provide the coinbase address for the VM instructions implementation.
fn storage_contract(
&self,
id: &ContractId
) -> Result<Option<Cow<'_, Contract>>, Self::DataError>
fn storage_contract(
&self,
id: &ContractId
) -> Result<Option<Cow<'_, Contract>>, Self::DataError>
Fetch a previously inserted contract code from the chain state for a given contract. Read more
fn storage_contract_insert(
&mut self,
id: &ContractId,
contract: &Contract
) -> Result<Option<Contract>, Self::DataError>
fn storage_contract_insert(
&mut self,
id: &ContractId,
contract: &Contract
) -> Result<Option<Contract>, Self::DataError>
Append a contract to the chain, provided its identifier. Read more
Check if a provided contract exists in the chain.
Fetch a previously inserted salt+root tuple from the chain state for a given contract. Read more
Append the salt+root of a contract that was appended to the chain.
fn merkle_contract_state(
&self,
id: &ContractId,
key: &Bytes32
) -> Result<Option<Cow<'_, Bytes32>>, Self::DataError>
fn merkle_contract_state(
&self,
id: &ContractId,
key: &Bytes32
) -> Result<Option<Cow<'_, Bytes32>>, Self::DataError>
Fetch the value form a key-value mapping in a contract storage.
fn merkle_contract_state_insert(
&mut self,
contract: &ContractId,
key: &Bytes32,
value: &Bytes32
) -> Result<Option<Bytes32>, Self::DataError>
fn merkle_contract_state_insert(
&mut self,
contract: &ContractId,
key: &Bytes32,
value: &Bytes32
) -> Result<Option<Bytes32>, Self::DataError>
Insert a key-value mapping in a contract storage.
fn merkle_contract_color_balance(
&self,
id: &ContractId,
color: &Color
) -> Result<Option<Word>, Self::DataError>
fn merkle_contract_color_balance(
&self,
id: &ContractId,
color: &Color
) -> Result<Option<Word>, Self::DataError>
Fetch the balance of a color in a contract storage.
fn merkle_contract_color_balance_insert(
&mut self,
contract: &ContractId,
color: &Color,
value: Word
) -> Result<Option<Word>, Self::DataError>
fn merkle_contract_color_balance_insert(
&mut self,
contract: &ContractId,
color: &Color,
value: Word
) -> Result<Option<Word>, Self::DataError>
Update the balance of a color in a contract storage.
type Error = Infallible
type Error = Infallible
Error implementation of the merkle storage functions
fn insert(
&mut self,
parent: &ContractId,
key: &Bytes32,
value: &Bytes32
) -> Result<Option<Bytes32>, Infallible>
fn insert(
&mut self,
parent: &ContractId,
key: &Bytes32,
value: &Bytes32
) -> Result<Option<Bytes32>, Infallible>
Append P->K->V
mapping to the storage. Read more
fn get(
&self,
parent: &ContractId,
key: &Bytes32
) -> Result<Option<Cow<'_, Bytes32>>, Infallible>
fn get(
&self,
parent: &ContractId,
key: &Bytes32
) -> Result<Option<Cow<'_, Bytes32>>, Infallible>
Retrieve Cow<V>
such as P->K->V
.
fn remove(
&mut self,
parent: &ContractId,
key: &Bytes32
) -> Result<Option<Bytes32>, Infallible>
fn remove(
&mut self,
parent: &ContractId,
key: &Bytes32
) -> Result<Option<Bytes32>, Infallible>
Remove P->K->V
mapping from the storage. Read more
Return true
if there is a P->K
mapping to a value in the storage.
Return the merkle root of the domain of P
. Read more
type Error = Infallible
type Error = Infallible
Error implementation of the merkle storage functions
fn insert(
&mut self,
parent: &ContractId,
key: &Color,
value: &Word
) -> Result<Option<Word>, Infallible>
fn insert(
&mut self,
parent: &ContractId,
key: &Color,
value: &Word
) -> Result<Option<Word>, Infallible>
Append P->K->V
mapping to the storage. Read more
Retrieve Cow<V>
such as P->K->V
.
Remove P->K->V
mapping from the storage. Read more
Return true
if there is a P->K
mapping to a value in the storage.
Return the merkle root of the domain of P
. Read more
type Error = Infallible
type Error = Infallible
Error implementation of the storage functions
Append K->V
mapping to the storage. Read more
Remove K->V
mapping from the storage. Read more
Retrieve Cow<V>
such as K->V
.
Return true
if there is a K
mapping to a value in the storage.
type Error = Infallible
type Error = Infallible
Error implementation of the storage functions
fn insert(
&mut self,
key: &ContractId,
value: &Contract
) -> Result<Option<Contract>, Infallible>
fn insert(
&mut self,
key: &ContractId,
value: &Contract
) -> Result<Option<Contract>, Infallible>
Append K->V
mapping to the storage. Read more
Remove K->V
mapping from the storage. Read more
Retrieve Cow<V>
such as K->V
.
Return true
if there is a K
mapping to a value in the storage.
Auto Trait Implementations
impl RefUnwindSafe for MemoryStorage
impl Send for MemoryStorage
impl Sync for MemoryStorage
impl Unpin for MemoryStorage
impl UnwindSafe for MemoryStorage
Blanket Implementations
Mutably borrows from an owned value. Read more