@@ -14,6 +14,9 @@ pub enum SearchResult<BorrowType, K, V, FoundType, GoDownType> {
1414/// Returns a `Found` with the handle of the matching KV, if any. Otherwise,
1515/// returns a `GoDown` with the handle of the possible leaf edge where the key
1616/// belongs.
17+ ///
18+ /// The result is meaningful only if the tree is ordered by key, like the tree
19+ /// in a `BTreeMap` is.
1720pub fn search_tree < BorrowType , K , V , Q : ?Sized > (
1821 mut node : NodeRef < BorrowType , K , V , marker:: LeafOrInternal > ,
1922 key : & Q ,
3841
3942/// Looks up a given key in a given node, without recursion.
4043/// Returns a `Found` with the handle of the matching KV, if any. Otherwise,
41- /// returns a `GoDown` with the handle of the edge where the key might be found.
42- /// If the node is a leaf, a `GoDown` edge is not an actual edge but a possible edge.
44+ /// returns a `GoDown` with the handle of the edge where the key might be found
45+ /// (if the node is internal) or where the key can be inserted.
46+ ///
47+ /// The result is meaningful only if the tree is ordered by key, like the tree
48+ /// in a `BTreeMap` is.
4349pub fn search_node < BorrowType , K , V , Type , Q : ?Sized > (
4450 node : NodeRef < BorrowType , K , V , Type > ,
4551 key : & Q ,
@@ -54,11 +60,11 @@ where
5460 }
5561}
5662
57- /// Returns the index in the node at which the key (or an equivalent) exists
58- /// or could exist, and whether it exists in the node itself. If it doesn't
59- /// exist in the node itself, it may exist in the subtree with that index
60- /// (if the node has subtrees). If the key doesn't exist in node or subtree,
61- /// the returned index is the position or subtree where the key belongs .
63+ /// Returns either the KV index in the node at which the key (or an equivalent)
64+ /// exists and `true`, or the edge index where the key belongs and `false`.
65+ ///
66+ /// The result is meaningful only if the tree is ordered by key, like the tree
67+ /// in a `BTreeMap` is.
6268fn search_linear < BorrowType , K , V , Type , Q : ?Sized > (
6369 node : & NodeRef < BorrowType , K , V , Type > ,
6470 key : & Q ,
0 commit comments