Merge pull request #1109 from matthiasbeyer/libimagentryref/all-references

Add RefStore::all_references()
This commit is contained in:
Matthias Beyer 2017-09-28 18:34:43 +02:00 committed by GitHub
commit 894604e5af

View file

@ -24,6 +24,7 @@ use std::fs::File;
use libimagstore::store::FileLockEntry;
use libimagstore::storeid::StoreId;
use libimagstore::storeid::IntoStoreId;
use libimagstore::storeid::StoreIdIterator;
use libimagstore::store::Store;
use toml::Value;
@ -61,6 +62,9 @@ pub trait RefStore {
fn create_with_hasher<'a, H: Hasher>(&'a self, pb: PathBuf, flags: RefFlags, h: H)
-> Result<FileLockEntry<'a>>;
/// Get all reference objects
fn all_references(&self) -> Result<StoreIdIterator>;
}
impl RefStore for Store {
@ -259,5 +263,8 @@ impl RefStore for Store {
Ok(fle)
}
fn all_references(&self) -> Result<StoreIdIterator> {
self.retrieve_for_module("ref").map_err(From::from)
}
}