Trait array_math::ArrayOps
source · pub trait ArrayOps<T, const N: usize>: ArrayPrereq<Item = T> + IntoIterator + Borrow<[T; N]> + BorrowMut<[T; N]> {
Show 129 associated items
type Array<I, const L: usize>: ArrayOps<I, L> = [I; L];
type PaddedItem<I, const W: usize>: Borrow<I> + BorrowMut<I> = Padded<I, W>;
type PaddedArray<I, const W: usize, const L: usize>: ArrayOps<Self::PaddedItem<I, W>, L> = Self::Array<Self::PaddedItem<I, W>, L>;
type Resized<const M: usize>: ArrayOps<T, M> = Self::Array<T, M>;
type Chained<const M: usize>: ArrayOps<T, array_trait::::array_ops::ArrayOps::Chained::{constant#1}> = Self::Array<T, array_trait::::array_ops::ArrayOps::Chained::{constant#2}>;
type RChained<const M: usize>: ArrayOps<T, array_trait::::array_ops::ArrayOps::RChained::{constant#1}> = Self::Array<T, array_trait::::array_ops::ArrayOps::RChained::{constant#2}>;
type MappedTo<M>: ArrayOps<M, N> = Self::Array<M, N>;
type Mapped<M: FnOnce(T)>: ArrayOps<<M as FnOnce(T)>::Output, N> = Self::MappedTo<<M as FnOnce(T)>::Output>;
type Zipped<Z>: ArrayOps<(T, Z), N> = Self::MappedTo<(T, Z)>;
type Enumerated: ArrayOps<(usize, T), N> = Self::MappedTo<usize>::Zipped<T>;
type Differentiated: ArrayOps<<T as Sub>::Output, array_trait::::array_ops::ArrayOps::Differentiated::{constant#1}> = Self::Array<<T as Sub>::Output, array_trait::::array_ops::ArrayOps::Differentiated::{constant#2}>
where T: Sub;
type Split<const M: usize>: ArrayOps<T, M> = Self::Resized<M>;
type RSplit<const M: usize>: ArrayOps<T, array_trait::::array_ops::ArrayOps::RSplit::{constant#1}> = Self::Resized<array_trait::::array_ops::ArrayOps::RSplit::{constant#2}>;
type ResizedDiv<const M: usize>: ArrayOps<T, array_trait::::array_ops::ArrayOps::ResizedDiv::{constant#1}> = Self::Resized<array_trait::::array_ops::ArrayOps::ResizedDiv::{constant#2}>;
type ResizedRem<const M: usize>: ArrayOps<T, array_trait::::array_ops::ArrayOps::ResizedRem::{constant#1}> = Self::Resized<array_trait::::array_ops::ArrayOps::ResizedRem::{constant#2}>;
type Chunks<const M: usize>: ArrayOps<Self::Array<T, M>, array_trait::::array_ops::ArrayOps::Chunks::{constant#1}> = [Self::Array<T, M>; { _ }];
// Required methods
fn split_len<const WRAPPING: bool>(n: usize) -> (usize, usize);
fn rsplit_len<const WRAPPING: bool>(n: usize) -> (usize, usize);
fn split_ptr<const WRAPPING: bool>(&self, n: usize) -> (*const T, *const T);
fn split_mut_ptr<const WRAPPING: bool>(
&mut self,
n: usize
) -> (*mut T, *mut T);
fn rsplit_ptr<const WRAPPING: bool>(&self, n: usize) -> (*const T, *const T);
fn rsplit_mut_ptr<const WRAPPING: bool>(
&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 for_each<F>(self, action: F)
where F: FnMut(T);
fn for_each_ref<F>(&self, action: F)
where F: FnMut(&T);
fn for_each_mut<F>(&mut self, action: F)
where F: FnMut(&mut T);
fn truncate<const M: usize>(self) -> Self::Resized<M>;
fn rtruncate<const M: usize>(self) -> Self::Resized<M>;
fn resize<const M: usize, F>(self, fill: F) -> Self::Resized<M>
where F: FnMut(usize) -> T;
fn rresize<const M: usize, F>(self, fill: F) -> Self::Resized<M>
where F: FnMut(usize) -> T;
fn extend<const M: usize, F>(self, fill: F) -> Self::Resized<M>
where F: FnMut(usize) -> T;
fn rextend<const M: usize, F>(self, fill: F) -> Self::Resized<M>
where F: FnMut(usize) -> T;
fn reformulate_length<const M: usize>(self) -> Self::Resized<M>;
fn reformulate_length_ref<const M: usize>(&self) -> &Self::Resized<M>;
fn reformulate_length_mut<const M: usize>(
&mut self
) -> &mut Self::Resized<M>;
fn try_reformulate_length<const M: usize>(
self
) -> Result<Self::Resized<M>, Self>;
fn try_reformulate_length_ref<const M: usize>(
&self
) -> Option<&Self::Resized<M>>;
fn try_reformulate_length_mut<const M: usize>(
&mut self
) -> Option<&mut Self::Resized<M>>;
fn into_const_iter(self) -> IntoConstIter<T, N, true>;
fn into_const_iter_reverse(self) -> IntoConstIter<T, N, false>;
fn const_iter(&self) -> ConstIter<'_, T, N>;
fn const_iter_mut(&mut self) -> ConstIterMut<'_, T, N>;
fn map2<Map>(self, map: Map) -> Self::Mapped<Map>
where Map: FnMut(T);
fn map_outer<Map>(
&self,
map: Map
) -> Self::MappedTo<Self::MappedTo<<Map as FnOnce(T, T)>::Output>>
where Map: FnMut(T, T),
T: Copy;
fn comap<Map, Rhs>(
self,
rhs: [Rhs; N],
map: Map
) -> Self::MappedTo<<Map as FnOnce(T, Rhs)>::Output>
where Map: FnMut(T, Rhs);
fn comap_outer<Map, Rhs, const M: usize>(
&self,
rhs: &Self::Array<Rhs, M>,
map: Map
) -> Self::MappedTo<Self::Array<<Map as FnOnce(T, Rhs)>::Output, M>>
where Map: FnMut(T, Rhs),
T: Copy,
Rhs: Copy;
fn zip2<Z>(self, other: Self::Array<Z, N>) -> Self::Zipped<Z>;
fn zip_outer<Z, const M: usize>(
&self,
other: &Self::Array<Z, M>
) -> Self::MappedTo<Self::Array<(T, Z), M>>
where T: Copy,
Z: Copy;
fn enumerate(self) -> Self::Enumerated;
fn diagonal<const H: usize, const W: usize>(
self
) -> Self::Array<Self::Resized<W>, H>
where T: Default + Copy;
fn differentiate(self) -> Self::Differentiated
where T: Sub + Copy;
fn integrate(self) -> Self
where T: AddAssign + Copy;
fn integrate_from<const M: usize>(self, x0: T) -> Self::Resized<M>
where T: AddAssign + 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;
fn first_min(self) -> Option<T>
where T: PartialOrd;
fn argmax(self) -> Option<usize>
where T: PartialOrd;
fn argmin(self) -> Option<usize>
where T: PartialOrd;
fn all(&self) -> bool
where T: Into<bool> + Copy;
fn any(&self) -> bool
where T: Into<bool> + Copy;
fn eq2<Rhs>(&self, rhs: &[Rhs]) -> bool
where T: PartialEq<Rhs>;
fn add_all<Rhs>(self, rhs: Rhs) -> Self::MappedTo<<T as Add<Rhs>>::Output>
where T: Add<Rhs>,
Rhs: Copy;
fn sub_all<Rhs>(self, rhs: Rhs) -> Self::MappedTo<<T as Sub<Rhs>>::Output>
where T: Sub<Rhs>,
Rhs: Copy;
fn mul_all<Rhs>(self, rhs: Rhs) -> Self::MappedTo<<T as Mul<Rhs>>::Output>
where T: Mul<Rhs>,
Rhs: Copy;
fn div_all<Rhs>(self, rhs: Rhs) -> Self::MappedTo<<T as Div<Rhs>>::Output>
where T: Div<Rhs>,
Rhs: Copy;
fn add_all_neg<Rhs>(
self,
rhs: Rhs
) -> Self::MappedTo<<Rhs as Sub<T>>::Output>
where Rhs: Copy + Sub<T>;
fn mul_all_inv<Rhs>(
self,
rhs: Rhs
) -> Self::MappedTo<<Rhs as Div<T>>::Output>
where Rhs: Copy + Div<T>;
fn neg_all(self) -> [<T as Neg>::Output; N]
where T: Neg;
fn add_each<Rhs>(
self,
rhs: Self::MappedTo<Rhs>
) -> Self::MappedTo<<T as Add<Rhs>>::Output>
where T: Add<Rhs>;
fn sub_each<Rhs>(
self,
rhs: Self::MappedTo<Rhs>
) -> Self::MappedTo<<T as Sub<Rhs>>::Output>
where T: Sub<Rhs>;
fn mul_each<Rhs>(
self,
rhs: Self::MappedTo<Rhs>
) -> Self::MappedTo<<T as Mul<Rhs>>::Output>
where T: Mul<Rhs>;
fn div_each<Rhs>(
self,
rhs: Self::MappedTo<Rhs>
) -> Self::MappedTo<<T as Div<Rhs>>::Output>
where T: Div<Rhs>;
fn try_mul_dot<Rhs>(
self,
rhs: Self::MappedTo<Rhs>
) -> Option<<T as Mul<Rhs>>::Output>
where T: Mul<Rhs>,
<T as Mul<Rhs>>::Output: AddAssign;
fn mul_dot_bias<Rhs>(
self,
rhs: Self::MappedTo<Rhs>,
bias: <T as Mul<Rhs>>::Output
) -> <T as Mul<Rhs>>::Output
where T: Mul<Rhs>,
<T as Mul<Rhs>>::Output: AddAssign;
fn mul_outer<Rhs, const M: usize>(
&self,
rhs: &Self::Array<Rhs, M>
) -> Self::MappedTo<Self::Array<<T as Mul<Rhs>>::Output, M>>
where T: Mul<Rhs> + Copy,
Rhs: Copy;
fn mul_cross<Rhs>(
&self,
rhs: [&Self::MappedTo<Rhs>; { _ }]
) -> Self::MappedTo<<T as Sub>::Output>
where T: MulAssign<Rhs> + Sub + Copy,
Rhs: Copy;
fn try_magnitude_squared(self) -> Option<<T as Mul>::Output>
where T: Mul + Copy,
<T as Mul>::Output: AddAssign;
fn chain<const M: usize>(
self,
rhs: Self::Array<T, M>
) -> Self::Resized<array_trait::::array_ops::ArrayOps::chain::{constant#0}>;
fn rchain<const M: usize>(
self,
rhs: Self::Array<T, M>
) -> Self::Resized<array_trait::::array_ops::ArrayOps::rchain::{constant#0}>;
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 from_item(item: T) -> Self::Array<T, 1>;
fn from_item_ref(item: &T) -> &Self::Array<T, 1>;
fn from_item_mut(item: &mut T) -> &mut Self::Array<T, 1>;
fn into_single_item(self) -> T;
fn try_into_single_item(self) -> Result<T, Self>;
fn array_spread<const M: usize>(
self
) -> ([Self::ResizedDiv<M>; M], Self::ResizedRem<M>);
fn array_spread_ref<const M: usize>(
&self
) -> ([&Self::PaddedArray<T, M, array_trait::::array_ops::ArrayOps::array_spread_ref::{constant#2}>; M], &Self::ResizedRem<M>);
fn array_spread_mut<const M: usize>(
&mut self
) -> ([&mut Self::PaddedArray<T, M, array_trait::::array_ops::ArrayOps::array_spread_mut::{constant#2}>; M], &mut Self::ResizedRem<M>);
fn array_rspread<const M: usize>(
self
) -> (Self::ResizedRem<M>, [Self::ResizedDiv<M>; M])
where T: Copy;
fn array_rspread_ref<const M: usize>(
&self
) -> (&Self::ResizedRem<M>, [&Self::PaddedArray<T, M, array_trait::::array_ops::ArrayOps::array_rspread_ref::{constant#2}>; M]);
fn array_rspread_mut<const M: usize>(
&mut self
) -> (&mut Self::ResizedRem<M>, [&mut Self::PaddedArray<T, M, array_trait::::array_ops::ArrayOps::array_rspread_mut::{constant#2}>; M]);
fn array_spread_exact<const M: usize>(self) -> [Self::ResizedDiv<M>; M];
fn array_spread_exact_ref<const M: usize>(
&self
) -> [&Self::PaddedArray<T, M, array_trait::::array_ops::ArrayOps::array_spread_exact_ref::{constant#2}>; M];
fn array_spread_exact_mut<const M: usize>(
&mut self
) -> [&mut Self::PaddedArray<T, M, array_trait::::array_ops::ArrayOps::array_spread_exact_mut::{constant#2}>; M];
fn array_chunks<const M: usize>(
self
) -> (Self::Chunks<M>, Self::ResizedRem<M>);
fn array_chunks_ref<const M: usize>(
&self
) -> (&Self::Chunks<M>, &Self::ResizedRem<M>);
fn array_chunks_mut<const M: usize>(
&mut self
) -> (&mut Self::Chunks<M>, &mut Self::ResizedRem<M>);
fn array_rchunks<const M: usize>(
self
) -> (Self::ResizedRem<M>, Self::Chunks<M>);
fn array_rchunks_ref<const M: usize>(
&self
) -> (&Self::ResizedRem<M>, &Self::Chunks<M>);
fn array_rchunks_mut<const M: usize>(
&mut self
) -> (&mut Self::ResizedRem<M>, &mut Self::Chunks<M>);
fn array_chunks_exact<const M: usize>(self) -> Self::Chunks<M>;
fn array_chunks_exact_ref<const M: usize>(&self) -> &Self::Chunks<M>;
fn array_chunks_exact_mut<const M: usize>(&mut self) -> &mut Self::Chunks<M>;
fn split_array<const M: usize>(
self
) -> (Self::Resized<M>, Self::Resized<array_trait::::array_ops::ArrayOps::split_array::{constant#1}>);
fn split_array_ref2<const M: usize>(
&self
) -> (&Self::Resized<M>, &Self::Resized<array_trait::::array_ops::ArrayOps::split_array_ref2::{constant#1}>);
fn split_array_mut2<const M: usize>(
&mut self
) -> (&mut Self::Resized<M>, &mut Self::Resized<array_trait::::array_ops::ArrayOps::split_array_mut2::{constant#1}>);
fn rsplit_array<const M: usize>(
self
) -> (Self::Resized<array_trait::::array_ops::ArrayOps::rsplit_array::{constant#1}>, Self::Resized<M>);
fn rsplit_array_ref2<const M: usize>(
&self
) -> (&Self::Resized<array_trait::::array_ops::ArrayOps::rsplit_array_ref2::{constant#1}>, &Self::Resized<M>);
fn rsplit_array_mut2<const M: usize>(
&mut self
) -> (&mut Self::Resized<array_trait::::array_ops::ArrayOps::rsplit_array_mut2::{constant#1}>, &mut Self::Resized<M>);
fn each_ref2<B>(&self) -> Self::MappedTo<&B>
where T: Borrow<B>;
fn each_mut2<B>(&mut self) -> Self::MappedTo<&mut B>
where T: BorrowMut<B>;
}Provided Associated Types§
type Array<I, const L: usize>: ArrayOps<I, L> = [I; L]
type PaddedItem<I, const W: usize>: Borrow<I> + BorrowMut<I> = Padded<I, W>
type PaddedArray<I, const W: usize, const L: usize>: ArrayOps<Self::PaddedItem<I, W>, L> = Self::Array<Self::PaddedItem<I, W>, L>
type Resized<const M: usize>: ArrayOps<T, M> = Self::Array<T, M>
type Chained<const M: usize>: ArrayOps<T, array_trait::::array_ops::ArrayOps::Chained::{constant#1}> = Self::Array<T, array_trait::::array_ops::ArrayOps::Chained::{constant#2}>
type RChained<const M: usize>: ArrayOps<T, array_trait::::array_ops::ArrayOps::RChained::{constant#1}> = Self::Array<T, array_trait::::array_ops::ArrayOps::RChained::{constant#2}>
type MappedTo<M>: ArrayOps<M, N> = Self::Array<M, N>
type Mapped<M: FnOnce(T)>: ArrayOps<<M as FnOnce(T)>::Output, N> = Self::MappedTo<<M as FnOnce(T)>::Output>
type Zipped<Z>: ArrayOps<(T, Z), N> = Self::MappedTo<(T, Z)>
type Enumerated: ArrayOps<(usize, T), N> = Self::MappedTo<usize>::Zipped<T>
type Differentiated: ArrayOps<<T as Sub>::Output, array_trait::::array_ops::ArrayOps::Differentiated::{constant#1}> = Self::Array<<T as Sub>::Output, array_trait::::array_ops::ArrayOps::Differentiated::{constant#2}> where T: Sub
type Split<const M: usize>: ArrayOps<T, M> = Self::Resized<M>
type RSplit<const M: usize>: ArrayOps<T, array_trait::::array_ops::ArrayOps::RSplit::{constant#1}> = Self::Resized<array_trait::::array_ops::ArrayOps::RSplit::{constant#2}>
type ResizedDiv<const M: usize>: ArrayOps<T, array_trait::::array_ops::ArrayOps::ResizedDiv::{constant#1}> = Self::Resized<array_trait::::array_ops::ArrayOps::ResizedDiv::{constant#2}>
type ResizedRem<const M: usize>: ArrayOps<T, array_trait::::array_ops::ArrayOps::ResizedRem::{constant#1}> = Self::Resized<array_trait::::array_ops::ArrayOps::ResizedRem::{constant#2}>
type Chunks<const M: usize>: ArrayOps<Self::Array<T, M>, array_trait::::array_ops::ArrayOps::Chunks::{constant#1}> = [Self::Array<T, M>; { _ }]
Required Methods§
fn split_len<const WRAPPING: bool>(n: usize) -> (usize, usize)
fn rsplit_len<const WRAPPING: bool>(n: usize) -> (usize, usize)
fn split_ptr<const WRAPPING: bool>(&self, n: usize) -> (*const T, *const T)
fn split_mut_ptr<const WRAPPING: bool>(&mut self, n: usize) -> (*mut T, *mut T)
fn rsplit_ptr<const WRAPPING: bool>(&self, n: usize) -> (*const T, *const T)
fn rsplit_mut_ptr<const WRAPPING: bool>(&mut self, n: usize) -> (*mut T, *mut T)
fn fill<F>(fill: F) -> Self
fn rfill<F>(fill: F) -> Self
fn for_each<F>(self, action: F)where
F: FnMut(T),
fn for_each_ref<F>(&self, action: F)
fn for_each_mut<F>(&mut self, action: F)
fn truncate<const M: usize>(self) -> Self::Resized<M>
fn rtruncate<const M: usize>(self) -> Self::Resized<M>
fn resize<const M: usize, F>(self, fill: F) -> Self::Resized<M>
fn rresize<const M: usize, F>(self, fill: F) -> Self::Resized<M>
fn extend<const M: usize, F>(self, fill: F) -> Self::Resized<M>
fn rextend<const M: usize, F>(self, fill: F) -> Self::Resized<M>
fn reformulate_length<const M: usize>(self) -> Self::Resized<M>
fn reformulate_length_ref<const M: usize>(&self) -> &Self::Resized<M>
fn reformulate_length_mut<const M: usize>(&mut self) -> &mut Self::Resized<M>
fn try_reformulate_length<const M: usize>( self ) -> Result<Self::Resized<M>, Self>
fn try_reformulate_length_ref<const M: usize>( &self ) -> Option<&Self::Resized<M>>
fn try_reformulate_length_mut<const M: usize>( &mut self ) -> Option<&mut Self::Resized<M>>
sourcefn into_const_iter(self) -> IntoConstIter<T, N, true>
fn into_const_iter(self) -> IntoConstIter<T, N, true>
Converts an array into a const interator.
The const iterator does not implement std::iter::Iterator, and as such is more limited in its usage. However it can be used at compile-time.
Example
#![feature(inline_const)]
#![feature(const_trait_impl)]
#![feature(const_mut_refs)]
#![feature(const_deref)]
use core::{mem::ManuallyDrop, ops::DerefMut};
use array_trait::*;
const A: [u8; 3] = [1, 2, 3];
const A_SUM: u8 = const {
let mut iter = ManuallyDrop::new(A.into_const_iter());
let mut sum = 0;
while let Some(b) = iter.deref_mut().next()
{
sum += b;
}
sum
};
assert_eq!(A_SUM, 1 + 2 + 3);fn into_const_iter_reverse(self) -> IntoConstIter<T, N, false>
sourcefn const_iter(&self) -> ConstIter<'_, T, N>
fn const_iter(&self) -> ConstIter<'_, T, N>
Makes a const iterator over the array-slice.
The const iterator does not implement std::iter::Iterator, and as such is more limited in its usage. However it can be used at compile-time.
sourcefn const_iter_mut(&mut self) -> ConstIterMut<'_, T, N>
fn const_iter_mut(&mut self) -> ConstIterMut<'_, T, N>
Makes a mutable const iterator over the mutable array-slice.
The const iterator does not implement std::iter::Iterator, and as such is more limited in its usage. However it can be used at compile-time.
sourcefn map2<Map>(self, map: Map) -> Self::Mapped<Map>where
Map: FnMut(T),
fn map2<Map>(self, map: Map) -> Self::Mapped<Map>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]);fn map_outer<Map>( &self, map: Map ) -> Self::MappedTo<Self::MappedTo<<Map as FnOnce(T, T)>::Output>>
fn comap<Map, Rhs>(
self,
rhs: [Rhs; N],
map: Map
) -> Self::MappedTo<<Map as FnOnce(T, Rhs)>::Output>where
Map: FnMut(T, Rhs),
fn comap_outer<Map, Rhs, const M: usize>( &self, rhs: &Self::Array<Rhs, M>, map: Map ) -> Self::MappedTo<Self::Array<<Map as FnOnce(T, Rhs)>::Output, M>>
sourcefn zip2<Z>(self, other: Self::Array<Z, N>) -> Self::Zipped<Z>
fn zip2<Z>(self, other: Self::Array<Z, N>) -> Self::Zipped<Z>
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")]);fn zip_outer<Z, const M: usize>( &self, other: &Self::Array<Z, M> ) -> Self::MappedTo<Self::Array<(T, Z), M>>
fn enumerate(self) -> Self::Enumerated
fn diagonal<const H: usize, const W: usize>( self ) -> Self::Array<Self::Resized<W>, H>
sourcefn differentiate(self) -> Self::Differentiated
fn differentiate(self) -> Self::Differentiated
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]);sourcefn integrate(self) -> Self
fn integrate(self) -> Self
Integrates array (discrete calculus)
Example
use array_trait::*;
let a = [1, 2, 3];
assert_eq!(a.integrate(), [1, 1 + 2, 1 + 2 + 3])fn integrate_from<const M: usize>(self, x0: T) -> Self::Resized<M>
sourcefn reduce<R>(self, reduce: R) -> Option<T>where
R: FnMut(T, T) -> T,
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);fn try_sum(self) -> Option<T>where
T: AddAssign,
fn sum_from<S>(self, from: S) -> Swhere
S: AddAssign<T>,
fn try_product(self) -> Option<T>where
T: MulAssign,
fn product_from<P>(self, from: P) -> Pwhere
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,
fn first_min(self) -> Option<T>where
T: PartialOrd,
fn argmax(self) -> Option<usize>where
T: PartialOrd,
fn argmin(self) -> Option<usize>where
T: PartialOrd,
fn all(&self) -> bool
fn any(&self) -> bool
fn eq2<Rhs>(&self, rhs: &[Rhs]) -> boolwhere
T: PartialEq<Rhs>,
fn add_all<Rhs>(self, rhs: Rhs) -> Self::MappedTo<<T as Add<Rhs>>::Output>
fn sub_all<Rhs>(self, rhs: Rhs) -> Self::MappedTo<<T as Sub<Rhs>>::Output>
fn mul_all<Rhs>(self, rhs: Rhs) -> Self::MappedTo<<T as Mul<Rhs>>::Output>
fn div_all<Rhs>(self, rhs: Rhs) -> Self::MappedTo<<T as Div<Rhs>>::Output>
fn add_all_neg<Rhs>(self, rhs: Rhs) -> Self::MappedTo<<Rhs as Sub<T>>::Output>
fn mul_all_inv<Rhs>(self, rhs: Rhs) -> Self::MappedTo<<Rhs as Div<T>>::Output>
fn neg_all(self) -> [<T as Neg>::Output; N]where
T: Neg,
fn add_each<Rhs>(
self,
rhs: Self::MappedTo<Rhs>
) -> Self::MappedTo<<T as Add<Rhs>>::Output>where
T: Add<Rhs>,
fn sub_each<Rhs>(
self,
rhs: Self::MappedTo<Rhs>
) -> Self::MappedTo<<T as Sub<Rhs>>::Output>where
T: Sub<Rhs>,
fn mul_each<Rhs>(
self,
rhs: Self::MappedTo<Rhs>
) -> Self::MappedTo<<T as Mul<Rhs>>::Output>where
T: Mul<Rhs>,
fn div_each<Rhs>(
self,
rhs: Self::MappedTo<Rhs>
) -> Self::MappedTo<<T as Div<Rhs>>::Output>where
T: Div<Rhs>,
fn try_mul_dot<Rhs>( self, rhs: Self::MappedTo<Rhs> ) -> Option<<T as Mul<Rhs>>::Output>
fn mul_dot_bias<Rhs>( self, rhs: Self::MappedTo<Rhs>, bias: <T as Mul<Rhs>>::Output ) -> <T as Mul<Rhs>>::Output
fn mul_outer<Rhs, const M: usize>( &self, rhs: &Self::Array<Rhs, M> ) -> Self::MappedTo<Self::Array<<T as Mul<Rhs>>::Output, M>>
sourcefn mul_cross<Rhs>(
&self,
rhs: [&Self::MappedTo<Rhs>; { _ }]
) -> Self::MappedTo<<T as Sub>::Output>
fn mul_cross<Rhs>( &self, rhs: [&Self::MappedTo<Rhs>; { _ }] ) -> Self::MappedTo<<T as Sub>::Output>
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]);fn try_magnitude_squared(self) -> Option<<T as Mul>::Output>
sourcefn chain<const M: usize>(
self,
rhs: Self::Array<T, M>
) -> Self::Resized<array_trait::::array_ops::ArrayOps::chain::{constant#0}>
fn chain<const M: usize>( self, rhs: Self::Array<T, M> ) -> Self::Resized<array_trait::::array_ops::ArrayOps::chain::{constant#0}>
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"]);sourcefn rchain<const M: usize>(
self,
rhs: Self::Array<T, M>
) -> Self::Resized<array_trait::::array_ops::ArrayOps::rchain::{constant#0}>
fn rchain<const M: usize>( self, rhs: Self::Array<T, M> ) -> Self::Resized<array_trait::::array_ops::ArrayOps::rchain::{constant#0}>
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"]);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 from_item(item: T) -> Self::Array<T, 1>
fn from_item_ref(item: &T) -> &Self::Array<T, 1>
fn from_item_mut(item: &mut T) -> &mut Self::Array<T, 1>
fn into_single_item(self) -> T
fn try_into_single_item(self) -> Result<T, Self>
sourcefn array_spread<const M: usize>(
self
) -> ([Self::ResizedDiv<M>; M], Self::ResizedRem<M>)
fn array_spread<const M: usize>( self ) -> ([Self::ResizedDiv<M>; M], Self::ResizedRem<M>)
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..."]);sourcefn array_spread_ref<const M: usize>(
&self
) -> ([&Self::PaddedArray<T, M, array_trait::::array_ops::ArrayOps::array_spread_ref::{constant#2}>; M], &Self::ResizedRem<M>)
fn array_spread_ref<const M: usize>( &self ) -> ([&Self::PaddedArray<T, M, array_trait::::array_ops::ArrayOps::array_spread_ref::{constant#2}>; M], &Self::ResizedRem<M>)
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.
sourcefn array_spread_mut<const M: usize>(
&mut self
) -> ([&mut Self::PaddedArray<T, M, array_trait::::array_ops::ArrayOps::array_spread_mut::{constant#2}>; M], &mut Self::ResizedRem<M>)
fn array_spread_mut<const M: usize>( &mut self ) -> ([&mut Self::PaddedArray<T, M, array_trait::::array_ops::ArrayOps::array_spread_mut::{constant#2}>; M], &mut Self::ResizedRem<M>)
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"]);
sourcefn array_rspread<const M: usize>(
self
) -> (Self::ResizedRem<M>, [Self::ResizedDiv<M>; M])where
T: Copy,
fn array_rspread<const M: usize>(
self
) -> (Self::ResizedRem<M>, [Self::ResizedDiv<M>; M])where
T: Copy,
Distributes items of an array equally across a given width, then provides the leftmost rest as a separate array.
sourcefn array_rspread_ref<const M: usize>(
&self
) -> (&Self::ResizedRem<M>, [&Self::PaddedArray<T, M, array_trait::::array_ops::ArrayOps::array_rspread_ref::{constant#2}>; M])
fn array_rspread_ref<const M: usize>( &self ) -> (&Self::ResizedRem<M>, [&Self::PaddedArray<T, M, array_trait::::array_ops::ArrayOps::array_rspread_ref::{constant#2}>; 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]);sourcefn array_rspread_mut<const M: usize>(
&mut self
) -> (&mut Self::ResizedRem<M>, [&mut Self::PaddedArray<T, M, array_trait::::array_ops::ArrayOps::array_rspread_mut::{constant#2}>; M])
fn array_rspread_mut<const M: usize>( &mut self ) -> (&mut Self::ResizedRem<M>, [&mut Self::PaddedArray<T, M, array_trait::::array_ops::ArrayOps::array_rspread_mut::{constant#2}>; 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"]);sourcefn array_spread_exact<const M: usize>(self) -> [Self::ResizedDiv<M>; M]
fn array_spread_exact<const M: usize>(self) -> [Self::ResizedDiv<M>; 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");sourcefn array_spread_exact_ref<const M: usize>(
&self
) -> [&Self::PaddedArray<T, M, array_trait::::array_ops::ArrayOps::array_spread_exact_ref::{constant#2}>; M]
fn array_spread_exact_ref<const M: usize>( &self ) -> [&Self::PaddedArray<T, M, array_trait::::array_ops::ArrayOps::array_spread_exact_ref::{constant#2}>; 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());sourcefn array_spread_exact_mut<const M: usize>(
&mut self
) -> [&mut Self::PaddedArray<T, M, array_trait::::array_ops::ArrayOps::array_spread_exact_mut::{constant#2}>; M]
fn array_spread_exact_mut<const M: usize>( &mut self ) -> [&mut Self::PaddedArray<T, M, array_trait::::array_ops::ArrayOps::array_spread_exact_mut::{constant#2}>; 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_")sourcefn array_chunks<const M: usize>(self) -> (Self::Chunks<M>, Self::ResizedRem<M>)
fn array_chunks<const M: usize>(self) -> (Self::Chunks<M>, Self::ResizedRem<M>)
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"]);sourcefn array_chunks_ref<const M: usize>(
&self
) -> (&Self::Chunks<M>, &Self::ResizedRem<M>)
fn array_chunks_ref<const M: usize>( &self ) -> (&Self::Chunks<M>, &Self::ResizedRem<M>)
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"]);sourcefn array_chunks_mut<const M: usize>(
&mut self
) -> (&mut Self::Chunks<M>, &mut Self::ResizedRem<M>)
fn array_chunks_mut<const M: usize>( &mut self ) -> (&mut Self::Chunks<M>, &mut Self::ResizedRem<M>)
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]);sourcefn array_rchunks<const M: usize>(self) -> (Self::ResizedRem<M>, Self::Chunks<M>)
fn array_rchunks<const M: usize>(self) -> (Self::ResizedRem<M>, Self::Chunks<M>)
Divides a mutable array-slice into chunks, then yielding the leftmost rest in a separate mutable array-slice.
sourcefn array_rchunks_ref<const M: usize>(
&self
) -> (&Self::ResizedRem<M>, &Self::Chunks<M>)
fn array_rchunks_ref<const M: usize>( &self ) -> (&Self::ResizedRem<M>, &Self::Chunks<M>)
Divides an array-slice into chunks, then yielding the leftmost rest in a separate array-slice.
sourcefn array_rchunks_mut<const M: usize>(
&mut self
) -> (&mut Self::ResizedRem<M>, &mut Self::Chunks<M>)
fn array_rchunks_mut<const M: usize>( &mut self ) -> (&mut Self::ResizedRem<M>, &mut Self::Chunks<M>)
Divides a mutable array-slice into chunks, then yielding the leftmost rest in a separate array-slice.
sourcefn array_chunks_exact<const M: usize>(self) -> Self::Chunks<M>
fn array_chunks_exact<const M: usize>(self) -> Self::Chunks<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]);sourcefn array_chunks_exact_ref<const M: usize>(&self) -> &Self::Chunks<M>
fn array_chunks_exact_ref<const M: usize>(&self) -> &Self::Chunks<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]);sourcefn array_chunks_exact_mut<const M: usize>(&mut self) -> &mut Self::Chunks<M>
fn array_chunks_exact_mut<const M: usize>(&mut self) -> &mut Self::Chunks<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.
sourcefn split_array<const M: usize>(
self
) -> (Self::Resized<M>, Self::Resized<array_trait::::array_ops::ArrayOps::split_array::{constant#1}>)
fn split_array<const M: usize>( self ) -> (Self::Resized<M>, Self::Resized<array_trait::::array_ops::ArrayOps::split_array::{constant#1}>)
Splits an array at a chosen index.
sourcefn split_array_ref2<const M: usize>(
&self
) -> (&Self::Resized<M>, &Self::Resized<array_trait::::array_ops::ArrayOps::split_array_ref2::{constant#1}>)
fn split_array_ref2<const M: usize>( &self ) -> (&Self::Resized<M>, &Self::Resized<array_trait::::array_ops::ArrayOps::split_array_ref2::{constant#1}>)
Splits an array at a chosen index as array-slices.
sourcefn split_array_mut2<const M: usize>(
&mut self
) -> (&mut Self::Resized<M>, &mut Self::Resized<array_trait::::array_ops::ArrayOps::split_array_mut2::{constant#1}>)
fn split_array_mut2<const M: usize>( &mut self ) -> (&mut Self::Resized<M>, &mut Self::Resized<array_trait::::array_ops::ArrayOps::split_array_mut2::{constant#1}>)
Splits an array at a chosen index as mutable array-slices.
sourcefn rsplit_array<const M: usize>(
self
) -> (Self::Resized<array_trait::::array_ops::ArrayOps::rsplit_array::{constant#1}>, Self::Resized<M>)
fn rsplit_array<const M: usize>( self ) -> (Self::Resized<array_trait::::array_ops::ArrayOps::rsplit_array::{constant#1}>, Self::Resized<M>)
Splits an array at a chosen index, where the index goes from right to left.
sourcefn rsplit_array_ref2<const M: usize>(
&self
) -> (&Self::Resized<array_trait::::array_ops::ArrayOps::rsplit_array_ref2::{constant#1}>, &Self::Resized<M>)
fn rsplit_array_ref2<const M: usize>( &self ) -> (&Self::Resized<array_trait::::array_ops::ArrayOps::rsplit_array_ref2::{constant#1}>, &Self::Resized<M>)
Splits an array at a chosen index as array-slices, where the index goes from right to left.
sourcefn rsplit_array_mut2<const M: usize>(
&mut self
) -> (&mut Self::Resized<array_trait::::array_ops::ArrayOps::rsplit_array_mut2::{constant#1}>, &mut Self::Resized<M>)
fn rsplit_array_mut2<const M: usize>( &mut self ) -> (&mut Self::Resized<array_trait::::array_ops::ArrayOps::rsplit_array_mut2::{constant#1}>, &mut Self::Resized<M>)
Splits an array at a chosen index as mutable array-slices, where the index goes from right to left.