imag/libimagentryview/src/viewer.rs
2016-04-18 19:52:14 +02:00

17 lines
371 B
Rust

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(())
}
}