mozilla / rkv

A simple, humane, typed key-value storage solution.
https://crates.io/crates/rkv
Apache License 2.0
310 stars 53 forks source link

Reverse iterators #192

Open maackle opened 4 years ago

maackle commented 4 years ago

It seems like it would be easy to add a few methods to SingleStore et al to produce Iterators that go in reverse. I proposed this in https://github.com/mozilla/lmdb-rs/issues/75, which if merged should make adding it to rkv a simple matter.

I'm going to try it in a fork, but I want to ask if there are any guidelines for interfaces that a maintainer could propose that would make my work more likely to be merged upstream. Adding iter_end and iter_from_reverse come to mind as a possibility, but it could also be implemented as a flag on iter_start and iter_from.

I need this for my project, specifically the ability to get the last key by sort order, which a reverse iterator would accomplish in a more general way.