Skip to main content

TupleLength

Trait TupleLength 

Source
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§

Source

const LENGTH: usize

The number of elements in this tuple

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.

Implementations on Foreign Types§

Source§

impl TupleLength for ()

Source§

impl<I1> TupleLength for (I1,)

Source§

impl<I1, I2> TupleLength for (I1, I2)

Source§

impl<I1, I2, I3> TupleLength for (I1, I2, I3)

Source§

impl<I1, I2, I3, I4> TupleLength for (I1, I2, I3, I4)

Source§

impl<I1, I2, I3, I4, I5> TupleLength for (I1, I2, I3, I4, I5)

Source§

impl<I1, I2, I3, I4, I5, I6> TupleLength for (I1, I2, I3, I4, I5, I6)

Source§

impl<I1, I2, I3, I4, I5, I6, I7> TupleLength for (I1, I2, I3, I4, I5, I6, I7)

Source§

impl<I1, I2, I3, I4, I5, I6, I7, I8> TupleLength for (I1, I2, I3, I4, I5, I6, I7, I8)

Implementors§