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>

source

pub fn insert_before( &mut self, key: K, value: V ) -> Result<(), UnorderedKeyError>
where K: Ord,

Insert leaving cursor after newly inserted element.

source

pub fn insert_after( &mut self, key: K, value: V ) -> Result<(), UnorderedKeyError>
where K: Ord,

Insert leaving cursor before newly inserted element.

source

pub fn insert_before_unchecked(&mut self, key: K, value: V)

Insert leaving cursor after newly inserted element.

source

pub fn insert_after_unchecked(&mut self, key: K, value: V)

Insert leaving cursor before newly inserted element.

source

pub fn remove_prev(&mut self) -> Option<(K, V)>

Remove previous element.

source

pub fn remove_next(&mut self) -> Option<(K, V)>

Remove next element.

source

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.

source

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.

source

pub fn peek_next(&self) -> Option<(&mut K, &mut V)>

Returns mutable references to the next key/value pair.

source

pub fn peek_prev(&self) -> Option<(&mut K, &mut V)>

Returns mutable references to the previous key/value pair.

source

pub fn as_cursor(&self) -> Cursor<'a, K, V, A>

Returns a read-only cursor pointing to the same location as the CursorMutKey.

Trait Implementations§

source§

impl<'a, K, V, A: Tuning> Send for CursorMutKey<'a, K, V, A>

source§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.