Struct ketos::name::NameMapSlice
[−]
[src]
pub struct NameMapSlice<T> { /* fields omitted */ }
Maps names to values in a sorted boxed slice.
Values may overwrite existing values, but new names cannot be inserted.
Methods
impl<T> NameMapSlice<T>
[src]
fn contains_key(&self, name: Name) -> bool
Returns whether the map contains a value for the given name.
fn index(&self, name: Name) -> Option<usize>
Returns the index within the internal Vec
of the given key.
fn get(&self, name: Name) -> Option<&T>
Returns the value corresponding to the given name.
fn values(&self) -> &[(Name, T)]
Returns a slice of the contained names and values.
fn set(&mut self, name: Name, value: T) -> Option<T>
Overwrites the value for the given name.
Returns None
if the name does not exist in the mapping.
When None
is returned, no value will have been stored in the mapping.
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 into_name_map(self) -> NameMap<T>
Elevates the map into NameMap
, which may receive new key-value pairs.
fn len(&self) -> usize
Returns the number of name-value pairs contained in the map.
Trait Implementations
impl<T: Clone> Clone for NameMapSlice<T>
[src]
fn clone(&self) -> NameMapSlice<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: Debug> Debug for NameMapSlice<T>
[src]
impl<T: Default> Default for NameMapSlice<T>
[src]
fn default() -> NameMapSlice<T>
Returns the "default value" for a type. Read more
impl<T: Eq> Eq for NameMapSlice<T>
[src]
impl<T: PartialEq> PartialEq for NameMapSlice<T>
[src]
fn eq(&self, __arg_0: &NameMapSlice<T>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &NameMapSlice<T>) -> bool
This method tests for !=
.
impl<T> FromIterator<(Name, T)> for NameMapSlice<T>
[src]
fn from_iter<I>(iterator: I) -> Self where I: IntoIterator<Item=(Name, T)>
Creates a value from an iterator. Read more