Debian Codegraph @

crates/wit-component/tests/interfaces/lists.wit.print

raw
1 package foo:foo;
2
3 interface lists {
4 record other-record {
5 a1: u32,
6 a2: u64,
7 a3: s32,
8 a4: s64,
9 b: string,
10 c: list<u8>,
11 }
12
13 record some-record {
14 x: string,
15 y: other-record,
16 c1: u32,
17 c2: u64,
18 c3: s32,
19 c4: s64,
20 }
21
22 variant other-variant {
23 a,
24 b(u32),
25 c(string),
26 }
27
28 variant some-variant {
29 a(string),
30 b,
31 c(u32),
32 d(list<other-variant>),
33 }
34
35 type load-store-all-sizes = list<tuple<string, u8, s8, u16, s16, u32, s32, u64, s64, f32, f64, char>>;
36
37 list-u8-param: func(x: list<u8>);
38
39 list-u16-param: func(x: list<u16>);
40
41 list-u32-param: func(x: list<u32>);
42
43 list-u64-param: func(x: list<u64>);
44
45 list-s8-param: func(x: list<s8>);
46
47 list-s16-param: func(x: list<s16>);
48
49 list-s32-param: func(x: list<s32>);
50
51 list-s64-param: func(x: list<s64>);
52
53 list-f32-param: func(x: list<f32>);
54
55 list-f64-param: func(x: list<f64>);
56
57 list-u8-ret: func() -> list<u8>;
58
59 list-u16-ret: func() -> list<u16>;
60
61 list-u32-ret: func() -> list<u32>;
62
63 list-u64-ret: func() -> list<u64>;
64
65 list-s8-ret: func() -> list<s8>;
66
67 list-s16-ret: func() -> list<s16>;
68
69 list-s32-ret: func() -> list<s32>;
70
71 list-s64-ret: func() -> list<s64>;
72
73 list-f32-ret: func() -> list<f32>;
74
75 list-f64-ret: func() -> list<f64>;
76
77 tuple-list: func(x: list<tuple<u8, s8>>) -> list<tuple<s64, u32>>;
78
79 string-list-arg: func(a: list<string>);
80
81 string-list-ret: func() -> list<string>;
82
83 tuple-string-list: func(x: list<tuple<u8, string>>) -> list<tuple<string, u8>>;
84
85 string-list: func(x: list<string>) -> list<string>;
86
87 record-list: func(x: list<some-record>) -> list<other-record>;
88
89 variant-list: func(x: list<some-variant>) -> list<other-variant>;
90
91 load-store-everything: func(a: load-store-all-sizes) -> load-store-all-sizes;
92 }
93
94 world lists-world {
95 import lists;
96 }