[][src]Struct ordered_multimap::list_ordered_multimap::VacantEntry

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

A view into a vacant entry in the multimap.

Methods

impl<'map, Key, Value, State> VacantEntry<'map, Key, Value, State> where
    Key: Eq + Hash,
    State: BuildHasher
[src]

pub fn insert(self, value: Value) -> &'map mut Value[src]

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");

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

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");

pub fn into_key(self) -> Key[src]

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");

pub fn key(&self) -> &Key[src]

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

impl<'_, Key, Value, State> Debug for VacantEntry<'_, Key, Value, State> where
    Key: Debug
[src]

Auto Trait Implementations

impl<'map, Key, Value, State> RefUnwindSafe for VacantEntry<'map, Key, Value, State> where
    Key: RefUnwindSafe,
    State: RefUnwindSafe,
    Value: RefUnwindSafe

impl<'map, Key, Value, State> Send for VacantEntry<'map, Key, Value, State> where
    Key: Send,
    State: Sync,
    Value: Send

impl<'map, Key, Value, State> Sync for VacantEntry<'map, Key, Value, State> where
    Key: Sync,
    State: Sync,
    Value: Sync

impl<'map, Key, Value, State> Unpin for VacantEntry<'map, Key, Value, State> where
    Key: Unpin

impl<'map, Key, Value, State = RandomState> !UnwindSafe for VacantEntry<'map, Key, Value, State>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,