StdoutViewer: Implement view()
This commit is contained in:
parent
68b2c152e3
commit
f582ea9367
1 changed files with 17 additions and 1 deletions
|
@ -1,5 +1,7 @@
|
|||
use std::io::{Stdout, stdout};
|
||||
|
||||
use toml::encode_str;
|
||||
|
||||
use viewer::{ViewInformation, Viewer};
|
||||
|
||||
pub struct StdoutViewer {
|
||||
|
@ -17,7 +19,21 @@ impl StdoutViewer {
|
|||
impl Viewer for StdoutViewer {
|
||||
|
||||
fn view(&self, vi: ViewInformation) {
|
||||
unimplemented!()
|
||||
if vi.view_copy {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
if vi.view_header {
|
||||
println!("{}", encode_str(vi.entry.get_header().header()));
|
||||
}
|
||||
|
||||
if vi.view_content {
|
||||
println!("{}", vi.entry.get_content());
|
||||
}
|
||||
|
||||
if vi.view_copy && !vi.keep_copy {
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue