Gettable

Trait Gettable 

Source
pub trait Gettable {
    type Key: Send + Sync;
    type Value: Send + Sync;
    type Error;

    // Required method
    fn get<'a>(
        &'a self,
        key: &'a Self::Key,
    ) -> impl Future<Output = Result<Option<Self::Value>, Self::Error>> + Send + use<'a, Self>;
}
Expand description

A readable key-value store.

Required Associated Types§

Required Methods§

Source

fn get<'a>( &'a self, key: &'a Self::Key, ) -> impl Future<Output = Result<Option<Self::Value>, Self::Error>> + Send + use<'a, Self>

Get the value of a key.

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§

Source§

impl<'a, K, V, D> Gettable for Batch<'a, K, V, D>
where K: Array, V: CodecShared + Clone, D: Gettable<Key = K, Value = V, Error = Error> + Sync,

Source§

impl<E, K, V, T, S> Gettable for commonware_storage::qmdb::store::db::Db<E, K, V, T, S>
where E: Storage + Clock + Metrics, K: Array, V: VariableValue, T: Translator, S: State,

Source§

impl<E: RStorage + Clock + Metrics, K: Array, V: FixedValue, H: Hasher, T: Translator, const N: usize, M: MerkleizationState<DigestOf<H>>, D: DurabilityState> Gettable for commonware_storage::qmdb::current::ordered::fixed::Db<E, K, V, H, T, N, M, D>

Source§

impl<E: RStorage + Clock + Metrics, K: Array, V: FixedValue, H: Hasher, T: Translator, const N: usize, M: MerkleizationState<DigestOf<H>>, D: DurabilityState> Gettable for commonware_storage::qmdb::current::unordered::fixed::Db<E, K, V, H, T, N, M, D>

Source§

impl<E: RStorage + Clock + Metrics, K: Array, V: VariableValue, H: CHasher, T: Translator, M: MerkleizationState<DigestOf<H>> + Send + Sync, D: DurabilityState> Gettable for Immutable<E, K, V, H, T, M, D>

Source§

impl<E: Storage + Metrics + Clock, K: Array, V: CodecShared> Gettable for Freezer<E, K, V>

Source§

impl<E: Storage + Metrics + Clock, V: CodecFixedShared> Gettable for Ordinal<E, V>

Source§

impl<E: Storage + Metrics, V: CodecShared> Gettable for Cache<E, V>