Back to Developer Roadmap

Tuple

src/data/roadmaps/rust/content/tuple@81_J7CwtUUjYPvKV_prg3.md

4.0624 B
Original Source

Tuple

Tuples are fixed-size collections that can hold elements of different types. Access elements using dot notation with zero-based indexing: tuple.0, tuple.1, etc. Example: let data: (i32, f64, char) = (42, 3.14, 'x');. Useful for grouping related values of different types and multiple variable assignments.

Visit the following resources to learn more: