pub struct TokenValueMap { /* private fields */ }Expand description
A collection of named values indexed by string tokens.
TokenValueMap struct stores a mapping from string tokens to Value
instances, allowing efficient lookup of named parameters or attributes by
token.
Implementations§
Source§impl TokenValueMap
impl TokenValueMap
pub fn new() -> Self
pub fn with_capacity(capacity: usize) -> Self
pub fn insert<V: Into<Value>>(&mut self, token: impl Into<Ustr>, value: V)
pub fn get(&self, token: &Ustr) -> Option<&Value>
pub fn get_mut(&mut self, token: &Ustr) -> Option<&mut Value>
pub fn remove(&mut self, token: &Ustr) -> Option<Value>
pub fn contains(&self, token: &Ustr) -> bool
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn clear(&mut self)
pub fn iter(&self) -> impl Iterator<Item = (&Ustr, &Value)>
pub fn iter_mut(&mut self) -> impl Iterator<Item = (&Ustr, &mut Value)>
pub fn tokens(&self) -> impl Iterator<Item = &Ustr>
pub fn values(&self) -> impl Iterator<Item = &Value>
pub fn values_mut(&mut self) -> impl Iterator<Item = &mut Value>
pub fn extend<I>(&mut self, iter: I)
pub fn retain<F>(&mut self, f: F)
Trait Implementations§
Source§impl Clone for TokenValueMap
impl Clone for TokenValueMap
Source§fn clone(&self) -> TokenValueMap
fn clone(&self) -> TokenValueMap
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TokenValueMap
impl Debug for TokenValueMap
Source§impl Default for TokenValueMap
impl Default for TokenValueMap
Source§fn default() -> TokenValueMap
fn default() -> TokenValueMap
Returns the “default value” for a type. Read more
Source§impl FromIterator<(Ustr, Value)> for TokenValueMap
impl FromIterator<(Ustr, Value)> for TokenValueMap
Source§impl Hash for TokenValueMap
impl Hash for TokenValueMap
Source§impl PartialEq for TokenValueMap
impl PartialEq for TokenValueMap
impl Eq for TokenValueMap
impl StructuralPartialEq for TokenValueMap
Auto Trait Implementations§
impl Freeze for TokenValueMap
impl RefUnwindSafe for TokenValueMap
impl Send for TokenValueMap
impl Sync for TokenValueMap
impl Unpin for TokenValueMap
impl UnwindSafe for TokenValueMap
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.