Skip to main content

Unflatten

Trait Unflatten 

Source
pub trait Unflatten<T, const K: usize>: Sized {
    // Required methods
    fn unflatten<const N: usize, const M: usize>(self) -> [[T; N]; M];
    fn unflatten_ref<const N: usize, const M: usize>(&self) -> &[[T; N]; M];
    fn unflatten_mut<const N: usize, const M: usize>(
        &mut self,
    ) -> &mut [[T; N]; M];
}
Expand description

Reshaping of [T; K], see crate-level documentation for examples.

The same conversions are available as free const fns, see unflatten() and others.

Required Methods§

Source

fn unflatten<const N: usize, const M: usize>(self) -> [[T; N]; M]

Unflatten into [[T; N]; M], where K == N * M

Source

fn unflatten_ref<const N: usize, const M: usize>(&self) -> &[[T; N]; M]

Unflatten into &[[T; N]; M], where K == N * M

Source

fn unflatten_mut<const N: usize, const M: usize>(&mut self) -> &mut [[T; N]; M]

Unflatten into &mut [[T; N]; M], 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 K: usize> Unflatten<T, K> for [T; K]

Source§

fn unflatten<const N: usize, const M: usize>(self) -> [[T; N]; M]

Source§

fn unflatten_ref<const N: usize, const M: usize>(&self) -> &[[T; N]; M]

Source§

fn unflatten_mut<const N: usize, const M: usize>(&mut self) -> &mut [[T; N]; M]

Implementors§