pub trait Array<T, const N: usize>:
From<[T; N]>
+ Into<[T; N]>
+ Index<usize, Output = T>
+ IndexMut<usize, Output = T> {
const DIMENSION: usize = N;
// Required methods
fn array(&self) -> &[T; N];
fn array_mut(&mut self) -> &mut [T; N];
// Provided methods
fn to_array_resized<const M: usize>(self) -> [T; M]
where T: Default { ... }
fn to_array_resized_with_value<const M: usize>(self, fill: T) -> [T; M]
where T: Clone { ... }
}Expand description
An array that is indexable, without any information if the type and the size are generic.
Check ArrayWithType and ArrayWithSize for editable generic type.
Provided Associated Constants§
Required Methods§
Provided Methods§
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.