TupleSplit

Trait TupleSplit 

Source
pub trait TupleSplit<Idx> {
    type Left;
    type Right;

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

A trait for splitting a tuple at a compile-time known index.

This trait allows splitting a tuple at a specific compile-time known index Idx, returning two tuples: the elements before the index and the elements at and after the index.

§Examples

use tuplities_split::TupleSplit;
use typenum::U2;

let tuple = (1, 2, 3, 4);
let (left, right) = TupleSplit::<U2>::split(tuple);
assert_eq!(left, (1, 2));
assert_eq!(right, (3, 4));

Part of the tuplities crate.

Required Associated Types§

Source

type Left

The type of the tuple containing elements before the split index.

Source

type Right

The type of the tuple containing elements at and after the split index.

Required Methods§

Source

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

Splits the tuple at index Idx, returning two tuples.

Implementations on Foreign Types§

Source§

impl TupleSplit<UTerm> for ()

Source§

type Left = ()

Source§

type Right = ()

Source§

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

Source§

impl<T1> TupleSplit<UInt<UTerm, B1>> for (T1,)

Source§

type Left = (T1,)

Source§

type Right = ()

Source§

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

Source§

impl<T1> TupleSplit<UTerm> for (T1,)

Source§

type Left = ()

Source§

type Right = (T1,)

Source§

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

Source§

impl<T1, T2> TupleSplit<UInt<UInt<UTerm, B1>, B0>> for (T1, T2)

Source§

type Left = (T1, T2)

Source§

type Right = ()

Source§

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

Source§

impl<T1, T2> TupleSplit<UInt<UTerm, B1>> for (T1, T2)

Source§

type Left = (T1,)

Source§

type Right = (T2,)

Source§

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

Source§

impl<T1, T2> TupleSplit<UTerm> for (T1, T2)

Source§

type Left = ()

Source§

type Right = (T1, T2)

Source§

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

Source§

impl<T1, T2, T3> TupleSplit<UInt<UInt<UTerm, B1>, B0>> for (T1, T2, T3)

Source§

type Left = (T1, T2)

Source§

type Right = (T3,)

Source§

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

Source§

impl<T1, T2, T3> TupleSplit<UInt<UInt<UTerm, B1>, B1>> for (T1, T2, T3)

Source§

type Left = (T1, T2, T3)

Source§

type Right = ()

Source§

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

Source§

impl<T1, T2, T3> TupleSplit<UInt<UTerm, B1>> for (T1, T2, T3)

Source§

type Left = (T1,)

Source§

type Right = (T2, T3)

Source§

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

Source§

impl<T1, T2, T3> TupleSplit<UTerm> for (T1, T2, T3)

Source§

type Left = ()

Source§

type Right = (T1, T2, T3)

Source§

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

Source§

impl<T1, T2, T3, T4> TupleSplit<UInt<UInt<UInt<UTerm, B1>, B0>, B0>> for (T1, T2, T3, T4)

Source§

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

Source§

type Right = ()

Source§

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

Source§

impl<T1, T2, T3, T4> TupleSplit<UInt<UInt<UTerm, B1>, B0>> for (T1, T2, T3, T4)

Source§

type Left = (T1, T2)

Source§

type Right = (T3, T4)

Source§

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

Source§

impl<T1, T2, T3, T4> TupleSplit<UInt<UInt<UTerm, B1>, B1>> for (T1, T2, T3, T4)

Source§

type Left = (T1, T2, T3)

Source§

type Right = (T4,)

Source§

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

Source§

impl<T1, T2, T3, T4> TupleSplit<UInt<UTerm, B1>> for (T1, T2, T3, T4)

Source§

type Left = (T1,)

Source§

type Right = (T2, T3, T4)

Source§

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

Source§

impl<T1, T2, T3, T4> TupleSplit<UTerm> for (T1, T2, T3, T4)

Source§

type Left = ()

Source§

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

Source§

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

Source§

impl<T1, T2, T3, T4, T5> TupleSplit<UInt<UInt<UInt<UTerm, B1>, B0>, B0>> for (T1, T2, T3, T4, T5)

Source§

impl<T1, T2, T3, T4, T5> TupleSplit<UInt<UInt<UInt<UTerm, B1>, B0>, B1>> for (T1, T2, T3, T4, T5)

Source§

impl<T1, T2, T3, T4, T5> TupleSplit<UInt<UInt<UTerm, B1>, B0>> for (T1, T2, T3, T4, T5)

Source§

type Left = (T1, T2)

Source§

type Right = (T3, T4, T5)

Source§

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

Source§

impl<T1, T2, T3, T4, T5> TupleSplit<UInt<UInt<UTerm, B1>, B1>> for (T1, T2, T3, T4, T5)

Source§

type Left = (T1, T2, T3)

Source§

type Right = (T4, T5)

Source§

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

Source§

impl<T1, T2, T3, T4, T5> TupleSplit<UInt<UTerm, B1>> for (T1, T2, T3, T4, T5)

Source§

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

Source§

impl<T1, T2, T3, T4, T5, T6> TupleSplit<UInt<UInt<UInt<UTerm, B1>, B0>, B0>> for (T1, T2, T3, T4, T5, T6)

Source§

impl<T1, T2, T3, T4, T5, T6> TupleSplit<UInt<UInt<UInt<UTerm, B1>, B0>, B1>> for (T1, T2, T3, T4, T5, T6)

Source§

impl<T1, T2, T3, T4, T5, T6> TupleSplit<UInt<UInt<UInt<UTerm, B1>, B1>, B0>> for (T1, T2, T3, T4, T5, T6)

Source§

impl<T1, T2, T3, T4, T5, T6> TupleSplit<UInt<UInt<UTerm, B1>, B0>> for (T1, T2, T3, T4, T5, T6)

Source§

impl<T1, T2, T3, T4, T5, T6> TupleSplit<UInt<UInt<UTerm, B1>, B1>> for (T1, T2, T3, T4, T5, T6)

Source§

impl<T1, T2, T3, T4, T5, T6> TupleSplit<UInt<UTerm, B1>> for (T1, T2, T3, T4, T5, T6)

Source§

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

Source§

impl<T1, T2, T3, T4, T5, T6, T7> TupleSplit<UInt<UInt<UInt<UTerm, B1>, B0>, B0>> for (T1, T2, T3, T4, T5, T6, T7)

Source§

impl<T1, T2, T3, T4, T5, T6, T7> TupleSplit<UInt<UInt<UInt<UTerm, B1>, B0>, B1>> for (T1, T2, T3, T4, T5, T6, T7)

Source§

impl<T1, T2, T3, T4, T5, T6, T7> TupleSplit<UInt<UInt<UInt<UTerm, B1>, B1>, B0>> for (T1, T2, T3, T4, T5, T6, T7)

Source§

impl<T1, T2, T3, T4, T5, T6, T7> TupleSplit<UInt<UInt<UInt<UTerm, B1>, B1>, B1>> for (T1, T2, T3, T4, T5, T6, T7)

Source§

impl<T1, T2, T3, T4, T5, T6, T7> TupleSplit<UInt<UInt<UTerm, B1>, B0>> for (T1, T2, T3, T4, T5, T6, T7)

Source§

impl<T1, T2, T3, T4, T5, T6, T7> TupleSplit<UInt<UInt<UTerm, B1>, B1>> for (T1, T2, T3, T4, T5, T6, T7)

Source§

impl<T1, T2, T3, T4, T5, T6, T7> TupleSplit<UInt<UTerm, B1>> for (T1, T2, T3, T4, T5, T6, T7)

Source§

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

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8> TupleSplit<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>> for (T1, T2, T3, T4, T5, T6, T7, T8)

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8> TupleSplit<UInt<UInt<UInt<UTerm, B1>, B0>, B0>> for (T1, T2, T3, T4, T5, T6, T7, T8)

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8> TupleSplit<UInt<UInt<UInt<UTerm, B1>, B0>, B1>> for (T1, T2, T3, T4, T5, T6, T7, T8)

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8> TupleSplit<UInt<UInt<UInt<UTerm, B1>, B1>, B0>> for (T1, T2, T3, T4, T5, T6, T7, T8)

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8> TupleSplit<UInt<UInt<UInt<UTerm, B1>, B1>, B1>> for (T1, T2, T3, T4, T5, T6, T7, T8)

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8> TupleSplit<UInt<UInt<UTerm, B1>, B0>> for (T1, T2, T3, T4, T5, T6, T7, T8)

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8> TupleSplit<UInt<UInt<UTerm, B1>, B1>> for (T1, T2, T3, T4, T5, T6, T7, T8)

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8> TupleSplit<UInt<UTerm, B1>> for (T1, T2, T3, T4, T5, T6, T7, T8)

Source§

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

Implementors§