Trait simd_json::value::prelude::Object [−][src]
pub trait Object { type Key; type Element; fn get<Q>(&self, k: &Q) -> Option<&Self::Element>
where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq; fn get_mut<Q>(&mut self, k: &Q) -> Option<&mut Self::Element>
where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq; fn insert<K, V>(&mut self, k: K, v: V) -> Option<Self::Element>
where
V: Into<Self::Element>,
K: Into<Self::Key>,
Self::Key: Hash,
Self::Key: Eq; fn remove<Q>(&mut self, k: &Q) -> Option<Self::Element>
where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>; fn iter(
&'i self
) -> Box<dyn Iterator<Item = (&'i Self::Key, &'i Self::Element)> + 'i, Global>; fn keys(&'i self) -> Box<dyn Iterator<Item = &'i Self::Key> + 'i, Global>; fn values(
&'i self
) -> Box<dyn Iterator<Item = &'i Self::Element> + 'i, Global>; fn len(&self) -> usize; fn is_empty(&self) -> bool { ... } }
Expand description
A JSON Object
Associated Types
Required methods
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.
Gets the value of a key as a mutable reference.
Inserts a value
Removes a value from the object
Iterates over the key value paris
Iterates over the keys
Iterates over the values
Provided methods
Implementations on Foreign Types
type Key = MapK
type Element = MapE
pub fn get<Q>(
&self,
k: &Q
) -> Option<&<HashMap<MapK, MapE, S> as Object>::Element> where
Q: Hash + Eq + Ord + ?Sized,
<HashMap<MapK, MapE, S> as Object>::Key: Borrow<Q>,
<HashMap<MapK, MapE, S> as Object>::Key: Hash,
<HashMap<MapK, MapE, S> as Object>::Key: Eq,
pub fn get_mut<Q>(
&mut self,
k: &Q
) -> Option<&mut <HashMap<MapK, MapE, S> as Object>::Element> where
Q: Hash + Eq + Ord + ?Sized,
<HashMap<MapK, MapE, S> as Object>::Key: Borrow<Q>,
<HashMap<MapK, MapE, S> as Object>::Key: Hash,
<HashMap<MapK, MapE, S> as Object>::Key: Eq,
pub fn insert<K, V>(
&mut self,
k: K,
v: V
) -> Option<<HashMap<MapK, MapE, S> as Object>::Element> where
V: Into<<HashMap<MapK, MapE, S> as Object>::Element>,
K: Into<<HashMap<MapK, MapE, S> as Object>::Key>,
<HashMap<MapK, MapE, S> as Object>::Key: Hash,
<HashMap<MapK, MapE, S> as Object>::Key: Eq,
pub fn remove<Q>(
&mut self,
k: &Q
) -> Option<<HashMap<MapK, MapE, S> as Object>::Element> where
Q: Hash + Eq + Ord + ?Sized,
<HashMap<MapK, MapE, S> as Object>::Key: Borrow<Q>,
<HashMap<MapK, MapE, S> as Object>::Key: Hash,
<HashMap<MapK, MapE, S> as Object>::Key: Eq,
pub fn iter(
&'i self
) -> Box<dyn Iterator<Item = (&'i <HashMap<MapK, MapE, S> as Object>::Key, &'i <HashMap<MapK, MapE, S> as Object>::Element)> + 'i, Global>
pub fn keys(
&'i self
) -> Box<dyn Iterator<Item = &'i <HashMap<MapK, MapE, S> as Object>::Key> + 'i, Global>
type Key = MapK
type Element = MapE
pub fn get<Q>(
&self,
k: &Q
) -> Option<&<HashMap<MapK, MapE, RandomState> as Object>::Element> where
Q: Hash + Eq + Ord + ?Sized,
<HashMap<MapK, MapE, RandomState> as Object>::Key: Borrow<Q>,
<HashMap<MapK, MapE, RandomState> as Object>::Key: Hash,
<HashMap<MapK, MapE, RandomState> as Object>::Key: Eq,
pub fn get_mut<Q>(
&mut self,
k: &Q
) -> Option<&mut <HashMap<MapK, MapE, RandomState> as Object>::Element> where
Q: Hash + Eq + Ord + ?Sized,
<HashMap<MapK, MapE, RandomState> as Object>::Key: Borrow<Q>,
<HashMap<MapK, MapE, RandomState> as Object>::Key: Hash,
<HashMap<MapK, MapE, RandomState> as Object>::Key: Eq,
pub fn insert<K, V>(
&mut self,
k: K,
v: V
) -> Option<<HashMap<MapK, MapE, RandomState> as Object>::Element> where
V: Into<<HashMap<MapK, MapE, RandomState> as Object>::Element>,
K: Into<<HashMap<MapK, MapE, RandomState> as Object>::Key>,
<HashMap<MapK, MapE, RandomState> as Object>::Key: Hash,
<HashMap<MapK, MapE, RandomState> as Object>::Key: Eq,
pub fn remove<Q>(
&mut self,
k: &Q
) -> Option<<HashMap<MapK, MapE, RandomState> as Object>::Element> where
Q: Hash + Eq + Ord + ?Sized,
<HashMap<MapK, MapE, RandomState> as Object>::Key: Borrow<Q>,
<HashMap<MapK, MapE, RandomState> as Object>::Key: Hash,
<HashMap<MapK, MapE, RandomState> as Object>::Key: Eq,
pub fn iter(
&'i self
) -> Box<dyn Iterator<Item = (&'i <HashMap<MapK, MapE, RandomState> as Object>::Key, &'i <HashMap<MapK, MapE, RandomState> as Object>::Element)> + 'i, Global>
pub fn keys(
&'i self
) -> Box<dyn Iterator<Item = &'i <HashMap<MapK, MapE, RandomState> as Object>::Key> + 'i, Global>