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

Feature request: partial drain #135

Open
redbaron opened this issue Mar 11, 2023 · 1 comment
Open

Feature request: partial drain #135

redbaron opened this issue Mar 11, 2023 · 1 comment

Comments

@redbaron
Copy link

For my usecase I'd like to pop N elements, leaving them vacant. Currently Drain removes all entries. Is it possible to add a variant of drain which on each .next():

  • returns by move stored element
  • stores Entry::Vacant in place

?

@Bergmann89
Copy link

I've recently created a fork of slab, that implements range iterators. With a few adaptions we could implement a draining iterator that accepts a range of items to be drained.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants