pub trait Index<const N: usize>: Tuple {
type Nth;
type NthMapped<U>;
// Required methods
fn nth(this: Self) -> Self::Nth;
fn nth_ref(this: &Self) -> &Self::Nth;
fn map_nth<U>(
this: Self,
f: impl FnOnce(Self::Nth) -> U,
) -> Self::NthMapped<U>;
}Expand description
The trait for a tuple that has the N-th element, the backbone of the Tuple::nth function.
The associated functions are not to be used directly, instead use the equivalent functions
or methods of the Tuple trait.
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.