tuple_len 3.0.0

Get the number of elements in a tuple
Documentation
  • Coverage
  • 20%
    1 out of 5 items documented1 out of 4 items with examples
  • Size
  • Source code size: 7.43 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 345.3 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • sanpii/tuple_len
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • sanpii

tuple_len

Github actions Gitlab CI

Get the number of elements in a tuple.

Usage

Add it to your dependencies:

cargo add tuple_len
// The macro way, compute at compilation time
assert_eq!(tuple_len::tuple_len!(("hello", 5, 'c')), 3);

// The trait way — limited to sized 12 tuple
use tuple_len::TupleLen;
assert_eq!(().len(), 0);

// The function way — idem
let tuple = (1,);
assert_eq!(tuple_len::len(&tuple), 1);