pub struct Cursor<'a, K>where
K: 'a,{ /* private fields */ }
btree_cursors #107540)
A cursor over a BTreeSet.
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 set, and can operate on the two immediately adjacent elements.
A Cursor is created with the BTreeSet::lower_bound and BTreeSet::upper_bound methods.
impl<'a, K> Cursor<'a, K>
pub fn next(&mut self) -> Option<&'a K>
btree_cursors #107540)
Advances the cursor to the next gap, returning the element that it moved over.
If the cursor is already at the end of the set then None is returned and the cursor is not moved.
pub fn prev(&mut self) -> Option<&'a K>
btree_cursors #107540)
Advances the cursor to the previous gap, returning the element that it moved over.
If the cursor is already at the start of the set then None is returned and the cursor is not moved.
pub fn peek_next(&self) -> Option<&'a K>
btree_cursors #107540)
Returns a reference to next element without moving the cursor.
If the cursor is at the end of the set then None is returned
pub fn peek_prev(&self) -> Option<&'a K>
btree_cursors #107540)
Returns a reference to the previous element without moving the cursor.
If the cursor is at the start of the set then None is returned.
impl<'a, K> Clone for Cursor<'a, K>where
K: Clone + 'a,fn clone(&self) -> Cursor<'a, K>
fn clone_from(&mut self, source: &Self)
source. Read more
impl<K> Debug for Cursor<'_, K>where
K: Debug,impl<'a, K> Freeze for Cursor<'a, K>
impl<'a, K> RefUnwindSafe for Cursor<'a, K>where
K: RefUnwindSafe,impl<'a, K> Send for Cursor<'a, K>where
K: Sync,impl<'a, K> Sync for Cursor<'a, K>where
K: Sync,impl<'a, K> Unpin for Cursor<'a, K>
impl<'a, K> UnwindSafe for Cursor<'a, K>where
K: 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_set/struct.Cursor.html