Struct fuel_vm::storage::ContractsState
source · [−]pub struct ContractsState<'a>(_);
Expand description
The storage table for contract’s hashed key-value state.
Lifetime is for optimization to avoid clone
.
Trait Implementations
sourceimpl<'a> Mappable for ContractsState<'a>
impl<'a> Mappable for ContractsState<'a>
type Key = (&'a ContractId, &'a Bytes32)
type Key = (&'a ContractId, &'a Bytes32)
The table key is combination of the ContractId
and Bytes32
hash of the value’s key.
type GetValue = <ContractsState<'a> as Mappable>::SetValue
type GetValue = <ContractsState<'a> as Mappable>::SetValue
The value type is used while getting the value from the storage.
sourceimpl MerkleRootStorage<ContractId, ContractsState<'_>> for MemoryStorage
impl MerkleRootStorage<ContractId, ContractsState<'_>> for MemoryStorage
sourcefn root(&mut self, parent: &ContractId) -> Result<MerkleRoot, Infallible>
fn root(&mut self, parent: &ContractId) -> Result<MerkleRoot, Infallible>
Return the merkle root of the stored
Type
in the storage. Read moresourceimpl StorageInspect<ContractsState<'_>> for MemoryStorage
impl StorageInspect<ContractsState<'_>> for MemoryStorage
type Error = Infallible
sourcefn get(
&self,
key: &(&ContractId, &Bytes32)
) -> Result<Option<Cow<'_, Bytes32>>, Infallible>
fn get(
&self,
key: &(&ContractId, &Bytes32)
) -> Result<Option<Cow<'_, Bytes32>>, Infallible>
Retrieve
Cow<Value>
such as Key->Value
.sourcefn contains_key(&self, key: &(&ContractId, &Bytes32)) -> Result<bool, Infallible>
fn contains_key(&self, key: &(&ContractId, &Bytes32)) -> Result<bool, Infallible>
Return
true
if there is a Key
mapping to a value in the storage.sourceimpl StorageMutate<ContractsState<'_>> for MemoryStorage
impl StorageMutate<ContractsState<'_>> for MemoryStorage
sourcefn insert(
&mut self,
key: &(&ContractId, &Bytes32),
value: &Bytes32
) -> Result<Option<Bytes32>, Infallible>
fn insert(
&mut self,
key: &(&ContractId, &Bytes32),
value: &Bytes32
) -> Result<Option<Bytes32>, Infallible>
Append
Key->Value
mapping to the storage. Read moresourcefn remove(
&mut self,
key: &(&ContractId, &Bytes32)
) -> Result<Option<Bytes32>, Infallible>
fn remove(
&mut self,
key: &(&ContractId, &Bytes32)
) -> Result<Option<Bytes32>, Infallible>
Remove
Key->Value
mapping from the storage. Read moreAuto Trait Implementations
impl<'a> RefUnwindSafe for ContractsState<'a>
impl<'a> Send for ContractsState<'a>
impl<'a> Sync for ContractsState<'a>
impl<'a> Unpin for ContractsState<'a>
impl<'a> UnwindSafe for ContractsState<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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