Struct fuel_vm::storage::ContractsAssets
source · pub struct ContractsAssets<'a>(_);
Expand description
The storage table for contract’s assets balances.
Lifetime is for optimization to avoid clone
.
Trait Implementations§
source§impl<'a> Mappable for ContractsAssets<'a>
impl<'a> Mappable for ContractsAssets<'a>
§type Key = (&'a ContractId, &'a AssetId)
type Key = (&'a ContractId, &'a AssetId)
The type of the value’s key.
§type SetValue = u64
type SetValue = u64
The value type is used while setting the value to the storage. In most cases, it is the same
as
Self::GetValue
, but it is without restriction and can be used for performance
optimizations. Read more§type GetValue = <ContractsAssets<'a> as Mappable>::SetValue
type GetValue = <ContractsAssets<'a> as Mappable>::SetValue
The value type is used while getting the value from the storage.
source§impl MerkleRootStorage<ContractId, ContractsAssets<'_>> for MemoryStorage
impl MerkleRootStorage<ContractId, ContractsAssets<'_>> for MemoryStorage
source§fn 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 moresource§impl StorageInspect<ContractsAssets<'_>> for MemoryStorage
impl StorageInspect<ContractsAssets<'_>> for MemoryStorage
type Error = Infallible
source§fn get(
&self,
key: &(&ContractId, &AssetId)
) -> Result<Option<Cow<'_, Word>>, Infallible>
fn get(
&self,
key: &(&ContractId, &AssetId)
) -> Result<Option<Cow<'_, Word>>, Infallible>
Retrieve
Cow<Value>
such as Key->Value
.source§fn contains_key(&self, key: &(&ContractId, &AssetId)) -> Result<bool, Infallible>
fn contains_key(&self, key: &(&ContractId, &AssetId)) -> Result<bool, Infallible>
Return
true
if there is a Key
mapping to a value in the storage.source§impl StorageMutate<ContractsAssets<'_>> for MemoryStorage
impl StorageMutate<ContractsAssets<'_>> for MemoryStorage
source§fn insert(
&mut self,
key: &(&ContractId, &AssetId),
value: &Word
) -> Result<Option<Word>, Infallible>
fn insert(
&mut self,
key: &(&ContractId, &AssetId),
value: &Word
) -> Result<Option<Word>, Infallible>
Append
Key->Value
mapping to the storage. Read moresource§fn remove(
&mut self,
key: &(&ContractId, &AssetId)
) -> Result<Option<Word>, Infallible>
fn remove(
&mut self,
key: &(&ContractId, &AssetId)
) -> Result<Option<Word>, Infallible>
Remove
Key->Value
mapping from the storage. Read more