pub trait SupportedArray<T, const N: usize> {
// Provided methods
fn map<U, F>(self, f: F) -> [U; N]
where Self: Sized,
F: FnMut(T) -> U { ... }
fn each_ref(&self) -> [&T; N] { ... }
fn each_mut(&mut self) -> [&mut T; N] { ... }
}Expand description
Methods only available on owned arrays [T; N], not on slices.
See the module docs for how to read this trait.
Provided Methods§
Sourcefn map<U, F>(self, f: F) -> [U; N]
fn map<U, F>(self, f: F) -> [U; N]
Returns a new array where each element is the result of applying f to
the corresponding element of self.
Mirrors <[T; N]>::map.
Sourcefn each_ref(&self) -> [&T; N]
fn each_ref(&self) -> [&T; N]
Borrows each element and returns a fresh array of references.
Mirrors <[T; N]>::each_ref.
Sourcefn each_mut(&mut self) -> [&mut T; N]
fn each_mut(&mut self) -> [&mut T; N]
Borrows each element mutably and returns a fresh array of references.
Mirrors <[T; N]>::each_mut.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".