diff --git a/librocksdb-sys/src/lib.rs b/librocksdb-sys/src/lib.rs index fb1ce6c..d70cab2 100644 --- a/librocksdb-sys/src/lib.rs +++ b/librocksdb-sys/src/lib.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); diff --git a/src/db.rs b/src/db.rs index 6df57bc..2290072 100644 --- a/src/db.rs +++ b/src/db.rs @@ -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