Struct pstd::collections::btree_map::CursorMutKey
source · pub struct CursorMutKey<'a, K, V, A: Tuning> { /* private fields */ }
Expand description
Cursor that allows mutation of map keys, returned by CursorMut::with_mutable_key
.
Implementations§
source§impl<'a, K, V, A: Tuning> CursorMutKey<'a, K, V, A>
impl<'a, K, V, A: Tuning> CursorMutKey<'a, K, V, A>
sourcepub fn insert_before(
&mut self,
key: K,
value: V
) -> Result<(), UnorderedKeyError>where
K: Ord,
pub fn insert_before(
&mut self,
key: K,
value: V
) -> Result<(), UnorderedKeyError>where
K: Ord,
Insert leaving cursor after newly inserted element.
sourcepub fn insert_after(
&mut self,
key: K,
value: V
) -> Result<(), UnorderedKeyError>where
K: Ord,
pub fn insert_after(
&mut self,
key: K,
value: V
) -> Result<(), UnorderedKeyError>where
K: Ord,
Insert leaving cursor before newly inserted element.
sourcepub fn insert_before_unchecked(&mut self, key: K, value: V)
pub fn insert_before_unchecked(&mut self, key: K, value: V)
Insert leaving cursor after newly inserted element.
sourcepub fn insert_after_unchecked(&mut self, key: K, value: V)
pub fn insert_after_unchecked(&mut self, key: K, value: V)
Insert leaving cursor before newly inserted element.
sourcepub fn remove_prev(&mut self) -> Option<(K, V)>
pub fn remove_prev(&mut self) -> Option<(K, V)>
Remove previous element.
sourcepub fn remove_next(&mut self) -> Option<(K, V)>
pub fn remove_next(&mut self) -> Option<(K, V)>
Remove next element.
sourcepub fn next(&mut self) -> Option<(&mut K, &mut V)>
pub fn next(&mut self) -> Option<(&mut K, &mut V)>
Advance the cursor, returns references to the key and value of the element that it moved over.
sourcepub fn prev(&mut self) -> Option<(&mut K, &mut V)>
pub fn prev(&mut self) -> Option<(&mut K, &mut V)>
Move the cursor back, returns references to the key and value of the element that it moved over.
sourcepub fn peek_next(&self) -> Option<(&mut K, &mut V)>
pub fn peek_next(&self) -> Option<(&mut K, &mut V)>
Returns mutable references to the next key/value pair.
Trait Implementations§
impl<'a, K, V, A: Tuning> Send for CursorMutKey<'a, K, V, A>
impl<'a, K, V, A: Tuning> Sync for CursorMutKey<'a, K, V, A>
Auto Trait Implementations§
impl<'a, K, V, A> Freeze for CursorMutKey<'a, K, V, A>
impl<'a, K, V, A> RefUnwindSafe for CursorMutKey<'a, K, V, A>
impl<'a, K, V, A> Unpin for CursorMutKey<'a, K, V, A>
impl<'a, K, V, A> !UnwindSafe for CursorMutKey<'a, K, V, A>
Blanket Implementations§
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