Struct gluon_base::scoped_map::ScopedMap [] [src]

pub struct ScopedMap<K: Eq + Hash + Clone, V> {
    // some fields omitted
}

A map struct which allows for the introduction of different scopes Introducing a new scope will make it possible to introduce additional variables with names already defined, shadowing the old name After exiting a scope the shadowed variable will again be re introduced

Methods

impl<K: Eq + Hash + Clone, V> ScopedMap<K, V>
[src]

fn new() -> ScopedMap<K, V>

fn enter_scope(&mut self)

Introduces a new scope

fn exit_scope(&mut self)

Exits the current scope, removing anything inserted since the matching enter_scope call

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

Removes a previusly inserted value from the map.

fn in_current_scope(&self, k: &K) -> bool

Returns true if the key has a value declared in the last declared scope

fn iter_mut(&mut self) -> IterMut<K, Vec<V>>

Returns an iterator of the (key, values) pairs inserted in the map

fn get<'a>(&'a self, k: &K) -> Option<&'a V>

Returns a reference to the last inserted value corresponding to the key

fn get_all<'a>(&'a self, k: &K) -> Option<&'a [V]>

Returns a reference to the all inserted value corresponding to the key

fn len(&self) -> usize

Returns the number of elements in the container. Shadowed elements are not counted

fn is_empty(&self) -> bool

Returns true if this map is empty

fn clear(&mut self)

Removes all elements

fn swap(&mut self, k: K, v: V) -> Option<V>

Swaps the value stored at key, or inserts it if it is not present

fn pop(&mut self, k: &K) -> Option<V>

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

fn insert(&mut self, k: K, v: V) -> bool

fn iter(&self) -> Iter<K, V>

Trait Implementations

impl<K: Debug + Eq + Hash + Clone, V: Debug> Debug for ScopedMap<K, V>
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.