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>;
}
Expand description
Trait which associates a usize
size and ArrayType
with a
typenum
-provided Unsigned
integer.
§Safety
ArrayType
MUST be an array with a number of elements exactly equal to
Unsigned::USIZE
. Breaking this requirement will cause undefined behavior.
NOTE: This trait is effectively sealed and can not be implemented by third-party crates.
It is implemented only for a number of types defined in typenum::consts
.
Required Associated Types§
sourcetype 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>
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>
Array type which corresponds to this size.
This is always defined to be [T; N]
where N
is the same as
ArraySize::USIZE
.
Object Safety§
This trait is not object safe.