Struct collections::btree_map::OccupiedEntry [] [src]

pub struct OccupiedEntry<'a, K: 'a, V: 'a> {
    handle: Handle<NodeRef<Mut<'a>, K, V, LeafOrInternal>, KV>,
    length: &'a mut usize,
    _marker: PhantomData<&'a mut (K, V)>,
}

An occupied Entry.

Fields

handle
length
_marker

Methods

impl<'a, K: Ord, V> OccupiedEntry<'a, K, V>

fn get(&self) -> &V

Gets a reference to the value in the entry.

fn get_mut(&mut self) -> &mut V

Gets a mutable reference to the value in the entry.

fn into_mut(self) -> &'a mut V

Converts the entry into a mutable reference to its value.

fn insert(&mut self, value: V) -> V

Sets the value of the entry with the OccupiedEntry's key, and returns the entry's old value.

fn remove(self) -> V

Takes the value of the entry out of the map, and returns it.

fn remove_kv(self) -> (K, V)

Unstable (collections #27783)

: library is unlikely to be stabilized with the current layout and name, use std::collections instead