Debian Codegraph @

crates/wasm-wave/tests/types.wit

raw
1 // Regenerate types.wasm:
2 // wasm-tools component embed --dummy types.wit | wasm-tools component new -o types.wasm
3
4 package tests:tests
5
6 world tests {
7 export bools: func() -> tuple<bool, bool>
8 export sints: func() -> tuple<s8, s16, s32, s64>
9 export uints: func() -> tuple<u8, u16, u32, u64>
10 export floats: func() -> tuple<f32, f64>
11 export options: func() -> tuple<option<u8>, option<option<s8>>>
12 export list-chars: func() -> list<char>
13 export list-strings: func() -> list<string>
14 export result-ok-only: func() -> result<u8>
15 export result-err-only: func() -> result<_, s8>
16 export result-no-payloads: func() -> result
17 export result-both-payloads: func() -> result<u8, s8>
18
19 record record-type {
20 required: u8,
21 optional: option<u8>,
22 }
23 export %record: func() -> record-type
24
25 variant variant-type {
26 without-payload,
27 with-payload(u8),
28 }
29 export %variant: func() -> variant-type
30
31 enum enum-type {
32 first,
33 second,
34 }
35 export %enum: func() -> enum-type
36
37 flags flags-type {
38 read,
39 write,
40 }
41 export %flags: func() -> flags-type
42
43 export func-type: func(a: bool, b: enum-type) -> result<u8>
44 }