pub struct VacantEntry<'map, Key, Value, State = RandomState> { /* private fields */ }
Expand description

A view into a vacant entry in the multimap.

Implementations

Examples
use ordered_multimap::ListOrderedMultimap;
use ordered_multimap::list_ordered_multimap::Entry;

let mut map = ListOrderedMultimap::new();

let mut entry = match map.entry("key") {
    Entry::Vacant(entry) => entry,
    _ => panic!("expected vacant entry")
};

assert_eq!(entry.insert("value"), &"value");
source

pub fn insert_entry(self, value: Value) -> OccupiedEntry<'map, Key, Value>

Examples
use ordered_multimap::ListOrderedMultimap;
use ordered_multimap::list_ordered_multimap::Entry;

let mut map = ListOrderedMultimap::new();

let mut entry = match map.entry("key") {
    Entry::Vacant(entry) => entry,
    _ => panic!("expected vacant entry")
};

let mut entry = entry.insert_entry("value");
assert_eq!(entry.get(), &"value");
Examples
use ordered_multimap::ListOrderedMultimap;
use ordered_multimap::list_ordered_multimap::Entry;

let mut map: ListOrderedMultimap<&str, &str> = ListOrderedMultimap::new();

let mut entry = match map.entry("key") {
    Entry::Vacant(entry) => entry,
    _ => panic!("expected vacant entry")
};

assert_eq!(entry.into_key(), "key");
Examples
use ordered_multimap::ListOrderedMultimap;
use ordered_multimap::list_ordered_multimap::Entry;

let mut map: ListOrderedMultimap<&str, &str> = ListOrderedMultimap::new();

let mut entry = match map.entry("key") {
    Entry::Vacant(entry) => entry,
    _ => panic!("expected vacant entry")
};

assert_eq!(entry.key(), &"key");

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.