pub trait TupleRow<Idx>: TupleLen {
type RowType: TupleRef + TupleLen<Len = <Self as TupleLen>::Len>;
// Required method
fn tuple_row(&self) -> <Self::RowType as TupleRef>::Ref<'_>;
}Expand description
A trait for indexing rows in tuples of tuples.
This trait allows accessing elements at a specific index across all tuples in a tuple of tuples.
For a tuple of tuples like ((A, B), (C, D)), TupleRow<U0> would return (&A, &C) and TupleRow<U1> would return (&B, &D).
Each inner tuple must implement TupleIndex<Idx>, and the returned row tuple implements TupleRef.
§Examples
use tuplities_row::TupleRow;
use typenum::U0;
let matrix = ((1, 2), (3, 4), (5, 6));
let first_row = TupleRow::<U0>::tuple_row(&matrix);
assert_eq!(first_row, (&1, &3, &5));Part of the tuplities crate.