Trait ordes::OrdesPush[][src]

pub trait OrdesPush<Input> {
    type Output;
    fn push(self, value: Input) -> Self::Output;
}
Expand description

Trait for defining pushing to an array- or tuple-like data structure.

Associated Types

Required methods

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

Examples

Using an array:

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

Using a tuple:

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

Implementations on Foreign Types

Implementors