Struct fuel_vm::storage::ContractsRawCode
source · pub struct ContractsRawCode;
Expand description
The storage table for contract’s raw byte code.
Trait Implementations§
source§impl Mappable for ContractsRawCode
impl Mappable for ContractsRawCode
§type Key = <ContractsRawCode as Mappable>::OwnedKey
type Key = <ContractsRawCode as Mappable>::OwnedKey
The key type is used during interaction with the storage. In most cases, it is the same
as
Self::OwnedKey
.§type OwnedKey = ContractId
type OwnedKey = ContractId
The owned type of the
Key
retrieving from the storage.§type Value = [u8]
type Value = [u8]
The value type is used while setting the value to the storage. In most cases, it is the same
as
Self::OwnedValue
, but it is without restriction and can be used for performance
optimizations.§type OwnedValue = Contract
type OwnedValue = Contract
The owned type of the
Value
retrieving from the storage.source§impl StorageInspect<ContractsRawCode> for MemoryStorage
impl StorageInspect<ContractsRawCode> for MemoryStorage
type Error = Infallible
source§fn get(&self, key: &ContractId) -> Result<Option<Cow<'_, Contract>>, Infallible>
fn get(&self, key: &ContractId) -> Result<Option<Cow<'_, Contract>>, Infallible>
Retrieve
Cow<Value>
such as Key->Value
.source§fn contains_key(&self, key: &ContractId) -> Result<bool, Infallible>
fn contains_key(&self, key: &ContractId) -> Result<bool, Infallible>
Return
true
if there is a Key
mapping to a value in the storage.source§impl StorageMutate<ContractsRawCode> for MemoryStorage
impl StorageMutate<ContractsRawCode> for MemoryStorage
source§fn insert(
&mut self,
key: &ContractId,
value: &[u8]
) -> Result<Option<Contract>, Infallible>
fn insert( &mut self, key: &ContractId, value: &[u8] ) -> Result<Option<Contract>, Infallible>
Append
Key->Value
mapping to the storage. Read moresource§fn remove(&mut self, key: &ContractId) -> Result<Option<Contract>, Infallible>
fn remove(&mut self, key: &ContractId) -> Result<Option<Contract>, Infallible>
Remove
Key->Value
mapping from the storage. Read moresource§impl StorageRead<ContractsRawCode> for MemoryStorage
impl StorageRead<ContractsRawCode> for MemoryStorage
source§fn read(
&self,
key: &ContractId,
buf: &mut [u8]
) -> Result<Option<usize>, Self::Error>
fn read( &self, key: &ContractId, buf: &mut [u8] ) -> Result<Option<usize>, Self::Error>
Read the value stored at the given key into the provided buffer if the value exists. Read more
source§fn read_alloc(&self, key: &ContractId) -> Result<Option<Vec<u8>>, Self::Error>
fn read_alloc(&self, key: &ContractId) -> Result<Option<Vec<u8>>, Self::Error>
Same as
read
but allocates a new buffer and returns it. Read moresource§impl StorageRead<ContractsRawCode> for PredicateStorage
impl StorageRead<ContractsRawCode> for PredicateStorage
source§impl StorageSize<ContractsRawCode> for MemoryStorage
impl StorageSize<ContractsRawCode> for MemoryStorage
source§fn size_of_value(&self, key: &ContractId) -> Result<Option<usize>, Infallible>
fn size_of_value(&self, key: &ContractId) -> Result<Option<usize>, Infallible>
Return the number of bytes stored at this key.
source§impl StorageSize<ContractsRawCode> for PredicateStorage
impl StorageSize<ContractsRawCode> for PredicateStorage
source§fn size_of_value(
&self,
_key: &ContractId
) -> Result<Option<usize>, InterpreterError>
fn size_of_value( &self, _key: &ContractId ) -> Result<Option<usize>, InterpreterError>
Return the number of bytes stored at this key.
source§impl StorageWrite<ContractsRawCode> for MemoryStorage
impl StorageWrite<ContractsRawCode> for MemoryStorage
source§fn write(&mut self, key: &ContractId, buf: Vec<u8>) -> Result<usize, Infallible>
fn write(&mut self, key: &ContractId, buf: Vec<u8>) -> Result<usize, Infallible>
Write the value to the given key from the provided buffer. Read more