pub trait AssocArraySize: Sized {
type Size: ArraySize;
}Expand description
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 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();
}Required Associated Types§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.