Skip to main content

ArrayView

Trait ArrayView 

Source
pub trait ArrayView<'a>: Copy {
    type Item: Instance<'a>;

    // Required methods
    fn len(self) -> usize;
    fn get(self, index: usize) -> Self::Item;
    fn iter(self) -> impl Iterator<Item = Self::Item>;

    // Provided methods
    fn is_empty(self) -> bool { ... }
    fn tail(self, start: usize) -> impl Iterator<Item = Self::Item> { ... }
}
Expand description

The items of an array.

Required Associated Types§

Required Methods§

Source

fn len(self) -> usize

Source

fn get(self, index: usize) -> Self::Item

The item at an index (which must be below len).

Source

fn iter(self) -> impl Iterator<Item = Self::Item>

Provided Methods§

Source

fn is_empty(self) -> bool

Source

fn tail(self, start: usize) -> impl Iterator<Item = Self::Item>

The items from an index on (none when it is past the end).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'a> ArrayView<'a> for &'a [Value]

Source§

type Item = &'a Value

Source§

fn len(self) -> usize

Source§

fn get(self, index: usize) -> &'a Value

Source§

fn iter(self) -> impl Iterator<Item = &'a Value>

Source§

fn tail(self, start: usize) -> impl Iterator<Item = &'a Value>

Implementors§