#hash-set #key #wrap #round-robin #iterate #iterator #last

bin+lib wrappinghashset

A HashSet that remembers the last key it returned with its iterator and subsequently will wrap around and only return all of the keys once per call. This is useful if you want to use a set both via hashing, and iterate over the members as a round-robin list.

2 unstable releases

0.5.0 Apr 8, 2024
0.4.1 Apr 16, 2020

#3 in #round-robin

Download history 10/week @ 2024-02-23 6/week @ 2024-03-01 6/week @ 2024-03-22 79/week @ 2024-03-29 144/week @ 2024-04-05

229 downloads per month
Used in rustygeard

Apache-2.0

9KB
194 lines

Greetings! This is a tiny library I created to allow round-robin access to a hashset. It stores an extra offset in the struct to keep track of which offset it returned last time, so that the next call to iter() will return the next item, and then only all of the rest, one time.

Please do report issues if you find them. Apologies for the lack of docs, but it pretty much works like std::collections::HashSet

No runtime deps