Trait ArrayOps

Source
pub trait ArrayOps<T: 'static, I> {
    // Required methods
    fn data(&self) -> &[T];
    fn offset(&self, index: I) -> usize;

    // Provided methods
    fn first(&self) -> &T { ... }
    fn as_slice(&self) -> &[T] { ... }
    fn subarray(&self, index: I) -> &[T] { ... }
    fn iter(&self) -> impl Iterator<Item = &T> { ... }
    fn subscript(&self, index: I) -> i32 { ... }
}

Required Methods§

Source

fn data(&self) -> &[T]

Source

fn offset(&self, index: I) -> usize

Provided Methods§

Source

fn first(&self) -> &T

Source

fn as_slice(&self) -> &[T]

Source

fn subarray(&self, index: I) -> &[T]

Source

fn iter(&self) -> impl Iterator<Item = &T>

Source

fn subscript(&self, index: I) -> i32

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T> ArrayOps<T, i32> for ActualArray<T>

Source§

impl<T> ArrayOps<T, i32> for DummyArray<'_, T>

Source§

impl<T> ArrayOps<T, i32> for DummyArrayMut<'_, T>

Source§

impl<T> ArrayOps<T, [i32; 2]> for ActualArray2D<T>

Source§

impl<T> ArrayOps<T, [i32; 2]> for DummyArray2D<'_, T>

Source§

impl<T> ArrayOps<T, [i32; 2]> for DummyArrayMut2D<'_, T>

Source§

impl<T> ArrayOps<T, [i32; 3]> for ActualArray3D<T>

Source§

impl<T> ArrayOps<T, [i32; 3]> for DummyArray3D<'_, T>

Source§

impl<T> ArrayOps<T, [i32; 3]> for DummyArrayMut3D<'_, T>

Source§

impl<T> ArrayOps<T, [i32; 4]> for ActualArray4D<T>

Source§

impl<T> ArrayOps<T, [i32; 4]> for DummyArray4D<'_, T>

Source§

impl<T> ArrayOps<T, [i32; 4]> for DummyArrayMut4D<'_, T>

Source§

impl<T, const N: usize> ArrayOps<T, i32> for StackArray<T, N>

Source§

impl<T, const N: usize> ArrayOps<T, [i32; 2]> for StackArray2D<T, N>

Source§

impl<T, const N: usize> ArrayOps<T, [i32; 3]> for StackArray3D<T, N>

Source§

impl<T, const N: usize> ArrayOps<T, [i32; 4]> for StackArray4D<T, N>