package local:local; interface baz { foo: async func(s: string) -> string; } world round-trip { import baz; export baz; } interface many { record stuff { a: list, b: bool, c: u64 } foo: async func(a: string, b: u32, c: list, d: tuple, e: stuff, f: option, g: result) -> tuple, tuple, stuff, option, result>; } world round-trip-many { import many; export many; } world round-trip-direct { import foo: async func(s: string) -> string; export foo: async func(s: string) -> string; } interface ready { resource thing { constructor(); set-ready: func(ready: bool); when-ready: async func(); } } interface continue { set-continue: func(continue: bool); get-continue: func() -> bool; } interface run { run: async func(); } interface backpressure { set-backpressure: func(enabled: bool); inc-backpressure: func(); dec-backpressure: func(); } interface transmit { variant control { read-stream(string), read-stream-zero, read-future(string), write-stream(string), write-stream-zero, write-future(string), } exchange: async func(control: stream, caller-stream: stream, caller-future1: future, caller-future2: future) -> tuple, future, future>; } interface post-return { foo: async func(s: string) -> string; get-post-return-value: func() -> string; } interface borrowing-types { resource x { constructor(); foo: func(); } } interface borrowing { use borrowing-types.{x}; foo: async func(x: borrow, misbehave: bool); } interface run-bool { run: async func(v: bool); } interface run-result { run-fail: async func() -> result<_, error-context>; run-pass: async func() -> result<_, error-context>; } interface run-stream { produce-then-error: func(times: u32) -> stream; } interface run-future { produce-then-error: func() -> future; } interface unit-stream { run: async func(count: u32) -> stream; } interface resource-stream { resource x { foo: func(); } foo: async func(count: u32) -> stream; } interface closed { read-stream: async func(rx: stream, expected: list); read-future: async func(rx: future, expected: u8, rx-ignore: future); read-future-post-return: async func(rx: future, expected: u8, rx-ignore: future); } interface yield { yield-times: async func(times: u64); } interface yield-with-options { use cancel.{mode}; variant on-cancel { task-return, task-cancel } yield-times: async func(times: u64, on-cancel: on-cancel, on-cancel-delay-times: u64, synchronous-delay: bool, mode: mode); } interface cancel { variant mode { normal, trap-cancel-guest-after-start-cancelled, trap-cancel-guest-after-return-cancelled, trap-cancel-guest-after-return, trap-cancel-host-after-return-cancelled, trap-cancel-host-after-return, leak-task-after-cancel, } run: async func(mode: mode, cancel-delay-times: u64); } interface intertask { foo: func(fut: future); } interface readiness { start: async func(s: stream, expected: list) -> tuple, list>; } interface synchronous-transmit { start: async func(s: stream, s-expected: list, f: future, f-expected: u8) -> tuple, list, future, u8>; } interface yield-post-return { run: async func(times: u64); } interface closed-stream { get: func() -> stream; } interface short-reads { resource thing { constructor(s: string); get: async func() -> string; } short-reads: async func(s: stream) -> stream; } world yield-caller { import continue; import ready; import run; export run; } world yield-callee { import continue; export run; } world yield-runner { import continue; import ready; export run; } world poll { import ready; export run; } world backpressure-caller { import backpressure; import run; export run; } world backpressure-callee { export backpressure; export run; } world transmit-caller { import transmit; export run; } world transmit-callee { export transmit; } world post-return-caller { import post-return; export run; } world post-return-callee { export post-return; } world borrowing-caller { import borrowing; export run-bool; } world borrowing-callee { export borrowing; export run-bool; } world borrowing-host { import borrowing-types; export run-bool; } world error-context-usage { export run; } world error-context-callee { export run-result; export run; } world error-context-caller { import run-result; export run; } world error-context-stream-callee { export run-stream; export run; } world error-context-stream-caller { import run-stream; export run; } world error-context-future-callee { export run-future; export run; } world error-context-future-caller { import run-future; export run; } world unit-stream-caller { import unit-stream; export run; } world unit-stream-callee { export unit-stream; } world read-resource-stream { import resource-stream; export run; } world closed-streams { export closed; } world yield-host { import yield; } world cancel-caller { import backpressure; import yield; import yield-with-options; export cancel; } world cancel-callee { import yield; export backpressure; export yield; export yield-with-options; } world cancel-host { export cancel; } world intertask-communication { import intertask; export run; } world readiness-guest { export readiness; } world synchronous-transmit-guest { export synchronous-transmit; } world yield-post-return-callee { import yield; export yield-post-return; } world yield-post-return-caller { import yield; import yield-post-return; export yield-post-return; } world closed-stream-guest { export closed-stream; } world short-reads-guest { export short-reads; }