LastTupleRow

Trait LastTupleRow 

Source
pub trait LastTupleRow: TupleLen {
    type LastRowType: TupleRef + TupleLen<Len = <Self as TupleLen>::Len>;

    // Required method
    fn last_tuple_row(&self) -> <Self::LastRowType as TupleRef>::Ref<'_>;
}
Expand description

A convenience trait for accessing the last row in tuples of tuples.

This trait is automatically implemented for tuples of tuples where the implementation depends on the length of the inner tuples. It provides access to the last element of each inner tuple.

§Examples

use tuplities_row::LastTupleRow;

let matrix = ((1, 2, 3), (4, 5, 6), (7, 8, 9));
let last_row = matrix.last_tuple_row();
assert_eq!(last_row, (&3, &6, &9));

Part of the tuplities crate.

Required Associated Types§

Source

type LastRowType: TupleRef + TupleLen<Len = <Self as TupleLen>::Len>

The type of the row tuple containing references to the last elements.

Required Methods§

Source

fn last_tuple_row(&self) -> <Self::LastRowType as TupleRef>::Ref<'_>

Returns a tuple of references to the last element in each inner tuple.

Implementations on Foreign Types§

Source§

impl LastTupleRow for ()

Source§

impl<T1: TupleRefBack> LastTupleRow for (T1,)

Source§

type LastRowType = (<T1 as TuplePopBack>::Back,)

Source§

fn last_tuple_row(&self) -> <Self::LastRowType as TupleRef>::Ref<'_>

Source§

impl<T1: TupleRefBack, T2: TupleRefBack> LastTupleRow for (T1, T2)

Source§

type LastRowType = (<T1 as TuplePopBack>::Back, <T2 as TuplePopBack>::Back)

Source§

fn last_tuple_row(&self) -> <Self::LastRowType as TupleRef>::Ref<'_>

Source§

impl<T1: TupleRefBack, T2: TupleRefBack, T3: TupleRefBack> LastTupleRow for (T1, T2, T3)

Source§

type LastRowType = (<T1 as TuplePopBack>::Back, <T2 as TuplePopBack>::Back, <T3 as TuplePopBack>::Back)

Source§

fn last_tuple_row(&self) -> <Self::LastRowType as TupleRef>::Ref<'_>

Source§

impl<T1: TupleRefBack, T2: TupleRefBack, T3: TupleRefBack, T4: TupleRefBack> LastTupleRow for (T1, T2, T3, T4)

Source§

type LastRowType = (<T1 as TuplePopBack>::Back, <T2 as TuplePopBack>::Back, <T3 as TuplePopBack>::Back, <T4 as TuplePopBack>::Back)

Source§

fn last_tuple_row(&self) -> <Self::LastRowType as TupleRef>::Ref<'_>

Source§

impl<T1: TupleRefBack, T2: TupleRefBack, T3: TupleRefBack, T4: TupleRefBack, T5: TupleRefBack> LastTupleRow for (T1, T2, T3, T4, T5)

Source§

type LastRowType = (<T1 as TuplePopBack>::Back, <T2 as TuplePopBack>::Back, <T3 as TuplePopBack>::Back, <T4 as TuplePopBack>::Back, <T5 as TuplePopBack>::Back)

Source§

fn last_tuple_row(&self) -> <Self::LastRowType as TupleRef>::Ref<'_>

Source§

impl<T1: TupleRefBack, T2: TupleRefBack, T3: TupleRefBack, T4: TupleRefBack, T5: TupleRefBack, T6: TupleRefBack> LastTupleRow for (T1, T2, T3, T4, T5, T6)

Source§

type LastRowType = (<T1 as TuplePopBack>::Back, <T2 as TuplePopBack>::Back, <T3 as TuplePopBack>::Back, <T4 as TuplePopBack>::Back, <T5 as TuplePopBack>::Back, <T6 as TuplePopBack>::Back)

Source§

fn last_tuple_row(&self) -> <Self::LastRowType as TupleRef>::Ref<'_>

Source§

impl<T1: TupleRefBack, T2: TupleRefBack, T3: TupleRefBack, T4: TupleRefBack, T5: TupleRefBack, T6: TupleRefBack, T7: TupleRefBack> LastTupleRow for (T1, T2, T3, T4, T5, T6, T7)

Source§

type LastRowType = (<T1 as TuplePopBack>::Back, <T2 as TuplePopBack>::Back, <T3 as TuplePopBack>::Back, <T4 as TuplePopBack>::Back, <T5 as TuplePopBack>::Back, <T6 as TuplePopBack>::Back, <T7 as TuplePopBack>::Back)

Source§

fn last_tuple_row(&self) -> <Self::LastRowType as TupleRef>::Ref<'_>

Source§

impl<T1: TupleRefBack, T2: TupleRefBack, T3: TupleRefBack, T4: TupleRefBack, T5: TupleRefBack, T6: TupleRefBack, T7: TupleRefBack, T8: TupleRefBack> LastTupleRow for (T1, T2, T3, T4, T5, T6, T7, T8)

Source§

type LastRowType = (<T1 as TuplePopBack>::Back, <T2 as TuplePopBack>::Back, <T3 as TuplePopBack>::Back, <T4 as TuplePopBack>::Back, <T5 as TuplePopBack>::Back, <T6 as TuplePopBack>::Back, <T7 as TuplePopBack>::Back, <T8 as TuplePopBack>::Back)

Source§

fn last_tuple_row(&self) -> <Self::LastRowType as TupleRef>::Ref<'_>

Implementors§