[][src]Struct lmdb::RoTransaction

pub struct RoTransaction<'env> { /* fields omitted */ }

An LMDB read-only transaction.

Methods

impl<'env> RoTransaction<'env>[src]

pub fn reset(self) -> InactiveTransaction<'env>[src]

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

impl<'env> Transaction for RoTransaction<'env>[src]

fn commit(self) -> Result<()>[src]

Commits the transaction. Read more

fn abort(self)[src]

Aborts the transaction. Read more

unsafe fn open_db(&self, name: Option<&str>) -> Result<Database>[src]

Opens a database in the transaction. Read more

fn get<'txn, K>(&'txn self, database: Database, key: &K) -> Result<&'txn [u8]> where
    K: AsRef<[u8]>, 
[src]

Gets an item from a database. Read more

fn open_ro_cursor<'txn>(&'txn self, db: Database) -> Result<RoCursor<'txn>>[src]

Open a new read-only cursor on the given database.

fn db_flags(&self, db: Database) -> Result<DatabaseFlags>[src]

Gets the option flags for the given database in the transaction.

fn stat(&self, db: Database) -> Result<Stat>[src]

Retrieves database statistics.

impl<'env> Drop for RoTransaction<'env>[src]

impl<'env> Debug for RoTransaction<'env>[src]

Auto Trait Implementations

impl<'env> !Send for RoTransaction<'env>

impl<'env> !Sync for RoTransaction<'env>

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.