Skip to main content

ArrayRef

Trait ArrayRef 

Source
pub trait ArrayRef<E, const N: usize> {
    // Required method
    fn array_ref(&self) -> &[E; N];
}
Expand description

A trait for accessing a reference to a fixed-size array from a collection.

This trait requires the collection to implement Collection.

Required Methods§

Source

fn array_ref(&self) -> &[E; N]

Returns a reference to a fixed-size array from the collection.

§Returns
  • &[ E ; N ]: A reference to the fixed-size array.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ArrayRef<usize, 0> for ()

Source§

fn array_ref(&self) -> &[usize; 0]

Source§

impl<E, const N: usize> ArrayRef<E, N> for [E; N]

Source§

impl<E, const N: usize> ArrayRef<E, N> for [E]

Source§

impl<E> ArrayRef<E, 1> for (E,)

Source§

impl<E> ArrayRef<E, 2> for (E, E)

Source§

impl<E> ArrayRef<E, 3> for (E, E, E)

Source§

impl<E> ArrayRef<E, 4> for (E, E, E, E)

Source§

impl<T, E, const N: usize> ArrayRef<E, N> for &T
where T: ArrayRef<E, N>,

Implementation of ArrayRef for references to collections.

Implementors§