Add Store::entries()

This commit is contained in:
Matthias Beyer 2017-04-25 14:36:41 +02:00
parent e75c37fbb2
commit bee97c8758

View file

@ -749,6 +749,18 @@ impl Store {
Ok(()) Ok(())
} }
/// Get _all_ entries in the store (by id as iterator)
pub fn entries(&self) -> Result<StoreIdIterator> {
let iter = Walk::new(self.path().clone(), "")
.filter_map(|id| match id {
StoreObject::Id(sid) => Some(sid),
_ => None
});
Ok(StoreIdIterator::new(Box::new(iter)))
}
/// Gets the path where this store is on the disk /// Gets the path where this store is on the disk
pub fn path(&self) -> &PathBuf { pub fn path(&self) -> &PathBuf {
&self.location &self.location