Struct ord_lmdb_rs::core::Cursor
source · [−]pub struct Cursor<'txn> { /* private fields */ }
Implementations
sourceimpl<'txn> Cursor<'txn>
impl<'txn> Cursor<'txn>
sourcepub fn to_key<'k, K: ToMdbValue>(&mut self, key: &'k K) -> MdbResult<()>
pub fn to_key<'k, K: ToMdbValue>(&mut self, key: &'k K) -> MdbResult<()>
Moves cursor to first entry for key if it exists
sourcepub fn to_gte_key<'k, K: ToMdbValue>(&mut self, key: &'k K) -> MdbResult<()>
pub 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
sourcepub fn to_item<K, V>(&mut self, key: &K, value: &V) -> MdbResult<()> where
K: ToMdbValue,
V: ToMdbValue,
pub fn to_item<K, V>(&mut self, key: &K, value: &V) -> MdbResult<()> where
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)
sourcepub fn to_gte_item<K, V>(&mut self, key: &K, value: &V) -> MdbResult<()> where
K: ToMdbValue,
V: ToMdbValue,
pub fn to_gte_item<K, V>(&mut self, key: &K, value: &V) -> MdbResult<()> where
K: ToMdbValue,
V: ToMdbValue,
Moves cursor to nearest item.
sourcepub fn to_next_key(&mut self) -> MdbResult<()>
pub fn to_next_key(&mut self) -> MdbResult<()>
Moves cursor to next key, i.e. skip items with duplicate keys
sourcepub fn to_next_item(&mut self) -> MdbResult<()>
pub fn to_next_item(&mut self) -> MdbResult<()>
Moves cursor to next item with the same key as current
sourcepub fn to_prev_key(&mut self) -> MdbResult<()>
pub fn to_prev_key(&mut self) -> MdbResult<()>
Moves cursor to prev entry, i.e. skips items with duplicate keys
sourcepub fn to_prev_item(&mut self) -> MdbResult<()>
pub fn to_prev_item(&mut self) -> MdbResult<()>
Moves cursor to prev item with the same key as current
sourcepub fn to_first_item(&mut self) -> MdbResult<()>
pub fn to_first_item(&mut self) -> MdbResult<()>
Moves cursor to first item with the same key as current
sourcepub fn to_last_item(&mut self) -> MdbResult<()>
pub fn to_last_item(&mut self) -> MdbResult<()>
Moves cursor to last item with the same key as current
sourcepub fn get<'a, T: FromMdbValue + 'a, U: FromMdbValue + 'a>(
&'a mut self
) -> MdbResult<(T, U)>
pub fn get<'a, T: FromMdbValue + 'a, U: FromMdbValue + 'a>(
&'a mut self
) -> MdbResult<(T, U)>
Retrieves current key/value as tuple
sourcepub fn get_value<'a, V: FromMdbValue + 'a>(&'a mut self) -> MdbResult<V>
pub fn get_value<'a, V: FromMdbValue + 'a>(&'a mut self) -> MdbResult<V>
Retrieves current value
sourcepub fn get_key<'a, K: FromMdbValue + 'a>(&'a mut self) -> MdbResult<K>
pub fn get_key<'a, K: FromMdbValue + 'a>(&'a mut self) -> MdbResult<K>
Retrieves current key
pub fn set<K: ToMdbValue, V: ToMdbValue>(
&mut self,
key: &K,
value: &V,
flags: c_uint
) -> MdbResult<()>
sourcepub fn replace<V: ToMdbValue>(&mut self, value: &V) -> MdbResult<()>
pub fn replace<V: ToMdbValue>(&mut self, value: &V) -> MdbResult<()>
Overwrites value for current item Note: overwrites max cur_value.len() bytes
sourcepub fn add_item<V: ToMdbValue>(&mut self, value: &V) -> MdbResult<()>
pub fn add_item<V: ToMdbValue>(&mut self, value: &V) -> MdbResult<()>
Adds a new item when created with allowed duplicates
sourcepub fn del_item(&mut self) -> MdbResult<()>
pub 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
sourcepub fn item_count(&self) -> MdbResult<size_t>
pub fn item_count(&self) -> MdbResult<size_t>
Returns count of items with the same key as current
pub fn get_item<'k, K: ToMdbValue>(
self,
k: &'k K
) -> CursorItemAccessor<'txn, 'k, K>
Trait Implementations
Auto Trait Implementations
impl<'txn> RefUnwindSafe for Cursor<'txn>
impl<'txn> !Send for Cursor<'txn>
impl<'txn> !Sync for Cursor<'txn>
impl<'txn> Unpin for Cursor<'txn>
impl<'txn> UnwindSafe for Cursor<'txn>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more