pub struct TxnRw<'a> { /* private fields */ }
Expand description

Read-write transaction

A read-write transaction can be started with EnvRw::txn_rw.

The methods for read-only access to the database are accessible through the Txn trait (which is implemented by TxnRo and TxnRw). Methods for write access, however, are available directly on the TxnRw struct.

Read-write transactions are aborted when dropped. To make changes permanent, TxnRw::commit must be called.

Read-write transactions are neither Send nor Sync.

Implementations

Commit transaction

Abort transaction (same as drop)

Start nested transaction

Panics if environment does not support nested transactions (which is the case when the EnvBuilder::writemap flag has been set).

Put value into database

This will overwrite an existing value if the database does not use the DbOptions::keys_duplicate option.

Put value into database unless key exists

Returns Ok(false) if key exists.

Put value into database unless key-value pair exists

Returns Ok(false) if key-value pair exists.

Delete all values from database that match a given key

Delete key-value pair from database

Delete key-value pair at current cursor position

Delete all values with same key at current cursor position

Trait Implementations

Formats the value using the given formatter. Read more

Get reference to value in database

Create a new cursor

Get number of values for current cursor position

Set cursor to first entry in database

Set cursor to first entry in database and get pair

Set cursor to last entry in database

Set cursor to last entry in database and get pair

Get key at current cursor position

Get value at current cursor position

Get key-value pair at current cursor position

Set cursor to key

Set cursor to key and get value

Set cursor to key or next greater key if not existent and get pair

Move cursor to next entry in database and get pair

Move cursor to previous entry in database and get pair

Move cursor to first value of next key and get pair

Move cursor to last value of previous key and get pair

Move cursor to first value of current key

Move cursor to first value of current key and get value

Move cursor to last value of current key

Move cursor to last value of current key and get value

Set cursor to key-value pair

Set cursor to key and value or next greater value if not existent and get value

Move cursor to next value of current key and get value

Move cursor to next value of current key and get value

Get owned value from database

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.