pub trait ArrayOps<T, const N: usize>: AsRef<[T; N]> + AsMut<[T; N]> + Borrow<[T; N]> + BorrowMut<[T; N]> + From<[T; N]> + Index<usize> + Index<Range<usize>> + IndexMut<usize> + IndexMut<Range<usize>> + IntoIterator + Sized {
    type Size: ArraySize;

    const SIZE: usize;

    // Required methods
    fn as_core_array(&self) -> &[T; N];
    fn as_mut_core_array(&mut self) -> &mut [T; N];
    fn from_core_array(arr: [T; N]) -> Self;
    fn ref_from_core_array(arr: &[T; N]) -> &Self;
    fn ref_from_mut_core_array(arr: &mut [T; N]) -> &mut Self;
    fn map_to_core_array<F, U>(self, f: F) -> [U; N]
       where F: FnMut(T) -> U;
}
Expand description

Array operations which are const generic over a given array size.

Required Associated Types§

source

type Size: ArraySize

ArraySize type: typenum-provided Unsigned integer.

Not to be confused with ArrayOps::SIZE, which is a usize.

Required Associated Constants§

source

const SIZE: usize

Size of an array as a usize.

Not to be confused with ArrayOps::Size, which is typenum-based.

Required Methods§

source

fn as_core_array(&self) -> &[T; N]

Returns a reference to the inner array.

source

fn as_mut_core_array(&mut self) -> &mut [T; N]

Returns a mutable reference to the inner array.

source

fn from_core_array(arr: [T; N]) -> Self

Create array from Rust’s core array type.

source

fn ref_from_core_array(arr: &[T; N]) -> &Self

Create array reference from reference to Rust’s core array type.

source

fn ref_from_mut_core_array(arr: &mut [T; N]) -> &mut Self

Create mutable array reference from reference to Rust’s core array type.

source

fn map_to_core_array<F, U>(self, f: F) -> [U; N]
where F: FnMut(T) -> U,

Returns an array of the same size as self, with function f applied to each element in order.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T> ArrayOps<T, 0> for Array<T, U0>

source§

const SIZE: usize = 0usize

§

type Size = UTerm

source§

impl<T> ArrayOps<T, 1> for Array<T, U1>

source§

const SIZE: usize = 1usize

§

type Size = UInt<UTerm, B1>

source§

impl<T> ArrayOps<T, 2> for Array<T, U2>

source§

const SIZE: usize = 2usize

§

type Size = UInt<UInt<UTerm, B1>, B0>

source§

impl<T> ArrayOps<T, 3> for Array<T, U3>

source§

const SIZE: usize = 3usize

§

type Size = UInt<UInt<UTerm, B1>, B1>

source§

impl<T> ArrayOps<T, 4> for Array<T, U4>

source§

const SIZE: usize = 4usize

§

type Size = UInt<UInt<UInt<UTerm, B1>, B0>, B0>

source§

impl<T> ArrayOps<T, 5> for Array<T, U5>

source§

const SIZE: usize = 5usize

§

type Size = UInt<UInt<UInt<UTerm, B1>, B0>, B1>

source§

impl<T> ArrayOps<T, 6> for Array<T, U6>

source§

const SIZE: usize = 6usize

§

type Size = UInt<UInt<UInt<UTerm, B1>, B1>, B0>

source§

impl<T> ArrayOps<T, 7> for Array<T, U7>

source§

const SIZE: usize = 7usize

§

type Size = UInt<UInt<UInt<UTerm, B1>, B1>, B1>

source§

impl<T> ArrayOps<T, 8> for Array<T, U8>

source§

const SIZE: usize = 8usize

§

type Size = UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>

source§

impl<T> ArrayOps<T, 9> for Array<T, U9>

source§

const SIZE: usize = 9usize

§

type Size = UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>

source§

impl<T> ArrayOps<T, 10> for Array<T, U10>

source§

const SIZE: usize = 10usize

§

type Size = UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>

source§

impl<T> ArrayOps<T, 11> for Array<T, U11>

source§

const SIZE: usize = 11usize

§

type Size = UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B1>

source§

impl<T> ArrayOps<T, 12> for Array<T, U12>

source§

const SIZE: usize = 12usize

§

type Size = UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>

source§

impl<T> ArrayOps<T, 13> for Array<T, U13>

source§

const SIZE: usize = 13usize

§

type Size = UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B1>

source§

impl<T> ArrayOps<T, 14> for Array<T, U14>

source§

const SIZE: usize = 14usize

§

type Size = UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>

source§

impl<T> ArrayOps<T, 15> for Array<T, U15>

source§

const SIZE: usize = 15usize

§

type Size = UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>

source§

impl<T> ArrayOps<T, 16> for Array<T, U16>

source§

const SIZE: usize = 16usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>

source§

impl<T> ArrayOps<T, 17> for Array<T, U17>

source§

const SIZE: usize = 17usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B1>

source§

impl<T> ArrayOps<T, 18> for Array<T, U18>

source§

const SIZE: usize = 18usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>, B0>

source§

impl<T> ArrayOps<T, 19> for Array<T, U19>

source§

const SIZE: usize = 19usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>, B1>

source§

impl<T> ArrayOps<T, 20> for Array<T, U20>

source§

const SIZE: usize = 20usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>, B0>

source§

impl<T> ArrayOps<T, 21> for Array<T, U21>

source§

const SIZE: usize = 21usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>, B1>

source§

impl<T> ArrayOps<T, 22> for Array<T, U22>

source§

const SIZE: usize = 22usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B1>, B0>

source§

impl<T> ArrayOps<T, 23> for Array<T, U23>

source§

const SIZE: usize = 23usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B1>, B1>

source§

impl<T> ArrayOps<T, 24> for Array<T, U24>

source§

const SIZE: usize = 24usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>

source§

impl<T> ArrayOps<T, 25> for Array<T, U25>

source§

const SIZE: usize = 25usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B1>

source§

impl<T> ArrayOps<T, 26> for Array<T, U26>

source§

const SIZE: usize = 26usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B1>, B0>

source§

impl<T> ArrayOps<T, 27> for Array<T, U27>

source§

const SIZE: usize = 27usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B1>, B1>

source§

impl<T> ArrayOps<T, 28> for Array<T, U28>

source§

const SIZE: usize = 28usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B0>

source§

impl<T> ArrayOps<T, 29> for Array<T, U29>

source§

const SIZE: usize = 29usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B1>

source§

impl<T> ArrayOps<T, 30> for Array<T, U30>

source§

const SIZE: usize = 30usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B0>

source§

impl<T> ArrayOps<T, 31> for Array<T, U31>

source§

const SIZE: usize = 31usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B1>

source§

impl<T> ArrayOps<T, 32> for Array<T, U32>

source§

const SIZE: usize = 32usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>

source§

impl<T> ArrayOps<T, 33> for Array<T, U33>

source§

const SIZE: usize = 33usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B1>

source§

impl<T> ArrayOps<T, 34> for Array<T, U34>

source§

const SIZE: usize = 34usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B1>, B0>

source§

impl<T> ArrayOps<T, 35> for Array<T, U35>

source§

const SIZE: usize = 35usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B1>, B1>

source§

impl<T> ArrayOps<T, 36> for Array<T, U36>

source§

const SIZE: usize = 36usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>, B0>, B0>

source§

impl<T> ArrayOps<T, 37> for Array<T, U37>

source§

const SIZE: usize = 37usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>, B0>, B1>

source§

impl<T> ArrayOps<T, 38> for Array<T, U38>

source§

const SIZE: usize = 38usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>, B1>, B0>

source§

impl<T> ArrayOps<T, 39> for Array<T, U39>

source§

const SIZE: usize = 39usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>, B1>, B1>

source§

impl<T> ArrayOps<T, 40> for Array<T, U40>

source§

const SIZE: usize = 40usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>, B0>, B0>

source§

impl<T> ArrayOps<T, 41> for Array<T, U41>

source§

const SIZE: usize = 41usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>, B0>, B1>

source§

impl<T> ArrayOps<T, 42> for Array<T, U42>

source§

const SIZE: usize = 42usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>, B1>, B0>

source§

impl<T> ArrayOps<T, 43> for Array<T, U43>

source§

const SIZE: usize = 43usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>, B1>, B1>

source§

impl<T> ArrayOps<T, 44> for Array<T, U44>

source§

const SIZE: usize = 44usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B1>, B0>, B0>

source§

impl<T> ArrayOps<T, 45> for Array<T, U45>

source§

const SIZE: usize = 45usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B1>, B0>, B1>

source§

impl<T> ArrayOps<T, 46> for Array<T, U46>

source§

const SIZE: usize = 46usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B1>, B1>, B0>

source§

impl<T> ArrayOps<T, 47> for Array<T, U47>

source§

const SIZE: usize = 47usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B1>, B1>, B1>

source§

impl<T> ArrayOps<T, 48> for Array<T, U48>

source§

const SIZE: usize = 48usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>, B0>

source§

impl<T> ArrayOps<T, 49> for Array<T, U49>

source§

const SIZE: usize = 49usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>, B1>

source§

impl<T> ArrayOps<T, 50> for Array<T, U50>

source§

const SIZE: usize = 50usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B1>, B0>

source§

impl<T> ArrayOps<T, 51> for Array<T, U51>

source§

const SIZE: usize = 51usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B1>, B1>

source§

impl<T> ArrayOps<T, 52> for Array<T, U52>

source§

const SIZE: usize = 52usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B1>, B0>, B0>

source§

impl<T> ArrayOps<T, 53> for Array<T, U53>

source§

const SIZE: usize = 53usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B1>, B0>, B1>

source§

impl<T> ArrayOps<T, 54> for Array<T, U54>

source§

const SIZE: usize = 54usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B1>, B1>, B0>

source§

impl<T> ArrayOps<T, 55> for Array<T, U55>

source§

const SIZE: usize = 55usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B1>, B1>, B1>

source§

impl<T> ArrayOps<T, 56> for Array<T, U56>

source§

const SIZE: usize = 56usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B0>, B0>

source§

impl<T> ArrayOps<T, 57> for Array<T, U57>

source§

const SIZE: usize = 57usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B0>, B1>

source§

impl<T> ArrayOps<T, 58> for Array<T, U58>

source§

const SIZE: usize = 58usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B1>, B0>

source§

impl<T> ArrayOps<T, 59> for Array<T, U59>

source§

const SIZE: usize = 59usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B1>, B1>

source§

impl<T> ArrayOps<T, 60> for Array<T, U60>

source§

const SIZE: usize = 60usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B0>, B0>

source§

impl<T> ArrayOps<T, 61> for Array<T, U61>

source§

const SIZE: usize = 61usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B0>, B1>

source§

impl<T> ArrayOps<T, 62> for Array<T, U62>

source§

const SIZE: usize = 62usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B1>, B0>

source§

impl<T> ArrayOps<T, 63> for Array<T, U63>

source§

const SIZE: usize = 63usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B1>, B1>

source§

impl<T> ArrayOps<T, 64> for Array<T, U64>

source§

const SIZE: usize = 64usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>

source§

impl<T> ArrayOps<T, 96> for Array<T, U96>

source§

const SIZE: usize = 96usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>, B0>, B0>

source§

impl<T> ArrayOps<T, 128> for Array<T, U128>

source§

const SIZE: usize = 128usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>

source§

impl<T> ArrayOps<T, 192> for Array<T, U192>

source§

const SIZE: usize = 192usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>, B0>, B0>, B0>

source§

impl<T> ArrayOps<T, 256> for Array<T, U256>

source§

const SIZE: usize = 256usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>

source§

impl<T> ArrayOps<T, 384> for Array<T, U384>

source§

const SIZE: usize = 384usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>

source§

impl<T> ArrayOps<T, 448> for Array<T, U448>

source§

const SIZE: usize = 448usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B0>, B0>, B0>, B0>, B0>

source§

impl<T> ArrayOps<T, 512> for Array<T, U512>

source§

const SIZE: usize = 512usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>

source§

impl<T> ArrayOps<T, 768> for Array<T, U768>

source§

const SIZE: usize = 768usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>

source§

impl<T> ArrayOps<T, 896> for Array<T, U896>

source§

const SIZE: usize = 896usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>

source§

impl<T> ArrayOps<T, 1024> for Array<T, U1024>

source§

const SIZE: usize = 1_024usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>

source§

impl<T> ArrayOps<T, 2048> for Array<T, U2048>

source§

const SIZE: usize = 2_048usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>

source§

impl<T> ArrayOps<T, 4096> for Array<T, U4096>

source§

const SIZE: usize = 4_096usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>

source§

impl<T> ArrayOps<T, 8192> for Array<T, U8192>

source§

const SIZE: usize = 8_192usize

§

type Size = UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>