simd_json::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§