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

Create a new memory storage.

Fetch a mapping from the contract state.

Set the transacted state to the memory state.

Revert the memory state to the transacted state.

Revert the memory and transacted changes to the persisted state.

Persist the changes from transacted to memory+persisted state.

Trait Implementations

Performs the conversion.

Performs the conversion.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Performs the conversion.

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.

Fetch a previously inserted contract code from the chain state for a given contract. Read more

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.

Fetch the value form a key-value mapping in a contract storage.

Insert a key-value mapping in a contract storage.

Fetch the balance of a color in a contract storage.

Update the balance of a color in a contract storage.

Error implementation of the merkle storage functions

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

Error implementation of the merkle storage functions

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

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.

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.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.