Trait tuple_list::Tuple[][src]

pub trait Tuple where
    Self: Sized
{ type TupleList: TupleList<Tuple = Self>; fn into_tuple_list(self) -> Self::TupleList; }
Expand description

Trait providing conversion from tuple into tuple list.

Generic trait implemented for all tuples (up to 12 elements).

Please note that Tuple trait does not have TUPLE_SIZE constant like TupleList does.

This is intentional, in order to avoid accidental use of it for tuple lists.

You can still get tuple size as Tuple::TupleList::TUPLE_LIST_SIZE.

Examples

use crate::tuple_list::Tuple;
 
let tuple = (1, false, "abc");
 
assert_eq!(
    tuple.into_tuple_list(),
    (1, (false, ("abc", ()))),
);
Run

Associated Types

Tuple list type corresponding to given tuple.

Required methods

Converts tuple into tuple list.

Implementations on Foreign Types

Implementors