Announcing const-lru 1.0: a no-std constant-memory usage LRU cache implementation
Links
I implemented a LRU cache that performs no allocations at runtime by storing all required data in const-generic arrays. It also maintains a binary search index to enable fast look-ups at the cost of slower insertions and deletions. I tried to make its API as similar to std::collections::HashMap as possible. For more details, the docs and full source code are available in the links above.
During the implementation, I also ran into several issues with undefined behavior from my usage of unsafe language features and decided to write about them in the blog post linked above. I hope this can help other devs avoid the pitfalls I encountered.
Thank you for listening and I hope people find this library useful!