HashMap::get_many_mut on stable

Is there a simple way to steal this one function HashMap in std::collections - Rust to use on stable, without having to use Rust nightly ?

I know the common trick is to store a HashMap<K, RefCell<V>> where you can then take multiple read-only refs, and run .borrow() on them, but I am curious if there is a way to just steal this one function instead.


If it's feasible, just use hashbrown as a drop-in replacement for std HashMap.

For the exact question: No, there's not. You can create an extension trait with get_many_mut with an implementation that does not use internal details, but that's as far as you can get.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.