-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider implementing entries(&mut self) -> impl Iterator<Item = OccupiedEntryRef>
#426
Comments
That doesn't work due to the way the |
@Amanieu sure, but that's fixable by just... Not doing that, right? We can have them hold a |
The problem is in the |
I understand that. My point is that we should allow |
This exposes too much of the implementation details of the current hash table implementation. For example, the previous implementation (before hashbrown) would shift adjacent entries on deletion. This would invalidate references to other elements in the table. |
Is that comment from the pov of std or the pov of hashbrown? Putting std aside for a minute, would hashbrown consider this API? |
No, I would like to keep the high-level |
See my comment here for the motivation: rust-lang/rust#59618 (comment) .
Unfortunately, the impl can't just be added. hashbrown's
EntryRef
s are currentlySend
, which means that they can't be allowed to co-exist. Allowing this API would require removing theSend
impls on those types. Before someone starts with the implementation, is that something the crate would consider? The tradeoff is pretty clearly well-motivated imo, especially since the entry types already have lifetimes and so aren't exactly likely to be sent across threads much.The text was updated successfully, but these errors were encountered: