X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibcollections%2Fbtree%2Fnode.rs;h=e55b1597a21b867ac355f83f02da6fdc6e5cdc02;hb=26a2f852beae15235e7d3c4c5751ffe8e9459817;hp=198025536f0b0183d037cb40129a2a94202634f6;hpb=f3f27a5c6483d9e2bb3c872a3b05291a6e1d9cb3;p=rust.git diff --git a/src/libcollections/btree/node.rs b/src/libcollections/btree/node.rs index 198025536f0..e55b1597a21 100644 --- a/src/libcollections/btree/node.rs +++ b/src/libcollections/btree/node.rs @@ -78,7 +78,7 @@ pub struct Node { _capacity: usize, } -struct NodeSlice<'a, K: 'a, V: 'a> { +pub struct NodeSlice<'a, K: 'a, V: 'a> { keys: &'a [K], vals: &'a [V], pub edges: &'a [Node], @@ -87,7 +87,7 @@ struct NodeSlice<'a, K: 'a, V: 'a> { has_edges: bool, } -struct MutNodeSlice<'a, K: 'a, V: 'a> { +pub struct MutNodeSlice<'a, K: 'a, V: 'a> { keys: &'a [K], vals: &'a mut [V], pub edges: &'a mut [Node], @@ -1344,7 +1344,7 @@ fn min_load_from_capacity(cap: usize) -> usize { /// A trait for pairs of `Iterator`s, one over edges and the other over key/value pairs. This is /// necessary, as the `MoveTraversalImpl` needs to have a destructor that deallocates the `Node`, /// and a pair of `Iterator`s would require two independent destructors. -trait TraversalImpl { +pub trait TraversalImpl { type Item; type Edge; @@ -1358,7 +1358,7 @@ trait TraversalImpl { /// A `TraversalImpl` that actually is backed by two iterators. This works in the non-moving case, /// as no deallocation needs to be done. #[derive(Clone)] -struct ElemsAndEdges(Elems, Edges); +pub struct ElemsAndEdges(Elems, Edges); impl TraversalImpl for ElemsAndEdges @@ -1375,7 +1375,7 @@ fn next_edge_back(&mut self) -> Option { self.1.next_back() } } /// A `TraversalImpl` taking a `Node` by value. -struct MoveTraversalImpl { +pub struct MoveTraversalImpl { keys: RawItems, vals: RawItems, edges: RawItems>, @@ -1436,7 +1436,7 @@ fn drop(&mut self) { /// An abstraction over all the different kinds of traversals a node supports #[derive(Clone)] -struct AbsTraversal { +pub struct AbsTraversal { inner: Impl, head_is_edge: bool, tail_is_edge: bool,