Enum kv::Txn

source ·
pub enum Txn<'env> {
    ReadOnly(RoTransaction<'env>),
    ReadWrite(RwTransaction<'env>),
}
Expand description

Access to the database

Variants§

§

ReadOnly(RoTransaction<'env>)

Readonly access

§

ReadWrite(RwTransaction<'env>)

Read-write access

Implementations§

Returns true when the transaction is ReadOnly

Ends the transaction, saving all changes

Ends the transaction, discarding all changes

Gets the value associated with the given key

Sets the value associated with the given key

Sets the value associated with the given key if it doesn’t already exist

Deletes the key and value associated with key from the database

Remove all items from the database

Reserve a buffer

Reserve a buffer with a unique key

Open a new readonly cursor

Open a new writable cursor

Open a nested transaction NOTE: you must alread be in a read/write transaction otherwise an error will be returned

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.