pub trait Slice<const N: usize>: Tuple {
type FirstN;
type FirstNStripped;
// Required methods
fn first_n(this: Self) -> Self::FirstN;
fn strip_first_n(this: Self) -> Self::FirstNStripped;
fn split(this: Self) -> (Self::FirstN, Self::FirstNStripped);
}Expand description
The trait for a tuple that has at least N elements.
The backbone of the Tuple::first_n function.
The associated functions are not to be used directly, instead use the equivalent functions
or methods of the Tuple trait.
Required Associated Types§
Sourcetype FirstNStripped
type FirstNStripped
A tuple with the first N elements of the original tuple.
Required Methods§
Sourcefn strip_first_n(this: Self) -> Self::FirstNStripped
fn strip_first_n(this: Self) -> Self::FirstNStripped
Returns the tuple without the first N elements
Sourcefn split(this: Self) -> (Self::FirstN, Self::FirstNStripped)
fn split(this: Self) -> (Self::FirstN, Self::FirstNStripped)
Splits the tuple into 2, with the 1st tuple having the 1st N element, and the 2nd tuple having the rest.
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.