pub trait ArrayLike<T, const N: usize>:
From<[T; N]>
+ Into<[T; N]>
+ Index<usize, Output = T>
+ IndexMut<usize, Output = T> {
type WithType<T2>: ArrayLike<T2, N>;
const DIMENSION: usize = N;
Show 13 methods
// Required methods
fn array(&self) -> &[T; N];
fn array_mut(&mut self) -> &mut [T; N];
// Provided methods
fn splat(value: T) -> Self
where T: Clone { ... }
fn map<U, F>(self, f: F) -> Self::WithType<U>
where F: FnMut(T) -> U { ... }
fn map_with<U, T2, F>(
self,
other: Self::WithType<T2>,
f: F,
) -> Self::WithType<U>
where F: FnMut(T, T2) -> U { ... }
fn any<P>(&self, p: P) -> bool
where P: FnMut(&T) -> bool { ... }
fn any_with<T2, P>(&self, other: Self::WithType<T2>, p: P) -> bool
where P: FnMut(&T, &T2) -> bool { ... }
fn all<P>(&self, p: P) -> bool
where P: FnMut(&T) -> bool { ... }
fn all_with<T2, P>(&self, other: &Self::WithType<T2>, p: P) -> bool
where P: FnMut(&T, &T2) -> bool { ... }
fn for_each<F>(&self, f: F)
where F: FnMut(&T) { ... }
fn for_each_mut<F>(&mut self, f: F)
where F: FnMut(&mut T) { ... }
fn slice(&self) -> &[T] { ... }
fn slice_mut(&mut self) -> &mut [T] { ... }
}Provided Associated Constants§
Required Associated Types§
Required Methods§
Provided Methods§
fn splat(value: T) -> Selfwhere
T: Clone,
fn map<U, F>(self, f: F) -> Self::WithType<U>where
F: FnMut(T) -> U,
fn map_with<U, T2, F>(
self,
other: Self::WithType<T2>,
f: F,
) -> Self::WithType<U>where
F: FnMut(T, T2) -> U,
Sourcefn any_with<T2, P>(&self, other: Self::WithType<T2>, p: P) -> bool
fn any_with<T2, P>(&self, other: Self::WithType<T2>, p: P) -> bool
True if the predicate is true for at least one component
Sourcefn all_with<T2, P>(&self, other: &Self::WithType<T2>, p: P) -> bool
fn all_with<T2, P>(&self, other: &Self::WithType<T2>, p: P) -> bool
True if the predicate is true for all component
fn for_each<F>(&self, f: F)
fn for_each_mut<F>(&mut self, f: F)
fn slice(&self) -> &[T]
fn slice_mut(&mut self) -> &mut [T]
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.