pub struct OptimisticTransaction { /* private fields */ }
Implementations§
Source§impl OptimisticTransaction
impl OptimisticTransaction
Sourcepub fn rollback_to_savepoint(&self) -> Result<(), Error>
pub fn rollback_to_savepoint(&self) -> Result<(), Error>
Transaction rollback to savepoint
Sourcepub fn set_savepoint(&self)
pub fn set_savepoint(&self)
Set savepoint for transaction
Sourcepub fn snapshot(&self) -> OptimisticTransactionSnapshot<'_>
pub fn snapshot(&self) -> OptimisticTransactionSnapshot<'_>
Get Snapshot
Sourcepub fn get_for_update<K: AsRef<[u8]>>(
&self,
key: K,
) -> Result<Option<DBVector>, Error>
pub fn get_for_update<K: AsRef<[u8]>>( &self, key: K, ) -> Result<Option<DBVector>, Error>
Get For Update ReadOptions: Default exclusive: true
Sourcepub fn get_for_update_opt<K: AsRef<[u8]>>(
&self,
key: K,
readopts: &ReadOptions,
exclusive: bool,
) -> Result<Option<DBVector>, Error>
pub fn get_for_update_opt<K: AsRef<[u8]>>( &self, key: K, readopts: &ReadOptions, exclusive: bool, ) -> Result<Option<DBVector>, Error>
Get For Update with custom ReadOptions and exclusive
pub fn get_for_update_cf<K: AsRef<[u8]>>( &self, cf: &ColumnFamily, key: K, ) -> Result<Option<DBVector>, Error>
pub fn get_for_update_cf_opt<K: AsRef<[u8]>>( &self, cf: &ColumnFamily, key: K, readopts: &ReadOptions, exclusive: bool, ) -> Result<Option<DBVector>, Error>
Trait Implementations§
Source§impl DeleteCF<()> for OptimisticTransaction
impl DeleteCF<()> for OptimisticTransaction
fn delete_cf_full<K>( &self, cf: Option<&ColumnFamily>, key: K, _: Option<&()>, ) -> Result<(), Error>
fn delete_cf<K>(&self, cf: &ColumnFamily, key: K) -> Result<(), Error>
fn put_cf_opt<K>( &self, cf: &ColumnFamily, key: K, writeopts: &W, ) -> Result<(), Error>
Source§impl Drop for OptimisticTransaction
impl Drop for OptimisticTransaction
Source§impl GetCF<ReadOptions> for OptimisticTransaction
impl GetCF<ReadOptions> for OptimisticTransaction
fn get_cf_full<K: AsRef<[u8]>>( &self, cf: Option<&ColumnFamily>, key: K, readopts: Option<&ReadOptions>, ) -> Result<Option<DBVector>, Error>
fn get_cf<K: AsRef<[u8]>>( &self, cf: &ColumnFamily, key: K, ) -> Result<Option<DBVector>, Error>
fn get_cf_opt<K: AsRef<[u8]>>( &self, cf: &ColumnFamily, key: K, readopts: &R, ) -> Result<Option<DBVector>, Error>
Source§impl<'a> GetPinnedCF<'a> for OptimisticTransaction
impl<'a> GetPinnedCF<'a> for OptimisticTransaction
type ColumnFamily = &'a ColumnFamily
type ReadOptions = &'a ReadOptions
Source§fn get_pinned_cf_full<K: AsRef<[u8]>>(
&'a self,
cf: Option<Self::ColumnFamily>,
key: K,
readopts: Option<Self::ReadOptions>,
) -> Result<Option<DBPinnableSlice<'a>>, Error>
fn get_pinned_cf_full<K: AsRef<[u8]>>( &'a self, cf: Option<Self::ColumnFamily>, key: K, readopts: Option<Self::ReadOptions>, ) -> Result<Option<DBPinnableSlice<'a>>, Error>
Return the value associated with a key using RocksDB’s PinnableSlice
so as to avoid unnecessary memory copy.
Source§fn get_pinned_cf<K: AsRef<[u8]>>(
&'a self,
cf: Self::ColumnFamily,
key: K,
) -> Result<Option<DBPinnableSlice<'a>>, Error>
fn get_pinned_cf<K: AsRef<[u8]>>( &'a self, cf: Self::ColumnFamily, key: K, ) -> Result<Option<DBPinnableSlice<'a>>, Error>
Return the value associated with a key using RocksDB’s PinnableSlice
so as to avoid unnecessary memory copy.
Source§fn get_pinned_cf_opt<K: AsRef<[u8]>>(
&'a self,
cf: Self::ColumnFamily,
key: K,
readopts: Self::ReadOptions,
) -> Result<Option<DBPinnableSlice<'a>>, Error>
fn get_pinned_cf_opt<K: AsRef<[u8]>>( &'a self, cf: Self::ColumnFamily, key: K, readopts: Self::ReadOptions, ) -> Result<Option<DBPinnableSlice<'a>>, Error>
Return the value associated with a key using RocksDB’s PinnableSlice
so as to avoid unnecessary memory copy.
Source§impl Handle<rocksdb_transaction_t> for OptimisticTransaction
impl Handle<rocksdb_transaction_t> for OptimisticTransaction
fn handle(&self) -> *mut rocksdb_transaction_t
Source§impl Iterate for OptimisticTransaction
impl Iterate for OptimisticTransaction
fn get_raw_iter<'a: 'b, 'b>( &'a self, readopts: &ReadOptions, ) -> DBRawIterator<'b>
fn get_iter<'a: 'b, 'b>( &'a self, readopts: &ReadOptions, mode: IteratorMode<'_>, ) -> DBIterator<'b> ⓘ
fn iterator_opt<'a: 'b, 'b>( &'a self, mode: IteratorMode<'_>, readopts: &ReadOptions, ) -> DBIterator<'b> ⓘ
fn iterator<'a: 'b, 'b>(&'a self, mode: IteratorMode<'_>) -> DBIterator<'b> ⓘ
Source§fn full_iterator<'a: 'b, 'b>(&'a self, mode: IteratorMode<'_>) -> DBIterator<'b> ⓘ
fn full_iterator<'a: 'b, 'b>(&'a self, mode: IteratorMode<'_>) -> DBIterator<'b> ⓘ
Opens an interator with
set_total_order_seek
enabled.
This must be used to iterate across prefixes when set_memtable_factory
has been called
with a Hash-based implementation.fn prefix_iterator<'a: 'b, 'b>(&'a self, prefix: &[u8]) -> DBIterator<'b> ⓘ
fn raw_iterator<'a: 'b, 'b>(&'a self) -> DBRawIterator<'b>
Source§impl IterateCF for OptimisticTransaction
impl IterateCF for OptimisticTransaction
fn get_raw_iter_cf<'a: 'b, 'b>( &'a self, cf_handle: &ColumnFamily, readopts: &ReadOptions, ) -> Result<DBRawIterator<'b>, Error>
fn get_iter_cf<'a: 'b, 'b>( &'a self, cf_handle: &ColumnFamily, readopts: &ReadOptions, mode: IteratorMode<'_>, ) -> Result<DBIterator<'b>, Error>
Source§fn iterator_cf_opt<'a: 'b, 'b>(
&'a self,
cf_handle: &ColumnFamily,
mode: IteratorMode<'_>,
readopts: &ReadOptions,
) -> Result<DBIterator<'b>, Error>
fn iterator_cf_opt<'a: 'b, 'b>( &'a self, cf_handle: &ColumnFamily, mode: IteratorMode<'_>, readopts: &ReadOptions, ) -> Result<DBIterator<'b>, Error>
Opens an interator using the provided ReadOptions.
This is used when you want to iterate over a specific ColumnFamily with a modified ReadOptions
fn iterator_cf<'a: 'b, 'b>( &'a self, cf_handle: &ColumnFamily, mode: IteratorMode<'_>, ) -> Result<DBIterator<'b>, Error>
fn full_iterator_cf<'a: 'b, 'b>( &'a self, cf_handle: &ColumnFamily, mode: IteratorMode<'_>, ) -> Result<DBIterator<'b>, Error>
fn prefix_iterator_cf<'a: 'b, 'b>( &'a self, cf_handle: &ColumnFamily, prefix: &[u8], ) -> Result<DBIterator<'b>, Error>
fn raw_iterator_cf<'a: 'b, 'b>( &'a self, cf_handle: &ColumnFamily, ) -> Result<DBRawIterator<'b>, Error>
Source§impl MergeCF<()> for OptimisticTransaction
impl MergeCF<()> for OptimisticTransaction
fn merge_cf_full<K, V>( &self, cf: Option<&ColumnFamily>, key: K, value: V, _: Option<&()>, ) -> Result<(), Error>
fn merge_cf<K, V>( &self, cf: &ColumnFamily, key: K, value: V, ) -> Result<(), Error>
fn merge_cf_opt<K, V>( &self, cf: &ColumnFamily, key: K, value: V, writeopts: &W, ) -> Result<(), Error>
Source§impl MultiGet<ReadOptions> for OptimisticTransaction
impl MultiGet<ReadOptions> for OptimisticTransaction
fn multi_get_full<K, I>( &self, keys: I, readopts: Option<&ReadOptions>, ) -> Vec<Result<Option<DBVector>, Error>>
fn multi_get<K, I>(&self, keys: I) -> Vec<Result<Option<DBVector>, Error>>
fn multi_get_opt<K, I>( &self, keys: I, readopts: &R, ) -> Vec<Result<Option<DBVector>, Error>>
Source§impl MultiGetCF<ReadOptions> for OptimisticTransaction
impl MultiGetCF<ReadOptions> for OptimisticTransaction
fn multi_get_cf_full<'a, K, I>( &self, keys: I, readopts: Option<&ReadOptions>, ) -> Vec<Result<Option<DBVector>, Error>>
fn multi_get_cf<'a, K, I>( &self, keys_cf: I, ) -> Vec<Result<Option<DBVector>, Error>>
fn multi_get_cf_opt<'a, K, I>( &self, keys_cf: I, readopts: &R, ) -> Vec<Result<Option<DBVector>, Error>>
Source§impl PutCF<()> for OptimisticTransaction
impl PutCF<()> for OptimisticTransaction
fn put_cf_full<K, V>( &self, cf: Option<&ColumnFamily>, key: K, value: V, _: Option<&()>, ) -> Result<(), Error>
fn put_cf<K, V>(&self, cf: &ColumnFamily, key: K, value: V) -> Result<(), Error>
fn put_cf_opt<K, V>( &self, cf: &ColumnFamily, key: K, value: V, writeopts: &W, ) -> Result<(), Error>
impl Read for OptimisticTransaction
impl Send for OptimisticTransaction
impl Sync for OptimisticTransaction
Auto Trait Implementations§
impl Freeze for OptimisticTransaction
impl RefUnwindSafe for OptimisticTransaction
impl Unpin for OptimisticTransaction
impl UnwindSafe for OptimisticTransaction
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
Source§impl<T, W> Delete<W> for Twhere
T: DeleteCF<W>,
impl<T, W> Delete<W> for Twhere
T: DeleteCF<W>,
Source§impl<T, R> Get<R> for Twhere
T: GetCF<R>,
impl<T, R> Get<R> for Twhere
T: GetCF<R>,
fn get_full<K>( &self, key: K, readopts: Option<&R>, ) -> Result<Option<DBVector>, Error>
Source§fn get<K: AsRef<[u8]>>(&self, key: K) -> Result<Option<DBVector>, Error>
fn get<K: AsRef<[u8]>>(&self, key: K) -> Result<Option<DBVector>, Error>
Return the bytes associated with a key value
fn get_opt<K: AsRef<[u8]>>( &self, key: K, readopts: &R, ) -> Result<Option<DBVector>, Error>
Source§impl<'a, T, R> GetPinned<'a> for Twhere
T: GetPinnedCF<'a, ReadOptions = R>,
impl<'a, T, R> GetPinned<'a> for Twhere
T: GetPinnedCF<'a, ReadOptions = R>,
type ReadOptions = R
Source§fn get_pinned_full<K>(
&'a self,
key: K,
readopts: Option<<T as GetPinned<'a>>::ReadOptions>,
) -> Result<Option<DBPinnableSlice<'a>>, Error>
fn get_pinned_full<K>( &'a self, key: K, readopts: Option<<T as GetPinned<'a>>::ReadOptions>, ) -> Result<Option<DBPinnableSlice<'a>>, Error>
Return the value associated with a key using RocksDB’s PinnableSlice
so as to avoid unnecessary memory copy.
Source§fn get_pinned<K: AsRef<[u8]>>(
&'a self,
key: K,
) -> Result<Option<DBPinnableSlice<'a>>, Error>
fn get_pinned<K: AsRef<[u8]>>( &'a self, key: K, ) -> Result<Option<DBPinnableSlice<'a>>, Error>
Return the value associated with a key using RocksDB’s PinnableSlice
so as to avoid unnecessary memory copy. Similar to get_pinned_opt but
leverages default options.
Source§fn get_pinned_opt<K: AsRef<[u8]>>(
&'a self,
key: K,
readopts: Self::ReadOptions,
) -> Result<Option<DBPinnableSlice<'a>>, Error>
fn get_pinned_opt<K: AsRef<[u8]>>( &'a self, key: K, readopts: Self::ReadOptions, ) -> Result<Option<DBPinnableSlice<'a>>, Error>
Return the value associated with a key using RocksDB’s PinnableSlice
so as to avoid unnecessary memory copy.