Return Resident struct from iter and iter_mut#116
Open
DenizUgur wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This would help with #115 indirectly as I could insert to cache twice if
ResidentStateisHot. I could then easily save and restore the cache. I would lose Ghost queue but at least residents would be restored.This also helps if I need to now what hot items are in my cache if I need to perform some extra operation on them.
Edit: Upon further examining of the code I see the following logic, so if I were to iterate in reverse I would recreate the same cache anyway. My other point about knowing which item is hot or not is still a valid use case though.
quick-cache/src/shard.rs
Lines 1085 to 1095 in 8b0077f