Trait simd_json::prelude::base::ValueAsContainer

source ·
pub trait ValueAsContainer {
    type Array: Array;
    type Object: Object;

    // Required methods
    fn as_array(&self) -> Option<&Self::Array>;
    fn as_object(&self) -> Option<&Self::Object>;
}
Expand description

Trait to allow accessing data inside a Value

Required Associated Types§

source

type Array: Array

The array structure

source

type Object: Object

The object structure

Required Methods§

source

fn as_array(&self) -> Option<&Self::Array>

Tries to represent the value as an array and returns a reference to it

source

fn as_object(&self) -> Option<&Self::Object>

Tries to represent the value as an object and returns a reference to it

Implementations on Foreign Types§

source§

impl<V> ValueAsContainer for Option<V>

source§

impl<V> ValueAsContainer for &V

source§

impl<V, E> ValueAsContainer for Result<V, E>

Implementors§

source§

impl ValueAsContainer for simd_json::value::owned::Value

source§

impl<'value> ValueAsContainer for simd_json::value::borrowed::Value<'value>

§

type Array = Vec<Value<'value>>

§

type Object = SizedHashMap<Cow<'value, str>, Value<'value>>