Trait value_trait::Object [−][src]
A JSON Object
Associated Types
Loading content...Required methods
#[must_use]fn get<Q: ?Sized>(&self, k: &Q) -> Option<&Self::Element> where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord,
[src]
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord,
Gets a ref to a value based on a key, returns None
if the
current Value isn't an Object or doesn't contain the key
it was asked for.
#[must_use]fn get_mut<Q: ?Sized>(&mut self, k: &Q) -> Option<&mut Self::Element> where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord,
[src]
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord,
Gets the value of a key as a mutable reference.
#[must_use]fn insert<K, V>(&mut self, k: K, v: V) -> Option<Self::Element> where
K: Into<Self::Key>,
V: Into<Self::Element>,
Self::Key: Hash + Eq,
[src]
K: Into<Self::Key>,
V: Into<Self::Element>,
Self::Key: Hash + Eq,
Inserts a value
#[must_use]fn remove<Q: ?Sized>(&mut self, k: &Q) -> Option<Self::Element> where
Self::Key: Borrow<Q>,
Q: Hash + Eq + Ord,
[src]
Self::Key: Borrow<Q>,
Q: Hash + Eq + Ord,
Removes a value from the object
#[must_use]fn iter<'i>(
&'i self
) -> Box<dyn Iterator<Item = (&Self::Key, &Self::Element)> + 'i>
[src]
&'i self
) -> Box<dyn Iterator<Item = (&Self::Key, &Self::Element)> + 'i>
Iterates over the key value paris
#[must_use]fn keys<'i>(&'i self) -> Box<dyn Iterator<Item = &Self::Key> + 'i>
[src]
Iterates over the keys
#[must_use]fn values<'i>(&'i self) -> Box<dyn Iterator<Item = &Self::Element> + 'i>
[src]
Iterates over the values
#[must_use]fn len(&self) -> usize
[src]
Number of key/value pairs
Provided methods
Loading content...Implementations on Foreign Types
impl<MapK, MapE> Object for Halfbrown<MapK, MapE> where
MapK: Hash + Eq,
[src]
MapK: Hash + Eq,
type Key = MapK
type Element = MapE
fn get<Q: ?Sized>(&self, k: &Q) -> Option<&Self::Element> where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord,
[src]
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord,
fn get_mut<Q: ?Sized>(&mut self, k: &Q) -> Option<&mut Self::Element> where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord,
[src]
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord,
fn insert<K, V>(&mut self, k: K, v: V) -> Option<Self::Element> where
K: Into<Self::Key>,
V: Into<Self::Element>,
Self::Key: Hash + Eq,
[src]
K: Into<Self::Key>,
V: Into<Self::Element>,
Self::Key: Hash + Eq,
fn remove<Q: ?Sized>(&mut self, k: &Q) -> Option<Self::Element> where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord,
[src]
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord,
fn iter<'i>(
&'i self
) -> Box<dyn Iterator<Item = (&Self::Key, &Self::Element)> + 'i>
[src]
&'i self
) -> Box<dyn Iterator<Item = (&Self::Key, &Self::Element)> + 'i>
fn keys<'i>(&'i self) -> Box<dyn Iterator<Item = &Self::Key> + 'i>
[src]
fn values<'i>(&'i self) -> Box<dyn Iterator<Item = &Self::Element> + 'i>
[src]
fn len(&self) -> usize
[src]
impl<MapK, MapE, S: BuildHasher> Object for HashMap<MapK, MapE, S> where
MapK: Hash + Eq,
[src]
MapK: Hash + Eq,
type Key = MapK
type Element = MapE
fn get<Q: ?Sized>(&self, k: &Q) -> Option<&Self::Element> where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord,
[src]
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord,
fn get_mut<Q: ?Sized>(&mut self, k: &Q) -> Option<&mut Self::Element> where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord,
[src]
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord,
fn insert<K, V>(&mut self, k: K, v: V) -> Option<Self::Element> where
K: Into<Self::Key>,
V: Into<Self::Element>,
Self::Key: Hash + Eq,
[src]
K: Into<Self::Key>,
V: Into<Self::Element>,
Self::Key: Hash + Eq,
fn remove<Q: ?Sized>(&mut self, k: &Q) -> Option<Self::Element> where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord,
[src]
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord,
fn iter<'i>(
&'i self
) -> Box<dyn Iterator<Item = (&Self::Key, &Self::Element)> + 'i>
[src]
&'i self
) -> Box<dyn Iterator<Item = (&Self::Key, &Self::Element)> + 'i>