pub struct Cursor<'a, K>where
K: 'a,{ /* private fields */ }btree_cursors)Expand description
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.
Implementations§
Source§impl<'a, K> Cursor<'a, K>
impl<'a, K> Cursor<'a, K>
Sourcepub fn next(&mut self) -> Option<&'a K>
🔬This is a nightly-only experimental API. (btree_cursors)
pub fn next(&mut self) -> Option<&'a K>
btree_cursors)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.
Sourcepub fn prev(&mut self) -> Option<&'a K>
🔬This is a nightly-only experimental API. (btree_cursors)
pub fn prev(&mut self) -> Option<&'a K>
btree_cursors)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.
Trait Implementations§
Auto Trait Implementations§
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,
Blanket Implementations§
Source§impl<S> AssignWithType for S
impl<S> AssignWithType for S
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneDyn for Twhere
T: Clone,
impl<T> CloneDyn for Twhere
T: Clone,
fn __clone_dyn(&self, _: DontCallMe) -> *mut ()
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<C, E> EntryToVal<C> for Ewhere
C: Collection<Entry = E>,
impl<C, E> EntryToVal<C> for Ewhere
C: Collection<Entry = E>,
Source§type Val = <C as Collection>::Val
type Val = <C as Collection>::Val
Entry in complex collections.
For example, in a HashMap, while Entry might be a ( key, value ) tuple, Val might only be the value part.Source§fn entry_to_val(self) -> <E as EntryToVal<C>>::Val
fn entry_to_val(self) -> <E as EntryToVal<C>>::Val
Source§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
type Err = Infallible
fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>
Source§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
type Err = Infallible
fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<Initial, Error, Final> TransitiveTryFrom<Error, Initial> for Final
impl<Initial, Error, Final> TransitiveTryFrom<Error, Initial> for Final
Source§impl<Error, Final, Initial> TransitiveTryInto<Error, Final> for Initial
impl<Error, Final, Initial> TransitiveTryInto<Error, Final> for Initial
Source§impl<C, Val> ValToEntry<C> for Valwhere
C: CollectionValToEntry<Val>,
impl<C, Val> ValToEntry<C> for Valwhere
C: CollectionValToEntry<Val>,
Source§fn val_to_entry(self) -> <C as CollectionValToEntry<Val>>::Entry
fn val_to_entry(self) -> <C as CollectionValToEntry<Val>>::Entry
Invokes the val_to_entry function of the CollectionValToEntry trait to convert the value to an entry.