pub trait SliceExt<T>: Sealed {
// Required methods
fn as_hybrid_array<U: ArraySize>(&self) -> Option<&Array<T, U>>;
fn as_mut_hybrid_array<U: ArraySize>(&mut self) -> Option<&mut Array<T, U>>;
fn as_hybrid_chunks<U: ArraySize>(&self) -> (&[Array<T, U>], &[T]);
fn as_hybrid_chunks_mut<U: ArraySize>(
&mut self,
) -> (&mut [Array<T, U>], &mut [T]);
}Expand description
Extension trait for [T] providing methods for working with Array.
Required Methods§
Sourcefn as_hybrid_array<U: ArraySize>(&self) -> Option<&Array<T, U>>
fn as_hybrid_array<U: ArraySize>(&self) -> Option<&Array<T, U>>
Get a reference to an array from a slice, if the slice is exactly the size of the array.
Returns None if the slice’s length is not exactly equal to the array size.
Sourcefn as_mut_hybrid_array<U: ArraySize>(&mut self) -> Option<&mut Array<T, U>>
fn as_mut_hybrid_array<U: ArraySize>(&mut self) -> Option<&mut Array<T, U>>
Get a mutable reference to an array from a slice, if the slice is exactly the size of the array.
Returns None if the slice’s length is not exactly equal to the array size.
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.