simd_json::prelude

Trait Indexed

Source
pub trait Indexed<T> {
    type Element: ?Sized;

    // Required method
    fn get(&self, i: T) -> Option<&Self::Element>;
}
Expand description

Trait for indexing into an array

Required Associated Types§

Source

type Element: ?Sized

Elements of the array

Required Methods§

Source

fn get(&self, i: T) -> Option<&Self::Element>

Gets a ref to a value based on n index, returns None if the current Value isn’t an Array or doesn’t contain the index it was asked for.

Implementations on Foreign Types§

Source§

impl<T, I> Indexed<I> for Vec<T>
where I: SliceIndex<[T]>,

Source§

type Element = <I as SliceIndex<[T]>>::Output

Source§

fn get(&self, i: I) -> Option<&<Vec<T> as Indexed<I>>::Element>

Implementors§