pub trait Formatter {
// Required methods
fn format_tree(&self, tree: &str) -> String;
fn format_file(&self, entry: &FileEntry, content: &str) -> String;
fn wrap(&self, tree_block: Option<&str>, files_block: &str) -> String;
fn stream_start(&self, tree_block: Option<&str>) -> String;
fn stream_end(&self) -> String;
fn separator(&self) -> &'static str;
}Expand description
Trait for formatting context output.
Required Methods§
Sourcefn format_tree(&self, tree: &str) -> String
fn format_tree(&self, tree: &str) -> String
Format the project tree block.
Sourcefn format_file(&self, entry: &FileEntry, content: &str) -> String
fn format_file(&self, entry: &FileEntry, content: &str) -> String
Format a single file block.
Sourcefn wrap(&self, tree_block: Option<&str>, files_block: &str) -> String
fn wrap(&self, tree_block: Option<&str>, files_block: &str) -> String
Wrap the tree block and files block into final output.
Sourcefn stream_start(&self, tree_block: Option<&str>) -> String
fn stream_start(&self, tree_block: Option<&str>) -> String
Get the opening wrapper for streaming output.
Sourcefn stream_end(&self) -> String
fn stream_end(&self) -> String
Get the closing wrapper for streaming output.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".