fuel_core_storage

Trait StorageInspect

source
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 StorageInspect<BlobData> for EmptyStorage

source§

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

source§

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>

source§

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

source§

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<D> StorageInspect<BlobData> for PredicateStorage<D>

source§

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>,

source§

type Error = Infallible

source§

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

source§

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

source§

impl<Type, D> StorageInspect<Type> for PredicateStorage<D>
where Type: Mappable + NoStorage,

source§

type Error = PredicateStorageError

source§

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

source§

fn contains_key( &self, _key: &<Type as Mappable>::Key, ) -> Result<bool, <PredicateStorage<D> as StorageInspect<Type>>::Error>

Implementors§

source§

impl<Column, S, M> StorageInspect<M> for StructuredStorage<S>
where S: KeyValueInspect<Column = Column>, M: TableWithBlueprint<Column = Column>, M::Blueprint: BlueprintInspect<M, StructuredStorage<S>>,

source§

impl<D, M: Mappable> StorageInspect<M> for VmStorage<D>
where D: StorageInspect<M, Error = Error>,