AppendFront

Trait AppendFront 

Source
pub trait AppendFront<T> {
    type Output;

    // Required method
    fn append_front(self, element: T) -> Self::Output;
}
Expand description

Implemented for GenericArray, this allows growable GenericArrays by appending elements to the front.

§Example

extern crate dimensioned as dim;
#[macro_use]
extern crate generic_array;

use dim::array::AppendFront;

fn main() {
    let a = arr![u32; 1, 2];
    let a2 = arr![u32; 0, 1, 2];

    assert_eq!(a.append_front(0), a2);
}

Required Associated Types§

Source

type Output

The resulting type after performing the append

Required Methods§

Source

fn append_front(self, element: T) -> Self::Output

Append element to the front of self.

Implementations on Foreign Types§

Source§

impl<T, N> AppendFront<T> for GenericArray<T, N>
where T: Default, N: Add<B1> + ArrayLength<T>, Add1<N>: ArrayLength<T>,

Source§

type Output = GenericArray<T, <N as Add<B1>>::Output>

Source§

fn append_front(self, element: T) -> Self::Output

Implementors§