pub trait TupleLength {
const LENGTH: usize;
}
Available on crate feature
length
only.Expand description
A tuple with a known length.
use tupleops::TupleLength;
assert_eq!(0, <() as TupleLength>::LENGTH);
assert_eq!(1, <(u8,) as TupleLength>::LENGTH);
assert_eq!(2, <(u8, u16) as TupleLength>::LENGTH);
assert_eq!(3, <(u8, u16, u32) as TupleLength>::LENGTH);
See also: length().
Required Associated Constants§
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.