Array types
Syntax
ArrayType :
[
Type;
Expression]
An array is a fixed-size sequence of N
elements of type T
. The array type
is written as [T; N]
.
The size is a constant expression that evaluates to a usize
.
Examples:
All elements of arrays are always initialized, and access to an array is always bounds-checked in safe methods and operators.
Note: The
Vec<T>
standard library type provides a heap-allocated resizable array type.