arrayvec

Trait Array

source
pub unsafe trait Array {
    type Item;

    const CAPACITY: usize;

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

Trait for fixed size arrays.

This trait is implemented for some specific array sizes, see the implementor list below. At the current state of Rust we can’t make this fully general for every array size.

The following crate features add more array sizes (and they are not enabled by default due to their impact on compliation speed).

  • array-sizes-33-128: All sizes 33 to 128 are implemented (a few in this range are included by default).
  • array-sizes-129-255: All sizes 129 to 255 are implemented (a few in this range are included by default).

§Safety

This trait can only be implemented by fixed-size arrays or types with exactly the representation of a fixed size array (of the right element type and capacity).

Normally this trait is an implementation detail of arrayvec and doesn’t need implementing.

Required Associated Constants§

source

const CAPACITY: usize

The array’s element capacity

Required Associated Types§

source

type Item

The array’s element type

Required Methods§

source

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

source

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

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T> Array for [T; 0]

source§

const CAPACITY: usize = 0usize

source§

type Item = T

source§

impl<T> Array for [T; 1]

source§

const CAPACITY: usize = 1usize

source§

type Item = T

source§

impl<T> Array for [T; 2]

source§

const CAPACITY: usize = 2usize

source§

type Item = T

source§

impl<T> Array for [T; 3]

source§

const CAPACITY: usize = 3usize

source§

type Item = T

source§

impl<T> Array for [T; 4]

source§

const CAPACITY: usize = 4usize

source§

type Item = T

source§

impl<T> Array for [T; 5]

source§

const CAPACITY: usize = 5usize

source§

type Item = T

source§

impl<T> Array for [T; 6]

source§

const CAPACITY: usize = 6usize

source§

type Item = T

source§

impl<T> Array for [T; 7]

source§

const CAPACITY: usize = 7usize

source§

type Item = T

source§

impl<T> Array for [T; 8]

source§

const CAPACITY: usize = 8usize

source§

type Item = T

source§

impl<T> Array for [T; 9]

source§

const CAPACITY: usize = 9usize

source§

type Item = T

source§

impl<T> Array for [T; 10]

source§

const CAPACITY: usize = 10usize

source§

type Item = T

source§

impl<T> Array for [T; 11]

source§

const CAPACITY: usize = 11usize

source§

type Item = T

source§

impl<T> Array for [T; 12]

source§

const CAPACITY: usize = 12usize

source§

type Item = T

source§

impl<T> Array for [T; 13]

source§

const CAPACITY: usize = 13usize

source§

type Item = T

source§

impl<T> Array for [T; 14]

source§

const CAPACITY: usize = 14usize

source§

type Item = T

source§

impl<T> Array for [T; 15]

source§

const CAPACITY: usize = 15usize

source§

type Item = T

source§

impl<T> Array for [T; 16]

source§

const CAPACITY: usize = 16usize

source§

type Item = T

source§

impl<T> Array for [T; 17]

source§

const CAPACITY: usize = 17usize

source§

type Item = T

source§

impl<T> Array for [T; 18]

source§

const CAPACITY: usize = 18usize

source§

type Item = T

source§

impl<T> Array for [T; 19]

source§

const CAPACITY: usize = 19usize

source§

type Item = T

source§

impl<T> Array for [T; 20]

source§

const CAPACITY: usize = 20usize

source§

type Item = T

source§

impl<T> Array for [T; 21]

source§

const CAPACITY: usize = 21usize

source§

type Item = T

source§

impl<T> Array for [T; 22]

source§

const CAPACITY: usize = 22usize

source§

type Item = T

source§

impl<T> Array for [T; 23]

source§

const CAPACITY: usize = 23usize

source§

type Item = T

source§

impl<T> Array for [T; 24]

source§

const CAPACITY: usize = 24usize

source§

type Item = T

source§

impl<T> Array for [T; 25]

source§

const CAPACITY: usize = 25usize

source§

type Item = T

source§

impl<T> Array for [T; 26]

source§

const CAPACITY: usize = 26usize

source§

type Item = T

source§

impl<T> Array for [T; 27]

source§

const CAPACITY: usize = 27usize

source§

type Item = T

source§

impl<T> Array for [T; 28]

source§

const CAPACITY: usize = 28usize

source§

type Item = T

source§

impl<T> Array for [T; 29]

source§

const CAPACITY: usize = 29usize

source§

type Item = T

source§

impl<T> Array for [T; 30]

source§

const CAPACITY: usize = 30usize

source§

type Item = T

source§

impl<T> Array for [T; 31]

source§

const CAPACITY: usize = 31usize

source§

type Item = T

source§

impl<T> Array for [T; 32]

source§

const CAPACITY: usize = 32usize

source§

type Item = T

source§

impl<T> Array for [T; 40]

source§

const CAPACITY: usize = 40usize

source§

type Item = T

source§

impl<T> Array for [T; 48]

source§

const CAPACITY: usize = 48usize

source§

type Item = T

source§

impl<T> Array for [T; 50]

source§

const CAPACITY: usize = 50usize

source§

type Item = T

source§

impl<T> Array for [T; 56]

source§

const CAPACITY: usize = 56usize

source§

type Item = T

source§

impl<T> Array for [T; 64]

source§

const CAPACITY: usize = 64usize

source§

type Item = T

source§

impl<T> Array for [T; 72]

source§

const CAPACITY: usize = 72usize

source§

type Item = T

source§

impl<T> Array for [T; 96]

source§

const CAPACITY: usize = 96usize

source§

type Item = T

source§

impl<T> Array for [T; 100]

source§

const CAPACITY: usize = 100usize

source§

type Item = T

source§

impl<T> Array for [T; 128]

source§

const CAPACITY: usize = 128usize

source§

type Item = T

source§

impl<T> Array for [T; 160]

source§

const CAPACITY: usize = 160usize

source§

type Item = T

source§

impl<T> Array for [T; 192]

source§

const CAPACITY: usize = 192usize

source§

type Item = T

source§

impl<T> Array for [T; 200]

source§

const CAPACITY: usize = 200usize

source§

type Item = T

source§

impl<T> Array for [T; 224]

source§

const CAPACITY: usize = 224usize

source§

type Item = T

source§

impl<T> Array for [T; 256]

source§

const CAPACITY: usize = 256usize

source§

type Item = T

source§

impl<T> Array for [T; 384]

source§

const CAPACITY: usize = 384usize

source§

type Item = T

source§

impl<T> Array for [T; 512]

source§

const CAPACITY: usize = 512usize

source§

type Item = T

source§

impl<T> Array for [T; 768]

source§

const CAPACITY: usize = 768usize

source§

type Item = T

source§

impl<T> Array for [T; 1024]

source§

const CAPACITY: usize = 1_024usize

source§

type Item = T

source§

impl<T> Array for [T; 2048]

source§

const CAPACITY: usize = 2_048usize

source§

type Item = T

source§

impl<T> Array for [T; 4096]

source§

const CAPACITY: usize = 4_096usize

source§

type Item = T

source§

impl<T> Array for [T; 8192]

source§

const CAPACITY: usize = 8_192usize

source§

type Item = T

source§

impl<T> Array for [T; 16384]

source§

const CAPACITY: usize = 16_384usize

source§

type Item = T

source§

impl<T> Array for [T; 32768]

source§

const CAPACITY: usize = 32_768usize

source§

type Item = T

source§

impl<T> Array for [T; 65536]

source§

const CAPACITY: usize = 65_536usize

source§

type Item = T

Implementors§