Struct rocksdb::OptimisticTransactionOptions
source · pub struct OptimisticTransactionOptions { /* private fields */ }
Implementations§
source§impl OptimisticTransactionOptions
impl OptimisticTransactionOptions
pub fn new() -> OptimisticTransactionOptions
sourcepub fn set_snapshot(&mut self, snapshot: bool)
pub fn set_snapshot(&mut self, snapshot: bool)
Specifies use snapshot or not.
Default: false.
If a transaction has a snapshot set, the transaction will ensure that
any keys successfully written(or fetched via get_for_update
) have not
been modified outside the transaction since the time the snapshot was
set.
If a snapshot has not been set, the transaction guarantees that keys have
not been modified since the time each key was first written (or fetched via
get_for_update
).
Using snapshot will provide stricter isolation guarantees at the expense of potentially more transaction failures due to conflicts with other writes.
Calling set_snapshot
will not affect the version of Data returned by get
methods.
Trait Implementations§
source§impl Drop for OptimisticTransactionOptions
impl Drop for OptimisticTransactionOptions
impl Send for OptimisticTransactionOptions
impl Sync for OptimisticTransactionOptions
Auto Trait Implementations§
impl Freeze for OptimisticTransactionOptions
impl RefUnwindSafe for OptimisticTransactionOptions
impl Unpin for OptimisticTransactionOptions
impl UnwindSafe for OptimisticTransactionOptions
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