Files
wasmtime/crates/component-macro/tests/codegen/records.wit
Alex Crichton 2329ecc341 Add a wasmtime::component::bindgen! macro (#5317)
* Import Wasmtime support from the `wit-bindgen` repo

This commit imports the `wit-bindgen-gen-host-wasmtime-rust` crate from
the `wit-bindgen` repository into the upstream Wasmtime repository. I've
chosen to not import the full history here since the crate is relatively
small and doesn't have a ton of complexity. While the history of the
crate is quite long the current iteration of the crate's history is
relatively short so there's not a ton of import there anyway. The
thinking is that this can now continue to evolve in-tree.

* Refactor `wasmtime-component-macro` a bit

Make room for a `wit_bindgen` macro to slot in.

* Add initial support for a `bindgen` macro

* Add tests for `wasmtime::component::bindgen!`

* Improve error forgetting `async` feature

* Add end-to-end tests for bindgen

* Add an audit of `unicase`

* Add a license to the test-helpers crate

* Add vet entry for `pulldown-cmark`

* Update publish script with new crate

* Try to fix publish script

* Update audits

* Update lock file
2022-12-06 13:06:00 -06:00

61 lines
1.2 KiB
Plaintext

interface records {
tuple-arg: func(x: tuple<char, u32>)
tuple-result: func() -> tuple<char, u32>
record empty {}
empty-arg: func(x: empty)
empty-result: func() -> empty
/// A record containing two scalar fields
/// that both have the same type
record scalars {
/// The first field, named a
a: u32,
/// The second field, named b
b: u32,
}
scalar-arg: func(x: scalars)
scalar-result: func() -> scalars
/// A record that is really just flags
/// All of the fields are bool
record really-flags {
a: bool,
b: bool,
c: bool,
d: bool,
e: bool,
f: bool,
g: bool,
h: bool,
i: bool,
}
flags-arg: func(x: really-flags)
flags-result: func() -> really-flags
record aggregates {
a: scalars,
b: u32,
c: empty,
d: string,
e: really-flags,
}
aggregate-arg: func(x: aggregates)
aggregate-result: func() -> aggregates
type tuple-typedef = tuple<s32>
type int-typedef = s32
type tuple-typedef2 = tuple<int-typedef>
typedef-inout: func(e: tuple-typedef2) -> s32
}
world the-world {
import imports: records
export exports: records
default export records
}