Struct lmdb::RwCursor
[−]
[src]
pub struct RwCursor<'txn> { /* fields omitted */ }
A read-only cursor for navigating items within a database.
Methods
impl<'txn> RwCursor<'txn>
[src]
fn put<K, D>(&mut self, key: &K, data: &D, flags: WriteFlags) -> Result<()> where
K: AsRef<[u8]>,
D: AsRef<[u8]>,
K: AsRef<[u8]>,
D: AsRef<[u8]>,
Puts a key/data pair into the database. The cursor will be positioned at the new data item, or on failure usually near it.
fn del(&mut self, flags: WriteFlags) -> Result<()>
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
impl<'txn> Cursor<'txn> for RwCursor<'txn>
[src]
fn cursor(&self) -> *mut MDB_cursor
Returns a raw pointer to the underlying LMDB cursor. Read more
fn get(
&self,
key: Option<&[u8]>,
data: Option<&[u8]>,
op: c_uint
) -> Result<(Option<&'txn [u8]>, &'txn [u8])>
&self,
key: Option<&[u8]>,
data: Option<&[u8]>,
op: c_uint
) -> Result<(Option<&'txn [u8]>, &'txn [u8])>
Retrieves a key/data pair from the cursor. Depending on the cursor op, the current key may be returned. Read more
fn iter(&mut self) -> Iter<'txn>
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. Read more
fn iter_start(&mut self) -> Iter<'txn>
Iterate over database items starting from the beginning of the database. Read more
fn iter_from<K>(&mut self, key: K) -> Iter<'txn> where
K: AsRef<[u8]>,
K: AsRef<[u8]>,
Iterate over database items starting from the given key. Read more
fn iter_dup(&mut self) -> IterDup<'txn>
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. Read more
fn iter_dup_start(&mut self) -> IterDup<'txn>
Iterate over duplicate database items starting from the beginning of the database. Each item will be returned as an iterator of its duplicates. Read more
fn iter_dup_from<K>(&mut self, key: &K) -> IterDup<'txn> where
K: AsRef<[u8]>,
K: AsRef<[u8]>,
Iterate over duplicate items in the database starting from the given key. Each item will be returned as an iterator of its duplicates. Read more
fn iter_dup_of<K>(&mut self, key: &K) -> Result<Iter<'txn>> where
K: AsRef<[u8]>,
K: AsRef<[u8]>,
Iterate over the duplicates of the item in the database with the given key. Read more