ArrayExt

Trait ArrayExt 

Source
pub trait ArrayExt<T, const N: usize> {
    // Required methods
    fn each_ref_ext(&self) -> [&T; N];
    fn each_mut_ext(&mut self) -> [&mut T; N];
    fn try_map_ext<F, U, E>(self, f: F) -> Result<[U; N], E>
       where F: FnMut(T) -> Result<U, E>;
    fn zip_ext<U>(self, rhs: [U; N]) -> [(T, U); N];
}
Expand description

Extension trait for arrays

Required Methods§

Source

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

Source

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

Source

fn try_map_ext<F, U, E>(self, f: F) -> Result<[U; N], E>
where F: FnMut(T) -> Result<U, E>,

Source

fn zip_ext<U>(self, rhs: [U; N]) -> [(T, U); N]

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.

Implementations on Foreign Types§

Source§

impl<T> ArrayExt<T, 2> for [T; 2]

Source§

fn each_ref_ext(&self) -> [&T; 2]

Source§

fn each_mut_ext(&mut self) -> [&mut T; 2]

Source§

fn try_map_ext<F, U, E>(self, f: F) -> Result<[U; 2], E>
where F: FnMut(T) -> Result<U, E>,

Source§

fn zip_ext<U>(self, rhs: [U; 2]) -> [(T, U); 2]

Source§

impl<T> ArrayExt<T, 3> for [T; 3]

Source§

fn each_ref_ext(&self) -> [&T; 3]

Source§

fn each_mut_ext(&mut self) -> [&mut T; 3]

Source§

fn try_map_ext<F, U, E>(self, f: F) -> Result<[U; 3], E>
where F: FnMut(T) -> Result<U, E>,

Source§

fn zip_ext<U>(self, rhs: [U; 3]) -> [(T, U); 3]

Source§

impl<T> ArrayExt<T, 4> for [T; 4]

Source§

fn each_ref_ext(&self) -> [&T; 4]

Source§

fn each_mut_ext(&mut self) -> [&mut T; 4]

Source§

fn try_map_ext<F, U, E>(self, f: F) -> Result<[U; 4], E>
where F: FnMut(T) -> Result<U, E>,

Source§

fn zip_ext<U>(self, rhs: [U; 4]) -> [(T, U); 4]

Implementors§