rpds_pathtree/
lib.rs

1// SPDX-FileCopyrightText: The rpds-pathtree authors
2// SPDX-License-Identifier: MPL-2.0
3
4//! Immutable, path-addressable tree data structure.
5
6mod edge;
7pub use self::edge::{HalfEdge, HalfEdgeOwned, HalfEdgeTreeNode};
8
9mod node;
10pub use self::node::{DepthFirstDescendantsIter, InnerNode, LeafNode, Node, NodeValue};
11
12mod path;
13pub use self::path::{PathSegment, RootPath, SegmentedPath};
14
15mod tree;
16pub use self::tree::{
17    AncestorTreeNodeIter, InsertOrUpdateNodeValueError, MatchNodePath, NewNodeId,
18    NodeInsertedOrUpdated, NodePathMatched, NodePathResolved, ParentNodeUpdated, PathTree,
19    PathTreeTypes, SubtreeInsertedOrReplaced, SubtreeRemoved, TreeNode,
20    TreeNodeParentChildPathConflict, UpdateNodeValueError,
21};
22
23#[cfg(feature = "sync")]
24type HashMap<K, V> = rpds::HashTrieMapSync<K, V>;
25
26#[cfg(feature = "sync")]
27fn new_hash_map<K: std::hash::Hash + Eq, V>() -> rpds::HashTrieMapSync<K, V> {
28    rpds::HashTrieMapSync::new_sync()
29}
30
31#[cfg(not(feature = "sync"))]
32type HashMap<K, V> = rpds::HashTrieMap<K, V>;
33
34#[cfg(not(feature = "sync"))]
35fn new_hash_map<K: std::hash::Hash + Eq, V>() -> rpds::HashTrieMap<K, V> {
36    rpds::HashTrieMap::new()
37}
38
39#[cfg(test)]
40mod tests;