pub struct Tx<K: TransactionKind> { /* private fields */ }mdbx only.Expand description
Wrapper for the libmdbx transaction.
Implementations§
Source§impl<K: TransactionKind> Tx<K>
impl<K: TransactionKind> Tx<K>
Sourcepub const fn inner(&self) -> &Transaction<K>
pub const fn inner(&self) -> &Transaction<K>
Returns a reference to the inner libmdbx transaction.
Sourcepub fn get_dbi_raw(&self, name: &str) -> Result<MDBX_dbi, DatabaseError>
pub fn get_dbi_raw(&self, name: &str) -> Result<MDBX_dbi, DatabaseError>
Gets a table database handle by name if it exists, otherwise, check the database, opening the DB if it exists.
Sourcepub fn get_dbi<T: Table>(&self) -> Result<MDBX_dbi, DatabaseError>
pub fn get_dbi<T: Table>(&self) -> Result<MDBX_dbi, DatabaseError>
Gets a table database handle by name if it exists, otherwise, check the database, opening the DB if it exists.
Sourcepub fn new_cursor<T: Table>(&self) -> Result<Cursor<K, T>, DatabaseError>
pub fn new_cursor<T: Table>(&self) -> Result<Cursor<K, T>, DatabaseError>
Create db Cursor
Trait Implementations§
Source§impl<K: TransactionKind> DbTx for Tx<K>
impl<K: TransactionKind> DbTx for Tx<K>
Source§fn cursor_dup_read<T: DupSort>(
&self,
) -> Result<Self::DupCursor<T>, DatabaseError>
fn cursor_dup_read<T: DupSort>( &self, ) -> Result<Self::DupCursor<T>, DatabaseError>
Iterate over read only values in database.
Source§fn entries<T: Table>(&self) -> Result<usize, DatabaseError>
fn entries<T: Table>(&self) -> Result<usize, DatabaseError>
Returns number of entries in the table using cheap DB stats invocation.
Source§fn disable_long_read_transaction_safety(&mut self)
fn disable_long_read_transaction_safety(&mut self)
Disables long-lived read transaction safety guarantees, such as backtrace recording and timeout.
Source§fn get<T: Table>(
&self,
key: T::Key,
) -> Result<Option<<T as Table>::Value>, DatabaseError>
fn get<T: Table>( &self, key: T::Key, ) -> Result<Option<<T as Table>::Value>, DatabaseError>
Source§fn get_by_encoded_key<T: Table>(
&self,
key: &<T::Key as Encode>::Encoded,
) -> Result<Option<T::Value>, DatabaseError>
fn get_by_encoded_key<T: Table>( &self, key: &<T::Key as Encode>::Encoded, ) -> Result<Option<T::Value>, DatabaseError>
get.Source§fn commit(self) -> Result<(), DatabaseError>
fn commit(self) -> Result<(), DatabaseError>
Source§fn cursor_read<T: Table>(&self) -> Result<Self::Cursor<T>, DatabaseError>
fn cursor_read<T: Table>(&self) -> Result<Self::Cursor<T>, DatabaseError>
Source§impl DbTxMut for Tx<RW>
impl DbTxMut for Tx<RW>
Source§fn put<T: Table>(
&self,
key: T::Key,
value: T::Value,
) -> Result<(), DatabaseError>
fn put<T: Table>( &self, key: T::Key, value: T::Value, ) -> Result<(), DatabaseError>
Source§fn append<T: Table>(
&self,
key: T::Key,
value: T::Value,
) -> Result<(), DatabaseError>
fn append<T: Table>( &self, key: T::Key, value: T::Value, ) -> Result<(), DatabaseError>
put, but databases like MDBX provide dedicated modes to make
it much faster, typically from O(logN) down to O(1) thanks to no lookup.Source§fn delete<T: Table>(
&self,
key: T::Key,
value: Option<T::Value>,
) -> Result<bool, DatabaseError>
fn delete<T: Table>( &self, key: T::Key, value: Option<T::Value>, ) -> Result<bool, DatabaseError>
Source§fn cursor_write<T: Table>(&self) -> Result<Self::CursorMut<T>, DatabaseError>
fn cursor_write<T: Table>(&self) -> Result<Self::CursorMut<T>, DatabaseError>
Source§fn cursor_dup_write<T: DupSort>(
&self,
) -> Result<Self::DupCursorMut<T>, DatabaseError>
fn cursor_dup_write<T: DupSort>( &self, ) -> Result<Self::DupCursorMut<T>, DatabaseError>
DupCursor mut.Source§impl TableImporter for Tx<RW>
impl TableImporter for Tx<RW>
§fn import_table<T, R>(&self, source_tx: &R) -> Result<(), DatabaseError>
fn import_table<T, R>(&self, source_tx: &R) -> Result<(), DatabaseError>
§fn import_table_with_range<T, R>(
&self,
source_tx: &R,
from: Option<<T as Table>::Key>,
to: <T as Table>::Key,
) -> Result<(), DatabaseError>
fn import_table_with_range<T, R>( &self, source_tx: &R, from: Option<<T as Table>::Key>, to: <T as Table>::Key, ) -> Result<(), DatabaseError>
§fn import_dupsort<T, R>(&self, source_tx: &R) -> Result<(), DatabaseError>
fn import_dupsort<T, R>(&self, source_tx: &R) -> Result<(), DatabaseError>
Auto Trait Implementations§
impl<K> !Freeze for Tx<K>
impl<K> !RefUnwindSafe for Tx<K>
impl<K> !UnwindSafe for Tx<K>
impl<K> Send for Tx<K>
impl<K> Sync for Tx<K>
impl<K> Unpin for Tx<K>
impl<K> UnsafeUnpin for Tx<K>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> DbTxUnwindExt for Twhere
T: DbTxMut,
impl<T> DbTxUnwindExt for Twhere
T: DbTxMut,
§fn unwind_table_by_num<T>(&self, num: u64) -> Result<usize, DatabaseError>
fn unwind_table_by_num<T>(&self, num: u64) -> Result<usize, DatabaseError>
§fn unwind_table<T, F>(
&self,
key: u64,
selector: F,
) -> Result<usize, DatabaseError>
fn unwind_table<T, F>( &self, key: u64, selector: F, ) -> Result<usize, DatabaseError>
§fn unwind_table_by_walker<T1, T2>(
&self,
range: impl RangeBounds<<T1 as Table>::Key>,
) -> Result<(), DatabaseError>
fn unwind_table_by_walker<T1, T2>( &self, range: impl RangeBounds<<T1 as Table>::Key>, ) -> Result<(), DatabaseError>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> MaybeDebug for Twhere
T: Debug,
§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn 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>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 64 bytes