Skip to main content

FlattenEach

Trait FlattenEach 

Source
pub trait FlattenEach<T, const N: usize, const M: usize> {
    type Flattened<const K: usize>: ?Sized;

    // Required methods
    fn flatten_each_ref<const K: usize>(&self) -> &Self::Flattened<K>;
    fn flatten_each_mut<const K: usize>(&mut self) -> &mut Self::Flattened<K>;
}
Expand description

Flattening of each element of [[[T; N]; M]] or [[[T; N]; M]; L], see crate-level documentation for examples.

The same conversions are available as free const fns, see flatten_each_ref(), flatten_each_mut(), flatten_each_array_ref() and flatten_each_array_mut().

Required Associated Types§

Source

type Flattened<const K: usize>: ?Sized

[[T; K]] for slices and [[T; K]; L] for arrays

Required Methods§

Source

fn flatten_each_ref<const K: usize>(&self) -> &Self::Flattened<K>

Flatten each element to get &[[T; K]] or &[[T; K]; L], where K == N * M

Source

fn flatten_each_mut<const K: usize>(&mut self) -> &mut Self::Flattened<K>

Flatten each element to get &mut [[T; K]] or &mut [[T; K]; L], where K == N * M

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<T, const N: usize, const M: usize, const L: usize> FlattenEach<T, N, M> for [[[T; N]; M]; L]

Source§

type Flattened<const K: usize> = [[T; K]; L]

Source§

fn flatten_each_ref<const K: usize>(&self) -> &[[T; K]; L]

Source§

fn flatten_each_mut<const K: usize>(&mut self) -> &mut [[T; K]; L]

Source§

impl<T, const N: usize, const M: usize> FlattenEach<T, N, M> for [[[T; N]; M]]

Source§

type Flattened<const K: usize> = [[T; K]]

Source§

fn flatten_each_ref<const K: usize>(&self) -> &[[T; K]]

Source§

fn flatten_each_mut<const K: usize>(&mut self) -> &mut [[T; K]]

Implementors§