pub struct RoTransaction<'env> { /* private fields */ }
Expand description
An LMDB read-only transaction.
Implementations§
Source§impl<'env> RoTransaction<'env>
impl<'env> RoTransaction<'env>
Sourcepub fn reset(self) -> InactiveTransaction<'env>
pub fn reset(self) -> InactiveTransaction<'env>
Resets the read-only transaction.
Abort the transaction like Transaction::abort
, but keep the
transaction handle. InactiveTransaction::renew
may reuse the handle.
This saves allocation overhead if the process will start a new read-only
transaction soon, and also locking overhead if
EnvironmentFlags::NO_TLS
is in use. The reader table lock is released,
but the table slot stays tied to its thread or transaction. Reader locks
generally don’t interfere with writers, but they keep old versions of
database pages allocated. Thus they prevent the old pages from being
reused when writers commit new data, and so under heavy load the
database size may grow much more rapidly than otherwise.
Trait Implementations§
Source§impl<'env> Debug for RoTransaction<'env>
impl<'env> Debug for RoTransaction<'env>
Source§impl<'env> Drop for RoTransaction<'env>
impl<'env> Drop for RoTransaction<'env>
Source§impl<'env> Transaction for RoTransaction<'env>
impl<'env> Transaction for RoTransaction<'env>
Source§fn txn(&self) -> *mut MDB_txn
fn txn(&self) -> *mut MDB_txn
Returns a raw pointer to the underlying LMDB transaction. Read more
Source§unsafe fn open_db(&self, name: Option<&str>) -> Result<Database>
unsafe fn open_db(&self, name: Option<&str>) -> Result<Database>
Opens a database in the transaction. Read more
Source§fn get<'txn, K>(&'txn self, database: Database, key: &K) -> Result<&'txn [u8]>
fn get<'txn, K>(&'txn self, database: Database, key: &K) -> Result<&'txn [u8]>
Gets an item from a database. Read more
Source§fn open_ro_cursor<'txn>(&'txn self, db: Database) -> Result<RoCursor<'txn>>
fn open_ro_cursor<'txn>(&'txn self, db: Database) -> Result<RoCursor<'txn>>
Open a new read-only cursor on the given database.
Auto Trait Implementations§
impl<'env> Freeze for RoTransaction<'env>
impl<'env> RefUnwindSafe for RoTransaction<'env>
impl<'env> !Send for RoTransaction<'env>
impl<'env> !Sync for RoTransaction<'env>
impl<'env> Unpin for RoTransaction<'env>
impl<'env> UnwindSafe for RoTransaction<'env>
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