Enum trie::map::Entry [] [src]

pub enum Entry<'a, T: 'a> {
    Occupied(OccupiedEntry<'a, T>),
    Vacant(VacantEntry<'a, T>),
}

A view into a single entry in a map, which may be vacant or occupied.

Variants

Occupied

An occupied entry.

Vacant

A vacant entry.

Methods

impl<'a, T> Entry<'a, T>

fn or_insert(self, default: T) -> &'a mut T

Ensures a value is in the entry by inserting the default if empty, and returns a mutable reference to the value in the entry.

fn or_insert_with<F: FnOnce() -> T>(self, default: F) -> &'a mut T

Ensures a value is in the entry by inserting the result of the default function if empty, and returns a mutable reference to the value in the entry.