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§
Required Methods§
Sourcefn last_tuple_row(&self) -> <Self::LastRowType as TupleRef>::Ref<'_>
fn last_tuple_row(&self) -> <Self::LastRowType as TupleRef>::Ref<'_>
Returns a tuple of references to the last element in each inner tuple.