ArrayN

Trait ArrayN 

Source
pub trait ArrayN<T, const N: usize>: Array<T> {
    // Required methods
    fn zip_with<U, V, F>(self, other: [U; N], f: F) -> [V; N]
       where F: FnMut(T, U) -> V,
             Self: Sized;
    fn downcast(self) -> [T; N];
    fn downcast_ref(&self) -> &[T; N];
    fn downcast_mut(&mut self) -> &mut [T; N];
}
Expand description

Array with size information on the type.

Required Methods§

Source

fn zip_with<U, V, F>(self, other: [U; N], f: F) -> [V; N]
where F: FnMut(T, U) -> V, Self: Sized,

Merges elements with another array by calling a FnMut(T, U) -> V closure for each pair.

Source

fn downcast(self) -> [T; N]

Converts this object into it’s concrete array type.

Source

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

Gets a reference to this object’s concrete array type.

Source

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

Gets a mutable reference to this object’s concrete array type.

Implementations on Foreign Types§

Source§

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

Source§

fn zip_with<U, V, F>(self, other: [U; N], f: F) -> [V; N]
where F: FnMut(T, U) -> V,

Source§

fn downcast(self) -> [T; N]

Source§

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

Source§

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

Implementors§