File: lists.wit

package info (click to toggle)
rust-wasmtime 26.0.1%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 48,492 kB
  • sloc: ansic: 4,003; sh: 561; javascript: 542; cpp: 254; asm: 175; ml: 96; makefile: 55
file content (85 lines) | stat: -rw-r--r-- 1,981 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
package foo:foo;

interface lists {
  list-u8-param: func(x: list<u8>);
  list-u16-param: func(x: list<u16>);
  list-u32-param: func(x: list<u32>);
  list-u64-param: func(x: list<u64>);
  list-s8-param: func(x: list<s8>);
  list-s16-param: func(x: list<s16>);
  list-s32-param: func(x: list<s32>);
  list-s64-param: func(x: list<s64>);
  list-f32-param: func(x: list<f32>);
  list-f64-param: func(x: list<f64>);

  list-u8-ret: func() -> list<u8>;
  list-u16-ret: func() -> list<u16>;
  list-u32-ret: func() -> list<u32>;
  list-u64-ret: func() -> list<u64>;
  list-s8-ret: func() -> list<s8>;
  list-s16-ret: func() -> list<s16>;
  list-s32-ret: func() -> list<s32>;
  list-s64-ret: func() -> list<s64>;
  list-f32-ret: func() -> list<f32>;
  list-f64-ret: func() -> list<f64>;

  tuple-list: func(x: list<tuple<u8, s8>>) -> list<tuple<s64, u32>>;
  string-list-arg: func(a: list<string>);
  string-list-ret: func() -> list<string>;
  tuple-string-list: func(x: list<tuple<u8, string>>) -> list<tuple<string, u8>>;
  string-list: func(x: list<string>) -> list<string>;

  record some-record {
    x: string,
    y: other-record,
    z: list<other-record>,
    c1: u32,
    c2: u64,
    c3: s32,
    c4: s64,
  }
  record other-record {
    a1: u32,
    a2: u64,
    a3: s32,
    a4: s64,
    b: string,
    c: list<u8>,
  }
  record-list: func(x: list<some-record>) -> list<other-record>;
  record-list-reverse: func(x: list<other-record>) -> list<some-record>;

  variant some-variant {
    a(string),
    b,
    c(u32),
    d(list<other-variant>),
  }
  variant other-variant {
    a,
    b(u32),
    c(string),
  }
  variant-list: func(x: list<some-variant>) -> list<other-variant>;

  type load-store-all-sizes = list<tuple<
    string,
    u8,
    s8,
    u16,
    s16,
    u32,
    s32,
    u64,
    s64,
    f32,
    f64,
    char,
  >>;
  load-store-everything: func(a: load-store-all-sizes) -> load-store-all-sizes;
}

world the-lists {
  import lists;
  export lists;
}