Struct fuel_core_storage::tables::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§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
source§fn insert(
&mut self,
key: &<ContractsState as Mappable>::Key,
value: &Bytes32
) -> Result<Option<Bytes32>, Infallible>
fn insert( &mut self, key: &<ContractsState as Mappable>::Key, value: &Bytes32 ) -> Result<Option<Bytes32>, Infallible>
Append
Key->Value
mapping to the storage. Read moresource§fn remove(
&mut self,
key: &<ContractsState as Mappable>::Key
) -> Result<Option<Bytes32>, Infallible>
fn remove( &mut self, key: &<ContractsState as Mappable>::Key ) -> Result<Option<Bytes32>, Infallible>
Remove
Key->Value
mapping from the storage. Read moreAuto 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