|
|
@ -1654,8 +1654,8 @@ impl WriteBatch { |
|
|
|
/// Removes the database entries in the range ["begin_key", "end_key"), i.e.,
|
|
|
|
/// Removes the database entries in the range ["begin_key", "end_key"), i.e.,
|
|
|
|
/// including "begin_key" and excluding "end_key". It is not an error if no
|
|
|
|
/// including "begin_key" and excluding "end_key". It is not an error if no
|
|
|
|
/// keys exist in the range ["begin_key", "end_key").
|
|
|
|
/// keys exist in the range ["begin_key", "end_key").
|
|
|
|
pub fn delete_range<K: AsRef<[u8]>>(&mut self, start_key: K, end_key: K) -> Result<(), Error> { |
|
|
|
pub fn delete_range<K: AsRef<[u8]>>(&mut self, from: K, to: K) -> Result<(), Error> { |
|
|
|
let (start_key, end_key) = (start_key.as_ref(), end_key.as_ref()); |
|
|
|
let (start_key, end_key) = (from.as_ref(), to.as_ref()); |
|
|
|
|
|
|
|
|
|
|
|
unsafe { |
|
|
|
unsafe { |
|
|
|
ffi::rocksdb_writebatch_delete_range( |
|
|
|
ffi::rocksdb_writebatch_delete_range( |
|
|
@ -1672,10 +1672,10 @@ impl WriteBatch { |
|
|
|
pub fn delete_range_cf<K: AsRef<[u8]>>( |
|
|
|
pub fn delete_range_cf<K: AsRef<[u8]>>( |
|
|
|
&mut self, |
|
|
|
&mut self, |
|
|
|
cf: ColumnFamily, |
|
|
|
cf: ColumnFamily, |
|
|
|
start_key: K, |
|
|
|
from: K, |
|
|
|
end_key: K, |
|
|
|
to: K, |
|
|
|
) -> Result<(), Error> { |
|
|
|
) -> Result<(), Error> { |
|
|
|
let (start_key, end_key) = (start_key.as_ref(), end_key.as_ref()); |
|
|
|
let (start_key, end_key) = (from.as_ref(), to.as_ref()); |
|
|
|
|
|
|
|
|
|
|
|
unsafe { |
|
|
|
unsafe { |
|
|
|
ffi::rocksdb_writebatch_delete_range_cf( |
|
|
|
ffi::rocksdb_writebatch_delete_range_cf( |
|
|
|