pub struct RwTransaction<'env> { /* fields omitted */ }
An LMDB read-write transaction.
Opens a database in the provided transaction, creating it if necessary.
If name
is None
, then the default database will be opened, otherwise
a named database will be opened. The database handle will be private to
the transaction until the transaction is successfully committed. If the
transaction is aborted the returned database handle should no longer be
used.
Prefer using Environment::create_db
.
This function (as well as Environment::open_db
,
Environment::create_db
, and Database::open
) must not be called
from multiple concurrent transactions in the same environment. A
transaction which uses this function must finish (either commit or
abort) before any other transaction may use this function.
Opens a new read-write cursor on the given database and transaction.
Stores an item into a database.
This function stores key/data pairs in the database. The default
behavior is to enter the new key/data pair, replacing any previously
existing key if duplicates are disallowed, or adding a duplicate data
item if duplicates are allowed (DatabaseFlags::DUP_SORT
).
Returns a buffer which can be used to write a value into the item at the
given key and with the given length. The buffer must be completely
filled by the caller.
Deletes an item from a database.
This function removes key/data pairs from the database. If the database
does not support sorted duplicate data items (DatabaseFlags::DUP_SORT
)
the data parameter is ignored. If the database supports sorted
duplicates and the data parameter is None
, all of the duplicate data
items for the key will be deleted. Otherwise, if the data parameter is
Some
only the matching data item will be deleted. This function will
return Error::NotFound
if the specified key/data pair is not in the
database.
Empties the given database. All items will be removed.
Drops the database from the environment.
This method is unsafe in the same ways as Environment::close_db
, and
should be used accordingly.
Begins a new nested transaction inside of this transaction.
Returns a raw pointer to the underlying LMDB transaction. Read more
Opens a database in the transaction. Read more
Open a new read-only cursor on the given database.
Gets the option flags for the given database in the transaction.
Executes the destructor for this type. Read more
Formats the value using the given formatter. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static