Trait dimensioned::array::AppendFront
source · [−]pub trait AppendFront<T> {
type Output;
fn append_front(self, element: T) -> Self::Output;
}
Expand description
Implemented for GenericArray
, this allows growable GenericArray
s 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
Required Methods
fn append_front(self, element: T) -> Self::Output
fn append_front(self, element: T) -> Self::Output
Append element
to the front of self
.