Fetch

Trait Fetch 

Source
pub trait Fetch<K, V>: StorageBackend {
    // Required method
    fn fetch(&self, key: &K) -> Result<Option<V>, Self::Error>;
}
Expand description

Fetch<K, V> trait extends the StorageBackend with fetch operation for the (key: K, value: V pair); therefore, it should be explicitly implemented for the corresponding StorageBackend.

Required Methods§

Source

fn fetch(&self, key: &K) -> Result<Option<V>, Self::Error>

Fetches the value associated with the key from the storage.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§