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
sourceimpl<'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 moretype 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.
sourceimpl MerkleRootStorage<ContractId, ContractsAssets<'_>> for MemoryStorage
impl MerkleRootStorage<ContractId, ContractsAssets<'_>> 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<ContractsAssets<'_>> for MemoryStorage
impl StorageInspect<ContractsAssets<'_>> for MemoryStorage
type Error = Infallible
sourcefn 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
.sourcefn 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.sourceimpl StorageMutate<ContractsAssets<'_>> for MemoryStorage
impl StorageMutate<ContractsAssets<'_>> for MemoryStorage
sourcefn 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 moresourcefn 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 moreAuto Trait Implementations
impl<'a> RefUnwindSafe for ContractsAssets<'a>
impl<'a> Send for ContractsAssets<'a>
impl<'a> Sync for ContractsAssets<'a>
impl<'a> Unpin for ContractsAssets<'a>
impl<'a> UnwindSafe for ContractsAssets<'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