pub trait ToArray<T>: TupleLike {
type Array;
// Required method
fn to_array(self) -> Self::Array;
}Expand description
The ToArray trait allows you to convert tuples to primitive arrays,
if and only if all elements of the tuple are of the same type.
Because the generic constant expressions feature is still unstable yet,
we can only limit the maximum number of elements of the tuple that implement ToArray to 32,
just like what we did with the primitive tuples.
However, if you are OK with using rustc released to nightly channel to compile codes with unstable features,
you can enable the any_array feature to implement ToArray on tuples with no limit on the number of elements.
tuplez = { features = [ "any_array" ] }
Always remember: unstable features are not guaranteed by Rust and may not be available someday in the future.
Required Associated Types§
Required Methods§
Object Safety§
This trait is not object safe.