Struct ckb_db::write_batch::RocksDBWriteBatch
source · pub struct RocksDBWriteBatch { /* private fields */ }
Expand description
An atomic batch of write operations.
Making an atomic commit of several write operations.
Implementations§
source§impl RocksDBWriteBatch
impl RocksDBWriteBatch
sourcepub fn size_in_bytes(&self) -> usize
pub fn size_in_bytes(&self) -> usize
Return WriteBatch serialized size (in bytes).
sourcepub fn put(&mut self, col: Col, key: &[u8], value: &[u8]) -> Result<()>
pub fn put(&mut self, col: Col, key: &[u8], value: &[u8]) -> Result<()>
Write the bytes into the given column with associated key.
sourcepub fn delete(&mut self, col: Col, key: &[u8]) -> Result<()>
pub fn delete(&mut self, col: Col, key: &[u8]) -> Result<()>
Delete the data associated with the given key and given column.
sourcepub fn delete_range<K: AsRef<[u8]>>(
&mut self,
col: Col,
range: impl Iterator<Item = K>
) -> Result<()>
pub fn delete_range<K: AsRef<[u8]>>( &mut self, col: Col, range: impl Iterator<Item = K> ) -> Result<()>
Remove database entries from start key to end key.
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 keys exist in the range [“begin_key”, “end_key”).
Auto Trait Implementations§
impl RefUnwindSafe for RocksDBWriteBatch
impl !Send for RocksDBWriteBatch
impl !Sync for RocksDBWriteBatch
impl Unpin for RocksDBWriteBatch
impl UnwindSafe for RocksDBWriteBatch
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more