use array_trait::{Array, length::Length};
use crate::{Bulk, CollectionAdapter, CollectionStrategy, FromBulk, IntoBulk, TryCollectionStrategy};
#[rustc_on_unimplemented(
message = "cannot determine the length of bulk `{Self}` at compile-time",
label = "the bulk `{Self}` is not statically sized",
)]
pub unsafe trait StaticBulk: Bulk<
MinLength: Length<Intersect<<Self as Bulk>::MaxLength> = Self::Array<()>>
> + Sized
{
type Array<U>: const Array<Elem = U> + Length<Elem = U> + const IntoBulk<Item = U> + CollectionAdapter<Elem = U> + FromBulk<Self::Array<U>> + CollectionStrategy<Self::MinLength, Self::MaxLength, Self::Array<U>> + TryCollectionStrategy<Self::MinLength, Self::MaxLength, Self::Array<U>>;
}
unsafe impl<T, const N: usize> StaticBulk for T
where
T: Bulk<
MinLength: Length<Intersect<<Self as Bulk>::MaxLength> = [(); N]>
> + Sized
{
type Array<U> = [U; N];
}