RustTuples


Introduction

The most trivial data-structure, after a singular value, is the tuple.

Syntax

  • (A, B, C) // a three-tuple (a tuple with three elements), whose first element has type A, second type B, and third type C
  • (A, B) // a two-tuple, whose two elements have type A and B respectively
  • (A,) // a one-tuple (note the trailing ,), which holds only a single element of type A
  • () // the empty tuple, which is both a type, and that type's only element