Struct TransactionDB

Source
pub struct TransactionDB { /* private fields */ }
Expand description

A transaction database.

Implementations§

Source§

impl TransactionDB

Source

pub fn path(&self) -> &Path

Source§

impl TransactionDB

Source

pub fn snapshot(&self) -> Snapshot<'_>

Trait Implementations§

Source§

impl CreateCF for TransactionDB

Source§

fn create_cf<N: AsRef<str>>( &mut self, name: N, opts: &Options, ) -> Result<(), Error>

Source§

impl CreateCheckpointObject for TransactionDB

Source§

impl DeleteCF<WriteOptions> for TransactionDB

Source§

fn delete_cf_full<K>( &self, cf: Option<&ColumnFamily>, key: K, writeopts: Option<&WriteOptions>, ) -> Result<(), Error>
where K: AsRef<[u8]>,

Source§

fn delete_cf<K>(&self, cf: &ColumnFamily, key: K) -> Result<(), Error>
where K: AsRef<[u8]>,

Source§

fn put_cf_opt<K>( &self, cf: &ColumnFamily, key: K, writeopts: &W, ) -> Result<(), Error>
where K: AsRef<[u8]>,

Source§

impl Drop for TransactionDB

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl GetCF<ReadOptions> for TransactionDB

Source§

fn get_cf_full<K: AsRef<[u8]>>( &self, cf: Option<&ColumnFamily>, key: K, readopts: Option<&ReadOptions>, ) -> Result<Option<DBVector>, Error>

Source§

fn get_cf<K: AsRef<[u8]>>( &self, cf: &ColumnFamily, key: K, ) -> Result<Option<DBVector>, Error>

Source§

fn get_cf_opt<K: AsRef<[u8]>>( &self, cf: &ColumnFamily, key: K, readopts: &R, ) -> Result<Option<DBVector>, Error>

Source§

impl GetColumnFamilys for TransactionDB

Source§

fn get_cfs(&self) -> &BTreeMap<String, ColumnFamily>

Source§

fn get_mut_cfs(&mut self) -> &mut BTreeMap<String, ColumnFamily>

Source§

fn cf_handle(&self, name: &str) -> Option<&ColumnFamily>

Return the underlying column family handle.
Source§

impl Handle<rocksdb_transactiondb_t> for TransactionDB

Source§

impl Iterate for TransactionDB

Source§

fn get_raw_iter<'a: 'b, 'b>( &'a self, readopts: &ReadOptions, ) -> DBRawIterator<'b>

Source§

fn get_iter<'a: 'b, 'b>( &'a self, readopts: &ReadOptions, mode: IteratorMode<'_>, ) -> DBIterator<'b>

Source§

fn iterator_opt<'a: 'b, 'b>( &'a self, mode: IteratorMode<'_>, readopts: &ReadOptions, ) -> DBIterator<'b>

Source§

fn iterator<'a: 'b, 'b>(&'a self, mode: IteratorMode<'_>) -> DBIterator<'b>

Source§

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.
Source§

fn prefix_iterator<'a: 'b, 'b>(&'a self, prefix: &[u8]) -> DBIterator<'b>

Source§

fn raw_iterator<'a: 'b, 'b>(&'a self) -> DBRawIterator<'b>

Source§

impl IterateCF for TransactionDB

Source§

fn get_raw_iter_cf<'a: 'b, 'b>( &'a self, cf_handle: &ColumnFamily, readopts: &ReadOptions, ) -> Result<DBRawIterator<'b>, Error>

Source§

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>

Opens an interator using the provided ReadOptions. This is used when you want to iterate over a specific ColumnFamily with a modified ReadOptions
Source§

fn iterator_cf<'a: 'b, 'b>( &'a self, cf_handle: &ColumnFamily, mode: IteratorMode<'_>, ) -> Result<DBIterator<'b>, Error>

Source§

fn full_iterator_cf<'a: 'b, 'b>( &'a self, cf_handle: &ColumnFamily, mode: IteratorMode<'_>, ) -> Result<DBIterator<'b>, Error>

Source§

fn prefix_iterator_cf<'a: 'b, 'b>( &'a self, cf_handle: &ColumnFamily, prefix: &[u8], ) -> Result<DBIterator<'b>, Error>

Source§

fn raw_iterator_cf<'a: 'b, 'b>( &'a self, cf_handle: &ColumnFamily, ) -> Result<DBRawIterator<'b>, Error>

Source§

impl MergeCF<WriteOptions> for TransactionDB

Source§

fn merge_cf_full<K, V>( &self, cf: Option<&ColumnFamily>, key: K, value: V, writeopts: Option<&WriteOptions>, ) -> Result<(), Error>
where K: AsRef<[u8]>, V: AsRef<[u8]>,

Source§

fn merge_cf<K, V>( &self, cf: &ColumnFamily, key: K, value: V, ) -> Result<(), Error>
where K: AsRef<[u8]>, V: AsRef<[u8]>,

Source§

fn merge_cf_opt<K, V>( &self, cf: &ColumnFamily, key: K, value: V, writeopts: &W, ) -> Result<(), Error>
where K: AsRef<[u8]>, V: AsRef<[u8]>,

Source§

impl MultiGet<ReadOptions> for TransactionDB

Source§

fn multi_get_full<K, I>( &self, keys: I, readopts: Option<&ReadOptions>, ) -> Vec<Result<Option<DBVector>, Error>>
where K: AsRef<[u8]>, I: IntoIterator<Item = K>,

Source§

fn multi_get<K, I>(&self, keys: I) -> Vec<Result<Option<DBVector>, Error>>
where K: AsRef<[u8]>, I: IntoIterator<Item = K>,

Source§

fn multi_get_opt<K, I>( &self, keys: I, readopts: &R, ) -> Vec<Result<Option<DBVector>, Error>>
where K: AsRef<[u8]>, I: IntoIterator<Item = K>,

Source§

impl MultiGetCF<ReadOptions> for TransactionDB

Source§

fn multi_get_cf_full<'a, K, I>( &self, keys: I, readopts: Option<&ReadOptions>, ) -> Vec<Result<Option<DBVector>, Error>>
where K: AsRef<[u8]>, I: IntoIterator<Item = (&'a ColumnFamily, K)>,

Source§

fn multi_get_cf<'a, K, I>( &self, keys_cf: I, ) -> Vec<Result<Option<DBVector>, Error>>
where K: AsRef<[u8]>, I: IntoIterator<Item = (&'a ColumnFamily, K)>,

Source§

fn multi_get_cf_opt<'a, K, I>( &self, keys_cf: I, readopts: &R, ) -> Vec<Result<Option<DBVector>, Error>>
where K: AsRef<[u8]>, I: IntoIterator<Item = (&'a ColumnFamily, K)>,

Source§

impl Open for TransactionDB

Source§

fn open_default<P: AsRef<Path>>(path: P) -> Result<Self, Error>

Open a database with default options.
Source§

fn open<P: AsRef<Path>>(opts: &Options, path: P) -> Result<Self, Error>

Open the database with the specified options.
Source§

fn open_with_descriptor<P: AsRef<Path>>( opts: &Options, path: P, descriptor: Self::Descriptor, ) -> Result<Self, Error>

Source§

impl OpenCF for TransactionDB

Source§

fn open_cf<P, I, N>(opts: &Options, path: P, cfs: I) -> Result<Self, Error>
where P: AsRef<Path>, I: IntoIterator<Item = N>, N: AsRef<str>,

Open a database with the given database options and column family names. Read more
Source§

fn open_cf_descriptors<P, I>( opts: &Options, path: P, cfs: I, ) -> Result<Self, Error>

Open a database with the given database options and column family descriptors.
Source§

fn open_cf_descriptors_with_descriptor<P, I>( opts: &Options, path: P, cfs: I, descriptor: Self::Descriptor, ) -> Result<Self, Error>

Source§

impl PutCF<WriteOptions> for TransactionDB

Source§

fn put_cf_full<K, V>( &self, cf: Option<&ColumnFamily>, key: K, value: V, writeopts: Option<&WriteOptions>, ) -> Result<(), Error>
where K: AsRef<[u8]>, V: AsRef<[u8]>,

Source§

fn put_cf<K, V>(&self, cf: &ColumnFamily, key: K, value: V) -> Result<(), Error>
where K: AsRef<[u8]>, V: AsRef<[u8]>,

Source§

fn put_cf_opt<K, V>( &self, cf: &ColumnFamily, key: K, value: V, writeopts: &W, ) -> Result<(), Error>
where K: AsRef<[u8]>, V: AsRef<[u8]>,

Source§

impl TransactionBegin for TransactionDB

Source§

type WriteOptions = WriteOptions

Source§

type TransactionOptions = TransactionOptions

Source§

fn transaction( &self, write_options: &WriteOptions, tx_options: &TransactionOptions, ) -> Transaction<'_, TransactionDB>

Source§

fn transaction_default(&self) -> Transaction<'_, Self>

Begins a new optimistic transaction with default options.
Source§

impl WriteOps for TransactionDB

Source§

fn write_full( &self, batch: &WriteBatch, writeopts: Option<&WriteOptions>, ) -> Result<(), Error>

Source§

fn write(&self, batch: &WriteBatch) -> Result<(), Error>

Source§

fn write_opt( &self, batch: &WriteBatch, writeopts: &WriteOptions, ) -> Result<(), Error>

Source§

fn write_without_wal(&self, batch: &WriteBatch) -> Result<(), Error>

Source§

impl Read for TransactionDB

Source§

impl Send for TransactionDB

Source§

impl Sync for TransactionDB

Source§

impl Write for TransactionDB

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T, W> Delete<W> for T
where T: DeleteCF<W>,

Source§

fn delete_full<K>(&self, key: K, writeopts: Option<&W>) -> Result<(), Error>
where K: AsRef<[u8]>,

Source§

fn delete<K>(&self, key: K) -> Result<(), Error>
where K: AsRef<[u8]>,

Remove the database entry for key. Read more
Source§

fn delete_opt<K>(&self, key: K, writeopts: &W) -> Result<(), Error>
where K: AsRef<[u8]>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, R> Get<R> for T
where T: GetCF<R>,

Source§

fn get_full<K>( &self, key: K, readopts: Option<&R>, ) -> Result<Option<DBVector>, Error>
where K: AsRef<[u8]>,

Source§

fn get<K: AsRef<[u8]>>(&self, key: K) -> Result<Option<DBVector>, Error>

Return the bytes associated with a key value
Source§

fn get_opt<K: AsRef<[u8]>>( &self, key: K, readopts: &R, ) -> Result<Option<DBVector>, Error>

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, W> Merge<W> for T
where T: MergeCF<W>,

Source§

fn merge_full<K, V>( &self, key: K, value: V, writeopts: Option<&W>, ) -> Result<(), Error>
where K: AsRef<[u8]>, V: AsRef<[u8]>,

Source§

fn merge<K, V>(&self, key: K, value: V) -> Result<(), Error>
where K: AsRef<[u8]>, V: AsRef<[u8]>,

Source§

fn merge_opt<K, V>(&self, key: K, value: V, writeopts: &W) -> Result<(), Error>
where K: AsRef<[u8]>, V: AsRef<[u8]>,

Source§

impl<T, W> Put<W> for T
where T: PutCF<W>,

Source§

fn put_full<K, V>( &self, key: K, value: V, writeopts: Option<&W>, ) -> Result<(), Error>
where K: AsRef<[u8]>, V: AsRef<[u8]>,

Source§

fn put<K, V>(&self, key: K, value: V) -> Result<(), Error>
where K: AsRef<[u8]>, V: AsRef<[u8]>,

Insert a value into the database under the given key.
Source§

fn put_opt<K, V>(&self, key: K, value: V, writeopts: &W) -> Result<(), Error>
where K: AsRef<[u8]>, V: AsRef<[u8]>,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.