Trait shrimple_parser::tuple::Index

source ·
pub trait Index<const N: usize>: 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 Tuple::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> Index<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> Index<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> Index<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> Index<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> Index<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> Index<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> Index<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> Index<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> Index<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> Index<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> Index<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> Index<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> Index<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> Index<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> Index<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> Index<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> Index<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> Index<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> Index<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> Index<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> Index<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> Index<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> Index<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> Index<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> Index<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> Index<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> Index<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> Index<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> Index<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> Index<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> Index<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> Index<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> Index<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> Index<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> Index<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> Index<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§