Trait Count

Source
pub trait Count {
    const COUNT: usize;
}
Expand description

A trait for getting the number of type arguments in a type.

This is implemented for Or types and tuples.

§Examples

use orn::{Count, Or3};

assert_eq!(Or3::<u8, u16, u32>::COUNT, 3);
assert_eq!(<(u8, u16, u32)>::COUNT, 3);

Required Associated Constants§

Source

const COUNT: usize

The number of type arguments.

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 Count for ()

Source§

const COUNT: usize = 0usize

Source§

impl<T0> Count for (T0,)

Source§

const COUNT: usize = 1usize

Source§

impl<T0, T1> Count for (T0, T1)

Source§

const COUNT: usize = 2usize

Source§

impl<T0, T1, T2> Count for (T0, T1, T2)

Source§

const COUNT: usize = 3usize

Source§

impl<T0, T1, T2, T3> Count for (T0, T1, T2, T3)

Source§

const COUNT: usize = 4usize

Source§

impl<T0, T1, T2, T3, T4> Count for (T0, T1, T2, T3, T4)

Source§

const COUNT: usize = 5usize

Source§

impl<T0, T1, T2, T3, T4, T5> Count for (T0, T1, T2, T3, T4, T5)

Source§

const COUNT: usize = 6usize

Source§

impl<T0, T1, T2, T3, T4, T5, T6> Count for (T0, T1, T2, T3, T4, T5, T6)

Source§

const COUNT: usize = 7usize

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7> Count for (T0, T1, T2, T3, T4, T5, T6, T7)

Source§

const COUNT: usize = 8usize

Implementors§

Source§

impl Count for orn::or0::Or

Source§

const COUNT: usize = 0usize

Source§

impl<T0> Count for orn::or1::Or<T0>

Source§

const COUNT: usize = 1usize

Source§

impl<T0, T1> Count for orn::or2::Or<T0, T1>

Source§

const COUNT: usize = 2usize

Source§

impl<T0, T1, T2> Count for orn::or3::Or<T0, T1, T2>

Source§

const COUNT: usize = 3usize

Source§

impl<T0, T1, T2, T3> Count for orn::or4::Or<T0, T1, T2, T3>

Source§

const COUNT: usize = 4usize

Source§

impl<T0, T1, T2, T3, T4> Count for orn::or5::Or<T0, T1, T2, T3, T4>

Source§

const COUNT: usize = 5usize

Source§

impl<T0, T1, T2, T3, T4, T5> Count for orn::or6::Or<T0, T1, T2, T3, T4, T5>

Source§

const COUNT: usize = 6usize

Source§

impl<T0, T1, T2, T3, T4, T5, T6> Count for orn::or7::Or<T0, T1, T2, T3, T4, T5, T6>

Source§

const COUNT: usize = 7usize

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7> Count for orn::or8::Or<T0, T1, T2, T3, T4, T5, T6, T7>

Source§

const COUNT: usize = 8usize