Skip to main content

TupleReverse

Trait TupleReverse 

Source
pub trait TupleReverse {
    type Output;

    // Required method
    fn reverse(self) -> Self::Output;
}
Expand description

A trait for reversing the elements of a tuple.

This trait provides a method to reverse the order of elements in a tuple.

§Examples

use tuplities_reverse::TupleReverse;

let tuple = (1, "hello", 3.14);
let reversed = tuple.reverse();
assert_eq!(reversed, (3.14, "hello", 1));

Part of the tuplities crate.

Required Associated Types§

Source

type Output

The type of the tuple with elements in reverse order.

Required Methods§

Source

fn reverse(self) -> Self::Output

Consumes the tuple and returns a new tuple with elements in reverse order.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl TupleReverse for ()

Source§

type Output = ()

Source§

fn reverse(self) -> Self::Output

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl<T1, T2, T3, T4> TupleReverse for (T1, T2, T3, T4)

Source§

impl<T1, T2, T3> TupleReverse for (T1, T2, T3)

Source§

impl<T1, T2> TupleReverse for (T1, T2)

Source§

impl<T1> TupleReverse for (T1,)

Source§

type Output = (T1,)

Source§

fn reverse(self) -> Self::Output

Implementors§