Module tuple

Source
Expand description

ULE impls for tuples.

Rust does not guarantee the layout of tuples, so ZeroVec defines its own tuple ULE types.

Impls are defined for tuples of up to 6 elements. For longer tuples, use a custom struct with #[make_ule].

§Examples

use zerovec::ZeroVec;

// ZeroVec of tuples!
let zerovec: ZeroVec<(u32, char)> = [(1, 'a'), (1234901, '啊'), (100, 'अ')]
    .iter()
    .copied()
    .collect();

assert_eq!(zerovec.get(1), Some((1234901, '啊')));

Structs§

Tuple2ULE
ULE type for tuples with 2 elements.
Tuple3ULE
ULE type for tuples with 3 elements.
Tuple4ULE
ULE type for tuples with 4 elements.
Tuple5ULE
ULE type for tuples with 5 elements.
Tuple6ULE
ULE type for tuples with 6 elements.