{"id":15973385,"url":"https://github.com/captain-camel/display_tree","last_synced_at":"2025-03-16T07:31:51.398Z","repository":{"id":64970075,"uuid":"580152677","full_name":"captain-camel/display_tree","owner":"captain-camel","description":"Simple, automatic, and customizable tree pretty-printing in Rust.","archived":false,"fork":false,"pushed_at":"2023-02-01T04:30:43.000Z","size":52,"stargazers_count":30,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-12T14:48:52.944Z","etag":null,"topics":["formatter","rust","tree"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/display_tree","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/captain-camel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-12-19T21:10:28.000Z","updated_at":"2024-05-21T02:45:06.000Z","dependencies_parsed_at":"2023-02-16T13:01:13.075Z","dependency_job_id":null,"html_url":"https://github.com/captain-camel/display_tree","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/captain-camel%2Fdisplay_tree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/captain-camel%2Fdisplay_tree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/captain-camel%2Fdisplay_tree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/captain-camel%2Fdisplay_tree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/captain-camel","download_url":"https://codeload.github.com/captain-camel/display_tree/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243806035,"owners_count":20350775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["formatter","rust","tree"],"created_at":"2024-10-07T21:04:43.374Z","updated_at":"2025-03-16T07:31:50.964Z","avatar_url":"https://github.com/captain-camel.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `display_tree`\n\nSimple, automatic, and customizable tree pretty-printing in Rust.\n\n![Example](https://i.ibb.co/RbpZ0Jk/Screenshot-2022-12-19-at-5-36-09-PM.png)\n\nThis crate provides tools to easily pretty-print data as a tree, including a trait that represents the ability to be printed as a tree, and a derive macro to automatically implement it for your types\n\nSee the [crate-level documentation](https://docs.rs/display_tree/*/display_tree) to get started.\n\n## Examples\n\n```rust\nuse display_tree::{AsTree, CharSet, DisplayTree, StyleBuilder};\n\n// A tree representing a numerical expression.\n#[derive(DisplayTree)]\nenum Expr {\n    Int(i32),\n    BinOp {\n        #[node_label]\n        op: char,\n        #[tree]\n        left: Box\u003cSelf\u003e,\n        #[tree]\n        right: Box\u003cSelf\u003e,\n    },\n    UnaryOp {\n        #[node_label]\n        op: char,\n        #[tree]\n        arg: Box\u003cSelf\u003e,\n    },\n}\n\nlet expr: Expr = Expr::BinOp {\n    op: '+',\n    left: Box::new(Expr::UnaryOp {\n        op: '-',\n        arg: Box::new(Expr::Int(2)),\n    }),\n    right: Box::new(Expr::Int(7)),\n};\n\nassert_eq!(\n    format!(\n        \"{}\",\n        AsTree::new(\u0026expr)\n            .indentation(1)\n            .char_set(CharSet::DOUBLE_LINE)\n    ),\n    concat!(\n        \"+\\n\",\n        \"╠═ -\\n\",\n        \"║  ╚═ Int\\n\",\n        \"║     ╚═ 2\\n\",\n        \"╚═ Int\\n\",\n        \"   ╚═ 7\",\n    ),\n);\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaptain-camel%2Fdisplay_tree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaptain-camel%2Fdisplay_tree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaptain-camel%2Fdisplay_tree/lists"}