Skip to main content

Array

Trait Array 

Source
pub trait Array {
    type Item: Default;

    const SIZE: usize;

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

Required Associated Constants§

Required Associated Types§

Required Methods§

Source

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

Source

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

Source

fn new() -> Self

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: Default + Copy, const SIZE: usize> Array for [T; SIZE]

Source§

const SIZE: usize = SIZE

Source§

type Item = T

Source§

fn as_slice(&self) -> &[T]

Source§

fn as_mut_slice(&mut self) -> &mut [T]

Source§

fn new() -> Self

Implementors§