pub struct Cursor<'a, K, V>where
K: 'a,
V: 'a,{ /* private fields */ }
btree_cursors #107540)
A cursor over a BTreeMap.
A Cursor is like an iterator, except that it can freely seek back-and-forth.
Cursors always point to a gap between two elements in the map, and can operate on the two immediately adjacent elements.
A Cursor is created with the BTreeMap::lower_bound and BTreeMap::upper_bound methods.
impl<'a, K, V> Cursor<'a, K, V>
pub fn next(&mut self) -> Option<(&'a K, &'a V)>
btree_cursors #107540)
Advances the cursor to the next gap, returning the key and value of the element that it moved over.
If the cursor is already at the end of the map then None is returned and the cursor is not moved.
pub fn prev(&mut self) -> Option<(&'a K, &'a V)>
btree_cursors #107540)
Advances the cursor to the previous gap, returning the key and value of the element that it moved over.
If the cursor is already at the start of the map then None is returned and the cursor is not moved.
pub fn peek_next(&self) -> Option<(&'a K, &'a V)>
btree_cursors #107540)
Returns a reference to the key and value of the next element without moving the cursor.
If the cursor is at the end of the map then None is returned.
pub fn peek_prev(&self) -> Option<(&'a K, &'a V)>
btree_cursors #107540)
Returns a reference to the key and value of the previous element without moving the cursor.
If the cursor is at the start of the map then None is returned.
impl<K, V> Clone for Cursor<'_, K, V>
fn clone(&self) -> Cursor<'_, K, V>
fn clone_from(&mut self, source: &Self)
source. Read more
impl<K, V> Debug for Cursor<'_, K, V>where
K: Debug,
V: Debug,impl<'a, K, V> Freeze for Cursor<'a, K, V>
impl<'a, K, V> RefUnwindSafe for Cursor<'a, K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,impl<'a, K, V> Send for Cursor<'a, K, V>where
K: Sync,
V: Sync,impl<'a, K, V> Sync for Cursor<'a, K, V>where
K: Sync,
V: Sync,impl<'a, K, V> Unpin for Cursor<'a, K, V>
impl<'a, K, V> UnwindSafe for Cursor<'a, K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,impl<T> Any for Twhere
T: 'static + ?Sized,impl<T> Borrow<T> for Twhere
T: ?Sized,impl<T> BorrowMut<T> for Twhere
T: ?Sized,impl<T> CloneToUninit for Twhere
T: Clone,unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit #126799)
impl<T> From<T> for T
fn from(t: T) -> T
Returns the argument unchanged.
impl<T, U> Into<U> for Twhere
U: From<T>,fn into(self) -> U
Calls U::from(self).
That is, this conversion is whatever the implementation of From<T> for U chooses to do.
impl<T> ToOwned for Twhere
T: Clone,type Owned = T
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)
impl<T, U> TryFrom<U> for Twhere
U: Into<T>,type Error = Infallible
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto<U> for Twhere
U: TryFrom<T>,
© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/std/collections/btree_map/struct.Cursor.html