imag/imag-view/src/editor.rs

25 lines
567 B
Rust
Raw Normal View History

2016-08-09 17:47:13 +00:00
use libimagstore::store::FileLockEntry;
use libimagrt::runtime::Runtime;
use libimagentryview::builtin::editor::EditorView;
use libimagentryview::viewer::Viewer;
use libimagentryview::error::ViewError as VE;
pub struct Editor<'a> {
rt: &'a Runtime<'a>,
fle: &'a FileLockEntry<'a>,
}
impl<'a> Editor<'a> {
pub fn new(rt: &'a Runtime, fle: &'a FileLockEntry) -> Editor<'a> {
Editor{
rt: rt,
fle: fle,
}
}
pub fn show(self) -> Result<(), VE> {
EditorView::new(self.rt).view_entry(self.fle)
}
}