pub trait Untupleable: TupleLike {
type UntupleOutput: TupleLike;
// Required method
fn untuple(self) -> Self::UntupleOutput;
}
Expand description
Opposite operation of to_tuple()
.
Required Associated Types§
Sourcetype UntupleOutput: TupleLike
type UntupleOutput: TupleLike
The type of tuple generated by untupling the elements of the tuple.
Required Methods§
Sourcefn untuple(self) -> Self::UntupleOutput
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", so this trait is not object safe.