Implement seek_for_prev

master
Karl Hobley 8 years ago
parent 6ad575fc04
commit 05c01f4e9e
  1. 2
      librocksdb-sys/src/lib.rs
  2. 4
      src/db.rs

@ -294,6 +294,8 @@ extern "C" {
pub fn rocksdb_iter_seek(iterator: *mut rocksdb_iterator_t, k: *const c_char, klen: size_t);
pub fn rocksdb_iter_seek_for_prev(iterator: *mut rocksdb_iterator_t, k: *const c_char, klen: size_t);
pub fn rocksdb_iter_next(iterator: *mut rocksdb_iterator_t);
pub fn rocksdb_iter_prev(iterator: *mut rocksdb_iterator_t);

@ -260,12 +260,10 @@ impl DBRawIterator {
self.just_seeked = true;
}
/*
pub fn seek_for_prev(&mut self, key: [u8]) {
pub fn seek_for_prev(&mut self, key: &[u8]) {
unsafe { ffi::rocksdb_iter_seek_for_prev(self.inner, key.as_ptr() as *const c_char, key.len() as size_t); }
self.just_seeked = true;
}
*/
pub fn next(&mut self) -> bool {
// Initial call to next() after seeking should not move the iterator

Loading…
Cancel
Save