| // Copyright 2019 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| library fidl.rust.test.compilation; |
| |
| using zx; |
| |
| flexible union TestXUnion { |
| 1: bool variant; |
| }; |
| |
| enum ErrorReturn : uint32 { |
| OK = 0x00; |
| CHANGED = 0x0D; |
| }; |
| |
| const ErrorReturn ERROR_RETURN_CONST = ErrorReturn.OK; |
| |
| protocol TestInterface { |
| TestMethod(TestXUnion test_x_union) -> (TestXUnion test_x_union); |
| TestNullableXUnion(TestXUnion? test_x_union) -> (TestXUnion? test_x_union); |
| TestErrorMethod(uint16 arg) -> () error ErrorReturn; |
| // TODO(fxbug.dev/59947): add "responder" and "control_handle" |
| TestNameClashesTwoWay(bytes bytes, vector<handle> handles, string header) |
| -> (bytes bytes, vector<handle> handles, string header); |
| TestNameClashesOneWay(bytes bytes, vector<handle> handles, string header); |
| -> TestNameClashesEvent(bytes bytes, vector<handle> handles, string header); |
| }; |
| |
| struct HasBigArray { |
| array<uint8>:256 big_arr; |
| }; |
| |
| union HasStructWithBigArray { |
| 1: HasBigArray variant; |
| 2: uint8 variant2; |
| }; |
| |
| struct Result { |
| string ensure_that_type_named_result_compiles; |
| }; |
| |
| resource struct HasHostFidlHandleStubbing { |
| zx.handle:LOG log; |
| }; |