Trait dinglebit_store::collection::Collection[][src]

pub trait Collection {
    fn put<T>(&mut self, key: &str, value: T) -> Result<Option<T>, Error>
    where
        T: Serialize + DeserializeOwned
;
fn get<T>(&mut self, key: &str) -> Result<Option<T>, Error>
    where
        T: Serialize + DeserializeOwned
;
fn prefix<'a, T>(
        &mut self,
        prefix: &str
    ) -> Box<dyn Iterator<Item = Result<T, Error>> + 'a>
    where
        T: Serialize + DeserializeOwned + 'a
; }
Expand description

A Collection contains serializable objects which are accessible by a key.

Required methods

Put the given value into the collection under the given key. If the key already exists, it’s replaced with the given value and the old value is returned.

Find all the files that have the given prefix and iterate over them.

Implementors