Skip to main content

Dict

Type Alias Dict 

Source
pub type Dict<T> = Vec<DictEntry<T>>;

Aliased Type§

pub struct Dict<T> { /* private fields */ }

Trait Implementations§

Source§

impl<T> DictIface<T> for Dict<T>

Source§

fn add(&mut self, key: String, val: T) -> bool

Add an element val of type T, indexed by the string key. Returns false if the key exists or there is a hash collision

Source§

fn remove_key(&mut self, key: &str) -> Option<T>

Remove the element identified by the key key and return it, if exists.

Source§

fn get(&self, key: &str) -> Option<&T>

Return a reference to the value identified by the key key, if exists.

Source§

fn contains_key(&self, key: &str) -> bool

Return true if an element identified by the key key exists.