We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b85b188 commit be6bbeaCopy full SHA for be6bbea
src/lib.rs
@@ -38,8 +38,21 @@
38
use std::fmt::{self, Debug, Display, Formatter};
39
use std::num::NonZeroUsize;
40
41
-#[cfg(feature = "serde")]
42
/// Implement serde traits for Tree
+///
43
+/// ```
44
+/// use ego_tree::{tree, Tree};
45
46
+/// let tree = tree!("a" => {"b", "c" => {"d", "e"}, "f"});
47
+/// let repr = serde_json::to_string(&tree).unwrap();
48
+/// let re_tree: Tree<&str> = serde_json::from_str(&repr).unwrap();
49
50
51
52
+/// # Warning
53
+/// Serialize and Deserialize implementations are recursive. They require an amount of stack memory
54
+/// propotional to the tree depth.
55
+#[cfg(feature = "serde")]
56
pub mod serde;
57
58
/// Vec-backed ID-tree.
0 commit comments