Trait array__ops::ArrayOps

source ·
pub trait ArrayOps<T, const N: usize>: Array + IntoIterator<Item = T> + Borrow<[T; N]> + BorrowMut<[T; N]> {
Show 112 methods // Required methods fn split_len(n: usize) -> (usize, usize); fn rsplit_len(n: usize) -> (usize, usize); fn split_ptr(&self, n: usize) -> (*const T, *const T); fn split_mut_ptr(&mut self, n: usize) -> (*mut T, *mut T); fn rsplit_ptr(&self, n: usize) -> (*const T, *const T); fn rsplit_mut_ptr(&mut self, n: usize) -> (*mut T, *mut T); fn fill<F>(fill: F) -> Self where F: FnMut(usize) -> T; fn rfill<F>(fill: F) -> Self where F: FnMut(usize) -> T; fn truncate<const M: usize>(self) -> [T; M]; fn rtruncate<const M: usize>(self) -> [T; M]; fn truncate_ref<const M: usize>(&self) -> &[T; M]; fn rtruncate_ref<const M: usize>(&self) -> &[T; M]; fn truncate_mut<const M: usize>(&mut self) -> &mut [T; M]; fn rtruncate_mut<const M: usize>(&mut self) -> &mut [T; M]; fn resize<const M: usize, F>(self, fill: F) -> [T; M] where F: FnMut(usize) -> T; fn rresize<const M: usize, F>(self, fill: F) -> [T; M] where F: FnMut(usize) -> T; fn extend<const M: usize, F>(self, fill: F) -> [T; M] where F: FnMut(usize) -> T; fn rextend<const M: usize, F>(self, fill: F) -> [T; M] where F: FnMut(usize) -> T; fn reformulate_length<const M: usize>(self) -> [T; M]; fn reformulate_length_ref<const M: usize>(&self) -> &[T; M]; fn reformulate_length_mut<const M: usize>(&mut self) -> &mut [T; M]; fn try_reformulate_length<const M: usize>(self) -> Result<[T; M], Self>; fn try_reformulate_length_ref<const M: usize>(&self) -> Option<&[T; M]>; fn try_reformulate_length_mut<const M: usize>( &mut self ) -> Option<&mut [T; M]>; fn map2<Map>(self, map: Map) -> [Map::Output; N] where Map: FnMut<(T,)>; fn map_outer<Map>(&self, map: Map) -> [[Map::Output; N]; N] where Map: FnMut<(T, T)>, T: Copy; fn comap<Map, Rhs>(self, rhs: [Rhs; N], map: Map) -> [Map::Output; N] where Map: FnMut<(T, Rhs)>; fn comap_outer<Map, Rhs, const M: usize>( &self, rhs: &[Rhs; M], map: Map ) -> [[Map::Output; M]; N] where Map: FnMut<(T, Rhs)>, T: Copy, Rhs: Copy; fn flat_map<Map, O, const M: usize>(self, map: Map) -> [O; { _ }] where Map: FnMut<(T,), Output = [O; M]>; fn zip<Z>(self, other: [Z; N]) -> [(T, Z); N]; fn zip_outer<Z, const M: usize>(&self, other: &[Z; M]) -> [[(T, Z); M]; N] where T: Copy, Z: Copy; fn enumerate(self) -> [(usize, T); N]; fn diagonal<const H: usize, const W: usize>(self) -> [[T; W]; H] where T: Default + Copy; fn differentiate(self) -> [<T as Sub<T>>::Output; { _ }] where T: Sub<T> + Copy; fn integrate(self) -> Self where T: AddAssign<T> + Copy; fn integrate_from<const M: usize>(self, x0: T) -> [T; M] where T: AddAssign<T> + Copy; fn reduce<R>(self, reduce: R) -> Option<T> where R: FnMut(T, T) -> T; fn try_sum(self) -> Option<T> where T: AddAssign; fn sum_from<S>(self, from: S) -> S where S: AddAssign<T>; fn try_product(self) -> Option<T> where T: MulAssign; fn product_from<P>(self, from: P) -> P where P: MulAssign<T>; fn max(self) -> Option<T> where T: Ord; fn min(self) -> Option<T> where T: Ord; fn first_max(self) -> Option<T> where T: PartialOrd<T>; fn first_min(self) -> Option<T> where T: PartialOrd<T>; fn argmax(&self) -> Option<usize> where T: PartialOrd<T>; fn argmin(&self) -> Option<usize> where T: PartialOrd<T>; fn add_all<Rhs>(self, rhs: Rhs) -> [<T as Add<Rhs>>::Output; N] where T: Add<Rhs>, Rhs: Copy; fn sub_all<Rhs>(self, rhs: Rhs) -> [<T as Sub<Rhs>>::Output; N] where T: Sub<Rhs>, Rhs: Copy; fn mul_all<Rhs>(self, rhs: Rhs) -> [<T as Mul<Rhs>>::Output; N] where T: Mul<Rhs>, Rhs: Copy; fn div_all<Rhs>(self, rhs: Rhs) -> [<T as Div<Rhs>>::Output; N] where T: Div<Rhs>, Rhs: Copy; fn add_all_neg<Rhs>(self, rhs: Rhs) -> [<Rhs as Sub<T>>::Output; N] where Rhs: Copy + Sub<T>; fn mul_all_inv<Rhs>(self, rhs: Rhs) -> [<Rhs as Div<T>>::Output; N] where Rhs: Copy + Div<T>; fn neg_all(self) -> [<T as Neg>::Output; N] where T: Neg; fn add_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as Add<Rhs>>::Output; N] where T: Add<Rhs>; fn sub_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as Sub<Rhs>>::Output; N] where T: Sub<Rhs>; fn mul_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as Mul<Rhs>>::Output; N] where T: Mul<Rhs>; fn div_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as Div<Rhs>>::Output; N] where T: Div<Rhs>; fn try_mul_dot<Rhs>(self, rhs: [Rhs; N]) -> Option<<T as Mul<Rhs>>::Output> where T: Mul<Rhs, Output: AddAssign>; fn mul_dot_bias<Rhs>( self, rhs: [Rhs; N], bias: <T as Mul<Rhs>>::Output ) -> <T as Mul<Rhs>>::Output where T: Mul<Rhs, Output: AddAssign>; fn mul_outer<Rhs, const M: usize>( &self, rhs: &[Rhs; M] ) -> [[<T as Mul<Rhs>>::Output; M]; N] where T: Mul<Rhs> + Copy, Rhs: Copy; fn mul_cross<Rhs>(&self, rhs: [&[Rhs; N]; { _ }]) -> [<T as Sub>::Output; N] where T: MulAssign<Rhs> + Sub + Copy, Rhs: Copy; fn try_magnitude_squared(self) -> Option<<T as Mul<T>>::Output> where T: Mul<T, Output: AddAssign> + Copy; fn chain<const M: usize>(self, rhs: [T; M]) -> [T; { _ }]; fn rchain<const M: usize>(self, rhs: [T; M]) -> [T; { _ }]; fn into_rotate_left(self, n: usize) -> Self; fn into_rotate_right(self, n: usize) -> Self; fn into_shift_many_left<const M: usize>( self, items: [T; M] ) -> ([T; M], Self); fn into_shift_many_right<const M: usize>( self, items: [T; M] ) -> (Self, [T; M]); fn into_shift_left(self, item: T) -> (T, Self); fn into_shift_right(self, item: T) -> (Self, T); fn rotate_left2(&mut self, n: usize); fn rotate_right2(&mut self, n: usize); fn shift_many_left<const M: usize>(&mut self, items: [T; M]) -> [T; M]; fn shift_many_right<const M: usize>(&mut self, items: [T; M]) -> [T; M]; fn shift_left(&mut self, item: T) -> T; fn shift_right(&mut self, item: T) -> T; fn array_spread<const M: usize>(self) -> ([[T; { _ }]; M], [T; { _ }]); fn array_spread_ref<const M: usize>( &self ) -> ([&[Padded<T, M>; { _ }]; M], &[T; { _ }]); fn array_spread_mut<const M: usize>( &mut self ) -> ([&mut [Padded<T, M>; { _ }]; M], &mut [T; { _ }]); fn array_rspread<const M: usize>(self) -> ([T; { _ }], [[T; { _ }]; M]) where T: Copy; fn array_rspread_ref<const M: usize>( &self ) -> (&[T; { _ }], [&[Padded<T, M>; { _ }]; M]); fn array_rspread_mut<const M: usize>( &mut self ) -> (&mut [T; { _ }], [&mut [Padded<T, M>; { _ }]; M]); fn array_spread_exact<const M: usize>(self) -> [[T; { _ }]; M]; fn array_spread_exact_ref<const M: usize>( &self ) -> [&[Padded<T, M>; { _ }]; M]; fn array_spread_exact_mut<const M: usize>( &mut self ) -> [&mut [Padded<T, M>; { _ }]; M]; fn array_chunks<const M: usize>(self) -> ([[T; M]; { _ }], [T; { _ }]); fn array_chunks_ref<const M: usize>( &self ) -> (&[[T; M]; { _ }], &[T; { _ }]); fn array_chunks_mut<const M: usize>( &mut self ) -> (&mut [[T; M]; { _ }], &mut [T; { _ }]); fn array_rchunks<const M: usize>(self) -> ([T; { _ }], [[T; M]; { _ }]); fn array_rchunks_ref<const M: usize>( &self ) -> (&[T; { _ }], &[[T; M]; { _ }]); fn array_rchunks_mut<const M: usize>( &mut self ) -> (&mut [T; { _ }], &mut [[T; M]; { _ }]); fn array_chunks_exact<const M: usize>(self) -> [[T; M]; { _ }]; fn array_chunks_exact_ref<const M: usize>(&self) -> &[[T; M]; { _ }]; fn array_chunks_exact_mut<const M: usize>(&mut self) -> &mut [[T; M]; { _ }]; fn array_simd<const M: usize>(self) -> ([Simd<T, M>; { _ }], [T; { _ }]) where T: SimdElement, LaneCount<M>: SupportedLaneCount; fn array_simd_ref<const M: usize>( &self ) -> (&[Simd<T, M>; { _ }], &[T; { _ }]) where T: SimdElement, LaneCount<M>: SupportedLaneCount; fn array_simd_mut<const M: usize>( &mut self ) -> (&mut [Simd<T, M>; { _ }], &mut [T; { _ }]) where T: SimdElement, LaneCount<M>: SupportedLaneCount; fn array_rsimd<const M: usize>(self) -> ([T; { _ }], [Simd<T, M>; { _ }]) where T: SimdElement, LaneCount<M>: SupportedLaneCount; fn array_rsimd_ref<const M: usize>( &self ) -> (&[T; { _ }], &[Simd<T, M>; { _ }]) where T: SimdElement, LaneCount<M>: SupportedLaneCount; fn array_rsimd_mut<const M: usize>( &mut self ) -> (&mut [T; { _ }], &mut [Simd<T, M>; { _ }]) where T: SimdElement, LaneCount<M>: SupportedLaneCount; fn array_simd_exact<const M: usize>(self) -> [Simd<T, M>; { _ }] where T: SimdElement, LaneCount<M>: SupportedLaneCount; fn array_simd_exact_ref<const M: usize>(&self) -> &[Simd<T, M>; { _ }] where T: SimdElement, LaneCount<M>: SupportedLaneCount; fn array_simd_exact_mut<const M: usize>( &mut self ) -> &mut [Simd<T, M>; { _ }] where T: SimdElement, LaneCount<M>: SupportedLaneCount; fn split_array<const M: usize>(self) -> ([T; M], [T; { _ }]); fn split_array_ref2<const M: usize>(&self) -> (&[T; M], &[T; { _ }]); fn split_array_mut2<const M: usize>( &mut self ) -> (&mut [T; M], &mut [T; { _ }]); fn rsplit_array<const M: usize>(self) -> ([T; { _ }], [T; M]); fn rsplit_array_ref2<const M: usize>(&self) -> (&[T; { _ }], &[T; M]); fn rsplit_array_mut2<const M: usize>( &mut self ) -> (&mut [T; { _ }], &mut [T; M]); fn each_ref2(&self) -> [&T; N]; fn each_mut2(&mut self) -> [&mut T; N];
}

Required Methods§

source

fn split_len(n: usize) -> (usize, usize)

source

fn rsplit_len(n: usize) -> (usize, usize)

source

fn split_ptr(&self, n: usize) -> (*const T, *const T)

source

fn split_mut_ptr(&mut self, n: usize) -> (*mut T, *mut T)

source

fn rsplit_ptr(&self, n: usize) -> (*const T, *const T)

source

fn rsplit_mut_ptr(&mut self, n: usize) -> (*mut T, *mut T)

source

fn fill<F>(fill: F) -> Self
where F: FnMut(usize) -> T,

source

fn rfill<F>(fill: F) -> Self
where F: FnMut(usize) -> T,

source

fn truncate<const M: usize>(self) -> [T; M]

source

fn rtruncate<const M: usize>(self) -> [T; M]

source

fn truncate_ref<const M: usize>(&self) -> &[T; M]

source

fn rtruncate_ref<const M: usize>(&self) -> &[T; M]

source

fn truncate_mut<const M: usize>(&mut self) -> &mut [T; M]

source

fn rtruncate_mut<const M: usize>(&mut self) -> &mut [T; M]

source

fn resize<const M: usize, F>(self, fill: F) -> [T; M]
where F: FnMut(usize) -> T,

source

fn rresize<const M: usize, F>(self, fill: F) -> [T; M]
where F: FnMut(usize) -> T,

source

fn extend<const M: usize, F>(self, fill: F) -> [T; M]
where F: FnMut(usize) -> T,

source

fn rextend<const M: usize, F>(self, fill: F) -> [T; M]
where F: FnMut(usize) -> T,

source

fn reformulate_length<const M: usize>(self) -> [T; M]

source

fn reformulate_length_ref<const M: usize>(&self) -> &[T; M]

source

fn reformulate_length_mut<const M: usize>(&mut self) -> &mut [T; M]

source

fn try_reformulate_length<const M: usize>(self) -> Result<[T; M], Self>

source

fn try_reformulate_length_ref<const M: usize>(&self) -> Option<&[T; M]>

source

fn try_reformulate_length_mut<const M: usize>(&mut self) -> Option<&mut [T; M]>

source

fn map2<Map>(self, map: Map) -> [Map::Output; N]
where Map: FnMut<(T,)>,

Maps all values of an array with a given function.

This method can be executed at compile-time, as opposed to the standard-library method.

Example
#![feature(const_closures)]
#![feature(const_mut_refs)]
#![feature(const_trait_impl)]
 
use array_trait::*;
 
const A: [u8; 4] = [1, 2, 3, 4];
const B: [i8; 4] = A.map2(const |b| -(b as i8));
 
assert_eq!(B, [-1, -2, -3, -4]);
source

fn map_outer<Map>(&self, map: Map) -> [[Map::Output; N]; N]
where Map: FnMut<(T, T)>, T: Copy,

source

fn comap<Map, Rhs>(self, rhs: [Rhs; N], map: Map) -> [Map::Output; N]
where Map: FnMut<(T, Rhs)>,

source

fn comap_outer<Map, Rhs, const M: usize>( &self, rhs: &[Rhs; M], map: Map ) -> [[Map::Output; M]; N]
where Map: FnMut<(T, Rhs)>, T: Copy, Rhs: Copy,

source

fn flat_map<Map, O, const M: usize>(self, map: Map) -> [O; { _ }]
where Map: FnMut<(T,), Output = [O; M]>,

source

fn zip<Z>(self, other: [Z; N]) -> [(T, Z); N]

Combines two arrays with possibly different items into parallel, where each element lines up in the same position.

This method can be executed at compile-time, as opposed to the standard-library method.

Example
#![feature(const_trait_impl)]
 
use array_trait::*;
 
const A: [u8; 4] = [4, 3, 2, 1];
const B: [&str; 4] = ["four", "three", "two", "one"];
const C: [(u8, &str); 4] = A.zip2(B);
 
assert_eq!(C, [(4, "four"), (3, "three"), (2, "two"), (1, "one")]);
source

fn zip_outer<Z, const M: usize>(&self, other: &[Z; M]) -> [[(T, Z); M]; N]
where T: Copy, Z: Copy,

source

fn enumerate(self) -> [(usize, T); N]

source

fn diagonal<const H: usize, const W: usize>(self) -> [[T; W]; H]
where T: Default + Copy,

source

fn differentiate(self) -> [<T as Sub<T>>::Output; { _ }]
where T: Sub<T> + Copy,

Differentiates array (discrete calculus)

Example
#![feature(generic_const_exprs)]
 
use array_trait::*;
 
let a = [1, 2, 3];
 
assert_eq!(a.differentiate(), [2 - 1, 3 - 2]);
source

fn integrate(self) -> Self
where T: AddAssign<T> + Copy,

Integrates array (discrete calculus)

Example
use array_trait::*;
 
let a = [1, 2, 3];
 
assert_eq!(a.integrate(), [1, 1 + 2, 1 + 2 + 3])
source

fn integrate_from<const M: usize>(self, x0: T) -> [T; M]
where T: AddAssign<T> + Copy,

source

fn reduce<R>(self, reduce: R) -> Option<T>
where R: FnMut(T, T) -> T,

Reduces elements in array into one element, using a given operand

Example
#![feature(generic_const_exprs)]
 
use array_trait::ArrayOps;
 
const A: [u8; 3] = [1, 2, 3];
 
let r: u8 = A.reduce(|a, b| a + b).unwrap();
 
assert_eq!(r, 6);
source

fn try_sum(self) -> Option<T>
where T: AddAssign,

source

fn sum_from<S>(self, from: S) -> S
where S: AddAssign<T>,

source

fn try_product(self) -> Option<T>
where T: MulAssign,

source

fn product_from<P>(self, from: P) -> P
where P: MulAssign<T>,

source

fn max(self) -> Option<T>
where T: Ord,

source

fn min(self) -> Option<T>
where T: Ord,

source

fn first_max(self) -> Option<T>
where T: PartialOrd<T>,

source

fn first_min(self) -> Option<T>
where T: PartialOrd<T>,

source

fn argmax(&self) -> Option<usize>
where T: PartialOrd<T>,

source

fn argmin(&self) -> Option<usize>
where T: PartialOrd<T>,

source

fn add_all<Rhs>(self, rhs: Rhs) -> [<T as Add<Rhs>>::Output; N]
where T: Add<Rhs>, Rhs: Copy,

source

fn sub_all<Rhs>(self, rhs: Rhs) -> [<T as Sub<Rhs>>::Output; N]
where T: Sub<Rhs>, Rhs: Copy,

source

fn mul_all<Rhs>(self, rhs: Rhs) -> [<T as Mul<Rhs>>::Output; N]
where T: Mul<Rhs>, Rhs: Copy,

source

fn div_all<Rhs>(self, rhs: Rhs) -> [<T as Div<Rhs>>::Output; N]
where T: Div<Rhs>, Rhs: Copy,

source

fn add_all_neg<Rhs>(self, rhs: Rhs) -> [<Rhs as Sub<T>>::Output; N]
where Rhs: Copy + Sub<T>,

source

fn mul_all_inv<Rhs>(self, rhs: Rhs) -> [<Rhs as Div<T>>::Output; N]
where Rhs: Copy + Div<T>,

source

fn neg_all(self) -> [<T as Neg>::Output; N]
where T: Neg,

source

fn add_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as Add<Rhs>>::Output; N]
where T: Add<Rhs>,

source

fn sub_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as Sub<Rhs>>::Output; N]
where T: Sub<Rhs>,

source

fn mul_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as Mul<Rhs>>::Output; N]
where T: Mul<Rhs>,

source

fn div_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as Div<Rhs>>::Output; N]
where T: Div<Rhs>,

source

fn try_mul_dot<Rhs>(self, rhs: [Rhs; N]) -> Option<<T as Mul<Rhs>>::Output>
where T: Mul<Rhs, Output: AddAssign>,

source

fn mul_dot_bias<Rhs>( self, rhs: [Rhs; N], bias: <T as Mul<Rhs>>::Output ) -> <T as Mul<Rhs>>::Output
where T: Mul<Rhs, Output: AddAssign>,

source

fn mul_outer<Rhs, const M: usize>( &self, rhs: &[Rhs; M] ) -> [[<T as Mul<Rhs>>::Output; M]; N]
where T: Mul<Rhs> + Copy, Rhs: Copy,

source

fn mul_cross<Rhs>(&self, rhs: [&[Rhs; N]; { _ }]) -> [<T as Sub>::Output; N]
where T: MulAssign<Rhs> + Sub + Copy, Rhs: Copy,

Computes the general cross-product of the two arrays (as if vectors, in the mathematical sense).

Example
#![feature(generic_const_exprs)]
#![feature(const_trait_impl)]
 
use array_trait::ArrayOps;
 
const U: [f64; 3] = [1.0, 0.0, 0.0];
const V: [f64; 3] = [0.0, 1.0, 0.0];
 
const W: [f64; 3] = U.mul_cross([&V]);
 
assert_eq!(W, [0.0, 0.0, 1.0]);
source

fn try_magnitude_squared(self) -> Option<<T as Mul<T>>::Output>
where T: Mul<T, Output: AddAssign> + Copy,

source

fn chain<const M: usize>(self, rhs: [T; M]) -> [T; { _ }]

Chains two arrays with the same item together.

Example
use array_trait::*;
 
let a = ["one", "two"];
let b = ["three"];
 
assert_eq!(a.chain(b), ["one", "two", "three"]);
source

fn rchain<const M: usize>(self, rhs: [T; M]) -> [T; { _ }]

Chains two arrays with the same item together in reverse.

Example
use array_trait::*;
 
let a = ["two", "three"];
let b = ["one"];
 
assert_eq!(a.rchain(b), ["one", "two", "three"]);
source

fn into_rotate_left(self, n: usize) -> Self

source

fn into_rotate_right(self, n: usize) -> Self

source

fn into_shift_many_left<const M: usize>(self, items: [T; M]) -> ([T; M], Self)

source

fn into_shift_many_right<const M: usize>(self, items: [T; M]) -> (Self, [T; M])

source

fn into_shift_left(self, item: T) -> (T, Self)

source

fn into_shift_right(self, item: T) -> (Self, T)

source

fn rotate_left2(&mut self, n: usize)

source

fn rotate_right2(&mut self, n: usize)

source

fn shift_many_left<const M: usize>(&mut self, items: [T; M]) -> [T; M]

source

fn shift_many_right<const M: usize>(&mut self, items: [T; M]) -> [T; M]

source

fn shift_left(&mut self, item: T) -> T

source

fn shift_right(&mut self, item: T) -> T

source

fn array_spread<const M: usize>(self) -> ([[T; { _ }]; M], [T; { _ }])

Distributes items of an array equally across a given width, then provides the rest as a separate array.

Example
#![feature(generic_const_exprs)]
#![feature(generic_arg_infer)]
 
use array_trait::*;
 
let array = ["ping 1", "pong 1", "ping 2", "pong 2", "ping 3", "pong 3", "uhh..."];
 
let ([ping, pong], rest) = array.array_spread::<2>();
 
assert_eq!(ping, ["ping 1", "ping 2", "ping 3"]);
assert_eq!(pong, ["pong 1", "pong 2", "pong 3"]);
assert_eq!(rest, ["uhh..."]);
source

fn array_spread_ref<const M: usize>( &self ) -> ([&[Padded<T, M>; { _ }]; M], &[T; { _ }])

Distributes items of an array-slice equally across a given width, then provides the rest as a separate array-slice.

The spread-out slices are given in padded arrays. Each padded item can be borrowed into a reference to the array’s item.

source

fn array_spread_mut<const M: usize>( &mut self ) -> ([&mut [Padded<T, M>; { _ }]; M], &mut [T; { _ }])

Distributes items of a mutable array-slice equally across a given width, then provides the rest as a separate mutable array-slice.

The spread-out slices are given in padded arrays. Each padded item can be borrowed into a reference to the array’s item.

Example
#![feature(generic_const_exprs)]
#![feature(generic_arg_infer)]
 
use array_trait::*;
 
let mut array = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"];
 
let (threes, _) = array.array_spread_mut::<3>();
 
for fizz in threes.into_iter().last().unwrap()
{
    **fizz = "fizz";
}
 
let (fives, _) = array.array_spread_mut::<5>();
 
for buzz in fives.into_iter().last().unwrap()
{
    **buzz = "buzz";
}
 
let (fifteens, _) = array.array_spread_mut::<15>();
 
for fizzbuzz in fifteens.into_iter().last().unwrap()
{
    **fizzbuzz = "fizzbuzz";
}
 
assert_eq!(array, ["1", "2", "fizz", "4", "buzz", "fizz", "7", "8", "fizz", "buzz", "11", "fizz", "13", "14", "fizzbuzz", "16", "17", "fizz", "19", "buzz"]);
 
source

fn array_rspread<const M: usize>(self) -> ([T; { _ }], [[T; { _ }]; M])
where T: Copy,

Distributes items of an array equally across a given width, then provides the leftmost rest as a separate array.

source

fn array_rspread_ref<const M: usize>( &self ) -> (&[T; { _ }], [&[Padded<T, M>; { _ }]; M])

Distributes items of an array-slice equally across a given width, then provides the leftmost rest as a separate array-slice.

The spread-out slices are given in padded arrays. Each padded item can be borrowed into a reference to the array’s item.

Example
#![feature(generic_const_exprs)]
#![feature(generic_arg_infer)]
#![feature(array_methods)]
 
use array_trait::*;
 
let array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20];
 
let (zero, [odd, even]) = array.array_rspread_ref::<2>();
 
assert_eq!(*zero, [0]);
assert_eq!(odd.each_ref().map(|padding| **padding), [1, 3, 5, 7, 9, 11, 13, 15, 17, 19]);
assert_eq!(even.each_ref().map(|padding| **padding), [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]);
source

fn array_rspread_mut<const M: usize>( &mut self ) -> (&mut [T; { _ }], [&mut [Padded<T, M>; { _ }]; M])

Distributes items of a mutable array-slice equally across a given width, then provides the leftmost rest as a separate mutable array-slice.

The spread-out slices are given in padded arrays. Each padded item can be borrowed into a reference to the array’s item.

Example
#![feature(generic_const_exprs)]
#![feature(generic_arg_infer)]
#![feature(array_methods)]
 
use array_trait::*;
 
let mut array = ["the", "beat", "goes", "1", "2", "3", "4", "5", "6", "7", "8"];
 
let (start, [boots, n, cats, and]) = array.array_rspread_mut::<4>();
 
for boots in boots
{
    **boots = "boots";
}
for n in n
{
    **n = "n";
}
for cats in cats
{
    **cats = "cats";
}
for and in and
{
    **and = "and";
}
 
assert_eq!(array, ["the", "beat", "goes", "boots", "n", "cats", "and", "boots", "n", "cats", "and"]);
source

fn array_spread_exact<const M: usize>(self) -> [[T; { _ }]; M]

Distributes items of an array equally across a given width, with no rest.

The width must be a factor of the array length, otherwise it will not compile.

Example
#![feature(generic_const_exprs)]
#![feature(generic_arg_infer)]
 
use array_trait::*;
 
let array = *b"aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ";
 
let [lower_case, upper_case] = array.array_spread_exact::<2>();
 
assert_eq!(lower_case, *b"abcdefghijklmnopqrstuvwxyz");
assert_eq!(upper_case, *b"ABCDEFGHIJKLMNOPQRSTUVWXYZ");
source

fn array_spread_exact_ref<const M: usize>(&self) -> [&[Padded<T, M>; { _ }]; M]

Distributes items of an array-slice equally across a given width, with no rest.

The width must be a factor of the array length, otherwise it will not compile.

The spread-out slices are given in padded arrays. Each padded item can be borrowed into a reference to the array’s item.

Example
#![feature(generic_const_exprs)]
#![feature(generic_arg_infer)]
#![feature(array_methods)]
 
use array_trait::*;
 
let statement = ["s", "he", "be", "lie", "ve", "d"];
 
let [interpretation2, interpretation1] = statement.array_spread_exact_ref::<2>();
 
assert_eq!(interpretation1.each_ref().map(|padding| &**padding), ["he", "lie", "d"].each_ref());
assert_eq!(interpretation2.each_ref().map(|padding| &**padding), ["s", "be", "ve"].each_ref());
source

fn array_spread_exact_mut<const M: usize>( &mut self ) -> [&mut [Padded<T, M>; { _ }]; M]

Distributes items of a mutable array-slice equally across a given width, with no rest.

The width must be a factor of the array length, otherwise it will not compile.

The spread-out slices are given in padded arrays. Each padded item can be borrowed into a reference to the array’s item.

Example
#![feature(generic_const_exprs)]
#![feature(generic_arg_infer)]
#![feature(array_methods)]
 
use array_trait::*;
 
let mut array = *b"aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ";
 
let [lower_case, upper_case] = array.array_spread_exact_mut::<2>();
 
assert_eq!(lower_case.each_ref().map(|padding| padding.borrow()), b"abcdefghijklmnopqrstuvwxyz".each_ref());
assert_eq!(upper_case.each_ref().map(|padding| padding.borrow()), b"ABCDEFGHIJKLMNOPQRSTUVWXYZ".each_ref());
 
for c in upper_case
{
    **c = b'_';
}
 
assert_eq!(array, *b"a_b_c_d_e_f_g_h_i_j_k_l_m_n_o_p_q_r_s_t_u_v_w_x_y_z_")
source

fn array_chunks<const M: usize>(self) -> ([[T; M]; { _ }], [T; { _ }])

Divides an array into chunks, then yielding the rest in a separate array.

Example
#![feature(generic_const_exprs)]
#![feature(generic_arg_infer)]
 
use array_trait::*;
 
let array = ["carrot", "potato", "beet", "tomato", "kiwi", "banana", "cherry", "peach", "strawberry", "nine volt batteries"];
 
let ([root_vegetables, technically_berries, stone_fruits], not_for_human_consumption) = array.array_chunks::<3>();
 
assert_eq!(root_vegetables, ["carrot", "potato", "beet"]);
assert_eq!(technically_berries, ["tomato", "kiwi", "banana"]);
assert_eq!(stone_fruits, ["cherry", "peach", "strawberry"]);
assert_eq!(not_for_human_consumption, ["nine volt batteries"]);
source

fn array_chunks_ref<const M: usize>(&self) -> (&[[T; M]; { _ }], &[T; { _ }])

Divides an array-slice into chunks, then yielding the rest in a separate array-slice.

Example
#![feature(generic_const_exprs)]
#![feature(generic_arg_infer)]
 
use array_trait::*;
 
let transistors = ["2N3904", "2N2222A", "BC107", "AC127", "OC7", "NKT275", "2SK30A", "2N5458", "J108", "2N7000", "BS170"];
 
let ([silicon_bjts, germanium_bjts, jfets], mosfets) = transistors.array_chunks_ref::<3>();
 
assert_eq!(silicon_bjts, &["2N3904", "2N2222A", "BC107"]);
assert_eq!(germanium_bjts, &["AC127", "OC7", "NKT275"]);
assert_eq!(jfets, &["2SK30A", "2N5458", "J108"]);
assert_eq!(mosfets, &["2N7000", "BS170"]);
source

fn array_chunks_mut<const M: usize>( &mut self ) -> (&mut [[T; M]; { _ }], &mut [T; { _ }])

Divides a mutable array-slice into chunks, then yielding the rest in a separate mutable array-slice.

Example
#![feature(generic_const_exprs)]
#![feature(generic_arg_infer)]
 
use array_trait::*;
 
let mut array = [0, 1, 0, 1, 0, 1, 6];
 
let (pairs, last) = array.array_chunks_mut::<2>();
 
for (i, pair) in pairs.into_iter().enumerate()
{
    for number in pair
    {
        *number += i*2;
    }
}
 
assert_eq!(array, [0, 1, 2, 3, 4, 5, 6]);
source

fn array_rchunks<const M: usize>(self) -> ([T; { _ }], [[T; M]; { _ }])

Divides a mutable array-slice into chunks, then yielding the leftmost rest in a separate mutable array-slice.

source

fn array_rchunks_ref<const M: usize>(&self) -> (&[T; { _ }], &[[T; M]; { _ }])

Divides an array-slice into chunks, then yielding the leftmost rest in a separate array-slice.

source

fn array_rchunks_mut<const M: usize>( &mut self ) -> (&mut [T; { _ }], &mut [[T; M]; { _ }])

Divides a mutable array-slice into chunks, then yielding the leftmost rest in a separate array-slice.

source

fn array_chunks_exact<const M: usize>(self) -> [[T; M]; { _ }]

Divides an array into chunks, with no rest.

The chunk length must be a factor of the array length, otherwise it will not compile.

Example
#![feature(generic_const_exprs)]
#![feature(generic_arg_infer)]
 
use array_trait::*;
 
let array = [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9];
 
let [lower_half, upper_half] = array.array_chunks_exact::<5>();
 
assert_eq!(lower_half, [0.0, 0.1, 0.2, 0.3, 0.4]);
assert_eq!(upper_half, [0.5, 0.6, 0.7, 0.8, 0.9]);
source

fn array_chunks_exact_ref<const M: usize>(&self) -> &[[T; M]; { _ }]

Divides an array-slice into chunks, with no rest.

The chunk length must be a factor of the array length, otherwise it will not compile.

Example
#![feature(generic_const_exprs)]
#![feature(generic_arg_infer)]
 
use array_trait::*;
 
let array = [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9];
 
let [lower_half, upper_half] = array.array_chunks_exact_ref::<5>();
 
assert_eq!(lower_half, &[0.0, 0.1, 0.2, 0.3, 0.4]);
assert_eq!(upper_half, &[0.5, 0.6, 0.7, 0.8, 0.9]);
source

fn array_chunks_exact_mut<const M: usize>(&mut self) -> &mut [[T; M]; { _ }]

Divides a mutable array-slice into chunks, with no rest.

The chunk length must be a factor of the array length, otherwise it will not compile.

source

fn array_simd<const M: usize>(self) -> ([Simd<T, M>; { _ }], [T; { _ }])

source

fn array_simd_ref<const M: usize>(&self) -> (&[Simd<T, M>; { _ }], &[T; { _ }])

source

fn array_simd_mut<const M: usize>( &mut self ) -> (&mut [Simd<T, M>; { _ }], &mut [T; { _ }])

source

fn array_rsimd<const M: usize>(self) -> ([T; { _ }], [Simd<T, M>; { _ }])

source

fn array_rsimd_ref<const M: usize>(&self) -> (&[T; { _ }], &[Simd<T, M>; { _ }])

source

fn array_rsimd_mut<const M: usize>( &mut self ) -> (&mut [T; { _ }], &mut [Simd<T, M>; { _ }])

source

fn array_simd_exact<const M: usize>(self) -> [Simd<T, M>; { _ }]

source

fn array_simd_exact_ref<const M: usize>(&self) -> &[Simd<T, M>; { _ }]

source

fn array_simd_exact_mut<const M: usize>(&mut self) -> &mut [Simd<T, M>; { _ }]

source

fn split_array<const M: usize>(self) -> ([T; M], [T; { _ }])

Splits an array at a chosen index.

source

fn split_array_ref2<const M: usize>(&self) -> (&[T; M], &[T; { _ }])

Splits an array at a chosen index as array-slices.

source

fn split_array_mut2<const M: usize>(&mut self) -> (&mut [T; M], &mut [T; { _ }])

Splits an array at a chosen index as mutable array-slices.

source

fn rsplit_array<const M: usize>(self) -> ([T; { _ }], [T; M])

Splits an array at a chosen index, where the index goes from right to left.

source

fn rsplit_array_ref2<const M: usize>(&self) -> (&[T; { _ }], &[T; M])

Splits an array at a chosen index as array-slices, where the index goes from right to left.

source

fn rsplit_array_mut2<const M: usize>( &mut self ) -> (&mut [T; { _ }], &mut [T; M])

Splits an array at a chosen index as mutable array-slices, where the index goes from right to left.

source

fn each_ref2(&self) -> [&T; N]

source

fn each_mut2(&mut self) -> [&mut T; N]

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T, const N: usize> ArrayOps<T, N> for [T; N]

source§

fn split_len(mid: usize) -> (usize, usize)

source§

fn rsplit_len(mid: usize) -> (usize, usize)

source§

fn split_ptr(&self, mid: usize) -> (*const T, *const T)

source§

fn split_mut_ptr(&mut self, mid: usize) -> (*mut T, *mut T)

source§

fn rsplit_ptr(&self, mid: usize) -> (*const T, *const T)

source§

fn rsplit_mut_ptr(&mut self, mid: usize) -> (*mut T, *mut T)

source§

fn fill<F>(fill: F) -> Self
where F: FnMut(usize) -> T + Destruct,

source§

fn rfill<F>(fill: F) -> Self
where F: FnMut(usize) -> T + Destruct,

source§

fn truncate<const M: usize>(self) -> [T; M]
where T: Destruct,

source§

fn rtruncate<const M: usize>(self) -> [T; M]
where T: Destruct,

source§

fn truncate_ref<const M: usize>(&self) -> &[T; M]

source§

fn rtruncate_ref<const M: usize>(&self) -> &[T; M]

source§

fn truncate_mut<const M: usize>(&mut self) -> &mut [T; M]

source§

fn rtruncate_mut<const M: usize>(&mut self) -> &mut [T; M]

source§

fn resize<const M: usize, F>(self, fill: F) -> [T; M]
where F: FnMut(usize) -> T + Destruct, T: Destruct,

source§

fn rresize<const M: usize, F>(self, fill: F) -> [T; M]
where F: FnMut(usize) -> T + Destruct, T: Destruct,

source§

fn into_rotate_left(self, n: usize) -> Self

source§

fn into_rotate_right(self, n: usize) -> Self

source§

fn into_shift_many_left<const M: usize>(self, items: [T; M]) -> ([T; M], Self)

source§

fn into_shift_many_right<const M: usize>(self, items: [T; M]) -> (Self, [T; M])

source§

fn into_shift_left(self, item: T) -> (T, Self)

source§

fn into_shift_right(self, item: T) -> (Self, T)

source§

fn rotate_left2(&mut self, n: usize)

source§

fn rotate_right2(&mut self, n: usize)

source§

fn shift_many_left<const M: usize>(&mut self, items: [T; M]) -> [T; M]

source§

fn shift_many_right<const M: usize>(&mut self, items: [T; M]) -> [T; M]

source§

fn shift_left(&mut self, item: T) -> T

source§

fn shift_right(&mut self, item: T) -> T

source§

fn extend<const M: usize, F>(self, fill: F) -> [T; M]
where F: FnMut(usize) -> T + Destruct,

source§

fn rextend<const M: usize, F>(self, fill: F) -> [T; M]
where F: FnMut(usize) -> T + Destruct,

source§

fn reformulate_length<const M: usize>(self) -> [T; M]

source§

fn reformulate_length_ref<const M: usize>(&self) -> &[T; M]

source§

fn reformulate_length_mut<const M: usize>(&mut self) -> &mut [T; M]

source§

fn try_reformulate_length<const M: usize>(self) -> Result<[T; M], Self>

source§

fn try_reformulate_length_ref<const M: usize>(&self) -> Option<&[T; M]>

source§

fn try_reformulate_length_mut<const M: usize>(&mut self) -> Option<&mut [T; M]>

source§

fn map2<Map>(self, map: Map) -> [Map::Output; N]
where Map: FnMut<(T,)> + Destruct,

source§

fn map_outer<Map>(&self, map: Map) -> [[Map::Output; N]; N]
where Map: FnMut<(T, T)> + Destruct, T: Copy,

source§

fn comap<Map, Rhs>(self, rhs: [Rhs; N], map: Map) -> [Map::Output; N]
where Map: FnMut<(T, Rhs)> + Destruct,

source§

fn comap_outer<Map, Rhs, const M: usize>( &self, rhs: &[Rhs; M], map: Map ) -> [[Map::Output; M]; N]
where Map: FnMut<(T, Rhs)> + Destruct, T: Copy, Rhs: Copy,

source§

fn flat_map<Map, O, const M: usize>(self, map: Map) -> [O; { _ }]
where Map: FnMut<(T,), Output = [O; M]> + Destruct,

source§

fn zip<Z>(self, other: [Z; N]) -> [(T, Z); N]

source§

fn zip_outer<Z, const M: usize>(&self, other: &[Z; M]) -> [[(T, Z); M]; N]
where T: Copy, Z: Copy,

source§

fn enumerate(self) -> [(usize, T); N]

source§

fn diagonal<const H: usize, const W: usize>(self) -> [[T; W]; H]
where T: Default,

source§

fn differentiate(self) -> [<T as Sub<T>>::Output; { _ }]
where T: Sub<T> + Copy + Destruct,

source§

fn integrate(self) -> Self
where T: AddAssign<T> + Copy + Destruct,

source§

fn integrate_from<const M: usize>(self, x0: T) -> [T; M]
where T: AddAssign<T> + Copy + Destruct,

source§

fn reduce<R>(self, reduce: R) -> Option<T>
where R: FnMut(T, T) -> T + Destruct,

source§

fn try_sum(self) -> Option<T>
where T: AddAssign,

source§

fn sum_from<S>(self, from: S) -> S
where S: AddAssign<T>,

source§

fn try_product(self) -> Option<T>
where T: MulAssign,

source§

fn product_from<P>(self, from: P) -> P
where P: MulAssign<T>,

source§

fn max(self) -> Option<T>
where T: Ord,

source§

fn min(self) -> Option<T>
where T: Ord,

source§

fn first_max(self) -> Option<T>
where T: PartialOrd<T>,

source§

fn first_min(self) -> Option<T>
where T: PartialOrd<T>,

source§

fn argmax(&self) -> Option<usize>
where T: PartialOrd<T>,

source§

fn argmin(&self) -> Option<usize>
where T: PartialOrd<T>,

source§

fn add_all<Rhs>(self, rhs: Rhs) -> [<T as Add<Rhs>>::Output; N]
where T: Add<Rhs>, Rhs: Copy,

source§

fn sub_all<Rhs>(self, rhs: Rhs) -> [<T as Sub<Rhs>>::Output; N]
where T: Sub<Rhs>, Rhs: Copy,

source§

fn mul_all<Rhs>(self, rhs: Rhs) -> [<T as Mul<Rhs>>::Output; N]
where T: Mul<Rhs>, Rhs: Copy,

source§

fn div_all<Rhs>(self, rhs: Rhs) -> [<T as Div<Rhs>>::Output; N]
where T: Div<Rhs>, Rhs: Copy,

source§

fn add_all_neg<Rhs>(self, rhs: Rhs) -> [<Rhs as Sub<T>>::Output; N]
where Rhs: Copy + Sub<T>,

source§

fn mul_all_inv<Rhs>(self, rhs: Rhs) -> [<Rhs as Div<T>>::Output; N]
where Rhs: Copy + Div<T>,

source§

fn neg_all(self) -> [<T as Neg>::Output; N]
where T: Neg,

source§

fn add_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as Add<Rhs>>::Output; N]
where T: Add<Rhs>,

source§

fn sub_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as Sub<Rhs>>::Output; N]
where T: Sub<Rhs>,

source§

fn mul_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as Mul<Rhs>>::Output; N]
where T: Mul<Rhs>,

source§

fn div_each<Rhs>(self, rhs: [Rhs; N]) -> [<T as Div<Rhs>>::Output; N]
where T: Div<Rhs>,

source§

fn try_mul_dot<Rhs>(self, rhs: [Rhs; N]) -> Option<<T as Mul<Rhs>>::Output>
where T: Mul<Rhs, Output: AddAssign>,

source§

fn mul_dot_bias<Rhs>( self, rhs: [Rhs; N], bias: <T as Mul<Rhs>>::Output ) -> <T as Mul<Rhs>>::Output
where T: Mul<Rhs, Output: AddAssign>,

source§

fn mul_outer<Rhs, const M: usize>( &self, rhs: &[Rhs; M] ) -> [[<T as Mul<Rhs>>::Output; M]; N]
where T: Mul<Rhs> + Copy, Rhs: Copy,

source§

fn mul_cross<Rhs>(&self, rhs: [&[Rhs; N]; { _ }]) -> [<T as Sub>::Output; N]
where T: MulAssign<Rhs> + Sub + Copy, Rhs: Copy,

source§

fn try_magnitude_squared(self) -> Option<<T as Mul<T>>::Output>
where T: Mul<T, Output: AddAssign> + Copy,

source§

fn chain<const M: usize>(self, rhs: [T; M]) -> [T; { _ }]

source§

fn rchain<const M: usize>(self, rhs: [T; M]) -> [T; { _ }]

source§

fn array_spread<const M: usize>(self) -> ([[T; { _ }]; M], [T; { _ }])

source§

fn array_spread_ref<const M: usize>( &self ) -> ([&[Padded<T, M>; { _ }]; M], &[T; { _ }])

source§

fn array_spread_mut<const M: usize>( &mut self ) -> ([&mut [Padded<T, M>; { _ }]; M], &mut [T; { _ }])

source§

fn array_rspread<const M: usize>(self) -> ([T; { _ }], [[T; { _ }]; M])

source§

fn array_rspread_ref<const M: usize>( &self ) -> (&[T; { _ }], [&[Padded<T, M>; { _ }]; M])

source§

fn array_rspread_mut<const M: usize>( &mut self ) -> (&mut [T; { _ }], [&mut [Padded<T, M>; { _ }]; M])

source§

fn array_spread_exact<const M: usize>(self) -> [[T; { _ }]; M]

source§

fn array_spread_exact_ref<const M: usize>(&self) -> [&[Padded<T, M>; { _ }]; M]

source§

fn array_spread_exact_mut<const M: usize>( &mut self ) -> [&mut [Padded<T, M>; { _ }]; M]

source§

fn array_chunks<const M: usize>(self) -> ([[T; M]; { _ }], [T; { _ }])

source§

fn array_chunks_ref<const M: usize>(&self) -> (&[[T; M]; { _ }], &[T; { _ }])

source§

fn array_chunks_mut<const M: usize>( &mut self ) -> (&mut [[T; M]; { _ }], &mut [T; { _ }])

source§

fn array_rchunks<const M: usize>(self) -> ([T; { _ }], [[T; M]; { _ }])

source§

fn array_rchunks_ref<const M: usize>(&self) -> (&[T; { _ }], &[[T; M]; { _ }])

source§

fn array_rchunks_mut<const M: usize>( &mut self ) -> (&mut [T; { _ }], &mut [[T; M]; { _ }])

source§

fn array_chunks_exact<const M: usize>(self) -> [[T; M]; { _ }]

source§

fn array_chunks_exact_ref<const M: usize>(&self) -> &[[T; M]; { _ }]

source§

fn array_chunks_exact_mut<const M: usize>(&mut self) -> &mut [[T; M]; { _ }]

source§

fn array_simd<const M: usize>(self) -> ([Simd<T, M>; { _ }], [T; { _ }])

source§

fn array_simd_ref<const M: usize>(&self) -> (&[Simd<T, M>; { _ }], &[T; { _ }])

source§

fn array_simd_mut<const M: usize>( &mut self ) -> (&mut [Simd<T, M>; { _ }], &mut [T; { _ }])

source§

fn array_rsimd<const M: usize>(self) -> ([T; { _ }], [Simd<T, M>; { _ }])

source§

fn array_rsimd_ref<const M: usize>(&self) -> (&[T; { _ }], &[Simd<T, M>; { _ }])

source§

fn array_rsimd_mut<const M: usize>( &mut self ) -> (&mut [T; { _ }], &mut [Simd<T, M>; { _ }])

source§

fn array_simd_exact<const M: usize>(self) -> [Simd<T, M>; { _ }]

source§

fn array_simd_exact_ref<const M: usize>(&self) -> &[Simd<T, M>; { _ }]

source§

fn array_simd_exact_mut<const M: usize>(&mut self) -> &mut [Simd<T, M>; { _ }]

source§

fn split_array<const M: usize>(self) -> ([T; M], [T; { _ }])

source§

fn split_array_ref2<const M: usize>(&self) -> (&[T; M], &[T; { _ }])

source§

fn split_array_mut2<const M: usize>(&mut self) -> (&mut [T; M], &mut [T; { _ }])

source§

fn rsplit_array<const M: usize>(self) -> ([T; { _ }], [T; M])

source§

fn rsplit_array_mut2<const M: usize>( &mut self ) -> (&mut [T; { _ }], &mut [T; M])

source§

fn rsplit_array_ref2<const M: usize>(&self) -> (&[T; { _ }], &[T; M])

source§

fn each_ref2(&self) -> [&T; N]

source§

fn each_mut2(&mut self) -> [&mut T; N]

Implementors§