Trait simd_json::prelude::ValueObjectAccessTryAsArray

source ·
pub trait ValueObjectAccessTryAsArray {
    type Key: ?Sized;
    type Array: Array;

    // Required method
    fn try_get_array<Q>(
        &self,
        k: &Q,
    ) -> Result<Option<&Self::Array>, TryTypeError>
       where Self::Key: Borrow<Q>,
             Q: Hash + Eq + Ord + ?Sized;
}
Expand description

Prelude to include needed traits try_get_array access to object values in an object

Required Associated Types§

source

type Key: ?Sized

The type for Objects

source

type Array: Array

The array structure

Required Methods§

source

fn try_get_array<Q>(&self, k: &Q) -> Result<Option<&Self::Array>, TryTypeError>
where Self::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Tries to get an element of an object as an array, returns an error if it isn’t a array

§Errors

if the requested type doesn’t match the actual type or the value is not an object

Object Safety§

This trait is not object safe.

Implementors§