Skip to Content

Records

A record is an abstract data type containing a series of named fields. It has no associated behavior and acts as a way to group data together. In C++, this would be referred to as a plain old data  type.

Depending on the language, records may be expressed in different ways.

LanguageEquivalent Construct
RustStruct
CStruct
PythonData Class 
TypeScriptType alias 

Syntax

A record contains a list of fields, where each field must be given a type.

record person { name: string, age: u32, has-lego-action-figure: bool, }

For more details, consult the Item: record section in the *.wai format.

Last updated on