Trait AsArrayRef
pub trait AsArrayRef<T>: AssocArraySize
Obtain an &Array reference for a given type.
This provides functionality equivalent to AsRef<Array> or Borrow<Array>, but is deliberately
implemented as its own trait both so it can leverage AssocArraySize to determine the
array size, and also to avoid inference problems that occur when third party impls of traits
like AsRef and Borrow are added to [T; N].
Usage with [T; N]
use ;
let array = ;
let x = getn_generic;
assert_eq!;
Required Methods
fn as_array_ref(&self) -> &Array<T, Self::Size>Converts this type into an immutable
Arrayreference.
Implementors
impl<T, U> AsArrayRef<T> for Array<T, U> where U: ArraySize,impl<T, U, const N: usize> AsArrayRef<T> for [T; N] where Self: AssocArraySize<Size = U>, U: ArraySize<ArrayType<T> = Self>,