Struct grammar
# Structs
+> **<sup>Syntax</sup>**
+> _Struct_ :
+> &nbsp;&nbsp; &nbsp;&nbsp; _StructStruct_
+> &nbsp;&nbsp; | _TupleStruct_
+>
+> _StructStruct_ :
+> &nbsp;&nbsp; `struct`
+> [IDENTIFIER]&nbsp;
+> [_Generics_]<sup>?</sup>
+> [_WhereClause_]<sup>?</sup>
+> ( `{` _StructFields_<sup>?</sup> `}` | `;` )
+>
+> _TupleStruct_ :
+> &nbsp;&nbsp; `struct`
+> [IDENTIFIER]&nbsp;
+> [_Generics_]<sup>?</sup>
+> `(` _TupleFields_<sup>?</sup> `)`
+> [_WhereClause_]<sup>?</sup>
+> `;`
+>
+> _StructFields_ :
+> &nbsp;&nbsp; _StructField_ (`,` _StructField_)<sup>\*</sup> `,`<sup>?</sup>
+>
+> _StructField_ :
+> &nbsp;&nbsp; [_OuterAttribute_]<sup>\*</sup>
+> &nbsp;&nbsp; [_Visibility_]<sup>?</sup>
+> &nbsp;&nbsp; [IDENTIFIER] `:` [_Type_]
+>
+> _TupleFields_ :
+> &nbsp;&nbsp; _TupleField_ (`,` _TupleField_)<sup>\*</sup> `,`<sup>?</sup>
+>
+> _TupleField_ :
+> &nbsp;&nbsp; [_OuterAttribute_]<sup>\*</sup>
+> &nbsp;&nbsp; [_Visibility_]<sup>?</sup>
+> &nbsp;&nbsp; [_Type_]
+
A _struct_ is a nominal [struct type] defined with the keyword `struct`.
An example of a `struct` item and its use:
@@ -43,3 +79,10 @@ The precise memory layout of a struct is not specified. One can specify a
particular layout using the [`repr` attribute].
[`repr` attribute]: attributes.html#ffi-attributes
+
+[_OuterAttribute_]: attributes.html
+[IDENTIFIER]: identifiers.html
+[_Generics_]: items.html#type-parameters
+[_WhereClause_]: items.html#type-parameters
+[_Visibility_]: visibility-and-privacy.html
+[_Type_]: types.html
