Trait differential_dataflow::collection::lookup::Lookup [] [src]

pub trait Lookup<K: Eq, V> {
    fn get_ref<'a>(&'a self, &K) -> Option<&'a V>;
    fn get_mut<'a>(&'a mut self, &K) -> Option<&'a mut V>;
    fn entry_or_insert<F: FnOnce() -> V>(&mut self, K, F) -> &mut V;
    fn remove_key(&mut self, &K) -> Option<V>;
}

A map from K to V.

Required Methods

fn get_ref<'a>(&'a self, &K) -> Option<&'a V>

Recovers a reference to the value associated with a key.

fn get_mut<'a>(&'a mut self, &K) -> Option<&'a mut V>

Recovers a mutable referecne to the value associated with a key.

fn entry_or_insert<F: FnOnce() -> V>(&mut self, K, F) -> &mut V

Recovers a mutable reference, inserting a new value if absent.

fn remove_key(&mut self, &K) -> Option<V>

Removes the key and returns its value if it exists.

Implementors