Struct ketos::name::NameMap [] [src]

pub struct NameMap<T> {
    // some fields omitted
}

Maps names to values in a sorted Vec

Methods

impl<T> NameMap<T>
[src]

fn new() -> NameMap<T>

Returns a new NameMap.

fn into_slice(self) -> NameMapSlice<T>

Lowers the map into a NameMapSlice, which may not receive new key-value pairs, but can overwrite existing values.

fn clear(&mut self)

Removes all values from the map.

fn contains_key(&self, name: Name) -> bool

Returns whether the map contains a value for the given name.

fn get(&self, name: Name) -> Option<&T>

Returns the value corresponding to the given name.

fn get_values(&self) -> &[(Name, T)]

Returns a slice of the contained names and values.

fn is_empty(&self) -> bool

Returns whether the given map is empty.

fn iter(&self) -> Iter<(Name, T)>

Returns an iterator over names and values.

fn insert(&mut self, name: Name, value: T) -> Option<T>

Insert a name-value pair into the map. If a value was already present for the name, it is returned.

fn len(&self) -> usize

Returns the number of name-value pairs contained in the map.

Trait Implementations

impl<T: PartialEq> PartialEq for NameMap<T>
[src]

fn eq(&self, __arg_0: &NameMap<T>) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &NameMap<T>) -> bool

This method tests for !=.

impl<T: Eq> Eq for NameMap<T>
[src]

impl<T: Default> Default for NameMap<T>
[src]

fn default() -> NameMap<T>

Returns the "default value" for a type. Read more

impl<T: Debug> Debug for NameMap<T>
[src]

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

Formats the value using the given formatter.

impl<T: Clone> Clone for NameMap<T>
[src]

fn clone(&self) -> NameMap<T>

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl<T> FromIterator<(Name, T)> for NameMap<T>
[src]

fn from_iter<I>(iterator: I) -> Self where I: IntoIterator<Item=(Name, T)>

Creates a value from an iterator. Read more

impl<'a, T> IntoIterator for &'a NameMap<T>
[src]

type Item = &'a (Name, T)

The type of the elements being iterated over.

type IntoIter = Iter<'a, (Name, T)>

Which kind of iterator are we turning this into?

fn into_iter(self) -> Iter<'a, (Name, T)>

Creates an iterator from a value. Read more