pub trait StoreExt<K, V>: Store<K, V> {
    // Provided methods
    fn get_many<'a, T>(
        &self,
        txn: &T,
        keys: impl Iterator<Item = &'a K>
    ) -> Result<Vec<Option<V>>, Self::Error>
       where T: Readable<Handle = Self::Handle>,
             K: AsRef<[u8]> + 'a,
             V: FromBytes,
             Self::Error: From<T::Error> { ... }
    fn put_many<'a, T>(
        &self,
        txn: &mut T,
        pairs: impl Iterator<Item = (&'a K, &'a V)>
    ) -> Result<(), Self::Error>
       where T: Writable<Handle = Self::Handle>,
             K: AsRef<[u8]> + 'a,
             V: ToBytes + 'a,
             Self::Error: From<T::Error> { ... }
}
Expand description

Extension trait for Store.

Provided Methods§

source

fn get_many<'a, T>( &self, txn: &T, keys: impl Iterator<Item = &'a K> ) -> Result<Vec<Option<V>>, Self::Error>where T: Readable<Handle = Self::Handle>, K: AsRef<[u8]> + 'a, V: FromBytes, Self::Error: From<T::Error>,

Returns multiple optional values (each may exist or not) from the store in one transaction.

source

fn put_many<'a, T>( &self, txn: &mut T, pairs: impl Iterator<Item = (&'a K, &'a V)> ) -> Result<(), Self::Error>where T: Writable<Handle = Self::Handle>, K: AsRef<[u8]> + 'a, V: ToBytes + 'a, Self::Error: From<T::Error>,

Puts multiple key/value pairs into the store in one transaction, potentially returning an error of type Self::Error if that fails.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<K, V, T: Store<K, V>> StoreExt<K, V> for T