std_traits::array

Trait Array

source
pub trait Array: Primitive + Sized {
    type Item;

    const N: usize;

    // Required methods
    fn as_slice(&self) -> &[Self::Item];
    fn as_mut_slice(&mut self) -> &mut [Self::Item];
}

Required Associated Constants§

source

const N: usize

Required Associated Types§

Required Methods§

source

fn as_slice(&self) -> &[Self::Item]

source

fn as_mut_slice(&mut self) -> &mut [Self::Item]

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.

Implementations on Foreign Types§

source§

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

source§

const N: usize = N

source§

type Item = T

source§

fn as_slice(&self) -> &[Self::Item]

source§

fn as_mut_slice(&mut self) -> &mut [Self::Item]

Implementors§