Trait Slice

Source
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§

Source

type FirstN

A tuple containing the first N elements of the original tuple.

Source

type FirstNStripped

A tuple with the first N elements of the original tuple.

Required Methods§

Source

fn first_n(this: Self) -> Self::FirstN

Return the first N elements of the tuple as a tuple.

Source

fn strip_first_n(this: Self) -> Self::FirstNStripped

Returns the tuple without the first N elements

Source

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.

Implementations on Foreign Types§

Source§

impl Slice<0> for ()

Source§

type FirstN = ()

Source§

type FirstNStripped = ()

Source§

fn first_n(this: Self) -> Self::FirstN

Source§

fn strip_first_n(_: Self) -> Self::FirstNStripped

Source§

fn split(this: Self) -> (Self::FirstN, Self::FirstNStripped)

Source§

impl<T0> Slice<0> for (T0,)

Source§

type FirstN = ()

Source§

type FirstNStripped = (T0,)

Source§

fn first_n(this: Self) -> Self::FirstN

Source§

fn strip_first_n(this: Self) -> Self::FirstNStripped

Source§

fn split(this: Self) -> (Self::FirstN, Self::FirstNStripped)

Source§

impl<T0> Slice<1> for (T0,)

Source§

type FirstN = (T0,)

Source§

type FirstNStripped = ()

Source§

fn first_n(this: Self) -> Self::FirstN

Source§

fn strip_first_n(_: Self) -> Self::FirstNStripped

Source§

fn split(this: Self) -> (Self::FirstN, Self::FirstNStripped)

Source§

impl<T0, T1> Slice<0> for (T0, T1)

Source§

type FirstN = ()

Source§

type FirstNStripped = (T0, T1)

Source§

fn first_n(this: Self) -> Self::FirstN

Source§

fn strip_first_n(this: Self) -> Self::FirstNStripped

Source§

fn split(this: Self) -> (Self::FirstN, Self::FirstNStripped)

Source§

impl<T0, T1> Slice<1> for (T0, T1)

Source§

type FirstN = (T0,)

Source§

type FirstNStripped = (T1,)

Source§

fn first_n(this: Self) -> Self::FirstN

Source§

fn strip_first_n(this: Self) -> Self::FirstNStripped

Source§

fn split(this: Self) -> (Self::FirstN, Self::FirstNStripped)

Source§

impl<T0, T1> Slice<2> for (T0, T1)

Source§

type FirstN = (T0, T1)

Source§

type FirstNStripped = ()

Source§

fn first_n(this: Self) -> Self::FirstN

Source§

fn strip_first_n(_: Self) -> Self::FirstNStripped

Source§

fn split(this: Self) -> (Self::FirstN, Self::FirstNStripped)

Source§

impl<T0, T1, T2> Slice<0> for (T0, T1, T2)

Source§

type FirstN = ()

Source§

type FirstNStripped = (T0, T1, T2)

Source§

fn first_n(this: Self) -> Self::FirstN

Source§

fn strip_first_n(this: Self) -> Self::FirstNStripped

Source§

fn split(this: Self) -> (Self::FirstN, Self::FirstNStripped)

Source§

impl<T0, T1, T2> Slice<1> for (T0, T1, T2)

Source§

type FirstN = (T0,)

Source§

type FirstNStripped = (T1, T2)

Source§

fn first_n(this: Self) -> Self::FirstN

Source§

fn strip_first_n(this: Self) -> Self::FirstNStripped

Source§

fn split(this: Self) -> (Self::FirstN, Self::FirstNStripped)

Source§

impl<T0, T1, T2> Slice<2> for (T0, T1, T2)

Source§

type FirstN = (T0, T1)

Source§

type FirstNStripped = (T2,)

Source§

fn first_n(this: Self) -> Self::FirstN

Source§

fn strip_first_n(this: Self) -> Self::FirstNStripped

Source§

fn split(this: Self) -> (Self::FirstN, Self::FirstNStripped)

Source§

impl<T0, T1, T2> Slice<3> for (T0, T1, T2)

Source§

type FirstN = (T0, T1, T2)

Source§

type FirstNStripped = ()

Source§

fn first_n(this: Self) -> Self::FirstN

Source§

fn strip_first_n(_: Self) -> Self::FirstNStripped

Source§

fn split(this: Self) -> (Self::FirstN, Self::FirstNStripped)

Source§

impl<T0, T1, T2, T3> Slice<0> for (T0, T1, T2, T3)

Source§

type FirstN = ()

Source§

type FirstNStripped = (T0, T1, T2, T3)

Source§

fn first_n(this: Self) -> Self::FirstN

Source§

fn strip_first_n(this: Self) -> Self::FirstNStripped

Source§

fn split(this: Self) -> (Self::FirstN, Self::FirstNStripped)

Source§

impl<T0, T1, T2, T3> Slice<1> for (T0, T1, T2, T3)

Source§

type FirstN = (T0,)

Source§

type FirstNStripped = (T1, T2, T3)

Source§

fn first_n(this: Self) -> Self::FirstN

Source§

fn strip_first_n(this: Self) -> Self::FirstNStripped

Source§

fn split(this: Self) -> (Self::FirstN, Self::FirstNStripped)

Source§

impl<T0, T1, T2, T3> Slice<2> for (T0, T1, T2, T3)

Source§

type FirstN = (T0, T1)

Source§

type FirstNStripped = (T2, T3)

Source§

fn first_n(this: Self) -> Self::FirstN

Source§

fn strip_first_n(this: Self) -> Self::FirstNStripped

Source§

fn split(this: Self) -> (Self::FirstN, Self::FirstNStripped)

Source§

impl<T0, T1, T2, T3> Slice<3> for (T0, T1, T2, T3)

Source§

type FirstN = (T0, T1, T2)

Source§

type FirstNStripped = (T3,)

Source§

fn first_n(this: Self) -> Self::FirstN

Source§

fn strip_first_n(this: Self) -> Self::FirstNStripped

Source§

fn split(this: Self) -> (Self::FirstN, Self::FirstNStripped)

Source§

impl<T0, T1, T2, T3> Slice<4> for (T0, T1, T2, T3)

Source§

type FirstN = (T0, T1, T2, T3)

Source§

type FirstNStripped = ()

Source§

fn first_n(this: Self) -> Self::FirstN

Source§

fn strip_first_n(_: Self) -> Self::FirstNStripped

Source§

fn split(this: Self) -> (Self::FirstN, Self::FirstNStripped)

Source§

impl<T0, T1, T2, T3, T4> Slice<0> for (T0, T1, T2, T3, T4)

Source§

type FirstN = ()

Source§

type FirstNStripped = (T0, T1, T2, T3, T4)

Source§

fn first_n(this: Self) -> Self::FirstN

Source§

fn strip_first_n(this: Self) -> Self::FirstNStripped

Source§

fn split(this: Self) -> (Self::FirstN, Self::FirstNStripped)

Source§

impl<T0, T1, T2, T3, T4> Slice<1> for (T0, T1, T2, T3, T4)

Source§

type FirstN = (T0,)

Source§

type FirstNStripped = (T1, T2, T3, T4)

Source§

fn first_n(this: Self) -> Self::FirstN

Source§

fn strip_first_n(this: Self) -> Self::FirstNStripped

Source§

fn split(this: Self) -> (Self::FirstN, Self::FirstNStripped)

Source§

impl<T0, T1, T2, T3, T4> Slice<2> for (T0, T1, T2, T3, T4)

Source§

type FirstN = (T0, T1)

Source§

type FirstNStripped = (T2, T3, T4)

Source§

fn first_n(this: Self) -> Self::FirstN

Source§

fn strip_first_n(this: Self) -> Self::FirstNStripped

Source§

fn split(this: Self) -> (Self::FirstN, Self::FirstNStripped)

Source§

impl<T0, T1, T2, T3, T4> Slice<3> for (T0, T1, T2, T3, T4)

Source§

type FirstN = (T0, T1, T2)

Source§

type FirstNStripped = (T3, T4)

Source§

fn first_n(this: Self) -> Self::FirstN

Source§

fn strip_first_n(this: Self) -> Self::FirstNStripped

Source§

fn split(this: Self) -> (Self::FirstN, Self::FirstNStripped)

Source§

impl<T0, T1, T2, T3, T4> Slice<4> for (T0, T1, T2, T3, T4)

Source§

type FirstN = (T0, T1, T2, T3)

Source§

type FirstNStripped = (T4,)

Source§

fn first_n(this: Self) -> Self::FirstN

Source§

fn strip_first_n(this: Self) -> Self::FirstNStripped

Source§

fn split(this: Self) -> (Self::FirstN, Self::FirstNStripped)

Source§

impl<T0, T1, T2, T3, T4> Slice<5> for (T0, T1, T2, T3, T4)

Source§

type FirstN = (T0, T1, T2, T3, T4)

Source§

type FirstNStripped = ()

Source§

fn first_n(this: Self) -> Self::FirstN

Source§

fn strip_first_n(_: Self) -> Self::FirstNStripped

Source§

fn split(this: Self) -> (Self::FirstN, Self::FirstNStripped)

Source§

impl<T0, T1, T2, T3, T4, T5> Slice<0> for (T0, T1, T2, T3, T4, T5)

Source§

type FirstN = ()

Source§

type FirstNStripped = (T0, T1, T2, T3, T4, T5)

Source§

fn first_n(this: Self) -> Self::FirstN

Source§

fn strip_first_n(this: Self) -> Self::FirstNStripped

Source§

fn split(this: Self) -> (Self::FirstN, Self::FirstNStripped)

Source§

impl<T0, T1, T2, T3, T4, T5> Slice<1> for (T0, T1, T2, T3, T4, T5)

Source§

type FirstN = (T0,)

Source§

type FirstNStripped = (T1, T2, T3, T4, T5)

Source§

fn first_n(this: Self) -> Self::FirstN

Source§

fn strip_first_n(this: Self) -> Self::FirstNStripped

Source§

fn split(this: Self) -> (Self::FirstN, Self::FirstNStripped)

Source§

impl<T0, T1, T2, T3, T4, T5> Slice<2> for (T0, T1, T2, T3, T4, T5)

Source§

type FirstN = (T0, T1)

Source§

type FirstNStripped = (T2, T3, T4, T5)

Source§

fn first_n(this: Self) -> Self::FirstN

Source§

fn strip_first_n(this: Self) -> Self::FirstNStripped

Source§

fn split(this: Self) -> (Self::FirstN, Self::FirstNStripped)

Source§

impl<T0, T1, T2, T3, T4, T5> Slice<3> for (T0, T1, T2, T3, T4, T5)

Source§

type FirstN = (T0, T1, T2)

Source§

type FirstNStripped = (T3, T4, T5)

Source§

fn first_n(this: Self) -> Self::FirstN

Source§

fn strip_first_n(this: Self) -> Self::FirstNStripped

Source§

fn split(this: Self) -> (Self::FirstN, Self::FirstNStripped)

Source§

impl<T0, T1, T2, T3, T4, T5> Slice<4> for (T0, T1, T2, T3, T4, T5)

Source§

type FirstN = (T0, T1, T2, T3)

Source§

type FirstNStripped = (T4, T5)

Source§

fn first_n(this: Self) -> Self::FirstN

Source§

fn strip_first_n(this: Self) -> Self::FirstNStripped

Source§

fn split(this: Self) -> (Self::FirstN, Self::FirstNStripped)

Source§

impl<T0, T1, T2, T3, T4, T5> Slice<5> for (T0, T1, T2, T3, T4, T5)

Source§

type FirstN = (T0, T1, T2, T3, T4)

Source§

type FirstNStripped = (T5,)

Source§

fn first_n(this: Self) -> Self::FirstN

Source§

fn strip_first_n(this: Self) -> Self::FirstNStripped

Source§

fn split(this: Self) -> (Self::FirstN, Self::FirstNStripped)

Source§

impl<T0, T1, T2, T3, T4, T5> Slice<6> for (T0, T1, T2, T3, T4, T5)

Source§

impl<T0, T1, T2, T3, T4, T5, T6> Slice<0> for (T0, T1, T2, T3, T4, T5, T6)

Source§

impl<T0, T1, T2, T3, T4, T5, T6> Slice<1> for (T0, T1, T2, T3, T4, T5, T6)

Source§

impl<T0, T1, T2, T3, T4, T5, T6> Slice<2> for (T0, T1, T2, T3, T4, T5, T6)

Source§

impl<T0, T1, T2, T3, T4, T5, T6> Slice<3> for (T0, T1, T2, T3, T4, T5, T6)

Source§

impl<T0, T1, T2, T3, T4, T5, T6> Slice<4> for (T0, T1, T2, T3, T4, T5, T6)

Source§

impl<T0, T1, T2, T3, T4, T5, T6> Slice<5> for (T0, T1, T2, T3, T4, T5, T6)

Source§

impl<T0, T1, T2, T3, T4, T5, T6> Slice<6> for (T0, T1, T2, T3, T4, T5, T6)

Source§

impl<T0, T1, T2, T3, T4, T5, T6> Slice<7> for (T0, T1, T2, T3, T4, T5, T6)

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7> Slice<0> for (T0, T1, T2, T3, T4, T5, T6, T7)

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7> Slice<1> for (T0, T1, T2, T3, T4, T5, T6, T7)

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7> Slice<2> for (T0, T1, T2, T3, T4, T5, T6, T7)

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7> Slice<3> for (T0, T1, T2, T3, T4, T5, T6, T7)

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7> Slice<4> for (T0, T1, T2, T3, T4, T5, T6, T7)

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7> Slice<5> for (T0, T1, T2, T3, T4, T5, T6, T7)

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7> Slice<6> for (T0, T1, T2, T3, T4, T5, T6, T7)

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7> Slice<7> for (T0, T1, T2, T3, T4, T5, T6, T7)

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7> Slice<8> for (T0, T1, T2, T3, T4, T5, T6, T7)

Implementors§