Trait value_trait::Object [−][src]
pub trait Object { type Key; type Element; #[must_use] fn get<Q: ?Sized>(&self, k: &Q) -> Option<&Self::Element>
where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord; #[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; #[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; #[must_use] fn remove<Q: ?Sized>(&mut self, k: &Q) -> Option<Self::Element>
where
Self::Key: Borrow<Q>,
Q: Hash + Eq + Ord; #[must_use] fn iter<'i>(
&'i self
) -> Box<dyn Iterator<Item = (&Self::Key, &Self::Element)> + 'i>; #[must_use] fn keys<'i>(&'i self) -> Box<dyn Iterator<Item = &Self::Key> + 'i>; #[must_use] fn values<'i>(&'i self) -> Box<dyn Iterator<Item = &Self::Element> + 'i>; #[must_use] fn len(&self) -> usize; #[must_use] fn is_empty(&self) -> bool { ... } }
Expand description
A JSON Object
Associated Types
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]
#[must_use]fn get<Q: ?Sized>(&self, k: &Q) -> Option<&Self::Element> where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord,
[src]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]
#[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]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]
#[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]Inserts a value
Provided methods
Implementations on Foreign Types
impl<MapK, MapE> Object for Halfbrown<MapK, MapE> where
MapK: Hash + Eq,
[src]
impl<MapK, MapE> Object for Halfbrown<MapK, MapE> where
MapK: Hash + Eq,
[src]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]
impl<MapK, MapE, S: BuildHasher> Object for HashMap<MapK, MapE, S> where
MapK: Hash + Eq,
[src]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>