tree_view 0.1.0

A library to give out a view of a tree structure. Tree structures need to implement the trait TreeView.
Documentation
  • Coverage
  • 0%
    0 out of 15 items documented0 out of 10 items with examples
  • Size
  • Source code size: 24.69 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.9 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 12s Average build duration of successful builds.
  • all releases: 15s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • the-forklift/tree_view
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • functional-tim

tree_view

Crates.io License dependency status


What this is

A library which easily formats tree structures into a view. This can be the output of an cli or part of a view in a tui.

Tree structures just need to implement the trait TreeView.

The trait TreeView has only one implementation of the function fn to\_node(&self) -> Node.

An example implementation for the struct TestMap:

#derive[Eq, Ord, PartialEq, PartialOrd]
pub struct TestMap {
    pub key: String,
    pub value: Vec<TestMap>,
}

impl ToTreeView for TestMap {
    fn to_node(&self) -> Node {
        node: self.key.clone(),
        children: self.value.iter().map(|v| v.to_node()).collect(),
    }
}

How to install

Using cargo

You need to install cargo on your system through your package manager or any other means.

Then you simply install it through cargo.

$ > cargo install tree_view

Using source

You need to install cargo on your system through your package manager or any other means.

The you download the repository through git or manual.

After unpacking or downloading from git you have to switch into the folder of tree_view.

Then run cargo install --path ..

$ > cd tree_view
$ > cargo install --path .

License

tree_view is dual licensed under MIT License and Apache 2 License