pub struct Object(pub IndexMap<String, ValueContainer>);Tuple Fields§
§0: IndexMap<String, ValueContainer>Implementations§
Source§impl Object
impl Object
pub fn new() -> Self
pub fn size(&self) -> usize
pub fn get(&self, key: &str) -> &ValueContainer
pub fn try_get(&self, key: &str) -> Option<&ValueContainer>
pub fn get_or_insert_with<F>(
&mut self,
key: &str,
default: F,
) -> &mut ValueContainerwhere
F: FnOnce() -> ValueContainer,
pub fn get_mut(&mut self, key: &str) -> Option<&mut ValueContainer>
pub fn contains_key(&self, key: &str) -> bool
pub fn keys(&self) -> impl Iterator<Item = &String>
pub fn values(&self) -> impl Iterator<Item = &ValueContainer>
pub fn iter(&self) -> impl Iterator<Item = (&String, &ValueContainer)>
pub fn iter_mut( &mut self, ) -> impl Iterator<Item = (&String, &mut ValueContainer)>
pub fn clear(&mut self)
pub fn is_empty(&self) -> bool
pub fn set<T: Into<ValueContainer>>(&mut self, key: &str, value: T)
pub fn remove(&mut self, key: &str) -> Option<ValueContainer>
Trait Implementations§
Source§impl From<IndexMap<ValueContainer, ValueContainer>> for Object
impl From<IndexMap<ValueContainer, ValueContainer>> for Object
Source§fn from(map: IndexMap<ValueContainer, ValueContainer>) -> Self
fn from(map: IndexMap<ValueContainer, ValueContainer>) -> Self
Converts to this type from the input type.
Source§impl<T> FromIterator<(String, T)> for Objectwhere
T: Into<ValueContainer>,
impl<T> FromIterator<(String, T)> for Objectwhere
T: Into<ValueContainer>,
Source§impl<'a> IntoIterator for &'a Object
impl<'a> IntoIterator for &'a Object
Source§impl IntoIterator for Object
impl IntoIterator for Object
Source§impl StructuralEq for Object
impl StructuralEq for Object
Source§fn structural_eq(&self, other: &Self) -> bool
fn structural_eq(&self, other: &Self) -> bool
Check if two values are equal, ignoring the type.
impl CoreValueTrait for Object
impl Eq for Object
impl StructuralPartialEq for Object
Auto Trait Implementations§
impl Freeze for Object
impl !RefUnwindSafe for Object
impl !Send for Object
impl !Sync for Object
impl Unpin for Object
impl !UnwindSafe for Object
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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 more