Struct fuel_vm::storage::ContractsState
source · pub struct ContractsState;
Expand description
The storage table for contract’s hashed key-value state.
Lifetime is for optimization to avoid clone
.
Trait Implementations§
source§impl Mappable for ContractsState
impl Mappable for ContractsState
§type OwnedKey = ContractsStateKey
type OwnedKey = ContractsStateKey
The table key is combination of the ContractId
and Bytes32
hash of the value’s
key.
§type Key = <ContractsState as Mappable>::OwnedKey
type Key = <ContractsState as Mappable>::OwnedKey
The key type is used during interaction with the storage. In most cases, it is the
same as
Self::OwnedKey
.§type OwnedValue = <ContractsState as Mappable>::Value
type OwnedValue = <ContractsState as Mappable>::Value
The owned type of the
Value
retrieving from the storage.source§impl MerkleRootStorage<ContractId, ContractsState> for MemoryStorage
impl MerkleRootStorage<ContractId, ContractsState> for MemoryStorage
source§fn root(&self, parent: &ContractId) -> Result<MerkleRoot, Infallible>
fn root(&self, parent: &ContractId) -> Result<MerkleRoot, Infallible>
Return the merkle root of the stored
Type
in the storage. Read moresource§impl StorageInspect<ContractsState> for MemoryStorage
impl StorageInspect<ContractsState> for MemoryStorage
type Error = Infallible
source§fn get(
&self,
key: &<ContractsState as Mappable>::Key
) -> Result<Option<Cow<'_, Bytes32>>, Infallible>
fn get( &self, key: &<ContractsState as Mappable>::Key ) -> Result<Option<Cow<'_, Bytes32>>, Infallible>
Retrieve
Cow<Value>
such as Key->Value
.source§fn contains_key(
&self,
key: &<ContractsState as Mappable>::Key
) -> Result<bool, Infallible>
fn contains_key( &self, key: &<ContractsState as Mappable>::Key ) -> Result<bool, Infallible>
Return
true
if there is a Key
mapping to a value in the storage.source§impl StorageMutate<ContractsState> for MemoryStorage
impl StorageMutate<ContractsState> for MemoryStorage
Auto Trait Implementations§
impl RefUnwindSafe for ContractsState
impl Send for ContractsState
impl Sync for ContractsState
impl Unpin for ContractsState
impl UnwindSafe for ContractsState
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more