simd_json::value::prelude::derived

Trait ValueArrayTryAccess

source
pub trait ValueArrayTryAccess {
    type Target: ?Sized;

    // Required method
    fn try_get_idx(
        &self,
        i: usize,
    ) -> Result<Option<&Self::Target>, TryTypeError>;
}
Expand description

Access to a value as an array with error handling

Required Associated Types§

source

type Target: ?Sized

The target for nested lookups

Required Methods§

source

fn try_get_idx(&self, i: usize) -> Result<Option<&Self::Target>, TryTypeError>

Tries to get a value based on n index, returns a type error if the current value isn’t an Array, returns None if the index is out of bounds

§Errors

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

Implementors§