From cb136318ce44e2103971ac5c76a66a08f362823c Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Sun, 5 Mar 2017 16:56:35 +0000 Subject: [PATCH] Removed seek_for_prev Not implemented in this version of RocksDB --- librocksdb-sys/src/lib.rs | 2 -- src/db.rs | 8 ++++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/librocksdb-sys/src/lib.rs b/librocksdb-sys/src/lib.rs index d70cab2..fb1ce6c 100644 --- a/librocksdb-sys/src/lib.rs +++ b/librocksdb-sys/src/lib.rs @@ -294,8 +294,6 @@ 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 f90b4d9..819396f 100644 --- a/src/db.rs +++ b/src/db.rs @@ -132,10 +132,6 @@ pub struct Snapshot<'a> { /// println!("Saw {:?} {:?}", iter.key(), iter.value()); /// } /// -/// iter.seek_for_prev(b"my key"); -/// while iter.prev() { -/// println!("Saw {:?} {:?}", iter.key(), iter.value()); -/// } /// ``` pub struct DBRawIterator { inner: *mut ffi::rocksdb_iterator_t, @@ -359,6 +355,9 @@ impl DBRawIterator { self.just_seeked = true; } +/* + SeekForPrev was added in RocksDB 4.13 but not implemented in the C API until RocksDB 5.0 + /// Seeks to the specified key, or the first key that lexicographically precedes it. /// /// Like ``.seek()`` this method will attempt to seek to the specified key. @@ -388,6 +387,7 @@ impl DBRawIterator { 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; } +*/ /// Seeks to the next key. ///