pub trait OptionalTransaction<'db, 'txn> {
// Required method
fn or_new<'inner>(
self,
db: &'inner MdbxDatabase,
) -> TransactionProxy<'db, 'txn>
where 'db: 'txn,
'inner: 'db;
}Expand description
A helper trait that is implemented on Option<&T> with T: AsRef<MdbxReadTransaction<'db>>.
It allows to use the existing transaction or create a new one.
Example: let txn = opt_txn.or_new(db);
Required Methods§
fn or_new<'inner>(self, db: &'inner MdbxDatabase) -> TransactionProxy<'db, 'txn>where
'db: 'txn,
'inner: 'db,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".