[−][src]Trait binjs_io::io::FileStructurePrinter
An API for printing the binary representation and its structural interpretation of the file.
A struct which implements this trait is supposed to print the binary representation of the file in the first column internally, and print the structural interpretation in the second column, which is triggered by print_file_structure!() macro below, from various places that interprets the file structure.
(first column) (second column) 01 # Script { 08 # AssertedScriptGlobalScope { 02 # list (length=0) [ ... # ...
Default no-op implementations are provided for all methods, which can be used by the following declaration:
impl FileStructurePrinter for T {}
Provided methods
fn enable_file_structure_print(&mut self)
Enables printing the binary representation and the structural interpretation.
fn disable_file_structure_print(&mut self)
Disables printing the binary representation and the structural interpretation.
fn is_file_structure_print_enabled(&mut self) -> bool
True if file structure print is enabled. With default implementation, nothing is printed.
fn prepare_file_structure_column(&mut self)
Prints the column separator ("# " characters), and padding before it if necessary.
Before calling this method, the output is supposed to be the following:
00 01 02<= cursor position
After calling this method, the output is supposed to be the following:
00 01 02 # <= cursor position
The column width is not defined but the implementation is supposed to keep the same column width through the entire output, regardless of the number of bytes it reads for each line.
fn newline_for_file_structure_print(&mut self)
Prints newline after printing the structural interpretation column. The implementation is supposed to print newline character(s) and also reset the current column position internally, in order to print the right number of spaces in prepare_file_structure_column.
Before calling this method, the output is supposed to be the following:
00 01 02 # string="hello"<= cursor position
After calling this method, the output is supposed to be the following:
00 01 02 # string="hello" <= cursor position
Implementors
impl FileStructurePrinter for binjs_io::entropy::read::Decoder
[src]
impl FileStructurePrinter for binjs_io::multipart::TreeTokenReader
[src]
fn enable_file_structure_print(&mut self)
[src]
fn disable_file_structure_print(&mut self)
[src]
fn is_file_structure_print_enabled(&mut self) -> bool
[src]
fn prepare_file_structure_column(&mut self)
[src]
fn newline_for_file_structure_print(&mut self)
[src]
impl<R> FileStructurePrinter for binjs_io::simple::TreeTokenReader<R> where
R: Read + Seek,
[src]
R: Read + Seek,