Trait ordes::OrdesCons[][src]

pub trait OrdesCons<Input> {
    type Output;
    fn cons(self, value: Input) -> Self::Output;
}

Associated Types

Required methods

Add an element to the start of self and return the sum.

Examples

Using an array:

let foo: [u8; 4] = [1, 2, 3, 4];
let foo = foo.cons(0);
assert_eq!(foo, [0, 1, 2, 3, 4]);

Using a tuple:

let foo = (false, b'c', "d");
let foo = foo.cons('a');
assert_eq!(foo, ('a', false, b'c', "d"));

Implementations on Foreign Types

Implementors