How to insert a value into a BTreeSet in Rust and then get an iterator beginning at its location? <p>Am I missing something, or is there no way to get an iterator beginning at the newly-inserted value in a <code>BTreeSet</code>? </p> <p><a href="https://doc.rust-lang.org/std/collections/struct.BTreeSet.html#method.insert" rel="nofollow"><code>BTreeSet::insert</code></a> just returns a boolean. For comparison, the <code>insert</code> method for <code>std::map</code> in C++ returns a pair of an iterator and a boolean.</p> <p>It is possible to look up the newly-inserted element and get the iterator that way, but that's inefficient.</p> <p>This isn't a duplicate of <a href="http://stackoverflow.com/questions/28512394/how-to-lookup-from-and-insert-into-a-hashmap-efficiently">How to lookup from and insert into a HashMap efficiently?</a> as I need to get an <strong>iterator</strong> pointing to the location of the newly inserted value. I want to obtain the preceding and following values, if these exist.</p>