| // Copyright 2021 The Fuchsia Authors. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| library fuchsia.example.fostr; |
| |
| open protocol ExampleProtocol {}; |
| |
| type ExampleBits = strict bits { |
| A = 1; |
| B = 2; |
| C = 4; |
| }; |
| |
| type ExampleEnum = strict enum { |
| FOO = 1; |
| BAR_BAZ = 2; |
| }; |
| |
| type MyStruct = struct { |
| nums vector<int32>:<10, optional>; |
| foo string; |
| bar MyXunion; |
| my_uint8 uint8; |
| my_int8 int8; |
| }; |
| |
| type MyXunion = flexible union { |
| 1: i int32; |
| 2: b bool; |
| 4: my_uint8 uint8; |
| 5: my_int8 int8; |
| }; |
| |
| type MyUnion = strict union { |
| 1: i int32; |
| 2: b bool; |
| 4: my_uint8 uint8; |
| 5: my_int8 int8; |
| }; |
| |
| type SimpleTable = table { |
| 1: x bool; |
| 3: y MyStruct; |
| 4: z int32; |
| 5: my_uint8 uint8; |
| 6: my_int8 int8; |
| }; |