TuplePushFront

Trait TuplePushFront 

Source
pub trait TuplePushFront<T> {
    type Output;

    // Required method
    fn push_front(self, value: T) -> Self::Output;
}
Expand description

A trait for tuples that allows pushing an element to the front.

Required Associated Types§

Source

type Output

The type of the tuple after adding T to the front.

Required Methods§

Source

fn push_front(self, value: T) -> Self::Output

Consumes the tuple and prepends the given value, returning the new tuple.

§Examples
use tuplities_push_front::TuplePushFront;

let tuple = ("world",);
let new_tuple = tuple.push_front("hello");
assert_eq!(new_tuple, ("hello", "world"));

Part of the tuplities crate.

Implementations on Foreign Types§

Source§

impl<T> TuplePushFront<T> for ()

Source§

type Output = (T,)

Source§

fn push_front(self, value: T) -> Self::Output

Source§

impl<T, T1> TuplePushFront<T> for (T1,)

Source§

type Output = (T, T1)

Source§

fn push_front(self, value: T) -> Self::Output

Source§

impl<T, T1, T2> TuplePushFront<T> for (T1, T2)

Source§

type Output = (T, T1, T2)

Source§

fn push_front(self, value: T) -> Self::Output

Source§

impl<T, T1, T2, T3> TuplePushFront<T> for (T1, T2, T3)

Source§

type Output = (T, T1, T2, T3)

Source§

fn push_front(self, value: T) -> Self::Output

Source§

impl<T, T1, T2, T3, T4> TuplePushFront<T> for (T1, T2, T3, T4)

Source§

impl<T, T1, T2, T3, T4, T5> TuplePushFront<T> for (T1, T2, T3, T4, T5)

Source§

impl<T, T1, T2, T3, T4, T5, T6> TuplePushFront<T> for (T1, T2, T3, T4, T5, T6)

Source§

impl<T, T1, T2, T3, T4, T5, T6, T7> TuplePushFront<T> for (T1, T2, T3, T4, T5, T6, T7)

Source§

impl<T, T1, T2, T3, T4, T5, T6, T7, T8> TuplePushFront<T> for (T1, T2, T3, T4, T5, T6, T7, T8)

Implementors§