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