tuple_split

Trait TupleSplitAt

Source
pub trait TupleSplitAt<const MIDDLE: usize>: Tuple {
    type Left: Tuple;
    type Right: Tuple;

    // Required method
    fn split_tuple_at(self) -> (Self::Left, Self::Right);
}
Expand description

Tuples which may be split at index MIDDLE have the trait TupleSplitAt, which, when split, returns TupleSplitAt::Left, TupleSplitAt::Right.

§Example

let t: (u8, f32, &str) = (1, 1.0, "test");
let (l, r): ((u8, f32), (&str,)) = tuple_split::split_tuple_at::<2>(t);

assert_eq!(t, tupleops::concat_tuples(l, r));

Required Associated Types§

Required Methods§

Source

fn split_tuple_at(self) -> (Self::Left, Self::Right)

Implementations on Foreign Types§

Source§

impl TupleSplitAt<0> for ()

Source§

type Left = ()

Source§

type Right = ()

Source§

const fn split_tuple_at(self) -> (Self::Left, Self::Right)

Source§

impl<_1, _2, _3, _4> TupleSplitAt<{count!($($types1),*)}> for (_1, _2, _3, _4)

Source§

type Left = (_1, _2, _3, _4)

Source§

type Right = ()

Source§

const fn split_tuple_at(self) -> (Self::Left, Self::Right)

Source§

impl<_2, _3, _4> TupleSplitAt<{count!($($types1),*)}> for (_2, _3, _4)

Source§

type Left = (_2, _3, _4)

Source§

type Right = ()

Source§

const fn split_tuple_at(self) -> (Self::Left, Self::Right)

Source§

impl<_2, _3, _4, _1> TupleSplitAt<{count!($($types1),*)}> for (_2, _3, _4, _1)

Source§

type Left = (_2, _3, _4)

Source§

type Right = (_1,)

Source§

const fn split_tuple_at(self) -> (Self::Left, Self::Right)

Source§

impl<_3, _4> TupleSplitAt<{count!($($types1),*)}> for (_3, _4)

Source§

type Left = (_3, _4)

Source§

type Right = ()

Source§

const fn split_tuple_at(self) -> (Self::Left, Self::Right)

Source§

impl<_3, _4, _2> TupleSplitAt<{count!($($types1),*)}> for (_3, _4, _2)

Source§

type Left = (_3, _4)

Source§

type Right = (_2,)

Source§

const fn split_tuple_at(self) -> (Self::Left, Self::Right)

Source§

impl<_3, _4, _2, _1> TupleSplitAt<{count!($($types1),*)}> for (_3, _4, _2, _1)

Source§

type Left = (_3, _4)

Source§

type Right = (_2, _1)

Source§

const fn split_tuple_at(self) -> (Self::Left, Self::Right)

Source§

impl<_4> TupleSplitAt<0> for (_4,)

Source§

type Left = ()

Source§

type Right = (_4,)

Source§

const fn split_tuple_at(self) -> (Self::Left, Self::Right)

Source§

impl<_4> TupleSplitAt<{count!($($types1),*)}> for (_4,)

Source§

type Left = (_4,)

Source§

type Right = ()

Source§

const fn split_tuple_at(self) -> (Self::Left, Self::Right)

Source§

impl<_4, _3> TupleSplitAt<0> for (_4, _3)

Source§

type Left = ()

Source§

type Right = (_4, _3)

Source§

const fn split_tuple_at(self) -> (Self::Left, Self::Right)

Source§

impl<_4, _3> TupleSplitAt<{count!($($types1),*)}> for (_4, _3)

Source§

type Left = (_4,)

Source§

type Right = (_3,)

Source§

const fn split_tuple_at(self) -> (Self::Left, Self::Right)

Source§

impl<_4, _3, _2> TupleSplitAt<0> for (_4, _3, _2)

Source§

type Left = ()

Source§

type Right = (_4, _3, _2)

Source§

const fn split_tuple_at(self) -> (Self::Left, Self::Right)

Source§

impl<_4, _3, _2> TupleSplitAt<{count!($($types1),*)}> for (_4, _3, _2)

Source§

type Left = (_4,)

Source§

type Right = (_3, _2)

Source§

const fn split_tuple_at(self) -> (Self::Left, Self::Right)

Source§

impl<_4, _3, _2, _1> TupleSplitAt<0> for (_4, _3, _2, _1)

Source§

type Left = ()

Source§

type Right = (_4, _3, _2, _1)

Source§

const fn split_tuple_at(self) -> (Self::Left, Self::Right)

Source§

impl<_4, _3, _2, _1> TupleSplitAt<{count!($($types1),*)}> for (_4, _3, _2, _1)

Source§

type Left = (_4,)

Source§

type Right = (_3, _2, _1)

Source§

const fn split_tuple_at(self) -> (Self::Left, Self::Right)

Implementors§