Trait AssocArraySize

pub trait AssocArraySize: Sized

Associates an ArraySize with a given type. Can be used to accept [T; N] const generic arguments and convert to Array internally.

This trait is also the magic glue that makes the [ArrayN]crate::ArrayN type alias work.

Example

use hybrid_array::{ArrayN, AssocArraySize};

pub fn example<const N: usize>(bytes: &[u8; N])
where
    [u8; N]: AssocArraySize + AsRef<ArrayN<u8, N>>
{
    // _arrayn is ArrayN<u8, N>
    let _arrayn = bytes.as_ref();
}

Associated Types

type Size: ArraySize;

Size of an array type, expressed as a typenum-based ArraySize.

Implementors