redb
redb copied to clipboard
Implement additional APIs from BtreeMap
There are several methods on std::collections::BtreeMap that would also make sense to have on Table. Such as:
- [ ] drain()
- [ ] pop_first()
- [ ] pop_last()
This can't be implemented in a nice way. drain() is suppose to remove the entries even if the iterator is dropped. However, removing from a redb Database must allocate pages which could result in an out of space error, and drop() can't return a Result obviously.
Actually this can be. All the removals just need to be done during the drain iterator creation, and only the page freeing during Drop