imag/libimagentryview/src/viewer.rs

18 lines
371 B
Rust
Raw Normal View History

2016-04-18 17:52:14 +00:00
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(())
}
}