pub struct Cursor<'txn, K> where
    K: TransactionKind
{ /* private fields */ }
Expand description

A cursor for navigating the items within a database.

Implementations

Returns a raw pointer to the underlying MDBX cursor.

The caller must ensure that the pointer is not used after the lifetime of the cursor.

Position at first key/data item.

DatabaseFlags::DUP_SORT-only: Position at first data item of current key.

DatabaseFlags::DUP_SORT-only: Position at key/data pair.

DatabaseFlags::DUP_SORT-only: Position at given key and at first data greater than or equal to specified data.

Return key/data at current cursor position.

DupFixed-only: Return up to a page of duplicate data items from current cursor position. Move cursor to prepare for Self::next_multiple().

Position at last key/data item.

DupSort-only: Position at last data item of current key.

Position at next data item

DatabaseFlags::DUP_SORT-only: Position at next data item of current key.

DatabaseFlags::DUP_FIXED-only: Return up to a page of duplicate data items from next cursor position. Move cursor to prepare for MDBX_NEXT_MULTIPLE.

Position at first data item of next key.

Position at previous data item.

DatabaseFlags::DUP_SORT-only: Position at previous data item of current key.

Position at last data item of previous key.

Position at specified key.

Position at specified key, return both key and data.

Position at first key greater than or equal to specified key.

DatabaseFlags::DUP_FIXED-only: Position at previous page and return up to a page of duplicate data items.

Position at first key-value pair greater than or equal to specified, return both key and data, and the return code depends on a exact match.

For non DupSort-ed collections this works the same as Self::set_range(), but returns false if key found exactly and true if greater key was found.

For DupSort-ed a data value is taken into account for duplicates, i.e. for a pairs/tuples of a key and an each data value of duplicates. Returns false if key-value pair found exactly and true if the next pair was returned.

Iterate over database items. The iterator will begin with item next after the cursor, and continue until the end of the database. For new cursors, the iterator will begin with the first item in the database.

For databases with duplicate data items (DatabaseFlags::DUP_SORT), the duplicate data items of each key will be returned before moving on to the next key.

Iterate over database items starting from the beginning of the database.

For databases with duplicate data items (DatabaseFlags::DUP_SORT), the duplicate data items of each key will be returned before moving on to the next key.

Iterate over database items starting from the given key.

For databases with duplicate data items (DatabaseFlags::DUP_SORT), the duplicate data items of each key will be returned before moving on to the next key.

Iterate over duplicate database items. The iterator will begin with the item next after the cursor, and continue until the end of the database. Each item will be returned as an iterator of its duplicates.

Iterate over duplicate database items starting from the beginning of the database. Each item will be returned as an iterator of its duplicates.

Iterate over duplicate items in the database starting from the given key. Each item will be returned as an iterator of its duplicates.

Iterate over the duplicates of the item in the database with the given key.

Puts a key/data pair into the database. The cursor will be positioned at the new data item, or on failure usually near it.

Deletes the current key/data pair.

Flags

WriteFlags::NO_DUP_DATA may be used to delete all data items for the current key, if the database was opened with DatabaseFlags::DUP_SORT.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

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.