{"id":16727683,"url":"https://github.com/poiscript/serde_indextree","last_synced_at":"2025-04-10T10:53:50.423Z","repository":{"id":52416257,"uuid":"199664215","full_name":"PoiScript/serde_indextree","owner":"PoiScript","description":"Serializing indextree structure.","archived":false,"fork":false,"pushed_at":"2021-04-29T20:29:38.000Z","size":5,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T09:47:08.157Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PoiScript.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-30T14:08:26.000Z","updated_at":"2024-02-27T19:59:23.000Z","dependencies_parsed_at":"2022-09-26T20:31:53.391Z","dependency_job_id":null,"html_url":"https://github.com/PoiScript/serde_indextree","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/PoiScript%2Fserde_indextree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PoiScript%2Fserde_indextree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PoiScript%2Fserde_indextree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PoiScript%2Fserde_indextree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PoiScript","download_url":"https://codeload.github.com/PoiScript/serde_indextree/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248204932,"owners_count":21064945,"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":[],"created_at":"2024-10-12T23:06:37.248Z","updated_at":"2025-04-10T10:53:50.401Z","avatar_url":"https://github.com/PoiScript.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `serde_indextree`\n\nSerializing `indextree` structure.\n\n## Version support\n\n| `indextree` version | `serde_indextree` version |\n|---------------------|---------------------------|\n| 3.3.x               | 0.1.x                     |\n| 4.0.x               | 0.2.x                     |\n\n## Usage\n\n`serde_indextree` provides two struct: `Node` for serializing\na node and its descendants, `SiblingNodes` for serializing a\nnode and its siblings in sequence.\n\n```rust\nuse indextree::Arena;\nuse serde::Serialize;\nuse serde_indextree::Node;\nuse serde_json::to_string_pretty;\n\n#[derive(Serialize)]\nstruct HtmlElement {\n    tag: \u0026'static str\n}\n\n// \u003chtml\u003e\n// \u003chead\u003e\n//     \u003ctitle\u003e\u003c/title\u003e\n// \u003chead\u003e\n// \u003cbody\u003e\n//     \u003ch1\u003e\u003c/h1\u003e\n//     \u003ch2\u003e\u003c/h2\u003e\n// \u003c/body\u003e\n// \u003c/html\u003e\nlet arena = \u0026mut Arena::new();\nlet a = arena.new_node(HtmlElement { tag: \"html\" });\nlet b = arena.new_node(HtmlElement { tag: \"head\" });\na.append(b, arena);\nlet c = arena.new_node(HtmlElement { tag: \"title\" });\nb.append(c, arena);\nlet d = arena.new_node(HtmlElement { tag: \"body\" });\na.append(d, arena);\nlet e = arena.new_node(HtmlElement { tag: \"h1\" });\nd.append(e, arena);\nlet f = arena.new_node(HtmlElement { tag: \"h2\" });\nd.append(f, arena);\n\nprintln!(\"{}\", to_string_pretty(\u0026Node::new(a, arena)).unwrap());\n// {\n//   \"tag\": \"html\",\n//   \"children\": [\n//     {\n//       \"tag\": \"head\",\n//       \"children\": [\n//         {\n//           \"tag\": \"title\"\n//         }\n//       ]\n//     },\n//     {\n//       \"tag\": \"body\",\n//       \"children\": [\n//         {\n//           \"tag\": \"h1\"\n//         },\n//         {\n//           \"tag\": \"h2\"\n//         }\n//       ]\n//     }\n//   ]\n// }\n```\n\n## Customization\n\nUnfortunately, `serde_indextree` doesn't come up with any customization.\n\nIf you want to rename field names or anything, just copy the entire code\n(only 40+ lines) and modify it at your wish.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoiscript%2Fserde_indextree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpoiscript%2Fserde_indextree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoiscript%2Fserde_indextree/lists"}