pub trait TupleSplit<Idx> {
type Left;
type Right;
// Required method
fn split(self) -> (Self::Left, Self::Right);
}Expand description
A trait for splitting a tuple at a compile-time known index.
This trait allows splitting a tuple at a specific compile-time known index Idx,
returning two tuples: the elements before the index and the elements at and after the index.
§Examples
use tuplities_split::TupleSplit;
use typenum::U2;
let tuple = (1, 2, 3, 4);
let (left, right) = TupleSplit::<U2>::split(tuple);
assert_eq!(left, (1, 2));
assert_eq!(right, (3, 4));Part of the tuplities crate.