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§

Required Methods§

source

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

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

source

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<'a, T, Type> StorageInspect<Type> for &'a mut Twhere T: StorageInspect<Type> + ?Sized, Type: Mappable,

§

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

source§

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

source§

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

source§

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

§

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

source§

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

source§

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

Implementors§

source§

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