Add Viewer Trait

This commit is contained in:
Matthias Beyer 2016-04-18 19:52:14 +02:00
parent 2a61af2a9d
commit b388c6684e

View file

@ -0,0 +1,17 @@
use libimagstore::store::Entry;
use result::Result;
pub trait Viewer {
fn view_entry(&self, e: &Entry) -> Result<()>;
fn view_entries<I: Iterator<Item = Entry>>(&self, entries: I) -> Result<()> {
for entry in entries {
if let Err(e) = self.view_entry(&entry) {
return Err(e);
}
}
Ok(())
}
}