mlx_rs

Trait FromNested

Source
pub trait FromNested<T> {
    // Required method
    fn from_nested(data: T) -> Array;
}
Expand description

A helper trait to construct Array from nested arrays or slices.

Given that this is not intended for use other than the macro [array!], this trait is added instead of directly implementing From for Array to avoid conflicts with other From implementations.

Beware that this is subject to change in the future should we find a better way to implement the macro without creating conflicts.

Required Methods§

Source

fn from_nested(data: T) -> Array

Create an array from nested arrays or slices.

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: ArrayElement + Copy> FromNested<&[&[T]]> for Array

Source§

impl<T: ArrayElement + Copy> FromNested<&[&[&[T]]]> for Array

Source§

impl<T: ArrayElement + Copy, const N: usize> FromNested<&[&[T; N]]> for Array

Source§

impl<T: ArrayElement + Copy, const N: usize> FromNested<&[&[[T; N]]]> for Array

Source§

impl<T: ArrayElement + Copy, const N: usize> FromNested<&[[T; N]]> for Array

Source§

impl<T: ArrayElement + Copy, const N: usize> FromNested<&[[&[T]; N]]> for Array

Source§

impl<T: ArrayElement + Copy, const N: usize> FromNested<[&[T]; N]> for Array

Source§

impl<T: ArrayElement + Copy, const N: usize> FromNested<[&[&[T]]; N]> for Array

Source§

impl<T: ArrayElement + Copy, const N: usize, const M: usize> FromNested<&[&[T; N]; M]> for Array

Source§

impl<T: ArrayElement + Copy, const N: usize, const M: usize> FromNested<&[&[[T; N]]; M]> for Array

Source§

impl<T: ArrayElement + Copy, const N: usize, const M: usize> FromNested<&[[T; N]; M]> for Array

Source§

impl<T: ArrayElement + Copy, const N: usize, const M: usize> FromNested<&[[&[T]; N]; M]> for Array

Source§

impl<T: ArrayElement + Copy, const N: usize, const M: usize> FromNested<[[T; N]; M]> for Array

Source§

impl<T: ArrayElement + Copy, const N: usize, const M: usize> FromNested<[[&[T]; N]; M]> for Array

Source§

impl<T: ArrayElement + Copy, const N: usize, const M: usize, const O: usize> FromNested<&[&[&[T; N]; M]; O]> for Array

Source§

impl<T: ArrayElement + Copy, const N: usize, const M: usize, const O: usize> FromNested<&[&[[T; N]; M]; O]> for Array

Source§

impl<T: ArrayElement + Copy, const N: usize, const M: usize, const O: usize> FromNested<&[[&[T; N]; M]; O]> for Array

Source§

impl<T: ArrayElement + Copy, const N: usize, const M: usize, const O: usize> FromNested<&[[[T; N]; M]; O]> for Array

Source§

impl<T: ArrayElement + Copy, const N: usize, const M: usize, const O: usize> FromNested<[[[T; N]; M]; O]> for Array

Source§

impl<T: ArrayElement> FromNested<&[T]> for Array

Source§

impl<T: ArrayElement, const N: usize> FromNested<&[T; N]> for Array

Source§

impl<T: ArrayElement, const N: usize> FromNested<[T; N]> for Array