Trait eclectic::map::OccupiedEntry [] [src]

pub trait OccupiedEntry<'a>: Sized {
    type Map: ?Sized + EntryMap<'a, OccupiedEntry=Self>;
    fn get(&self) -> &Self::Map::Value;
    fn get_mut(&mut self) -> &mut Self::Map::Value;
    fn into_mut(self) -> &'a mut Self::Map::Value;
    fn remove(self) -> Self::Map::Value;

    fn insert(&mut self, value: Self::Map::Value) -> Self::Map::Value { ... }
}

An occupied map entry.

'a is the lifetime of the map.

Associated Types

type Map: ?Sized + EntryMap<'a, OccupiedEntry=Self>

The entry's map type.

Required Methods

fn get(&self) -> &Self::Map::Value

Returns a reference to the entry's value.

fn get_mut(&mut self) -> &mut Self::Map::Value

Returns a mutable reference to the entry's value.

fn into_mut(self) -> &'a mut Self::Map::Value

Returns a mutable reference to the entry's value with the same lifetime as the map.

fn remove(self) -> Self::Map::Value

Removes the entry from the map and returns its value.

Provided Methods

fn insert(&mut self, value: Self::Map::Value) -> Self::Map::Value

Replaces the entry's value with the given one and returns the old value.

Implementors