Trait hybrid_array::ArrayOps
source · pub trait ArrayOps<T, const N: usize>: Borrow<[T; N]> + BorrowMut<[T; N]> + From<[T; N]> + FromFn<T> + Into<[T; N]> + IntoIterator<Item = T> + Sized + SliceOps<T> {
const SIZE: usize;
// Required methods
fn map_to_core_array<F, U>(self, f: F) -> [U; N]
where F: FnMut(T) -> U;
fn cast_slice_to_core(slice: &[Self]) -> &[[T; N]];
fn cast_slice_to_core_mut(slice: &mut [Self]) -> &mut [[T; N]];
fn cast_slice_from_core(slice: &[[T; N]]) -> &[Self];
fn cast_slice_from_core_mut(slice: &mut [[T; N]]) -> &mut [Self];
}
Expand description
Array operations which are const generic over a given array size.
Required Associated Constants§
sourceconst SIZE: usize
const SIZE: usize
Size of an array as a usize
.
Not to be confused with AssociatedArraySize::Size
, which is typenum
-based.
Required Methods§
sourcefn map_to_core_array<F, U>(self, f: F) -> [U; N]where
F: FnMut(T) -> U,
fn map_to_core_array<F, U>(self, f: F) -> [U; N]where
F: FnMut(T) -> U,
Returns an array of the same size as self
, with function f
applied to each element
in order.
sourcefn cast_slice_to_core(slice: &[Self]) -> &[[T; N]]
fn cast_slice_to_core(slice: &[Self]) -> &[[T; N]]
Transform slice to slice of core array type
sourcefn cast_slice_to_core_mut(slice: &mut [Self]) -> &mut [[T; N]]
fn cast_slice_to_core_mut(slice: &mut [Self]) -> &mut [[T; N]]
Transform mutable slice to mutable slice of core array type
sourcefn cast_slice_from_core(slice: &[[T; N]]) -> &[Self]
fn cast_slice_from_core(slice: &[[T; N]]) -> &[Self]
Transform slice to slice of core array type
sourcefn cast_slice_from_core_mut(slice: &mut [[T; N]]) -> &mut [Self]
fn cast_slice_from_core_mut(slice: &mut [[T; N]]) -> &mut [Self]
Transform mutable slice to mutable slice of core array type
Object Safety§
This trait is not object safe.