pub trait StorageInspect<Type>where
    Type: Mappable,{
    type Error;

    // Required methods
    fn get(
        &self,
        key: &<Type as Mappable>::Key
    ) -> Result<Option<Cow<'_, <Type as Mappable>::OwnedValue>>, Self::Error>;
    fn contains_key(
        &self,
        key: &<Type as Mappable>::Key
    ) -> Result<bool, Self::Error>;
}
Expand description

Base read storage trait for Fuel infrastructure.

Generic should implement Mappable trait with all storage type information.

Required Associated Types§

type Error

Required Methods§

fn get( &self, key: &<Type as Mappable>::Key ) -> Result<Option<Cow<'_, <Type as Mappable>::OwnedValue>>, Self::Error>

Retrieve Cow<Value> such as Key->Value.

fn contains_key( &self, key: &<Type as Mappable>::Key ) -> Result<bool, Self::Error>

Return true if there is a Key mapping to a value in the storage.

Implementations on Foreign Types§

source§

impl<Type> StorageInspect<Type> for PredicateStoragewhere Type: Mappable,

§

type Error = InterpreterError

source§

fn get( &self, _key: &<Type as Mappable>::Key ) -> Result<Option<Cow<'_, <Type as Mappable>::OwnedValue>>, InterpreterError>

source§

fn contains_key( &self, _key: &<Type as Mappable>::Key ) -> Result<bool, InterpreterError>

source§

impl StorageInspect<ContractsInfo> for MemoryStorage

§

type Error = Infallible

source§

fn get( &self, key: &ContractId ) -> Result<Option<Cow<'_, (Salt, Bytes32)>>, Infallible>

source§

fn contains_key(&self, key: &ContractId) -> Result<bool, Infallible>

source§

impl StorageInspect<ContractsAssets> for MemoryStorage

source§

impl StorageInspect<ContractsRawCode> for MemoryStorage

§

type Error = Infallible

source§

fn get(&self, key: &ContractId) -> Result<Option<Cow<'_, Contract>>, Infallible>

source§

fn contains_key(&self, key: &ContractId) -> Result<bool, Infallible>

source§

impl StorageInspect<ContractsState> for MemoryStorage

§

impl<Type> StorageInspect<Type> for StorageMap<Type>where Type: Mappable, <Type as Mappable>::Key: Eq + Hash, <Type as Mappable>::OwnedKey: Eq + Hash + Borrow<<Type as Mappable>::Key>,

§

type Error = Infallible

§

fn get( &self, key: &<Type as Mappable>::Key ) -> Result<Option<Cow<'_, <Type as Mappable>::OwnedValue>>, <StorageMap<Type> as StorageInspect<Type>>::Error>

§

fn contains_key( &self, key: &<Type as Mappable>::Key ) -> Result<bool, <StorageMap<Type> as StorageInspect<Type>>::Error>

§

impl<'a, T, Type> StorageInspect<Type> for &'a Twhere T: StorageInspect<Type> + ?Sized, Type: Mappable,

§

type Error = <T as StorageInspect<Type>>::Error

§

fn get( &self, key: &<Type as Mappable>::Key ) -> Result<Option<Cow<'_, <Type as Mappable>::OwnedValue>>, <&'a T as StorageInspect<Type>>::Error>

§

fn contains_key( &self, key: &<Type as Mappable>::Key ) -> Result<bool, <&'a T as StorageInspect<Type>>::Error>

§

impl<'a, T, Type> StorageInspect<Type> for &'a mut Twhere T: StorageInspect<Type> + ?Sized, Type: Mappable,

§

type Error = <T as StorageInspect<Type>>::Error

§

fn get( &self, key: &<Type as Mappable>::Key ) -> Result<Option<Cow<'_, <Type as Mappable>::OwnedValue>>, <&'a mut T as StorageInspect<Type>>::Error>

§

fn contains_key( &self, key: &<Type as Mappable>::Key ) -> Result<bool, <&'a mut T as StorageInspect<Type>>::Error>

Implementors§