Trait shrimple_parser::tuple::IndexTuple

source ·
pub trait IndexTuple<const N: usize>: Sized + Tuple {
    type Nth;
    type NthMapped<U>;

    // Required methods
    fn nth(this: Self) -> Self::Nth;
    fn nth_ref(this: &Self) -> &Self::Nth;
    fn map_nth<U>(
        this: Self,
        f: impl FnOnce(Self::Nth) -> U
    ) -> Self::NthMapped<U>;
}
Expand description

The trait for a tuple that has the N-th element, the backbone of the [nth] function. The associated functions are not to be used directly, instead use the equivalent functions or methods of the Tuple trait.

Required Associated Types§

source

type Nth

The N-th element of the tuple.

source

type NthMapped<U>

The tuple with its N-th element mapped to U.

Required Methods§

source

fn nth(this: Self) -> Self::Nth

Returns the N-th element of the tuple.

source

fn nth_ref(this: &Self) -> &Self::Nth

Returns a reference to the N-th element of the tuple.

source

fn map_nth<U>(this: Self, f: impl FnOnce(Self::Nth) -> U) -> Self::NthMapped<U>

Returns the tuple with the N-th element transformed by f

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T0> IndexTuple<0> for (T0,)

§

type Nth = T0

§

type NthMapped<U> = (U,)

source§

fn nth(this: Self) -> Self::Nth

source§

fn nth_ref(this: &Self) -> &Self::Nth

source§

fn map_nth<U>(this: Self, f: impl FnOnce(Self::Nth) -> U) -> Self::NthMapped<U>

source§

impl<T0, T1> IndexTuple<0> for (T0, T1)

§

type Nth = T0

§

type NthMapped<U> = (U, T1)

source§

fn nth(this: Self) -> Self::Nth

source§

fn nth_ref(this: &Self) -> &Self::Nth

source§

fn map_nth<U>(this: Self, f: impl FnOnce(Self::Nth) -> U) -> Self::NthMapped<U>

source§

impl<T0, T1> IndexTuple<1> for (T0, T1)

§

type Nth = T1

§

type NthMapped<U> = (T0, U)

source§

fn nth(this: Self) -> Self::Nth

source§

fn nth_ref(this: &Self) -> &Self::Nth

source§

fn map_nth<U>(this: Self, f: impl FnOnce(Self::Nth) -> U) -> Self::NthMapped<U>

source§

impl<T0, T1, T2> IndexTuple<0> for (T0, T1, T2)

§

type Nth = T0

§

type NthMapped<U> = (U, T1, T2)

source§

fn nth(this: Self) -> Self::Nth

source§

fn nth_ref(this: &Self) -> &Self::Nth

source§

fn map_nth<U>(this: Self, f: impl FnOnce(Self::Nth) -> U) -> Self::NthMapped<U>

source§

impl<T0, T1, T2> IndexTuple<1> for (T0, T1, T2)

§

type Nth = T1

§

type NthMapped<U> = (T0, U, T2)

source§

fn nth(this: Self) -> Self::Nth

source§

fn nth_ref(this: &Self) -> &Self::Nth

source§

fn map_nth<U>(this: Self, f: impl FnOnce(Self::Nth) -> U) -> Self::NthMapped<U>

source§

impl<T0, T1, T2> IndexTuple<2> for (T0, T1, T2)

§

type Nth = T2

§

type NthMapped<U> = (T0, T1, U)

source§

fn nth(this: Self) -> Self::Nth

source§

fn nth_ref(this: &Self) -> &Self::Nth

source§

fn map_nth<U>(this: Self, f: impl FnOnce(Self::Nth) -> U) -> Self::NthMapped<U>

source§

impl<T0, T1, T2, T3> IndexTuple<0> for (T0, T1, T2, T3)

§

type Nth = T0

§

type NthMapped<U> = (U, T1, T2, T3)

source§

fn nth(this: Self) -> Self::Nth

source§

fn nth_ref(this: &Self) -> &Self::Nth

source§

fn map_nth<U>(this: Self, f: impl FnOnce(Self::Nth) -> U) -> Self::NthMapped<U>

source§

impl<T0, T1, T2, T3> IndexTuple<1> for (T0, T1, T2, T3)

§

type Nth = T1

§

type NthMapped<U> = (T0, U, T2, T3)

source§

fn nth(this: Self) -> Self::Nth

source§

fn nth_ref(this: &Self) -> &Self::Nth

source§

fn map_nth<U>(this: Self, f: impl FnOnce(Self::Nth) -> U) -> Self::NthMapped<U>

source§

impl<T0, T1, T2, T3> IndexTuple<2> for (T0, T1, T2, T3)

§

type Nth = T2

§

type NthMapped<U> = (T0, T1, U, T3)

source§

fn nth(this: Self) -> Self::Nth

source§

fn nth_ref(this: &Self) -> &Self::Nth

source§

fn map_nth<U>(this: Self, f: impl FnOnce(Self::Nth) -> U) -> Self::NthMapped<U>

source§

impl<T0, T1, T2, T3> IndexTuple<3> for (T0, T1, T2, T3)

§

type Nth = T3

§

type NthMapped<U> = (T0, T1, T2, U)

source§

fn nth(this: Self) -> Self::Nth

source§

fn nth_ref(this: &Self) -> &Self::Nth

source§

fn map_nth<U>(this: Self, f: impl FnOnce(Self::Nth) -> U) -> Self::NthMapped<U>

source§

impl<T0, T1, T2, T3, T4> IndexTuple<0> for (T0, T1, T2, T3, T4)

§

type Nth = T0

§

type NthMapped<U> = (U, T1, T2, T3, T4)

source§

fn nth(this: Self) -> Self::Nth

source§

fn nth_ref(this: &Self) -> &Self::Nth

source§

fn map_nth<U>(this: Self, f: impl FnOnce(Self::Nth) -> U) -> Self::NthMapped<U>

source§

impl<T0, T1, T2, T3, T4> IndexTuple<1> for (T0, T1, T2, T3, T4)

§

type Nth = T1

§

type NthMapped<U> = (T0, U, T2, T3, T4)

source§

fn nth(this: Self) -> Self::Nth

source§

fn nth_ref(this: &Self) -> &Self::Nth

source§

fn map_nth<U>(this: Self, f: impl FnOnce(Self::Nth) -> U) -> Self::NthMapped<U>

source§

impl<T0, T1, T2, T3, T4> IndexTuple<2> for (T0, T1, T2, T3, T4)

§

type Nth = T2

§

type NthMapped<U> = (T0, T1, U, T3, T4)

source§

fn nth(this: Self) -> Self::Nth

source§

fn nth_ref(this: &Self) -> &Self::Nth

source§

fn map_nth<U>(this: Self, f: impl FnOnce(Self::Nth) -> U) -> Self::NthMapped<U>

source§

impl<T0, T1, T2, T3, T4> IndexTuple<3> for (T0, T1, T2, T3, T4)

§

type Nth = T3

§

type NthMapped<U> = (T0, T1, T2, U, T4)

source§

fn nth(this: Self) -> Self::Nth

source§

fn nth_ref(this: &Self) -> &Self::Nth

source§

fn map_nth<U>(this: Self, f: impl FnOnce(Self::Nth) -> U) -> Self::NthMapped<U>

source§

impl<T0, T1, T2, T3, T4> IndexTuple<4> for (T0, T1, T2, T3, T4)

§

type Nth = T4

§

type NthMapped<U> = (T0, T1, T2, T3, U)

source§

fn nth(this: Self) -> Self::Nth

source§

fn nth_ref(this: &Self) -> &Self::Nth

source§

fn map_nth<U>(this: Self, f: impl FnOnce(Self::Nth) -> U) -> Self::NthMapped<U>

source§

impl<T0, T1, T2, T3, T4, T5> IndexTuple<0> for (T0, T1, T2, T3, T4, T5)

§

type Nth = T0

§

type NthMapped<U> = (U, T1, T2, T3, T4, T5)

source§

fn nth(this: Self) -> Self::Nth

source§

fn nth_ref(this: &Self) -> &Self::Nth

source§

fn map_nth<U>(this: Self, f: impl FnOnce(Self::Nth) -> U) -> Self::NthMapped<U>

source§

impl<T0, T1, T2, T3, T4, T5> IndexTuple<1> for (T0, T1, T2, T3, T4, T5)

§

type Nth = T1

§

type NthMapped<U> = (T0, U, T2, T3, T4, T5)

source§

fn nth(this: Self) -> Self::Nth

source§

fn nth_ref(this: &Self) -> &Self::Nth

source§

fn map_nth<U>(this: Self, f: impl FnOnce(Self::Nth) -> U) -> Self::NthMapped<U>

source§

impl<T0, T1, T2, T3, T4, T5> IndexTuple<2> for (T0, T1, T2, T3, T4, T5)

§

type Nth = T2

§

type NthMapped<U> = (T0, T1, U, T3, T4, T5)

source§

fn nth(this: Self) -> Self::Nth

source§

fn nth_ref(this: &Self) -> &Self::Nth

source§

fn map_nth<U>(this: Self, f: impl FnOnce(Self::Nth) -> U) -> Self::NthMapped<U>

source§

impl<T0, T1, T2, T3, T4, T5> IndexTuple<3> for (T0, T1, T2, T3, T4, T5)

§

type Nth = T3

§

type NthMapped<U> = (T0, T1, T2, U, T4, T5)

source§

fn nth(this: Self) -> Self::Nth

source§

fn nth_ref(this: &Self) -> &Self::Nth

source§

fn map_nth<U>(this: Self, f: impl FnOnce(Self::Nth) -> U) -> Self::NthMapped<U>

source§

impl<T0, T1, T2, T3, T4, T5> IndexTuple<4> for (T0, T1, T2, T3, T4, T5)

§

type Nth = T4

§

type NthMapped<U> = (T0, T1, T2, T3, U, T5)

source§

fn nth(this: Self) -> Self::Nth

source§

fn nth_ref(this: &Self) -> &Self::Nth

source§

fn map_nth<U>(this: Self, f: impl FnOnce(Self::Nth) -> U) -> Self::NthMapped<U>

source§

impl<T0, T1, T2, T3, T4, T5> IndexTuple<5> for (T0, T1, T2, T3, T4, T5)

§

type Nth = T5

§

type NthMapped<U> = (T0, T1, T2, T3, T4, U)

source§

fn nth(this: Self) -> Self::Nth

source§

fn nth_ref(this: &Self) -> &Self::Nth

source§

fn map_nth<U>(this: Self, f: impl FnOnce(Self::Nth) -> U) -> Self::NthMapped<U>

source§

impl<T0, T1, T2, T3, T4, T5, T6> IndexTuple<0> for (T0, T1, T2, T3, T4, T5, T6)

§

type Nth = T0

§

type NthMapped<U> = (U, T1, T2, T3, T4, T5, T6)

source§

fn nth(this: Self) -> Self::Nth

source§

fn nth_ref(this: &Self) -> &Self::Nth

source§

fn map_nth<U>(this: Self, f: impl FnOnce(Self::Nth) -> U) -> Self::NthMapped<U>

source§

impl<T0, T1, T2, T3, T4, T5, T6> IndexTuple<1> for (T0, T1, T2, T3, T4, T5, T6)

§

type Nth = T1

§

type NthMapped<U> = (T0, U, T2, T3, T4, T5, T6)

source§

fn nth(this: Self) -> Self::Nth

source§

fn nth_ref(this: &Self) -> &Self::Nth

source§

fn map_nth<U>(this: Self, f: impl FnOnce(Self::Nth) -> U) -> Self::NthMapped<U>

source§

impl<T0, T1, T2, T3, T4, T5, T6> IndexTuple<2> for (T0, T1, T2, T3, T4, T5, T6)

§

type Nth = T2

§

type NthMapped<U> = (T0, T1, U, T3, T4, T5, T6)

source§

fn nth(this: Self) -> Self::Nth

source§

fn nth_ref(this: &Self) -> &Self::Nth

source§

fn map_nth<U>(this: Self, f: impl FnOnce(Self::Nth) -> U) -> Self::NthMapped<U>

source§

impl<T0, T1, T2, T3, T4, T5, T6> IndexTuple<3> for (T0, T1, T2, T3, T4, T5, T6)

§

type Nth = T3

§

type NthMapped<U> = (T0, T1, T2, U, T4, T5, T6)

source§

fn nth(this: Self) -> Self::Nth

source§

fn nth_ref(this: &Self) -> &Self::Nth

source§

fn map_nth<U>(this: Self, f: impl FnOnce(Self::Nth) -> U) -> Self::NthMapped<U>

source§

impl<T0, T1, T2, T3, T4, T5, T6> IndexTuple<4> for (T0, T1, T2, T3, T4, T5, T6)

§

type Nth = T4

§

type NthMapped<U> = (T0, T1, T2, T3, U, T5, T6)

source§

fn nth(this: Self) -> Self::Nth

source§

fn nth_ref(this: &Self) -> &Self::Nth

source§

fn map_nth<U>(this: Self, f: impl FnOnce(Self::Nth) -> U) -> Self::NthMapped<U>

source§

impl<T0, T1, T2, T3, T4, T5, T6> IndexTuple<5> for (T0, T1, T2, T3, T4, T5, T6)

§

type Nth = T5

§

type NthMapped<U> = (T0, T1, T2, T3, T4, U, T6)

source§

fn nth(this: Self) -> Self::Nth

source§

fn nth_ref(this: &Self) -> &Self::Nth

source§

fn map_nth<U>(this: Self, f: impl FnOnce(Self::Nth) -> U) -> Self::NthMapped<U>

source§

impl<T0, T1, T2, T3, T4, T5, T6> IndexTuple<6> for (T0, T1, T2, T3, T4, T5, T6)

§

type Nth = T6

§

type NthMapped<U> = (T0, T1, T2, T3, T4, T5, U)

source§

fn nth(this: Self) -> Self::Nth

source§

fn nth_ref(this: &Self) -> &Self::Nth

source§

fn map_nth<U>(this: Self, f: impl FnOnce(Self::Nth) -> U) -> Self::NthMapped<U>

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7> IndexTuple<0> for (T0, T1, T2, T3, T4, T5, T6, T7)

§

type Nth = T0

§

type NthMapped<U> = (U, T1, T2, T3, T4, T5, T6, T7)

source§

fn nth(this: Self) -> Self::Nth

source§

fn nth_ref(this: &Self) -> &Self::Nth

source§

fn map_nth<U>(this: Self, f: impl FnOnce(Self::Nth) -> U) -> Self::NthMapped<U>

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7> IndexTuple<1> for (T0, T1, T2, T3, T4, T5, T6, T7)

§

type Nth = T1

§

type NthMapped<U> = (T0, U, T2, T3, T4, T5, T6, T7)

source§

fn nth(this: Self) -> Self::Nth

source§

fn nth_ref(this: &Self) -> &Self::Nth

source§

fn map_nth<U>(this: Self, f: impl FnOnce(Self::Nth) -> U) -> Self::NthMapped<U>

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7> IndexTuple<2> for (T0, T1, T2, T3, T4, T5, T6, T7)

§

type Nth = T2

§

type NthMapped<U> = (T0, T1, U, T3, T4, T5, T6, T7)

source§

fn nth(this: Self) -> Self::Nth

source§

fn nth_ref(this: &Self) -> &Self::Nth

source§

fn map_nth<U>(this: Self, f: impl FnOnce(Self::Nth) -> U) -> Self::NthMapped<U>

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7> IndexTuple<3> for (T0, T1, T2, T3, T4, T5, T6, T7)

§

type Nth = T3

§

type NthMapped<U> = (T0, T1, T2, U, T4, T5, T6, T7)

source§

fn nth(this: Self) -> Self::Nth

source§

fn nth_ref(this: &Self) -> &Self::Nth

source§

fn map_nth<U>(this: Self, f: impl FnOnce(Self::Nth) -> U) -> Self::NthMapped<U>

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7> IndexTuple<4> for (T0, T1, T2, T3, T4, T5, T6, T7)

§

type Nth = T4

§

type NthMapped<U> = (T0, T1, T2, T3, U, T5, T6, T7)

source§

fn nth(this: Self) -> Self::Nth

source§

fn nth_ref(this: &Self) -> &Self::Nth

source§

fn map_nth<U>(this: Self, f: impl FnOnce(Self::Nth) -> U) -> Self::NthMapped<U>

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7> IndexTuple<5> for (T0, T1, T2, T3, T4, T5, T6, T7)

§

type Nth = T5

§

type NthMapped<U> = (T0, T1, T2, T3, T4, U, T6, T7)

source§

fn nth(this: Self) -> Self::Nth

source§

fn nth_ref(this: &Self) -> &Self::Nth

source§

fn map_nth<U>(this: Self, f: impl FnOnce(Self::Nth) -> U) -> Self::NthMapped<U>

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7> IndexTuple<6> for (T0, T1, T2, T3, T4, T5, T6, T7)

§

type Nth = T6

§

type NthMapped<U> = (T0, T1, T2, T3, T4, T5, U, T7)

source§

fn nth(this: Self) -> Self::Nth

source§

fn nth_ref(this: &Self) -> &Self::Nth

source§

fn map_nth<U>(this: Self, f: impl FnOnce(Self::Nth) -> U) -> Self::NthMapped<U>

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7> IndexTuple<7> for (T0, T1, T2, T3, T4, T5, T6, T7)

§

type Nth = T7

§

type NthMapped<U> = (T0, T1, T2, T3, T4, T5, T6, U)

source§

fn nth(this: Self) -> Self::Nth

source§

fn nth_ref(this: &Self) -> &Self::Nth

source§

fn map_nth<U>(this: Self, f: impl FnOnce(Self::Nth) -> U) -> Self::NthMapped<U>

Implementors§