Struct lmdb_rs::core::Cursor
[−]
[src]
pub struct Cursor<'txn> { /* fields omitted */ }
Methods
impl<'txn> Cursor<'txn>
[src]
fn to_first(&mut self) -> MdbResult<()>
Moves cursor to first entry
fn to_last(&mut self) -> MdbResult<()>
Moves cursor to last entry
fn to_key<'k, K: ToMdbValue>(&mut self, key: &'k K) -> MdbResult<()>
Moves cursor to first entry for key if it exists
fn to_gte_key<'k, K: ToMdbValue>(&mut self, key: &'k K) -> MdbResult<()>
Moves cursor to first entry for key greater than or equal to ke
fn to_item<K, V>(&mut self, key: &K, value: &V) -> MdbResult<()> where
K: ToMdbValue,
V: ToMdbValue,
K: ToMdbValue,
V: ToMdbValue,
Moves cursor to specific item (for example, if cursor already points to a correct key and you need to delete a specific item through cursor)
fn to_gte_item<K, V>(&mut self, key: &K, value: &V) -> MdbResult<()> where
K: ToMdbValue,
V: ToMdbValue,
K: ToMdbValue,
V: ToMdbValue,
Moves cursor to nearest item.
fn to_next_key(&mut self) -> MdbResult<()>
Moves cursor to next key, i.e. skip items with duplicate keys
fn to_next_item(&mut self) -> MdbResult<()>
Moves cursor to next item with the same key as current
fn to_prev_key(&mut self) -> MdbResult<()>
Moves cursor to prev entry, i.e. skips items with duplicate keys
fn to_prev_item(&mut self) -> MdbResult<()>
Moves cursor to prev item with the same key as current
fn to_first_item(&mut self) -> MdbResult<()>
Moves cursor to first item with the same key as current
fn to_last_item(&mut self) -> MdbResult<()>
Moves cursor to last item with the same key as current
fn get<'a, T: FromMdbValue + 'a, U: FromMdbValue + 'a>(
&'a mut self
) -> MdbResult<(T, U)>
&'a mut self
) -> MdbResult<(T, U)>
Retrieves current key/value as tuple
fn get_value<'a, V: FromMdbValue + 'a>(&'a mut self) -> MdbResult<V>
Retrieves current value
fn get_key<'a, K: FromMdbValue + 'a>(&'a mut self) -> MdbResult<K>
Retrieves current key
fn set<K: ToMdbValue, V: ToMdbValue>(
&mut self,
key: &K,
value: &V,
flags: c_uint
) -> MdbResult<()>
&mut self,
key: &K,
value: &V,
flags: c_uint
) -> MdbResult<()>
fn replace<V: ToMdbValue>(&mut self, value: &V) -> MdbResult<()>
Overwrites value for current item Note: overwrites max cur_value.len() bytes
fn add_item<V: ToMdbValue>(&mut self, value: &V) -> MdbResult<()>
Adds a new item when created with allowed duplicates
fn del(&mut self) -> MdbResult<()>
Deletes current key
fn del_item(&mut self) -> MdbResult<()>
Deletes only current item
Note that it doesn't check anything so it is caller responsibility to make sure that correct item is deleted if, for example, caller wants to delete only items of current key
fn del_all(&mut self) -> MdbResult<()>
Deletes all items with same key as current
fn item_count(&self) -> MdbResult<size_t>
Returns count of items with the same key as current
fn get_item<'k, K: ToMdbValue>(
self,
k: &'k K
) -> CursorItemAccessor<'txn, 'k, K>
self,
k: &'k K
) -> CursorItemAccessor<'txn, 'k, K>