[−][src]Struct ketos::name::NameMapSlice
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]
fn clone(&self) -> NameMapSlice<T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Debug> Debug for NameMapSlice<T>
[src]
impl<T: Default> Default for NameMapSlice<T>
[src]
fn default() -> 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?
fn into_iter(self) -> Iter<'a, (Name, T)>
[src]
impl<T: PartialEq> PartialEq<NameMapSlice<T>> for NameMapSlice<T>
[src]
fn eq(&self, other: &NameMapSlice<T>) -> bool
[src]
fn ne(&self, other: &NameMapSlice<T>) -> bool
[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,
T: RefUnwindSafe,
impl<T> Send for NameMapSlice<T> where
T: Send,
T: Send,
impl<T> Sync for NameMapSlice<T> where
T: Sync,
T: Sync,
impl<T> Unpin for NameMapSlice<T>
impl<T> UnwindSafe for NameMapSlice<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,