[][src]Trait rs_graph::collections::ItemMap

pub trait ItemMap<K, V> where
    K: Copy
{ fn len(&self) -> usize;
fn clear(&mut self);
fn insert(&mut self, key: K, value: V) -> bool;
fn insert_or_replace(&mut self, key: K, value: V) -> bool;
fn remove(&mut self, key: K) -> bool;
fn get(&self, key: K) -> Option<&V>;
fn get_mut(&mut self, key: K) -> Option<&mut V>;
fn contains(&self, key: K) -> bool; fn is_empty(&self) -> bool { ... } }

A (finite) map of items (node or edges) of a graph to some value.

Required methods

fn len(&self) -> usize

Return the number of items in this map.

fn clear(&mut self)

Remove all items from the map.

fn insert(&mut self, key: K, value: V) -> bool

Add one item to the map.

Return true iff u had not been contained in this map before. In this case the value is not updated.

fn insert_or_replace(&mut self, key: K, value: V) -> bool

Add one item to the map.

Return true iff key had not been contained in this map before. In this case the value is updated.

fn remove(&mut self, key: K) -> bool

Remove one item from the map.

Returns true if the item had been contained in the map, otherwise false.

fn get(&self, key: K) -> Option<&V>

Return a read-only reference to the element with the given key.

fn get_mut(&mut self, key: K) -> Option<&mut V>

Return a mutable reference to the element with the given key.

fn contains(&self, key: K) -> bool

Return true iff item u is contained in this map.

Loading content...

Provided methods

fn is_empty(&self) -> bool

Return true if this map is empty.

Loading content...

Implementations on Foreign Types

impl<'a, K, V, S> ItemMap<K, V> for &'a mut S where
    K: Copy,
    S: ItemMap<K, V>, 
[src]

impl<K, V, S> ItemMap<K, V> for HashMap<K, V, S> where
    K: Copy + Eq + Hash,
    S: BuildHasher
[src]

Loading content...

Implementors

impl<'a, I, V> ItemMap<<I as Indexer>::Idx, V> for ItemVecMap<'a, I, V> where
    I: Indexer,
    I::Idx: Copy
[src]

Loading content...