Skip to main content

Crate ls_tree

Crate ls_tree 

Source
Expand description

Recursively render a directory hierarchy using the classic tree drawing characters (├──, └──, │ ) or output machine-readable JSON. Supports colours, file sizes, .gitignore awareness, sorting, pruning, and file-type icons. The render target is a generic std::io::Write so the library can be tested without a terminal or the filesystem.

Structs§

FlatFormatter
Find-style flat listing (one path per line).
JsonFormatter
Machine-readable JSON output.
Options
Controls how the tree is gathered and rendered.
TreeFormatter
Classic ├── / └── / │ tree output.
TreeNode
TreeStats

Enums§

Format
Controls which output format is used to render the tree.
SortField

Traits§

OutputFormatter
Renders a complete TreeNode tree into the supplied writer.

Functions§

generate
Convenience entry point that selects the built-in formatter based on Options::effective_format and delegates to generate_with_formatter.
generate_with_formatter
Build the tree and hand it off to a custom OutputFormatter.