| library fidl.test.imported; |
| |
| type WantResponse = strict enum { |
| SUCCESS = 1; |
| ERR = 2; |
| }; |
| |
| type SimpleStruct = struct { |
| f1 bool; |
| f2 uint64; |
| }; |
| |
| // If `forward_to_server` is empty, just returns `value`. |
| // If `forward_to_server` is not empty, it is treated as the URL of a server |
| // which implements this interface. The server that receives the non-empty |
| // `forward_to_server` arg acts as a proxy for that other server. |
| // For the error variants: if should_error is true, the provided err result |
| // error is sent, otherwise the response variant is sent. |
| type RequestStruct = struct { |
| value SimpleStruct; |
| forward_to_server string; |
| }; |
| |
| type ResponseStruct = struct { |
| value SimpleStruct; |
| }; |
| |
| type EventTriggeringRequestStruct = struct { |
| value SimpleStruct; |
| forward_to_server string; |
| }; |
| |
| type ErrorableRequestStruct = struct { |
| value SimpleStruct; |
| result_err uint32; |
| forward_to_server string; |
| result_variant WantResponse; |
| }; |
| |
| // This protocol exists solely to be composed into the `Echo` protocol in `library |
| // fidl.test.compatibility` as a means of testing the behavior and code generation of protocol |
| // composition. |
| // TODO(fxbug.dev/94910): Only test these tests in "N+M" mode, and move them into their |
| // own file, as they are not specifically concerned with wire compatibility across bindings. |
| protocol Composed { |
| EchoTableRequestComposed(table { |
| 1: value uint64; |
| 2: forward_to_server string; |
| }) -> (ResponseStruct); |
| EchoUnionResponseWithErrorComposed(struct { |
| value int64; |
| want_absolute_value bool; |
| forward_to_server string; |
| result_err uint32; |
| result_variant WantResponse; |
| }) -> (strict union { |
| 1: unsigned uint64; |
| 2: signed int64; |
| }) error uint32; |
| }; |