pub trait TupleCons<Head>: Tuple {
type ConsResult: Tuple;
// Required method
fn cons(head: Head, tail: Self) -> Self::ConsResult;
}Expand description
Trait providing tuple construction function, allows to prepend a value to a tuple.
Required Associated Types§
Sourcetype ConsResult: Tuple
type ConsResult: Tuple
Tuple with Head prepended to Self
Required Methods§
Sourcefn cons(head: Head, tail: Self) -> Self::ConsResult
fn cons(head: Head, tail: Self) -> Self::ConsResult
Constructs a tuple from head value and tail tuple by prepending head to tail.
Reverse of NonEmptyTuple::uncons.
§Examples
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.