Removed seek_for_prev

Not implemented in this version of RocksDB
master
Karl Hobley 8 years ago
parent 007616446f
commit cb136318ce
  1. 2
      librocksdb-sys/src/lib.rs
  2. 8
      src/db.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(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_next(iterator: *mut rocksdb_iterator_t);
pub fn rocksdb_iter_prev(iterator: *mut rocksdb_iterator_t); pub fn rocksdb_iter_prev(iterator: *mut rocksdb_iterator_t);

@ -132,10 +132,6 @@ pub struct Snapshot<'a> {
/// println!("Saw {:?} {:?}", iter.key(), iter.value()); /// 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 { pub struct DBRawIterator {
inner: *mut ffi::rocksdb_iterator_t, inner: *mut ffi::rocksdb_iterator_t,
@ -359,6 +355,9 @@ impl DBRawIterator {
self.just_seeked = true; 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. /// 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. /// 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); } 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; self.just_seeked = true;
} }
*/
/// Seeks to the next key. /// Seeks to the next key.
/// ///

Loading…
Cancel
Save