Open
Description
Feature gate: #![feature(map_many_mut)]
This is a tracking issue for the HashMap::get_many{,_unchecked}_mut
functions.
Attempts to get mutable references to N
values in the map at once.
Public API
// in HashMap
pub fn get_many_mut<Q: ?Sized, const N: usize>(
&mut self,
ks: [&Q; N]
) -> [Option<&'_ mut V>; N]
where
K: Borrow<Q>,
Q: Hash + Eq;
pub unsafe fn get_many_unchecked_mut<Q: ?Sized, const N: usize>(
&mut self,
ks: [&Q; N],
) -> [Option<&'_ mut V>; N]
where
K: Borrow<Q>,
Q: Hash + Eq;
Steps / History
- Implementation: Expose
get_many_mut
andget_many_unchecked_mut
to HashMap #94647 and Change signature ofget_many_mut
APIs hashbrown#562 - Final comment period (FCP)
- Stabilization PR
Unresolved Questions
Should the return type be insteadResult<[Option<&mut V>; N], DuplicateKeys>
? Tracking Issue for map_many_mut #97601 (comment) and Tracking Issue for map_many_mut #97601 (comment)
Tracking Issue for map_many_mut #97601 (comment)Having instead a entry-like API? Tracking Issue for map_many_mut #97601 (comment)
Tracking Issue for map_many_mut #97601 (comment)
Metadata
Assignees
Labels
Category: An issue tracking the progress of sth. like the implementation of an RFCRelevant to the library API team, which will review and decide on the PR/issue.This issue / PR is in PFCP or FCP with a disposition to merge it.Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off.