Skip to content
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

Implement Drain and IntoIterator #62

Open
jonhoo opened this issue Feb 17, 2020 · 2 comments
Open

Implement Drain and IntoIterator #62

jonhoo opened this issue Feb 17, 2020 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@jonhoo
Copy link
Owner

jonhoo commented Feb 17, 2020

We should implement the Drain and IntoIterator traits on HashMap!

Part of what is tricky about Drain is the contract for what happens when the user "does something weird". For example, what happens if I write the following code:

std::mem::forget(map.drain());

Is map now empty or full? What happens if I read one element and then drop the Drain? Take a look at hashbrown::RawDrain for some inspiration. I'm genuinely not sure what the best way to express this is a concurrent map.

@soruh began an implementation in #33, but it has since run out of time to work on it. It may still be useful to draw inspiration from though, and has a fair amount of good discussion around the challenges involved.

@jonhoo jonhoo added enhancement New feature or request help wanted Extra attention is needed labels Feb 17, 2020
@domenicquirl domenicquirl added this to the 1.0 milestone Feb 18, 2020
@jmfrank63
Copy link

Hi Jon, I would like to give it a try, though this will be challenging. But I found solving specific problems is a good way, if not the best, to strengthen your coding skills.
I used flurry in a small actix project and I noted that there is no serde implementation and also no merge. Should I open separate issues for this?

@jonhoo
Copy link
Owner Author

jonhoo commented Oct 17, 2021

Definitely give it a try if you have the time! Serialization support should have landed in #79 — what in particular are you missing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants