Struct wasmer_compiler::lib::std::collections::btree_map::Cursor
source · pub struct Cursor<'a, K, V>where
K: 'a,
V: 'a,{
current: Option<Handle<NodeRef<Immut<'a>, K, V, Leaf>, Edge>>,
root: Option<&'a NodeRef<Owned, K, V, LeafOrInternal>>,
}
🔬This is a nightly-only experimental API. (
btree_cursors
)Expand description
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.
Fields§
§current: Option<Handle<NodeRef<Immut<'a>, K, V, Leaf>, Edge>>
🔬This is a nightly-only experimental API. (
§btree_cursors
)root: Option<&'a NodeRef<Owned, K, V, LeafOrInternal>>
🔬This is a nightly-only experimental API. (
btree_cursors
)Implementations§
source§impl<'a, K, V> Cursor<'a, K, V>
impl<'a, K, V> Cursor<'a, K, V>
sourcepub fn next(&mut self) -> Option<(&'a K, &'a V)>
🔬This is a nightly-only experimental API. (btree_cursors
)
pub fn next(&mut self) -> Option<(&'a K, &'a V)>
btree_cursors
)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.
sourcepub fn prev(&mut self) -> Option<(&'a K, &'a V)>
🔬This is a nightly-only experimental API. (btree_cursors
)
pub fn prev(&mut self) -> Option<(&'a K, &'a V)>
btree_cursors
)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.
Trait Implementations§
Auto Trait Implementations§
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>
impl<'a, K, V> Sync for Cursor<'a, K, V>
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,
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
§impl<T> Pointee for T
impl<T> Pointee for T
source§impl<T> Upcastable for T
impl<T> Upcastable for T
source§fn upcast_any_ref(&self) -> &(dyn Any + 'static)
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
upcast ref
source§fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
upcast mut ref