pub trait ArrayWithSize<T, const N: usize>: Array<T, N> {
type WithSize<const M: usize>: ArrayWithSize<T, M>;
// Provided methods
fn resize<const M: usize>(self) -> Self::WithSize<M>
where T: Default { ... }
fn resize_with_value<const M: usize>(self, value: T) -> Self::WithSize<M>
where T: Clone { ... }
}Expand description
An type equivalent to an array with a generic size that can be changed
ex, [T;N] is an array with a generic size, but struct RGBA([T;4]) don’t have a generic size (always 4 components)
Required Associated Types§
type WithSize<const M: usize>: ArrayWithSize<T, M>
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.