Struct kvdb::DBTransaction
source · [−]Expand description
Write transaction. Batches a sequence of put/delete operations for efficiency.
Fields
ops: Vec<DBOp>
Database operations.
Implementations
sourceimpl DBTransaction
impl DBTransaction
sourcepub fn new() -> DBTransaction
pub fn new() -> DBTransaction
Create new transaction.
sourcepub fn with_capacity(cap: usize) -> DBTransaction
pub fn with_capacity(cap: usize) -> DBTransaction
Create new transaction with capacity.
sourcepub fn put(&mut self, col: u32, key: &[u8], value: &[u8])
pub fn put(&mut self, col: u32, key: &[u8], value: &[u8])
Insert a key-value pair in the transaction. Any existing value will be overwritten upon write.
Trait Implementations
sourceimpl Clone for DBTransaction
impl Clone for DBTransaction
sourcefn clone(&self) -> DBTransaction
fn clone(&self) -> DBTransaction
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Default for DBTransaction
impl Default for DBTransaction
sourcefn default() -> DBTransaction
fn default() -> DBTransaction
Returns the “default value” for a type. Read more
sourceimpl PartialEq<DBTransaction> for DBTransaction
impl PartialEq<DBTransaction> for DBTransaction
sourcefn eq(&self, other: &DBTransaction) -> bool
fn eq(&self, other: &DBTransaction) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &DBTransaction) -> bool
fn ne(&self, other: &DBTransaction) -> bool
This method tests for !=
.
impl StructuralPartialEq for DBTransaction
Auto Trait Implementations
impl RefUnwindSafe for DBTransaction
impl Send for DBTransaction
impl Sync for DBTransaction
impl Unpin for DBTransaction
impl UnwindSafe for DBTransaction
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more