Add binary type and tree sink

This commit is contained in:
Jonathan Turner
2019-07-04 17:11:56 +12:00
parent dc8545ce10
commit 65a0d27c8a
14 changed files with 181 additions and 38 deletions

View File

@ -41,6 +41,11 @@ impl RenderView for GenericView<'value> {
Ok(())
}
Value::Binary(_) => {
host.stdout("<Binary>");
Ok(())
}
Value::Filesystem => {
host.stdout("<filesystem>");
Ok(())

View File

@ -7,14 +7,8 @@ use ptree::print_config::PrintConfig;
use ptree::style::{Color, Style};
use ptree::TreeBuilder;
// An entries list is printed like this:
//
// name : ...
// name2 : ...
// another_name : ...
#[derive(new)]
pub struct TreeView {
//entries: Vec<(crate::object::DescriptorName, Value)>,
tree: StringItem,
}
@ -39,6 +33,7 @@ impl TreeView {
Value::Block(_) => {}
Value::Error(_) => {}
Value::Filesystem => {}
Value::Binary(_) => {}
}
}
crate fn from_value(value: &Value) -> TreeView {
@ -73,7 +68,6 @@ impl RenderView for TreeView {
bold: true,
..Style::default()
};
//config.characters = UTF_CHARS_BOLD.into();
config.indent = 4;
config
};