Skip to main content

Untupleable

Trait Untupleable 

Source
pub trait Untupleable: TupleLike {
    type UntupleOutput: TupleLike;

    // Required method
    fn untuple(self) -> Self::UntupleOutput;
}
Expand description

Opposite operation of to_tuple().

Required Associated Types§

Source

type UntupleOutput: TupleLike

The type of tuple generated by untupling the elements of the tuple.

Required Methods§

Source

fn untuple(self) -> Self::UntupleOutput

Untuple a tuple, whose elements are all tuples with only one element.

Hint: The TupleLike trait provides the untuple() method as the wrapper for this untuple() method.

§Example
use tuplez::{tuple, TupleLike};

let tup_tup = tuple!(tuple!(1), tuple!("hello"), tuple!(3.14));
assert_eq!(tup_tup.untuple(), tuple!(1, "hello", 3.14));

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl Untupleable for Unit

Source§

impl<First, Other> Untupleable for Tuple<First, Other>
where First: TupleLike, Other: Untupleable,