Skip to main content

StreamingFormatter

Trait StreamingFormatter 

Source
pub trait StreamingFormatter {
    // Required methods
    fn start_stream(
        &self,
        writer: &mut dyn Write,
        root_path: &Path,
    ) -> Result<()>;
    fn format_node(
        &self,
        writer: &mut dyn Write,
        node: &FileNode,
        root_path: &Path,
    ) -> Result<()>;
    fn end_stream(
        &self,
        writer: &mut dyn Write,
        stats: &TreeStats,
        root_path: &Path,
    ) -> Result<()>;
}

Required Methods§

Source

fn start_stream(&self, writer: &mut dyn Write, root_path: &Path) -> Result<()>

Initialize the stream (e.g., write headers)

Source

fn format_node( &self, writer: &mut dyn Write, node: &FileNode, root_path: &Path, ) -> Result<()>

Format a single node as it arrives

Source

fn end_stream( &self, writer: &mut dyn Write, stats: &TreeStats, root_path: &Path, ) -> Result<()>

Finalize the stream (e.g., write stats, footers)

Implementors§