diff --git a/src/db.rs b/src/db.rs index 9af7e72..2fd59c5 100644 --- a/src/db.rs +++ b/src/db.rs @@ -1804,8 +1804,15 @@ impl ReadOptions { } } - /// Set the upper bound for an iterator, and the upper bound itself is not included on the iteration result. - pub fn set_iterate_upper_bound>(&mut self, key: K) { + /// Set the upper bound for an iterator. + /// The upper bound itself is not included on the iteration result. + /// + /// # Safety + /// + /// This function will store a clone of key and will give a raw pointer of it to the + /// underlying C++ API, therefore, when given to any other [`DB`] method you must ensure + /// that this [`ReadOptions`] value does not leave the scope too early (e.g. `DB::iterator_cf_opt`). + pub unsafe fn set_iterate_upper_bound>(&mut self, key: K) { let key = key.as_ref(); unsafe { ffi::rocksdb_readoptions_set_iterate_upper_bound(