Uses old Rust 2015
|0.3.2||Mar 13, 2021|
|0.3.1||Jan 6, 2021|
|0.3.0||Aug 29, 2020|
|0.2.1||Sep 12, 2018|
|0.1.0||Aug 20, 2018|
#27 in Command-line interface
7,049 downloads per month
Used in 10 crates (8 directly)
Pretty-print tree-like structures
ptree crate supports output formatting due to a user-provided configuration file and/or environment variables.
[dependencies] ptree = "0.3"
There are two main ways of using
ptree to print a tree-like data structure.
The first is to implement
TreeItem for your structure.
The second is to create a new tree, either using
TreeBuilder or by manually constructing
ptree crate includes implementations of
TreeItem for some common types, including a custom
A tree can be printed to standard output using
print_tree, or to an arbitrary writer using
Both functions have variants which take a
PrintConfig that controls the output.
Text is formatted using
ansi-term, which allows changing colors and styles of the printed text.
ptree loads configuration from a user configuration file.
This allows end users to globally configure the output format for all applications using
Applications can use this configuration directly, modify it, or ignore it altogether.
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.