typenum

Module marker_traits

Source
Expand description

All of the marker traits used in typenum.

Note that the definition here for marker traits is slightly different than the conventional one – we include traits with functions that convert a type to the corresponding value, as well as associated constants that do the same.

For example, the Integer trait includes the function (among others) fn to_i32() -> i32 and the associated constant I32 so that one can do this:

use typenum::{Integer, N42};

assert_eq!(-42, N42::to_i32());
assert_eq!(-42, N42::I32);

Traits§

  • The marker trait for compile time bits.
  • The marker trait for compile time signed integers.
  • A marker trait to designate that a type is not zero. All number types in this crate implement NonZero except B0, U0, and Z0.
  • A Marker trait for the types Greater, Equal, and Less.
  • The marker trait for type-level numbers which are a power of two.
  • The marker trait for type-level arrays of type-level numbers.
  • The marker trait for compile time unsigned integers.
  • A marker trait to designate that a type is zero. Only B0, U0, and Z0 implement this trait.