[][src]Struct ketos::name::NameMapSlice

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]

pub fn contains_key(&self, name: Name) -> bool[src]

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

pub fn index(&self, name: Name) -> Option<usize>[src]

Returns the index within the internal Vec of the given key.

pub fn get(&self, name: Name) -> Option<&T>[src]

Returns the value corresponding to the given name.

pub fn values(&self) -> &[(Name, T)][src]

Returns a slice of the contained names and values.

pub fn set(&mut self, name: Name, value: T) -> Option<T>[src]

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.

pub fn is_empty(&self) -> bool[src]

Returns whether the given map is empty.

pub fn iter(&self) -> Iter<(Name, T)>[src]

Returns an iterator over names and values.

pub fn into_name_map(self) -> NameMap<T>[src]

Elevates the map into NameMap, which may receive new key-value pairs.

pub fn len(&self) -> usize[src]

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

Trait Implementations

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

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

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

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

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

impl<'a, T> IntoIterator for &'a NameMapSlice<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?

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

impl<T> StructuralEq for NameMapSlice<T>[src]

impl<T> StructuralPartialEq for NameMapSlice<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for NameMapSlice<T> where
    T: RefUnwindSafe

impl<T> Send for NameMapSlice<T> where
    T: Send

impl<T> Sync for NameMapSlice<T> where
    T: Sync

impl<T> Unpin for NameMapSlice<T>

impl<T> UnwindSafe for NameMapSlice<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,