Tuple

Trait Tuple 

Source
pub trait Tuple
where Self: Sized,
{ type TupleList: TupleList<Tuple = Self>; // Required method 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", ()))),
);

Required Associated Types§

Source

type TupleList: TupleList<Tuple = Self>

Tuple list type corresponding to given tuple.

Required Methods§

Source

fn into_tuple_list(self) -> Self::TupleList

Converts tuple into tuple list.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Tuple for ()

Source§

impl<T1> Tuple for (T1,)

Source§

impl<T1, T2> Tuple for (T1, T2)

Source§

type TupleList = (T1, (T2, ()))

Source§

fn into_tuple_list(self) -> Self::TupleList

Source§

impl<T1, T2, T3> Tuple for (T1, T2, T3)

Source§

type TupleList = (T1, (T2, (T3, ())))

Source§

fn into_tuple_list(self) -> Self::TupleList

Source§

impl<T1, T2, T3, T4> Tuple for (T1, T2, T3, T4)

Source§

type TupleList = (T1, (T2, (T3, (T4, ()))))

Source§

fn into_tuple_list(self) -> Self::TupleList

Source§

impl<T1, T2, T3, T4, T5> Tuple for (T1, T2, T3, T4, T5)

Source§

type TupleList = (T1, (T2, (T3, (T4, (T5, ())))))

Source§

fn into_tuple_list(self) -> Self::TupleList

Source§

impl<T1, T2, T3, T4, T5, T6> Tuple for (T1, T2, T3, T4, T5, T6)

Source§

type TupleList = (T1, (T2, (T3, (T4, (T5, (T6, ()))))))

Source§

fn into_tuple_list(self) -> Self::TupleList

Source§

impl<T1, T2, T3, T4, T5, T6, T7> Tuple for (T1, T2, T3, T4, T5, T6, T7)

Source§

type TupleList = (T1, (T2, (T3, (T4, (T5, (T6, (T7, ())))))))

Source§

fn into_tuple_list(self) -> Self::TupleList

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8> Tuple for (T1, T2, T3, T4, T5, T6, T7, T8)

Source§

type TupleList = (T1, (T2, (T3, (T4, (T5, (T6, (T7, (T8, ()))))))))

Source§

fn into_tuple_list(self) -> Self::TupleList

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9> Tuple for (T1, T2, T3, T4, T5, T6, T7, T8, T9)

Source§

type TupleList = (T1, (T2, (T3, (T4, (T5, (T6, (T7, (T8, (T9, ())))))))))

Source§

fn into_tuple_list(self) -> Self::TupleList

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Tuple for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)

Source§

type TupleList = (T1, (T2, (T3, (T4, (T5, (T6, (T7, (T8, (T9, (T10, ()))))))))))

Source§

fn into_tuple_list(self) -> Self::TupleList

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tuple for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)

Source§

type TupleList = (T1, (T2, (T3, (T4, (T5, (T6, (T7, (T8, (T9, (T10, (T11, ())))))))))))

Source§

fn into_tuple_list(self) -> Self::TupleList

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tuple for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)

Source§

type TupleList = (T1, (T2, (T3, (T4, (T5, (T6, (T7, (T8, (T9, (T10, (T11, (T12, ()))))))))))))

Source§

fn into_tuple_list(self) -> Self::TupleList

Implementors§