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
sourceimpl 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more