Type Alias simd_json::value::borrowed::Object

source ·
pub type Object<'value> = HashMap<Cow<'value, str>, Value<'value>, ObjectHasher>;
Expand description

Representation of a JSON object

Aliased Type§

struct Object<'value>(/* private fields */);

Trait Implementations§

source§

impl<MapK, MapE, S> Object for SizedHashMap<MapK, MapE, S, 32>where MapK: Hash + Eq, S: BuildHasher + Default,

§

type Key = MapK

The key in the objects
§

type Element = MapE

The values in the object
source§

fn get<Q>( &self, k: &Q ) -> Option<&<SizedHashMap<MapK, MapE, S, 32> as Object>::Element>where <SizedHashMap<MapK, MapE, S, 32> as Object>::Key: Borrow<Q> + Hash + Eq, Q: Hash + Eq + Ord + ?Sized,

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.
source§

fn get_mut<Q>( &mut self, k: &Q ) -> Option<&mut <SizedHashMap<MapK, MapE, S, 32> as Object>::Element>where <SizedHashMap<MapK, MapE, S, 32> as Object>::Key: Borrow<Q> + Hash + Eq, Q: Hash + Eq + Ord + ?Sized,

Gets the value of a key as a mutable reference.
source§

fn insert<K, V>( &mut self, k: K, v: V ) -> Option<<SizedHashMap<MapK, MapE, S, 32> as Object>::Element>where K: Into<<SizedHashMap<MapK, MapE, S, 32> as Object>::Key>, V: Into<<SizedHashMap<MapK, MapE, S, 32> as Object>::Element>, <SizedHashMap<MapK, MapE, S, 32> as Object>::Key: Hash + Eq,

Inserts a value
source§

fn remove<Q>( &mut self, k: &Q ) -> Option<<SizedHashMap<MapK, MapE, S, 32> as Object>::Element>where <SizedHashMap<MapK, MapE, S, 32> as Object>::Key: Borrow<Q> + Hash + Eq, Q: Hash + Eq + Ord + ?Sized,

Removes a value from the object
source§

fn iter<'i>( &'i self ) -> Box<dyn Iterator<Item = (&'i <SizedHashMap<MapK, MapE, S, 32> as Object>::Key, &'i <SizedHashMap<MapK, MapE, S, 32> as Object>::Element)> + 'i, Global>

Iterates over the key value paris
source§

fn keys<'i>( &'i self ) -> Box<dyn Iterator<Item = &'i <SizedHashMap<MapK, MapE, S, 32> as Object>::Key> + 'i, Global>

Iterates over the keys
source§

fn values<'i>( &'i self ) -> Box<dyn Iterator<Item = &'i <SizedHashMap<MapK, MapE, S, 32> as Object>::Element> + 'i, Global>

Iterates over the values
source§

fn len(&self) -> usize

Number of key/value pairs
source§

fn is_empty(&self) -> bool

Returns if the array is empty