Trait simd_json::value::prelude::derived::ValueObjectAccess

source ·
pub trait ValueObjectAccess {
    type Key: ?Sized;
    type Target;

    // Required methods
    fn get<Q>(&self, k: &Q) -> Option<&Self::Target>
       where Self::Key: Borrow<Q> + Hash + Eq,
             Q: Hash + Eq + Ord + ?Sized;
    fn contains_key<Q>(&self, k: &Q) -> bool
       where Self::Key: Borrow<Q> + Hash + Eq,
             Q: Hash + Eq + Ord + ?Sized;
}
Expand description

Access to a value as an object

Required Associated Types§

source

type Key: ?Sized

The type for Objects

source

type Target

The target for nested lookups

Required Methods§

source

fn get<Q>(&self, k: &Q) -> Option<&Self::Target>
where Self::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 contains_key<Q>(&self, k: &Q) -> bool
where Self::Key: Borrow<Q> + Hash + Eq, Q: Hash + Eq + Ord + ?Sized,

Checks if a Value contains a given key. This will return flase if Value isn’t an object

Object Safety§

This trait is not object safe.

Implementors§