use crate::Array;
use core::{
borrow::{Borrow, BorrowMut},
ops::{Index, IndexMut, Range},
};
use typenum::Unsigned;
pub unsafe trait ArraySize: Unsigned {
type ArrayType<T>: AssocArraySize<Size = Self>
+ AsRef<[T]>
+ AsMut<[T]>
+ Borrow<[T]>
+ BorrowMut<[T]>
+ From<Array<T, Self>>
+ Index<usize>
+ Index<Range<usize>>
+ IndexMut<usize>
+ IndexMut<Range<usize>>
+ Into<Array<T, Self>>
+ IntoIterator<Item = T>;
}
pub trait AssocArraySize: Sized {
type Size: ArraySize;
}
impl<T, U> AssocArraySize for Array<T, U>
where
U: ArraySize,
{
type Size = U;
}