# Trait std::array::FixedSizeArray[−][src]

###

###

    pub unsafe trait FixedSizeArray<T> {
        pub fn as_slice(&self) -> &[T]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8];
        pub fn as_mut_slice(&mut self) -> &mut [T]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8];
    }

🔬 This is a nightly-only experimental API. (`fixed_size_array` #27778)

Utility trait implemented only on arrays of fixed size

This trait can be used to implement other traits on fixed-size arrays without causing much metadata bloat.

The trait is marked unsafe in order to restrict implementors to fixed-size arrays. User of this trait can assume that implementors have the exact layout in memory of a fixed size array (for example, for unsafe initialization).

Note that the traits `AsRef` and `AsMut` provide similar methods for types that may not be fixed-size arrays. Implementors should prefer those traits instead.

## Required methods

### `pub fn as_slice(&self) -> &[T]ⓘ

### Notable traits for &[u8]

`impl Read for &[u8]impl Write for &mut [u8]`
`[src]

🔬 This is a nightly-only experimental API. (`fixed_size_array` #27778)

Converts the array to immutable slice

### `pub fn as_mut_slice(&mut self) -> &mut [T]ⓘ

### Notable traits for &[u8]

`impl Read for &[u8]impl Write for &mut [u8]`
`[src]

🔬 This is a nightly-only experimental API. (`fixed_size_array` #27778)

Converts the array to mutable slice

Loading content...

## Implementors

### `impl<T, A> FixedSizeArray<T> for A where
A: Unsize<[T]>,` [src]

#### `pub fn as_slice(&self) -> &[T]ⓘ

### Notable traits for &[u8]

`impl Read for &[u8]impl Write for &mut [u8]`
`[src]

🔬 This is a nightly-only experimental API. (`fixed_size_array` #27778)

#### `pub fn as_mut_slice(&mut self) -> &mut [T]ⓘ

### Notable traits for &[u8]

`impl Read for &[u8]impl Write for &mut [u8]`
`[src]

🔬 This is a nightly-only experimental API. (`fixed_size_array` #27778)
Loading content...