Compound types gather multiple values of other types into one type. The first compound type is the tuple tuples store multiple values of any type. We've seen it before, it looks like this parentheses containing comma separated values. The type annotation is pretty intuitive parentheses surrounding comma separated types. There are two ways to access members of a tuple. The first way is to use dot syntax, also known as a field access expression.
I believe rust uses the dot syntax here instead of square brackets to emphasize that members of tuples are not always the same type. Since a tuples fields have no names, you use their indices starting with zero. The second way to access members of a tuple is all at once we've seen this before, you can use a pattern to D structure and access all the elements of a tuple. Please be aware that tuples currently have a maximum arity of 12 Above which you can technically still use the tuple, but only with limited functionality. arity means how many items are in the tuple. So this tuple type has an arity of four, since the current maximum arity is 12.
You can have a dozen elements in a tuple, but not a baker's dozen, at least not with full functionality. Arrays by contrast, store multiple values of the same type. You can specify them literally with square brackets and commas or with a value and how many you want separated by a semicolon. Note that the type annotation for an array always uses the semicolon form. Even when you specify all the literal values in the array. You index values in an array as you would expect with square brackets.
What you would not expect, however, is that arrays are limited to a size of 32, above which they lose most of their functionality. Arrays live on the stack by default and are fixed size so you will usually use vectors slices of vectors instead of arrays. We'll talk about vectors in a later video. In the next video, we will talk about control flow.