TupleRemove

Trait TupleRemove 

Source
pub trait TupleRemove<Idx: Unsigned> {
    type Type;
    type Remainder;

    // Required method
    fn remove(self) -> (Self::Type, Self::Remainder);
}
Expand description

A trait for removing an element at a specific index from a tuple.

This trait allows removing an element at compile-time known index Idx from a tuple, returning the element and the remaining tuple.

§Examples

use tuplities_remove::TupleRemove;
use typenum::U1;

let tuple = (1, "hello", 3.14);
let (removed, remainder) = TupleRemove::<U1>::remove(tuple);
assert_eq!(removed, "hello");
assert_eq!(remainder, (1, 3.14));

Required Associated Types§

Source

type Type

The type of the element being removed.

Source

type Remainder

The type of the remaining tuple after removing.

Required Methods§

Source

fn remove(self) -> (Self::Type, Self::Remainder)

Removes the element at index Idx from the tuple.

Returns a tuple containing the removed element and the remaining tuple.

Implementations on Foreign Types§

Source§

impl<T1> TupleRemove<UTerm> for (T1,)

Source§

type Type = T1

Source§

type Remainder = ()

Source§

fn remove(self) -> (Self::Type, Self::Remainder)

Source§

impl<T1, T2> TupleRemove<UInt<UTerm, B1>> for (T1, T2)

Source§

type Type = T2

Source§

type Remainder = (T1,)

Source§

fn remove(self) -> (Self::Type, Self::Remainder)

Source§

impl<T1, T2> TupleRemove<UTerm> for (T1, T2)

Source§

type Type = T1

Source§

type Remainder = (T2,)

Source§

fn remove(self) -> (Self::Type, Self::Remainder)

Source§

impl<T1, T2, T3> TupleRemove<UInt<UInt<UTerm, B1>, B0>> for (T1, T2, T3)

Source§

type Type = T3

Source§

type Remainder = (T1, T2)

Source§

fn remove(self) -> (Self::Type, Self::Remainder)

Source§

impl<T1, T2, T3> TupleRemove<UInt<UTerm, B1>> for (T1, T2, T3)

Source§

type Type = T2

Source§

type Remainder = (T1, T3)

Source§

fn remove(self) -> (Self::Type, Self::Remainder)

Source§

impl<T1, T2, T3> TupleRemove<UTerm> for (T1, T2, T3)

Source§

type Type = T1

Source§

type Remainder = (T2, T3)

Source§

fn remove(self) -> (Self::Type, Self::Remainder)

Source§

impl<T1, T2, T3, T4> TupleRemove<UInt<UInt<UTerm, B1>, B0>> for (T1, T2, T3, T4)

Source§

type Type = T3

Source§

type Remainder = (T1, T2, T4)

Source§

fn remove(self) -> (Self::Type, Self::Remainder)

Source§

impl<T1, T2, T3, T4> TupleRemove<UInt<UInt<UTerm, B1>, B1>> for (T1, T2, T3, T4)

Source§

type Type = T4

Source§

type Remainder = (T1, T2, T3)

Source§

fn remove(self) -> (Self::Type, Self::Remainder)

Source§

impl<T1, T2, T3, T4> TupleRemove<UInt<UTerm, B1>> for (T1, T2, T3, T4)

Source§

type Type = T2

Source§

type Remainder = (T1, T3, T4)

Source§

fn remove(self) -> (Self::Type, Self::Remainder)

Source§

impl<T1, T2, T3, T4> TupleRemove<UTerm> for (T1, T2, T3, T4)

Source§

type Type = T1

Source§

type Remainder = (T2, T3, T4)

Source§

fn remove(self) -> (Self::Type, Self::Remainder)

Source§

impl<T1, T2, T3, T4, T5> TupleRemove<UInt<UInt<UInt<UTerm, B1>, B0>, B0>> for (T1, T2, T3, T4, T5)

Source§

impl<T1, T2, T3, T4, T5> TupleRemove<UInt<UInt<UTerm, B1>, B0>> for (T1, T2, T3, T4, T5)

Source§

impl<T1, T2, T3, T4, T5> TupleRemove<UInt<UInt<UTerm, B1>, B1>> for (T1, T2, T3, T4, T5)

Source§

impl<T1, T2, T3, T4, T5> TupleRemove<UInt<UTerm, B1>> for (T1, T2, T3, T4, T5)

Source§

impl<T1, T2, T3, T4, T5> TupleRemove<UTerm> for (T1, T2, T3, T4, T5)

Source§

impl<T1, T2, T3, T4, T5, T6> TupleRemove<UInt<UInt<UInt<UTerm, B1>, B0>, B0>> for (T1, T2, T3, T4, T5, T6)

Source§

impl<T1, T2, T3, T4, T5, T6> TupleRemove<UInt<UInt<UInt<UTerm, B1>, B0>, B1>> for (T1, T2, T3, T4, T5, T6)

Source§

impl<T1, T2, T3, T4, T5, T6> TupleRemove<UInt<UInt<UTerm, B1>, B0>> for (T1, T2, T3, T4, T5, T6)

Source§

impl<T1, T2, T3, T4, T5, T6> TupleRemove<UInt<UInt<UTerm, B1>, B1>> for (T1, T2, T3, T4, T5, T6)

Source§

impl<T1, T2, T3, T4, T5, T6> TupleRemove<UInt<UTerm, B1>> for (T1, T2, T3, T4, T5, T6)

Source§

impl<T1, T2, T3, T4, T5, T6> TupleRemove<UTerm> for (T1, T2, T3, T4, T5, T6)

Source§

impl<T1, T2, T3, T4, T5, T6, T7> TupleRemove<UInt<UInt<UInt<UTerm, B1>, B0>, B0>> for (T1, T2, T3, T4, T5, T6, T7)

Source§

impl<T1, T2, T3, T4, T5, T6, T7> TupleRemove<UInt<UInt<UInt<UTerm, B1>, B0>, B1>> for (T1, T2, T3, T4, T5, T6, T7)

Source§

impl<T1, T2, T3, T4, T5, T6, T7> TupleRemove<UInt<UInt<UInt<UTerm, B1>, B1>, B0>> for (T1, T2, T3, T4, T5, T6, T7)

Source§

impl<T1, T2, T3, T4, T5, T6, T7> TupleRemove<UInt<UInt<UTerm, B1>, B0>> for (T1, T2, T3, T4, T5, T6, T7)

Source§

impl<T1, T2, T3, T4, T5, T6, T7> TupleRemove<UInt<UInt<UTerm, B1>, B1>> for (T1, T2, T3, T4, T5, T6, T7)

Source§

impl<T1, T2, T3, T4, T5, T6, T7> TupleRemove<UInt<UTerm, B1>> for (T1, T2, T3, T4, T5, T6, T7)

Source§

impl<T1, T2, T3, T4, T5, T6, T7> TupleRemove<UTerm> for (T1, T2, T3, T4, T5, T6, T7)

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8> TupleRemove<UInt<UInt<UInt<UTerm, B1>, B0>, B0>> for (T1, T2, T3, T4, T5, T6, T7, T8)

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8> TupleRemove<UInt<UInt<UInt<UTerm, B1>, B0>, B1>> for (T1, T2, T3, T4, T5, T6, T7, T8)

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8> TupleRemove<UInt<UInt<UInt<UTerm, B1>, B1>, B0>> for (T1, T2, T3, T4, T5, T6, T7, T8)

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8> TupleRemove<UInt<UInt<UInt<UTerm, B1>, B1>, B1>> for (T1, T2, T3, T4, T5, T6, T7, T8)

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8> TupleRemove<UInt<UInt<UTerm, B1>, B0>> for (T1, T2, T3, T4, T5, T6, T7, T8)

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8> TupleRemove<UInt<UInt<UTerm, B1>, B1>> for (T1, T2, T3, T4, T5, T6, T7, T8)

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8> TupleRemove<UInt<UTerm, B1>> for (T1, T2, T3, T4, T5, T6, T7, T8)

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8> TupleRemove<UTerm> for (T1, T2, T3, T4, T5, T6, T7, T8)

Implementors§