Trait AssocCursor

Source
pub trait AssocCursor<'txn> {
    // Required method
    fn assoc_cursor<'db>(
        &self,
        cursor: StaleCursor<'db>,
    ) -> Result<Cursor<'txn, 'db>>;
}
Expand description

Types of transaction references which can be used to renew StaleCursors into functional Cursors.

In most cases this is simply used as an extension trait (see the examples on Cursor). However, it can also be used to abstract over things that can be used to create Cursors if so desired.

Implementations are provided for normal references to ReadTransaction as well as Rc and Arc. The latter two require the transaction’s inner lifetime to be 'static.

Required Methods§

Source

fn assoc_cursor<'db>( &self, cursor: StaleCursor<'db>, ) -> Result<Cursor<'txn, 'db>>

Associates a saved read-only with this transaction.

The cursor will be rebound to this transaction, but will continue using the same database that it was previously.

Implementations on Foreign Types§

Source§

impl<'txn> AssocCursor<'txn> for Rc<ReadTransaction<'static>>

Source§

fn assoc_cursor<'db>( &self, cursor: StaleCursor<'db>, ) -> Result<Cursor<'txn, 'db>>

Source§

impl<'txn> AssocCursor<'txn> for Arc<ReadTransaction<'static>>

Source§

fn assoc_cursor<'db>( &self, cursor: StaleCursor<'db>, ) -> Result<Cursor<'txn, 'db>>

Implementors§

Source§

impl<'txn, 'env: 'txn> AssocCursor<'txn> for &'txn ReadTransaction<'env>