pub fn seek_for_prev<K: AsRef<[u8]>>(&mut self, key: K) {
        let key = key.as_ref();

        unsafe {
            ffi::rocksdb_iter_seek_for_prev(
                self.inner,
                key.as_ptr() as *const c_char,
                key.len() as size_t,
            );
        }
    }
/// 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.
/// The difference with ``.seek()`` is that if the specified key do not exist, this method will
/// seek to key that lexicographically precedes it instead.
///
/// # Examples
///
/// ```rust
/// use rocksdb::{DB, Options};
///
/// let path = "_path_for_rocksdb_storage8";
/// {
///     let db = DB::open_default(path).unwrap();
///     let mut iter = db.raw_iterator();
///
///     // Read the last key that starts with 'a'
///     iter.seek_for_prev(b"b");
///
///     if iter.valid() {
///         println!("{:?} {:?}", iter.key(), iter.value());
///     } else {
///         // There are no keys in the database
///     }
/// }
/// let _ = DB::destroy(&Options::default(), path);
/// ```
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.
The difference with ``.seek()`` is that if the specified key do not exist, this method will
seek to key that lexicographically precedes it instead.
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 . The difference with ` ` . seek () ` ` is that if the specified key do not exist this method will seek to key that lexicographically precedes it instead .
pub fn seek_for_prev<K: AsRef<[u8]>>(&mut self, key: K) {
        let key = key.as_ref();
        unsafe {
            ffi::rocksdb_iter_seek_for_prev(
                self.inner,
                key.as_ptr() as *const c_char,
                key.len() as size_t,
            );
        }
    }
pub fn seek_for_prev < K : AsRef < [ u8 ] > > ( & mut self , key : K ) { let key = key . as_ref ( ) ; unsafe { ffi :: rocksdb_iter_seek_for_prev ( self . inner , key . as_ptr ( ) as * const c_char , key . len ( ) as size_t , ) ; } }
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 .
&mut self
key
K
&mut self
key
K
examples
```rust
use rocksdb::{DB, Options}.

let path = "_path_for_rocksdb_storage8";
{
let db = DB::open_default(path).unwrap();
let mut iter = db.raw_iterator().

Read the last key that starts with 'a'
iter.seek_for_prev(b"b").

if iter.valid() {
println!("{:?} {:?}", iter.key(), iter.value());
} else {
There are no keys in the database
}
}
let _ = DB::destroy(&Options::default(), path);
```
` ` ` rust use rocksdb :: { DB Options } . let path = " _path_for_rocksdb_storage8 " ; { let db = DB :: open_default ( path ) . unwrap () ; let mut iter = db . raw_iterator () . Read the last key that starts with ' a ' iter . seek_for_prev ( b " b " ) . if iter . valid () { println! ( " { : ? } { : ? } " iter . key () iter . value () ) ; } else { There are no keys in the database } } let _ = DB :: destroy ( &Options :: default () path ) ; ` ` `