Trait CreateCursor

Source
pub trait CreateCursor<'txn> {
    // Required method
    fn cursor<'db, DB>(&self, db: DB) -> Result<Cursor<'txn, 'db>>
       where DB: Into<Supercow<'db, Database<'db>>>;
}
Expand description

Types of transaction references which can be used to construct 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 references to the three general transaction types, as well as Rc and Arc directly wrapping either concrete transaction type with a 'static lifetime.

Required Methods§

Source

fn cursor<'db, DB>(&self, db: DB) -> Result<Cursor<'txn, 'db>>
where DB: Into<Supercow<'db, Database<'db>>>,

Create a cursor using self as the reference to the containing transaction and db as the database the cursor will read from and write into.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

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

Source§

fn cursor<'db, DB>(&self, db: DB) -> Result<Cursor<'txn, 'db>>
where DB: Into<Supercow<'db, Database<'db>>>,

Source§

impl<'txn> CreateCursor<'txn> for Rc<WriteTransaction<'static>>

Source§

fn cursor<'db, DB>(&self, db: DB) -> Result<Cursor<'txn, 'db>>
where DB: Into<Supercow<'db, Database<'db>>>,

Source§

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

Source§

fn cursor<'db, DB>(&self, db: DB) -> Result<Cursor<'txn, 'db>>
where DB: Into<Supercow<'db, Database<'db>>>,

Source§

impl<'txn> CreateCursor<'txn> for Arc<WriteTransaction<'static>>

Source§

fn cursor<'db, DB>(&self, db: DB) -> Result<Cursor<'txn, 'db>>
where DB: Into<Supercow<'db, Database<'db>>>,

Implementors§

Source§

impl<'txn, 'env: 'txn> CreateCursor<'txn> for &'txn ConstTransaction<'env>

Source§

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

Source§

impl<'txn, 'env: 'txn> CreateCursor<'txn> for &'txn WriteTransaction<'env>