pub trait TupleSplitAt<const MIDDLE: usize>: Tuple {
type Left: Tuple;
type Right: Tuple;
// Required method
const fn split_tuple_at(self) -> (Self::Left, Self::Right);
}
Expand description
Tuples which may be split at index MIDDLE
have the trait TupleSplitAt,
which, when split, returns TupleSplitAt::Left, TupleSplitAt::Right.
§Example
#![feature(generic_const_exprs)]
let t = (1, 1.0, "test");
let (l, r) = tuple_split::split_tuple_at::<2, _>(t);
assert_eq!(t, tupleops::concat_tuples(l, r));