diff --git a/golem-cli/src/diagnose.rs b/golem-cli/src/diagnose.rs index 470da7ca80..a4a194d742 100644 --- a/golem-cli/src/diagnose.rs +++ b/golem-cli/src/diagnose.rs @@ -308,7 +308,7 @@ impl Tool { Tool::Cargo => ToolMetadata { short_name: "cargo", description: "Rust package manager", - version_requirement: MinimumVersion("1.80.1"), + version_requirement: MinimumVersion("1.84.0"), instructions: "See the rustup step above (https://www.rust-lang.org/learn/get-started)", }, @@ -343,10 +343,10 @@ impl Tool { Tool::ComponentizePy => ToolMetadata { short_name: "componentize-py", description: "Tool for converting Python applications to WebAssembly components", - version_requirement: ExactVersion("0.13.5"), + version_requirement: ExactVersion("0.16.0"), instructions: indoc! {" Install the following specific version: - pip install componentize-py==0.13.5 + pip install componentize-py==0.16.0 For more information see: https://github.com/bytecodealliance/componentize-py @@ -363,7 +363,7 @@ impl Tool { Tool::GolemSdkGo => ToolMetadata { short_name: "golem-go", description: "Golem SDK for Go", - version_requirement: MinimumVersion("0.7.0"), + version_requirement: MinimumVersion("1.1.0"), instructions: indoc! {" Add latest golem-go as dependency: go get github.com/golemcloud/golem-go @@ -375,7 +375,7 @@ impl Tool { Tool::GolemSdkRust => ToolMetadata { short_name: "golem-rust", description: "Golem SDK for Rust", - version_requirement: MinimumVersion("1.0.0"), + version_requirement: MinimumVersion("1.1.0"), instructions: indoc! {" Add latest golem-rust as dependency: cargo add golem-rust @@ -384,7 +384,7 @@ impl Tool { Tool::GolemSdkTypeScript => ToolMetadata { short_name: "golem-ts", description: "Golem SDK for JavaScript and TypeScript", - version_requirement: MinimumVersion("0.2.0"), + version_requirement: MinimumVersion("1.1.0"), instructions: indoc! {" Add latest golem-ts as dependency: npm install --save-dev @golemcloud/golem-ts @@ -443,7 +443,7 @@ impl Tool { Tool::Rustc => ToolMetadata { short_name: "rustc", description: "Rust compiler", - version_requirement: MinimumVersion("1.80.1"), + version_requirement: MinimumVersion("1.84.0"), instructions: indoc! {" See the rustup step above (https://www.rust-lang.org/learn/get-started), then install latest stable rust: @@ -476,7 +476,7 @@ impl Tool { Tool::TinyGo => ToolMetadata { short_name: "tinygo", description: "Go compiler for WebAssembly (and embedded systems)", - version_requirement: MinimumVersion("0.33"), + version_requirement: MinimumVersion("0.35"), instructions: indoc! {" Install latest TinyGo: https://tinygo.org/getting-started/install/ @@ -489,8 +489,7 @@ impl Tool { Tool::WasiSdk => ToolMetadata { short_name: "wasi-sdk", description: "WebAssembly toolchain for C and C++", - // NOTE: Version is not detectable currently, from 24.0 it will be stored in a version file - version_requirement: ExactByNameVersion("WASI_SDK set"), + version_requirement: MinimumVersion("25.0"), instructions: indoc! {" Install WASI SDK 23.0: https://github.com/WebAssembly/wasi-sdk @@ -501,25 +500,25 @@ impl Tool { Tool::WasmTools => ToolMetadata { short_name: "wasm-tools", description: "Tools for manipulation of WebAssembly modules", - version_requirement: ExactVersion("1.210.0"), + version_requirement: ExactVersion("1.223.0"), instructions: indoc! {" Install the following specific version of wasm-tools: - cargo install --force --locked wasm-tools@1.210.0 + cargo install --force --locked wasm-tools@1.223.0 "}, }, Tool::WitBindgen => ToolMetadata { short_name: "wit-bindgen", description: "Guest language bindings generator for WIT", - version_requirement: ExactVersion("0.26.0"), + version_requirement: ExactVersion("0.37.0"), instructions: indoc! {" Install the following specific version of wit-bindgen: - cargo install --force --locked wit-bindgen-cli@0.26.0 + cargo install --force --locked wit-bindgen-cli@0.37.0 "}, }, Tool::Zig => ToolMetadata { short_name: "zig", description: "Zig language tooling", - version_requirement: MinimumVersion("0.13.0"), + version_requirement: MinimumVersion("0.14.0"), instructions: indoc! {" Install latest version of Zig: https://ziglang.org/learn/getting-started/#installing-zig @@ -604,9 +603,28 @@ impl Tool { Tool::Rustup => cmd_version(dir, "rustup", vec!["--version"], &version_regex), Tool::RustTargetWasm32WasiP1 => rust_target(dir, "wasm32-wasip1"), Tool::TinyGo => cmd_version(dir, "tinygo", vec!["version"], &version_regex), - Tool::WasiSdk => std::env::var("WASI_SDK") - .map(|_| "WASI_SDK set".to_string()) - .map_err(|_| "WASI_SDK no set".to_string()), + Tool::WasiSdk => { + let wasi_sdk_path = std::env::var("WASI_SDK_PATH") + .map_err(|_| "WASI_SDK_PATH not set".to_string())?; + let wasi_sdk_version_file = Path::new(&wasi_sdk_path).join("VERSION"); + let versions = std::fs::read_to_string(&wasi_sdk_version_file).map_err(|err| { + format!( + "Failed to open {}: {}", + wasi_sdk_version_file.to_string_lossy(), + err + ) + })?; + versions + .lines() + .next() + .ok_or_else(|| { + format!( + "Version not found in {}", + wasi_sdk_version_file.to_string_lossy() + ) + }) + .map(|version| version.to_string()) + } Tool::WasmTools => cmd_version(dir, "wasm-tools", vec!["--version"], &version_regex), Tool::WitBindgen => cmd_version(dir, "wit-bindgen", vec!["--version"], &version_regex), Tool::Zig => cmd_version(dir, "zig", vec!["version"], &version_regex), diff --git a/test-components/.gitignore b/test-components/.gitignore new file mode 100644 index 0000000000..ad8bcfb243 --- /dev/null +++ b/test-components/.gitignore @@ -0,0 +1 @@ +.zig-cache \ No newline at end of file diff --git a/test-components/auction-example/auction/wit/auction.wit b/test-components/auction-example/auction/wit/auction.wit index 1092f74b81..eed76ba2a8 100644 --- a/test-components/auction-example/auction/wit/auction.wit +++ b/test-components/auction-example/auction/wit/auction.wit @@ -15,7 +15,7 @@ interface api { auction-id: auction-id, name: string, description: string, - limit-price: float32, + limit-price: f32, expiration: deadline, } diff --git a/test-components/auction_registry_composed.wasm b/test-components/auction_registry_composed.wasm index 1904ea6465..0ea575bceb 100644 Binary files a/test-components/auction_registry_composed.wasm and b/test-components/auction_registry_composed.wasm differ diff --git a/test-components/build-components.sh b/test-components/build-components.sh index 79b2fbcadf..7e1d5344bd 100755 --- a/test-components/build-components.sh +++ b/test-components/build-components.sh @@ -1,4 +1,6 @@ #!/bin/bash +set -euo pipefail +IFS=$'\n\t' rust_test_components=("write-stdout" "write-stderr" "read-stdin" "clocks" "shopping-cart" "file-write-read-delete" "file-service" "http-client" "directories" "environment-service" "promise" "interruption" "clock-service" "option-service" "flags-service" "http-client-2" "stdio-cc" "failing-component" "variant-service" "key-value-service" "blob-store-service" "runtime-service" "networking" "shopping-cart-resource" @@ -12,7 +14,9 @@ dotnet_test_components=("csharp-1") swift_test_components=("swift-1") c_test_components=("c-1" "large-initial-memory" "large-dynamic-memory") python_test_components=("python-1" "py-echo") -ts_test_components=("ts-rpc") + +rust_test_apps=("auction-example" "rpc" "rust-service/rpc") +ts_test_apps=("ts-rpc") # Optional arguments: # - rebuild: clean all projects before building them @@ -107,6 +111,28 @@ if [ "$single_lang" = "false" ] || [ "$lang" = "rust" ]; then done fi +if [ "$single_lang" = "false" ] || [ "$lang" = "rust" ]; then + echo "Building the Rust test apps" + for subdir in "${rust_test_apps[@]}"; do + echo "Building $subdir..." + pushd "$subdir" || exit + + if [ "$update_wit" = true ] && [ -f "wit/deps.toml" ]; then + wit-deps update + fi + + if [ "$rebuild" = true ]; then + golem-cli app clean + cargo clean + fi + + golem-cli app -b release build + golem-cli app -b release copy + + popd || exit + done +fi + if [ "$single_lang" = "false" ] || [ "$lang" = "zig" ]; then echo "Building the Zig test components" for subdir in "${zig_test_components[@]}"; do @@ -279,7 +305,7 @@ if [ "$single_lang" = "false" ] || [ "$lang" = "swift" ]; then if [ "$rebuild" = true ]; then rm *.wasm fi - /Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin/swiftc -target wasm32-unknown-wasi main.swift -o main.wasm -sdk /Library/Developer/Toolchains/swift-wasm-5.7.3-RELEASE.xctoolchain/usr/share/wasi-sysroot/ + /Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin/swiftc -target wasm32-unknown-wasi main.swift -o main.wasm -sdk /Library/Developer/Toolchains/swift-latest.xctoolchain/usr/share/wasi-sysroot/ wasm-opt -Os main.wasm -o main.opt.wasm echo "Turning the module into a WebAssembly Component..." @@ -306,7 +332,8 @@ if [ "$single_lang" = "false" ] || [ "$lang" = "c" ]; then rm *.wasm fi wit-bindgen c --autodrop-borrows yes ./wit - ~/wasi-sdk-20.0/bin/clang --sysroot ~/wasi-sdk-20.0/share/wasi-sysroot main.c c_api1.c c_api1_component_type.o -o main.wasm + # last built with wasi-sdk-0.25.0 + $WASI_SDK_PATH/bin/clang --sysroot $WASI_SDK_PATH/share/wasi-sysroot main.c c_api1.c c_api1_component_type.o -o main.wasm echo "Turning the module into a WebAssembly Component..." target="../$subdir.wasm" @@ -334,6 +361,7 @@ if [ "$single_lang" = "false" ] || [ "$lang" = "python" ]; then fi echo "Compiling the python code into a WebAssembly Component..." + rm -rf bindings componentize-py bindings bindings componentize-py componentize test -o "${subdir}_full.wasm" wasm-tools strip "${subdir}_full.wasm" -o "${subdir}.wasm" @@ -349,8 +377,8 @@ if [ "$single_lang" = "false" ] || [ "$lang" = "python" ]; then fi if [ "$single_lang" = "false" ] || [ "$lang" = "ts" ]; then - echo "Building the TS test components" - for subdir in ${ts_test_components[@]}; do + echo "Building the TS test apps" + for subdir in ${ts_test_apps[@]}; do echo "Building $subdir..." pushd "$subdir" || exit @@ -359,10 +387,12 @@ if [ "$single_lang" = "false" ] || [ "$lang" = "ts" ]; then fi if [ "$rebuild" = true ]; then - golem-cli app build - golem-cli app copy + golem-cli app clean fi + golem-cli app build + golem-cli app copy + popd || exit done fi diff --git a/test-components/c-1.wasm b/test-components/c-1.wasm index d605c6ab68..438f56dd4b 100644 Binary files a/test-components/c-1.wasm and b/test-components/c-1.wasm differ diff --git a/test-components/c-1/main.c b/test-components/c-1/main.c index 62790dd1e2..7f8f92d54f 100644 --- a/test-components/c-1/main.c +++ b/test-components/c-1/main.c @@ -9,12 +9,12 @@ int32_t main(void) { return 0; } -int32_t c_api1_run(void) { +int32_t exports_c_api1_run(void) { printf("Hello World!\n"); return 100; } -void c_api1_print(c_api1_string_t *s) { +void exports_c_api1_print(c_api1_string_t *s) { char* buf = malloc(s->len + 1); memset(buf, 0, s->len + 1); strncpy(buf, s->ptr, s->len); diff --git a/test-components/caller-composed-ts.wasm b/test-components/caller-composed-ts.wasm index f8dda4bc36..e7d25b6fec 100644 Binary files a/test-components/caller-composed-ts.wasm and b/test-components/caller-composed-ts.wasm differ diff --git a/test-components/caller-ts.wasm b/test-components/caller-ts.wasm index f056df0eda..b1e97e2f15 100644 Binary files a/test-components/caller-ts.wasm and b/test-components/caller-ts.wasm differ diff --git a/test-components/counter-ts.wasm b/test-components/counter-ts.wasm index a163d58e60..9cbfea71c1 100644 Binary files a/test-components/counter-ts.wasm and b/test-components/counter-ts.wasm differ diff --git a/test-components/csharp-1.wasm b/test-components/csharp-1.wasm index 9c8733418e..95ac223c03 100644 Binary files a/test-components/csharp-1.wasm and b/test-components/csharp-1.wasm differ diff --git a/test-components/grain-1.wasm b/test-components/grain-1.wasm index a5b3edd86a..9549fd5274 100644 Binary files a/test-components/grain-1.wasm and b/test-components/grain-1.wasm differ diff --git a/test-components/java-1.wasm b/test-components/java-1.wasm index ab871909fc..179297ced3 100644 Binary files a/test-components/java-1.wasm and b/test-components/java-1.wasm differ diff --git a/test-components/java-1/pom.xml b/test-components/java-1/pom.xml index 7669d78df5..50689af438 100644 --- a/test-components/java-1/pom.xml +++ b/test-components/java-1/pom.xml @@ -8,7 +8,7 @@ 9 - 0.2.7-SNAPSHOT + 0.2.8 UTF-8 diff --git a/test-components/java-1/src/main/java/wit/worlds/JavaExample.java b/test-components/java-1/src/main/java/wit/worlds/JavaExample.java index ec40193ab9..2cfbe483fc 100644 --- a/test-components/java-1/src/main/java/wit/worlds/JavaExample.java +++ b/test-components/java-1/src/main/java/wit/worlds/JavaExample.java @@ -1,4 +1,4 @@ -// Generated by `wit-bindgen` 0.26.0. DO NOT EDIT! +// Generated by `wit-bindgen` 0.37.0. DO NOT EDIT! package wit.worlds; import java.nio.charset.StandardCharsets; @@ -17,7 +17,7 @@ private JavaExample() {} private static int wasmExportRunExample1(int p0, int p1) { byte[] bytes = new byte[p1]; - Memory.getBytes(Address.fromInt(p0), bytes, 0, p1); + Memory.getBytes(org.teavm.interop.Address.fromInt(p0), bytes, 0, p1); int result = wit.worlds.JavaExampleImpl.runExample1(new String(bytes, StandardCharsets.UTF_8)); @@ -26,6 +26,6 @@ private static int wasmExportRunExample1(int p0, int p1) { } @CustomSection(name = "component-type:JavaExample") - private static final String __WIT_BINDGEN_COMPONENT_TYPE = "0061736d0d0001000019167769742d636f6d706f6e656e742d656e636f64696e6704000739014102014102014001016173007904000c72756e2d6578616d706c65310100040115676f6c656d3a69742f6a6176612d6578616d706c6504000b1201000c6a6176612d6578616d706c65030000004d0970726f647563657273010c70726f6365737365642d6279020d7769742d636f6d706f6e656e7407302e3230392e31167769742d62696e6467656e2d746561766d2d6a61766106302e32362e30"; + private static final String __WIT_BINDGEN_COMPONENT_TYPE = "0061736d0d0001000019167769742d636f6d706f6e656e742d656e636f64696e6704000739014102014102014001016173007904000c72756e2d6578616d706c65310100040015676f6c656d3a69742f6a6176612d6578616d706c6504000b1201000c6a6176612d6578616d706c65030000004d0970726f647563657273010c70726f6365737365642d6279020d7769742d636f6d706f6e656e7407302e3232332e30167769742d62696e6467656e2d746561766d2d6a61766106302e33372e30"; } diff --git a/test-components/java-2.wasm b/test-components/java-2.wasm index 0f1e7763a4..a5225a43ae 100644 Binary files a/test-components/java-2.wasm and b/test-components/java-2.wasm differ diff --git a/test-components/java-2/pom.xml b/test-components/java-2/pom.xml index 3364410c08..fe793e0d4b 100644 --- a/test-components/java-2/pom.xml +++ b/test-components/java-2/pom.xml @@ -8,7 +8,7 @@ 9 - 0.2.7-SNAPSHOT + 0.2.8 UTF-8 diff --git a/test-components/java-2/src/main/java/wit/worlds/ShoppingCart.java b/test-components/java-2/src/main/java/wit/worlds/ShoppingCart.java index 52f57b03af..5314740b15 100644 --- a/test-components/java-2/src/main/java/wit/worlds/ShoppingCart.java +++ b/test-components/java-2/src/main/java/wit/worlds/ShoppingCart.java @@ -1,4 +1,4 @@ -// Generated by `wit-bindgen` 0.26.0. DO NOT EDIT! +// Generated by `wit-bindgen` 0.37.0. DO NOT EDIT! package wit.worlds; import java.nio.charset.StandardCharsets; @@ -90,7 +90,7 @@ public OrderConfirmation getSuccess() { private static void wasmExportInitializeCart(int p0, int p1) { byte[] bytes = new byte[p1]; - Memory.getBytes(Address.fromInt(p0), bytes, 0, p1); + Memory.getBytes(org.teavm.interop.Address.fromInt(p0), bytes, 0, p1); wit.worlds.ShoppingCartImpl.initializeCart(new String(bytes, StandardCharsets.UTF_8)); @@ -100,10 +100,10 @@ private static void wasmExportInitializeCart(int p0, int p1) { private static void wasmExportAddItem(int p0, int p1, int p2, int p3, float p4, int p5) { byte[] bytes = new byte[p1]; - Memory.getBytes(Address.fromInt(p0), bytes, 0, p1); + Memory.getBytes(org.teavm.interop.Address.fromInt(p0), bytes, 0, p1); byte[] bytes0 = new byte[p3]; - Memory.getBytes(Address.fromInt(p2), bytes0, 0, p3); + Memory.getBytes(org.teavm.interop.Address.fromInt(p2), bytes0, 0, p3); wit.worlds.ShoppingCartImpl.addItem(new ProductItem(new String(bytes, StandardCharsets.UTF_8), new String(bytes0, StandardCharsets.UTF_8), p4, p5)); @@ -113,7 +113,7 @@ private static void wasmExportAddItem(int p0, int p1, int p2, int p3, float p4, private static void wasmExportRemoveItem(int p0, int p1) { byte[] bytes = new byte[p1]; - Memory.getBytes(Address.fromInt(p0), bytes, 0, p1); + Memory.getBytes(org.teavm.interop.Address.fromInt(p0), bytes, 0, p1); wit.worlds.ShoppingCartImpl.removeItem(new String(bytes, StandardCharsets.UTF_8)); @@ -123,7 +123,7 @@ private static void wasmExportRemoveItem(int p0, int p1) { private static void wasmExportUpdateItemQuantity(int p0, int p1, int p2) { byte[] bytes = new byte[p1]; - Memory.getBytes(Address.fromInt(p0), bytes, 0, p1); + Memory.getBytes(org.teavm.interop.Address.fromInt(p0), bytes, 0, p1); wit.worlds.ShoppingCartImpl.updateItemQuantity(new String(bytes, StandardCharsets.UTF_8), p2); @@ -137,25 +137,25 @@ private static int wasmExportCheckout() { switch ((result).tag) { case 0: { String payload = (result).getError(); - Address.fromInt((wit.worlds.ShoppingCart.RETURN_AREA) + 0).putByte((byte) (0)); + org.teavm.interop.Address.fromInt((wit.worlds.ShoppingCart.RETURN_AREA) + 0).putByte((byte) (0)); byte[] bytes = (payload).getBytes(StandardCharsets.UTF_8); - Address address = Memory.malloc(bytes.length, 1); + org.teavm.interop.Address address = Memory.malloc(bytes.length, 1); Memory.putBytes(address, bytes, 0, bytes.length); - Address.fromInt((wit.worlds.ShoppingCart.RETURN_AREA) + 8).putInt(bytes.length); - Address.fromInt((wit.worlds.ShoppingCart.RETURN_AREA) + 4).putInt(address.toInt()); + org.teavm.interop.Address.fromInt((wit.worlds.ShoppingCart.RETURN_AREA) + 8).putInt(bytes.length); + org.teavm.interop.Address.fromInt((wit.worlds.ShoppingCart.RETURN_AREA) + 4).putInt(address.toInt()); break; } case 1: { OrderConfirmation payload2 = (result).getSuccess(); - Address.fromInt((wit.worlds.ShoppingCart.RETURN_AREA) + 0).putByte((byte) (1)); + org.teavm.interop.Address.fromInt((wit.worlds.ShoppingCart.RETURN_AREA) + 0).putByte((byte) (1)); byte[] bytes3 = ((payload2).orderId).getBytes(StandardCharsets.UTF_8); - Address address4 = Memory.malloc(bytes3.length, 1); + org.teavm.interop.Address address4 = Memory.malloc(bytes3.length, 1); Memory.putBytes(address4, bytes3, 0, bytes3.length); - Address.fromInt((wit.worlds.ShoppingCart.RETURN_AREA) + 8).putInt(bytes3.length); - Address.fromInt((wit.worlds.ShoppingCart.RETURN_AREA) + 4).putInt(address4.toInt()); + org.teavm.interop.Address.fromInt((wit.worlds.ShoppingCart.RETURN_AREA) + 8).putInt(bytes3.length); + org.teavm.interop.Address.fromInt((wit.worlds.ShoppingCart.RETURN_AREA) + 4).putInt(address4.toInt()); break; } @@ -169,14 +169,14 @@ private static int wasmExportCheckout() { @Export(name = "cabi_post_checkout") private static void wasmExportCheckoutPostReturn(int p0) { - switch ((((int) Address.fromInt((p0) + 0).getByte()) & 0xFF)) { + switch ((((int) org.teavm.interop.Address.fromInt((p0) + 0).getByte()) & 0xFF)) { case 0: { - Memory.free(Address.fromInt(Address.fromInt((p0) + 4).getInt()), Address.fromInt((p0) + 8).getInt(), 1); + Memory.free(org.teavm.interop.Address.fromInt(org.teavm.interop.Address.fromInt((p0) + 4).getInt()), org.teavm.interop.Address.fromInt((p0) + 8).getInt(), 1); break; } case 1: { - Memory.free(Address.fromInt(Address.fromInt((p0) + 4).getInt()), Address.fromInt((p0) + 8).getInt(), 1); + Memory.free(org.teavm.interop.Address.fromInt(org.teavm.interop.Address.fromInt((p0) + 4).getInt()), org.teavm.interop.Address.fromInt((p0) + 8).getInt(), 1); break; } @@ -195,22 +195,22 @@ private static int wasmExportGetCartContents() { int base = address2 + (index * 24); byte[] bytes = ((element).productId).getBytes(StandardCharsets.UTF_8); - Address address = Memory.malloc(bytes.length, 1); + org.teavm.interop.Address address = Memory.malloc(bytes.length, 1); Memory.putBytes(address, bytes, 0, bytes.length); - Address.fromInt((base) + 4).putInt(bytes.length); - Address.fromInt((base) + 0).putInt(address.toInt()); + org.teavm.interop.Address.fromInt((base) + 4).putInt(bytes.length); + org.teavm.interop.Address.fromInt((base) + 0).putInt(address.toInt()); byte[] bytes0 = ((element).name).getBytes(StandardCharsets.UTF_8); - Address address1 = Memory.malloc(bytes0.length, 1); + org.teavm.interop.Address address1 = Memory.malloc(bytes0.length, 1); Memory.putBytes(address1, bytes0, 0, bytes0.length); - Address.fromInt((base) + 12).putInt(bytes0.length); - Address.fromInt((base) + 8).putInt(address1.toInt()); - Address.fromInt((base) + 16).putFloat((element).price); - Address.fromInt((base) + 20).putInt((element).quantity); + org.teavm.interop.Address.fromInt((base) + 12).putInt(bytes0.length); + org.teavm.interop.Address.fromInt((base) + 8).putInt(address1.toInt()); + org.teavm.interop.Address.fromInt((base) + 16).putFloat((element).price); + org.teavm.interop.Address.fromInt((base) + 20).putInt((element).quantity); } - Address.fromInt((wit.worlds.ShoppingCart.RETURN_AREA) + 4).putInt((result).size()); - Address.fromInt((wit.worlds.ShoppingCart.RETURN_AREA) + 0).putInt(address2); + org.teavm.interop.Address.fromInt((wit.worlds.ShoppingCart.RETURN_AREA) + 4).putInt((result).size()); + org.teavm.interop.Address.fromInt((wit.worlds.ShoppingCart.RETURN_AREA) + 0).putInt(address2); return wit.worlds.ShoppingCart.RETURN_AREA; } @@ -218,18 +218,18 @@ private static int wasmExportGetCartContents() { @Export(name = "cabi_post_get-cart-contents") private static void wasmExportGetCartContentsPostReturn(int p0) { - for (int index = 0; index < (Address.fromInt((p0) + 4).getInt()); ++index) { - int base = (Address.fromInt((p0) + 0).getInt()) + (index * 24); - Memory.free(Address.fromInt(Address.fromInt((base) + 0).getInt()), Address.fromInt((base) + 4).getInt(), 1); - Memory.free(Address.fromInt(Address.fromInt((base) + 8).getInt()), Address.fromInt((base) + 12).getInt(), 1); + for (int index = 0; index < (org.teavm.interop.Address.fromInt((p0) + 4).getInt()); ++index) { + int base = (org.teavm.interop.Address.fromInt((p0) + 0).getInt()) + (index * 24); + Memory.free(org.teavm.interop.Address.fromInt(org.teavm.interop.Address.fromInt((base) + 0).getInt()), org.teavm.interop.Address.fromInt((base) + 4).getInt(), 1); + Memory.free(org.teavm.interop.Address.fromInt(org.teavm.interop.Address.fromInt((base) + 8).getInt()), org.teavm.interop.Address.fromInt((base) + 12).getInt(), 1); } - Memory.free(Address.fromInt(Address.fromInt((p0) + 0).getInt()), (Address.fromInt((p0) + 4).getInt()) * 24, 4); + Memory.free(org.teavm.interop.Address.fromInt(org.teavm.interop.Address.fromInt((p0) + 0).getInt()), (org.teavm.interop.Address.fromInt((p0) + 4).getInt()) * 24, 4); } @CustomSection(name = "component-type:ShoppingCart") - private static final String __WIT_BINDGEN_COMPONENT_TYPE = "0061736d0d0001000019167769742d636f6d706f6e656e742d656e636f64696e670400079a030141020141150172040a70726f647563742d696473046e616d657305707269636576087175616e746974797903000c70726f647563742d6974656d030000017001017204086f726465722d696473056974656d730205746f74616c760974696d657374616d70770300056f72646572030003017201086f726465722d6964730300126f726465722d636f6e6669726d6174696f6e030005017102056572726f72017300077375636365737301060003000f636865636b6f75742d726573756c7403000701400107757365722d696473010004000f696e697469616c697a652d636172740109014001046974656d0101000400086164642d6974656d010a0140010a70726f647563742d696473010004000b72656d6f76652d6974656d010b0140020a70726f647563742d696473087175616e746974797901000400147570646174652d6974656d2d7175616e74697479010c0140000008040008636865636b6f7574010d01400000020400116765742d636172742d636f6e74656e7473010e040116676f6c656d3a69742f73686f7070696e672d6361727404000b1301000d73686f7070696e672d63617274030000004d0970726f647563657273010c70726f6365737365642d6279020d7769742d636f6d706f6e656e7407302e3230392e31167769742d62696e6467656e2d746561766d2d6a61766106302e32362e30"; + private static final String __WIT_BINDGEN_COMPONENT_TYPE = "0061736d0d0001000019167769742d636f6d706f6e656e742d656e636f64696e670400079a030141020141150172040a70726f647563742d696473046e616d657305707269636576087175616e746974797903000c70726f647563742d6974656d030000017001017204086f726465722d696473056974656d730205746f74616c760974696d657374616d70770300056f72646572030003017201086f726465722d6964730300126f726465722d636f6e6669726d6174696f6e030005017102056572726f72017300077375636365737301060003000f636865636b6f75742d726573756c7403000701400107757365722d696473010004000f696e697469616c697a652d636172740109014001046974656d0101000400086164642d6974656d010a0140010a70726f647563742d696473010004000b72656d6f76652d6974656d010b0140020a70726f647563742d696473087175616e746974797901000400147570646174652d6974656d2d7175616e74697479010c0140000008040008636865636b6f7574010d01400000020400116765742d636172742d636f6e74656e7473010e040016676f6c656d3a69742f73686f7070696e672d6361727404000b1301000d73686f7070696e672d63617274030000004d0970726f647563657273010c70726f6365737365642d6279020d7769742d636f6d706f6e656e7407302e3232332e30167769742d62696e6467656e2d746561766d2d6a61766106302e33372e30"; public static final int RETURN_AREA = Memory.malloc(12, 4).toInt(); } diff --git a/test-components/java-2/wit/main.wit b/test-components/java-2/wit/main.wit index 2e081281f3..e1e0a1d359 100644 --- a/test-components/java-2/wit/main.wit +++ b/test-components/java-2/wit/main.wit @@ -4,14 +4,14 @@ world shopping-cart { record product-item { product-id: string, name: string, - price: float32, + price: f32, quantity: u32, } record order { order-id: string, items: list, - total: float32, + total: f32, timestamp: u64, } diff --git a/test-components/js-1.wasm b/test-components/js-1.wasm index 5b8bd6dd68..6c5e266bb9 100644 Binary files a/test-components/js-1.wasm and b/test-components/js-1.wasm differ diff --git a/test-components/js-2.wasm b/test-components/js-2.wasm index 5293ee46cb..84f1e4177d 100644 Binary files a/test-components/js-2.wasm and b/test-components/js-2.wasm differ diff --git a/test-components/js-3.wasm b/test-components/js-3.wasm index fe991c0d1c..9561d71236 100644 Binary files a/test-components/js-3.wasm and b/test-components/js-3.wasm differ diff --git a/test-components/js-4.wasm b/test-components/js-4.wasm index 38f59255ac..2c2e8d7c41 100644 Binary files a/test-components/js-4.wasm and b/test-components/js-4.wasm differ diff --git a/test-components/js-echo.wasm b/test-components/js-echo.wasm index 50b2e87573..731f045d04 100644 Binary files a/test-components/js-echo.wasm and b/test-components/js-echo.wasm differ diff --git a/test-components/large-dynamic-memory.wasm b/test-components/large-dynamic-memory.wasm index 96f7d337b9..4ccf06a7ad 100644 Binary files a/test-components/large-dynamic-memory.wasm and b/test-components/large-dynamic-memory.wasm differ diff --git a/test-components/large-dynamic-memory/c_api1.c b/test-components/large-dynamic-memory/c_api1.c index 4c7d54fd93..8815bf9c90 100644 --- a/test-components/large-dynamic-memory/c_api1.c +++ b/test-components/large-dynamic-memory/c_api1.c @@ -1,4 +1,4 @@ -// Generated by `wit-bindgen` 0.26.0. DO NOT EDIT! +// Generated by `wit-bindgen` 0.37.0. DO NOT EDIT! #include "c_api1.h" #include @@ -19,8 +19,8 @@ void *cabi_realloc(void *ptr, size_t old_size, size_t align, size_t new_size) { // Component Adapters __attribute__((__export_name__("run"))) -int64_t __wasm_export_c_api1_run(void) { - uint64_t ret = c_api1_run(); +int64_t __wasm_export_exports_c_api1_run(void) { + uint64_t ret = exports_c_api1_run(); return (int64_t) (ret); } diff --git a/test-components/large-dynamic-memory/c_api1.h b/test-components/large-dynamic-memory/c_api1.h index b8bf7d17aa..ab30e350ac 100644 --- a/test-components/large-dynamic-memory/c_api1.h +++ b/test-components/large-dynamic-memory/c_api1.h @@ -1,4 +1,4 @@ -// Generated by `wit-bindgen` 0.26.0. DO NOT EDIT! +// Generated by `wit-bindgen` 0.37.0. DO NOT EDIT! #ifndef __BINDINGS_C_API1_H #define __BINDINGS_C_API1_H #ifdef __cplusplus @@ -7,9 +7,10 @@ extern "C" { #include #include +#include // Exported Functions from `c-api1` -uint64_t c_api1_run(void); +uint64_t exports_c_api1_run(void); #ifdef __cplusplus } diff --git a/test-components/large-dynamic-memory/c_api1_component_type.o b/test-components/large-dynamic-memory/c_api1_component_type.o index 00a03546d2..62a6a0c6e8 100644 Binary files a/test-components/large-dynamic-memory/c_api1_component_type.o and b/test-components/large-dynamic-memory/c_api1_component_type.o differ diff --git a/test-components/large-dynamic-memory/main.c b/test-components/large-dynamic-memory/main.c index 055e4645ea..467d01c21a 100644 --- a/test-components/large-dynamic-memory/main.c +++ b/test-components/large-dynamic-memory/main.c @@ -13,7 +13,7 @@ int32_t main(void) { #define PAGE_SIZE 1024*1024 #define COUNT 512 -uint64_t c_api1_run(void) { +uint64_t exports_c_api1_run(void) { for (int i = 0; i < COUNT; i++) { char* DATA = malloc(PAGE_SIZE); printf("page %d first: %d\n", i, DATA[0]); diff --git a/test-components/large-initial-memory.wasm b/test-components/large-initial-memory.wasm index f08a3f3af2..261e07aea5 100644 Binary files a/test-components/large-initial-memory.wasm and b/test-components/large-initial-memory.wasm differ diff --git a/test-components/large-initial-memory/c_api1.c b/test-components/large-initial-memory/c_api1.c index 4c7d54fd93..8815bf9c90 100644 --- a/test-components/large-initial-memory/c_api1.c +++ b/test-components/large-initial-memory/c_api1.c @@ -1,4 +1,4 @@ -// Generated by `wit-bindgen` 0.26.0. DO NOT EDIT! +// Generated by `wit-bindgen` 0.37.0. DO NOT EDIT! #include "c_api1.h" #include @@ -19,8 +19,8 @@ void *cabi_realloc(void *ptr, size_t old_size, size_t align, size_t new_size) { // Component Adapters __attribute__((__export_name__("run"))) -int64_t __wasm_export_c_api1_run(void) { - uint64_t ret = c_api1_run(); +int64_t __wasm_export_exports_c_api1_run(void) { + uint64_t ret = exports_c_api1_run(); return (int64_t) (ret); } diff --git a/test-components/large-initial-memory/c_api1.h b/test-components/large-initial-memory/c_api1.h index b8bf7d17aa..ab30e350ac 100644 --- a/test-components/large-initial-memory/c_api1.h +++ b/test-components/large-initial-memory/c_api1.h @@ -1,4 +1,4 @@ -// Generated by `wit-bindgen` 0.26.0. DO NOT EDIT! +// Generated by `wit-bindgen` 0.37.0. DO NOT EDIT! #ifndef __BINDINGS_C_API1_H #define __BINDINGS_C_API1_H #ifdef __cplusplus @@ -7,9 +7,10 @@ extern "C" { #include #include +#include // Exported Functions from `c-api1` -uint64_t c_api1_run(void); +uint64_t exports_c_api1_run(void); #ifdef __cplusplus } diff --git a/test-components/large-initial-memory/c_api1_component_type.o b/test-components/large-initial-memory/c_api1_component_type.o index 00a03546d2..62a6a0c6e8 100644 Binary files a/test-components/large-initial-memory/c_api1_component_type.o and b/test-components/large-initial-memory/c_api1_component_type.o differ diff --git a/test-components/large-initial-memory/main.c b/test-components/large-initial-memory/main.c index 5c533175a0..51f2b459c8 100644 --- a/test-components/large-initial-memory/main.c +++ b/test-components/large-initial-memory/main.c @@ -13,7 +13,7 @@ int32_t main(void) { #define DATA_SIZE 536870912 static char DATA[DATA_SIZE] = {}; -uint64_t c_api1_run(void) { +uint64_t exports_c_api1_run(void) { printf("DATA: %lu\n", sizeof(DATA)); printf("first: %d\n", DATA[0]); printf("last: %d\n", DATA[DATA_SIZE-1]); diff --git a/test-components/py-echo.wasm b/test-components/py-echo.wasm index 982897d0d2..fd1a552fed 100644 Binary files a/test-components/py-echo.wasm and b/test-components/py-echo.wasm differ diff --git a/test-components/python-1.wasm b/test-components/python-1.wasm index f43c6da0a2..fb61fa9c5d 100644 Binary files a/test-components/python-1.wasm and b/test-components/python-1.wasm differ diff --git a/test-components/swift-1.wasm b/test-components/swift-1.wasm index c86dd4e460..5cae091461 100644 Binary files a/test-components/swift-1.wasm and b/test-components/swift-1.wasm differ diff --git a/test-components/tinygo-wasi-http.wasm b/test-components/tinygo-wasi-http.wasm index db314a0e8d..6aa2baf4b1 100644 Binary files a/test-components/tinygo-wasi-http.wasm and b/test-components/tinygo-wasi-http.wasm differ diff --git a/test-components/tinygo-wasi.wasm b/test-components/tinygo-wasi.wasm index 6d95c12786..673164b305 100644 Binary files a/test-components/tinygo-wasi.wasm and b/test-components/tinygo-wasi.wasm differ diff --git a/test-components/zig-3.wasm b/test-components/zig-3.wasm index 21d2754417..665767dddf 100644 Binary files a/test-components/zig-3.wasm and b/test-components/zig-3.wasm differ diff --git a/test-components/zig-3/build.zig b/test-components/zig-3/build.zig index 6683a1b611..5bbcac8839 100644 --- a/test-components/zig-3/build.zig +++ b/test-components/zig-3/build.zig @@ -1,21 +1,21 @@ const std = @import("std"); -const Builder = std.build.Builder; +const Build = std.Build; const CrossTarget = std.zig.CrossTarget; -pub fn build(b: *Builder) !void { +pub fn build(b: *Build) !void { const optimize = b.standardOptimizeOption(.{ .preferred_optimize_mode = .ReleaseSmall, }); const bindgen = b.addSystemCommand(&.{ "wit-bindgen", "c", "--autodrop-borrows", "yes", "./wit", "--out-dir", "src/bindings" }); - const wasm = b.addExecutable(.{ .name = "main", .root_source_file = .{ .path = "src/main.zig" }, .target = .{ + const wasm = b.addExecutable(.{ .name = "main", .root_source_file = b.path("src/main.zig"), .target = b.resolveTargetQuery(.{ .cpu_arch = .wasm32, .os_tag = .wasi, - }, .optimize = optimize }); + }), .optimize = optimize }); - const binding_root = b.pathFromRoot("src/bindings"); - var binding_root_dir = try std.fs.cwd().openIterableDir(binding_root, .{}); + const binding_root = "src/bindings"; + var binding_root_dir = try std.fs.cwd().openDir(binding_root, .{ .iterate = true }); defer binding_root_dir.close(); var it = try binding_root_dir.walk(b.allocator); while (try it.next()) |entry| { @@ -23,16 +23,16 @@ pub fn build(b: *Builder) !void { .file => { const path = b.pathJoin(&.{ binding_root, entry.path }); if (std.mem.endsWith(u8, entry.basename, ".c")) { - wasm.addCSourceFile(.{ .file = .{ .path = path }, .flags = &.{} }); + wasm.addCSourceFile(.{ .file = b.path(path), .flags = &.{} }); } else if (std.mem.endsWith(u8, entry.basename, ".o")) { - wasm.addObjectFile(.{ .path = path }); + wasm.addObjectFile(b.path(path)); } }, else => continue, } } - wasm.addIncludePath(.{ .path = binding_root }); + wasm.addIncludePath(b.path(binding_root)); wasm.linkLibC(); wasm.step.dependOn(&bindgen.step); diff --git a/test-components/zig-3/src/bindings/zig3.c b/test-components/zig-3/src/bindings/zig3.c index 12a61ae554..19e0e724aa 100644 --- a/test-components/zig-3/src/bindings/zig3.c +++ b/test-components/zig-3/src/bindings/zig3.c @@ -1,4 +1,4 @@ -// Generated by `wit-bindgen` 0.26.0. DO NOT EDIT! +// Generated by `wit-bindgen` 0.37.0. DO NOT EDIT! #include "zig3.h" #include diff --git a/test-components/zig-3/src/bindings/zig3.h b/test-components/zig-3/src/bindings/zig3.h index 5b12b3b2d0..ed9c3b6d8e 100644 --- a/test-components/zig-3/src/bindings/zig3.h +++ b/test-components/zig-3/src/bindings/zig3.h @@ -1,4 +1,4 @@ -// Generated by `wit-bindgen` 0.26.0. DO NOT EDIT! +// Generated by `wit-bindgen` 0.37.0. DO NOT EDIT! #ifndef __BINDINGS_ZIG3_H #define __BINDINGS_ZIG3_H #ifdef __cplusplus @@ -7,6 +7,7 @@ extern "C" { #include #include +#include // Exported Functions from `golem:it/api` void exports_golem_it_api_add(uint64_t value); diff --git a/test-components/zig-3/src/bindings/zig3_component_type.o b/test-components/zig-3/src/bindings/zig3_component_type.o index 71ca8698dc..34b141d6de 100644 Binary files a/test-components/zig-3/src/bindings/zig3_component_type.o and b/test-components/zig-3/src/bindings/zig3_component_type.o differ diff --git a/wasm-rpc/src/bindings.rs b/wasm-rpc/src/bindings.rs index eccfb785a9..8447263125 100644 --- a/wasm-rpc/src/bindings.rs +++ b/wasm-rpc/src/bindings.rs @@ -1,16 +1,15 @@ -// Generated by `wit-bindgen` 0.25.0. DO NOT EDIT! +// Generated by `wit-bindgen` 0.36.0. DO NOT EDIT! // Options used: -#[allow(dead_code)] +// * runtime_path: "wit_bindgen_rt" +#[rustfmt::skip] +#[allow(dead_code, clippy::all)] pub mod golem { - #[allow(dead_code)] pub mod rpc { #[allow(dead_code, clippy::all)] pub mod types { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::__link_custom_section_describing_imports; use super::super::super::_rt; pub type Pollable = super::super::super::wasi::io::poll::Pollable; pub type NodeIndex = i32; @@ -19,7 +18,10 @@ pub mod golem { pub value: _rt::String, } impl ::core::fmt::Debug for Uri { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("Uri").field("value", &self.value).finish() } } @@ -49,7 +51,10 @@ pub mod golem { Handle((Uri, u64)), } impl ::core::fmt::Debug for WitNode { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { WitNode::RecordValue(e) => { f.debug_tuple("WitNode::RecordValue").field(e).finish() @@ -75,14 +80,30 @@ pub mod golem { WitNode::ResultValue(e) => { f.debug_tuple("WitNode::ResultValue").field(e).finish() } - WitNode::PrimU8(e) => f.debug_tuple("WitNode::PrimU8").field(e).finish(), - WitNode::PrimU16(e) => f.debug_tuple("WitNode::PrimU16").field(e).finish(), - WitNode::PrimU32(e) => f.debug_tuple("WitNode::PrimU32").field(e).finish(), - WitNode::PrimU64(e) => f.debug_tuple("WitNode::PrimU64").field(e).finish(), - WitNode::PrimS8(e) => f.debug_tuple("WitNode::PrimS8").field(e).finish(), - WitNode::PrimS16(e) => f.debug_tuple("WitNode::PrimS16").field(e).finish(), - WitNode::PrimS32(e) => f.debug_tuple("WitNode::PrimS32").field(e).finish(), - WitNode::PrimS64(e) => f.debug_tuple("WitNode::PrimS64").field(e).finish(), + WitNode::PrimU8(e) => { + f.debug_tuple("WitNode::PrimU8").field(e).finish() + } + WitNode::PrimU16(e) => { + f.debug_tuple("WitNode::PrimU16").field(e).finish() + } + WitNode::PrimU32(e) => { + f.debug_tuple("WitNode::PrimU32").field(e).finish() + } + WitNode::PrimU64(e) => { + f.debug_tuple("WitNode::PrimU64").field(e).finish() + } + WitNode::PrimS8(e) => { + f.debug_tuple("WitNode::PrimS8").field(e).finish() + } + WitNode::PrimS16(e) => { + f.debug_tuple("WitNode::PrimS16").field(e).finish() + } + WitNode::PrimS32(e) => { + f.debug_tuple("WitNode::PrimS32").field(e).finish() + } + WitNode::PrimS64(e) => { + f.debug_tuple("WitNode::PrimS64").field(e).finish() + } WitNode::PrimFloat32(e) => { f.debug_tuple("WitNode::PrimFloat32").field(e).finish() } @@ -98,7 +119,9 @@ pub mod golem { WitNode::PrimString(e) => { f.debug_tuple("WitNode::PrimString").field(e).finish() } - WitNode::Handle(e) => f.debug_tuple("WitNode::Handle").field(e).finish(), + WitNode::Handle(e) => { + f.debug_tuple("WitNode::Handle").field(e).finish() + } } } } @@ -107,10 +130,11 @@ pub mod golem { pub nodes: _rt::Vec, } impl ::core::fmt::Debug for WitValue { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - f.debug_struct("WitValue") - .field("nodes", &self.nodes) - .finish() + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { + f.debug_struct("WitValue").field("nodes", &self.nodes).finish() } } #[derive(Clone)] @@ -121,36 +145,42 @@ pub mod golem { RemoteInternalError(_rt::String), } impl ::core::fmt::Debug for RpcError { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { RpcError::ProtocolError(e) => { f.debug_tuple("RpcError::ProtocolError").field(e).finish() } - RpcError::Denied(e) => f.debug_tuple("RpcError::Denied").field(e).finish(), + RpcError::Denied(e) => { + f.debug_tuple("RpcError::Denied").field(e).finish() + } RpcError::NotFound(e) => { f.debug_tuple("RpcError::NotFound").field(e).finish() } - RpcError::RemoteInternalError(e) => f - .debug_tuple("RpcError::RemoteInternalError") - .field(e) - .finish(), + RpcError::RemoteInternalError(e) => { + f.debug_tuple("RpcError::RemoteInternalError") + .field(e) + .finish() + } } } } impl ::core::fmt::Display for RpcError { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { write!(f, "{:?}", self) } } - impl std::error::Error for RpcError {} - #[derive(Debug)] #[repr(transparent)] pub struct WasmRpc { handle: _rt::Resource, } - impl WasmRpc { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { @@ -158,24 +188,20 @@ pub mod golem { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for WasmRpc { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "golem:rpc/types@0.1.0")] @@ -183,18 +209,15 @@ pub mod golem { #[link_name = "[resource-drop]wasm-rpc"] fn drop(_: u32); } - drop(_handle); } } } - #[derive(Debug)] #[repr(transparent)] pub struct FutureInvokeResult { handle: _rt::Resource, } - impl FutureInvokeResult { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { @@ -202,24 +225,20 @@ pub mod golem { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for FutureInvokeResult { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "golem:rpc/types@0.1.0")] @@ -227,12 +246,10 @@ pub mod golem { #[link_name = "[resource-drop]future-invoke-result"] fn drop(_: u32); } - drop(_handle); } } } - impl WasmRpc { #[allow(unused_unsafe, clippy::all)] pub fn new(location: &Uri) -> Self { @@ -241,14 +258,12 @@ pub mod golem { let vec1 = value0; let ptr1 = vec1.as_ptr().cast::(); let len1 = vec1.len(); - #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "golem:rpc/types@0.1.0")] extern "C" { #[link_name = "[constructor]wasm-rpc"] fn wit_import(_: *mut u8, _: usize) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8, _: usize) -> i32 { unreachable!() @@ -269,14 +284,18 @@ pub mod golem { let mut cleanup_list = _rt::Vec::new(); #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 16]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 16]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 16], + ); let vec0 = function_name; let ptr0 = vec0.as_ptr().cast::(); let len0 = vec0.len(); let vec12 = function_params; let len12 = vec12.len(); - let layout12 = - _rt::alloc::Layout::from_size_align_unchecked(vec12.len() * 8, 4); + let layout12 = _rt::alloc::Layout::from_size_align_unchecked( + vec12.len() * 8, + 4, + ); let result12 = if layout12.size() != 0 { let ptr = _rt::alloc::alloc(layout12).cast::(); if ptr.is_null() { @@ -284,9 +303,7 @@ pub mod golem { } ptr } else { - { - ::core::ptr::null_mut() - } + ::core::ptr::null_mut() }; for (i, e) in vec12.into_iter().enumerate() { let base = result12.add(i * 8); @@ -305,9 +322,7 @@ pub mod golem { } ptr } else { - { - ::core::ptr::null_mut() - } + ::core::ptr::null_mut() }; for (i, e) in vec11.into_iter().enumerate() { let base = result11.add(i * 24); @@ -328,8 +343,7 @@ pub mod golem { match t3_1 { Some(e) => { *base.add(12).cast::() = (1i32) as u8; - *base.add(16).cast::() = - _rt::as_i32(e); + *base.add(16).cast::() = _rt::as_i32(e); } None => { *base.add(12).cast::() = (0i32) as u8; @@ -344,22 +358,18 @@ pub mod golem { *base.add(0).cast::() = (3i32) as u8; let vec4 = e; let len4 = vec4.len(); - let layout4 = - _rt::alloc::Layout::from_size_align_unchecked( - vec4.len() * 1, - 1, - ); + let layout4 = _rt::alloc::Layout::from_size_align_unchecked( + vec4.len() * 1, + 1, + ); let result4 = if layout4.size() != 0 { - let ptr = - _rt::alloc::alloc(layout4).cast::(); + let ptr = _rt::alloc::alloc(layout4).cast::(); if ptr.is_null() { _rt::alloc::handle_alloc_error(layout4); } ptr } else { - { - ::core::ptr::null_mut() - } + ::core::ptr::null_mut() }; for (i, e) in vec4.into_iter().enumerate() { let base = result4.add(i * 1); @@ -367,14 +377,12 @@ pub mod golem { *base.add(0).cast::() = (match e { true => 1, false => 0, - }) - as u8; + }) as u8; } } *base.add(12).cast::() = len4; *base.add(8).cast::<*mut u8>() = result4; - cleanup_list - .extend_from_slice(&[(result4, layout4)]); + cleanup_list.extend_from_slice(&[(result4, layout4)]); } WitNode::TupleValue(e) => { *base.add(0).cast::() = (4i32) as u8; @@ -397,8 +405,7 @@ pub mod golem { match e { Some(e) => { *base.add(8).cast::() = (1i32) as u8; - *base.add(12).cast::() = - _rt::as_i32(e); + *base.add(12).cast::() = _rt::as_i32(e); } None => { *base.add(8).cast::() = (0i32) as u8; @@ -412,14 +419,11 @@ pub mod golem { *base.add(8).cast::() = (0i32) as u8; match e { Some(e) => { - *base.add(12).cast::() = - (1i32) as u8; - *base.add(16).cast::() = - _rt::as_i32(e); + *base.add(12).cast::() = (1i32) as u8; + *base.add(16).cast::() = _rt::as_i32(e); } None => { - *base.add(12).cast::() = - (0i32) as u8; + *base.add(12).cast::() = (0i32) as u8; } }; } @@ -427,14 +431,11 @@ pub mod golem { *base.add(8).cast::() = (1i32) as u8; match e { Some(e) => { - *base.add(12).cast::() = - (1i32) as u8; - *base.add(16).cast::() = - _rt::as_i32(e); + *base.add(12).cast::() = (1i32) as u8; + *base.add(16).cast::() = _rt::as_i32(e); } None => { - *base.add(12).cast::() = - (0i32) as u8; + *base.add(12).cast::() = (0i32) as u8; } }; } @@ -446,8 +447,7 @@ pub mod golem { } WitNode::PrimU16(e) => { *base.add(0).cast::() = (9i32) as u8; - *base.add(8).cast::() = - (_rt::as_i32(e)) as u16; + *base.add(8).cast::() = (_rt::as_i32(e)) as u16; } WitNode::PrimU32(e) => { *base.add(0).cast::() = (10i32) as u8; @@ -463,8 +463,7 @@ pub mod golem { } WitNode::PrimS16(e) => { *base.add(0).cast::() = (13i32) as u8; - *base.add(8).cast::() = - (_rt::as_i32(e)) as u16; + *base.add(8).cast::() = (_rt::as_i32(e)) as u16; } WitNode::PrimS32(e) => { *base.add(0).cast::() = (14i32) as u8; @@ -491,8 +490,7 @@ pub mod golem { *base.add(8).cast::() = (match e { true => 1, false => 0, - }) - as u8; + }) as u8; } WitNode::PrimString(e) => { *base.add(0).cast::() = (20i32) as u8; @@ -535,7 +533,6 @@ pub mod golem { _: *mut u8, ); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import( _: i32, @@ -582,42 +579,34 @@ pub mod golem { let l18 = *base.add(8).cast::<*mut u8>(); let l19 = *base.add(12).cast::(); let len20 = l19; - - _rt::Vec::from_raw_parts( - l18.cast(), - len20, - len20, - ) + _rt::Vec::from_raw_parts(l18.cast(), len20, len20) }; WitNode::RecordValue(e61) } 1 => { - let e61 = - { - let l21 = *base.add(8).cast::(); - let l22 = i32::from( - *base.add(12).cast::(), - ); - - (l21 as u32, match l22 { - 0 => None, - 1 => { - let e = { - let l23 = *base.add(16).cast::(); - - l23 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }) - }; + let e61 = { + let l21 = *base.add(8).cast::(); + let l22 = i32::from(*base.add(12).cast::()); + ( + l21 as u32, + match l22 { + 0 => None, + 1 => { + let e = { + let l23 = *base.add(16).cast::(); + l23 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + ) + }; WitNode::VariantValue(e61) } 2 => { let e61 = { let l24 = *base.add(8).cast::(); - l24 as u32 }; WitNode::EnumValue(e61) @@ -628,21 +617,16 @@ pub mod golem { let l26 = *base.add(12).cast::(); let base28 = l25; let len28 = l26; - let mut result28 = - _rt::Vec::with_capacity(len28); + let mut result28 = _rt::Vec::with_capacity(len28); for i in 0..len28 { let base = base28.add(i * 1); let e28 = { - let l27 = i32::from( - *base.add(0).cast::(), - ); - + let l27 = i32::from(*base.add(0).cast::()); _rt::bool_lift(l27 as u8) }; result28.push(e28); } _rt::cabi_dealloc(base28, len28 * 1, 1); - result28 }; WitNode::FlagsValue(e61) @@ -652,12 +636,7 @@ pub mod golem { let l29 = *base.add(8).cast::<*mut u8>(); let l30 = *base.add(12).cast::(); let len31 = l30; - - _rt::Vec::from_raw_parts( - l29.cast(), - len31, - len31, - ) + _rt::Vec::from_raw_parts(l29.cast(), len31, len31) }; WitNode::TupleValue(e61) } @@ -666,27 +645,18 @@ pub mod golem { let l32 = *base.add(8).cast::<*mut u8>(); let l33 = *base.add(12).cast::(); let len34 = l33; - - _rt::Vec::from_raw_parts( - l32.cast(), - len34, - len34, - ) + _rt::Vec::from_raw_parts(l32.cast(), len34, len34) }; WitNode::ListValue(e61) } 6 => { let e61 = { - let l35 = - i32::from(*base.add(8).cast::()); - + let l35 = i32::from(*base.add(8).cast::()); match l35 { 0 => None, 1 => { let e = { - let l36 = - *base.add(12).cast::(); - + let l36 = *base.add(12).cast::(); l36 }; Some(e) @@ -698,49 +668,39 @@ pub mod golem { } 7 => { let e61 = { - let l37 = - i32::from(*base.add(8).cast::()); - + let l37 = i32::from(*base.add(8).cast::()); match l37 { 0 => { let e = { - let l38 = i32::from( - *base.add(12).cast::(), - ); - + let l38 = i32::from(*base.add(12).cast::()); match l38 { - 0 => None, - 1 => { - let e = { - let l39 = *base.add(16).cast::(); - - l39 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } + 0 => None, + 1 => { + let e = { + let l39 = *base.add(16).cast::(); + l39 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } }; Ok(e) } 1 => { let e = { - let l40 = i32::from( - *base.add(12).cast::(), - ); - + let l40 = i32::from(*base.add(12).cast::()); match l40 { - 0 => None, - 1 => { - let e = { - let l41 = *base.add(16).cast::(); - - l41 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } + 0 => None, + 1 => { + let e = { + let l41 = *base.add(16).cast::(); + l41 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } }; Err(e) } @@ -751,18 +711,14 @@ pub mod golem { } 8 => { let e61 = { - let l42 = - i32::from(*base.add(8).cast::()); - + let l42 = i32::from(*base.add(8).cast::()); l42 as u8 }; WitNode::PrimU8(e61) } 9 => { let e61 = { - let l43 = - i32::from(*base.add(8).cast::()); - + let l43 = i32::from(*base.add(8).cast::()); l43 as u16 }; WitNode::PrimU16(e61) @@ -770,7 +726,6 @@ pub mod golem { 10 => { let e61 = { let l44 = *base.add(8).cast::(); - l44 as u32 }; WitNode::PrimU32(e61) @@ -778,25 +733,20 @@ pub mod golem { 11 => { let e61 = { let l45 = *base.add(8).cast::(); - l45 as u64 }; WitNode::PrimU64(e61) } 12 => { let e61 = { - let l46 = - i32::from(*base.add(8).cast::()); - + let l46 = i32::from(*base.add(8).cast::()); l46 as i8 }; WitNode::PrimS8(e61) } 13 => { let e61 = { - let l47 = - i32::from(*base.add(8).cast::()); - + let l47 = i32::from(*base.add(8).cast::()); l47 as i16 }; WitNode::PrimS16(e61) @@ -804,7 +754,6 @@ pub mod golem { 14 => { let e61 = { let l48 = *base.add(8).cast::(); - l48 }; WitNode::PrimS32(e61) @@ -812,7 +761,6 @@ pub mod golem { 15 => { let e61 = { let l49 = *base.add(8).cast::(); - l49 }; WitNode::PrimS64(e61) @@ -820,7 +768,6 @@ pub mod golem { 16 => { let e61 = { let l50 = *base.add(8).cast::(); - l50 }; WitNode::PrimFloat32(e61) @@ -828,7 +775,6 @@ pub mod golem { 17 => { let e61 = { let l51 = *base.add(8).cast::(); - l51 }; WitNode::PrimFloat64(e61) @@ -836,16 +782,13 @@ pub mod golem { 18 => { let e61 = { let l52 = *base.add(8).cast::(); - _rt::char_lift(l52 as u32) }; WitNode::PrimChar(e61) } 19 => { let e61 = { - let l53 = - i32::from(*base.add(8).cast::()); - + let l53 = i32::from(*base.add(8).cast::()); _rt::bool_lift(l53 as u8) }; WitNode::PrimBool(e61) @@ -860,16 +803,12 @@ pub mod golem { len56, len56, ); - _rt::string_lift(bytes56) }; WitNode::PrimString(e61) } n => { - debug_assert_eq!( - n, 21, - "invalid enum discriminant" - ); + debug_assert_eq!(n, 21, "invalid enum discriminant"); let e61 = { let l57 = *base.add(8).cast::<*mut u8>(); let l58 = *base.add(12).cast::(); @@ -880,7 +819,6 @@ pub mod golem { len59, ); let l60 = *base.add(16).cast::(); - ( Uri { value: _rt::string_lift(bytes59), @@ -891,13 +829,11 @@ pub mod golem { WitNode::Handle(e61) } }; - v61 }; result62.push(e62); } _rt::cabi_dealloc(base62, len62 * 24, 8); - WitValue { nodes: result62 } }; Ok(e) @@ -916,7 +852,6 @@ pub mod golem { len66, len66, ); - _rt::string_lift(bytes66) }; RpcError::ProtocolError(e76) @@ -931,7 +866,6 @@ pub mod golem { len69, len69, ); - _rt::string_lift(bytes69) }; RpcError::Denied(e76) @@ -946,7 +880,6 @@ pub mod golem { len72, len72, ); - _rt::string_lift(bytes72) }; RpcError::NotFound(e76) @@ -962,13 +895,11 @@ pub mod golem { len75, len75, ); - _rt::string_lift(bytes75) }; RpcError::RemoteInternalError(e76) } }; - v76 }; Err(e) @@ -989,14 +920,18 @@ pub mod golem { let mut cleanup_list = _rt::Vec::new(); #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 16]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 16]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 16], + ); let vec0 = function_name; let ptr0 = vec0.as_ptr().cast::(); let len0 = vec0.len(); let vec12 = function_params; let len12 = vec12.len(); - let layout12 = - _rt::alloc::Layout::from_size_align_unchecked(vec12.len() * 8, 4); + let layout12 = _rt::alloc::Layout::from_size_align_unchecked( + vec12.len() * 8, + 4, + ); let result12 = if layout12.size() != 0 { let ptr = _rt::alloc::alloc(layout12).cast::(); if ptr.is_null() { @@ -1004,9 +939,7 @@ pub mod golem { } ptr } else { - { - ::core::ptr::null_mut() - } + ::core::ptr::null_mut() }; for (i, e) in vec12.into_iter().enumerate() { let base = result12.add(i * 8); @@ -1025,9 +958,7 @@ pub mod golem { } ptr } else { - { - ::core::ptr::null_mut() - } + ::core::ptr::null_mut() }; for (i, e) in vec11.into_iter().enumerate() { let base = result11.add(i * 24); @@ -1048,8 +979,7 @@ pub mod golem { match t3_1 { Some(e) => { *base.add(12).cast::() = (1i32) as u8; - *base.add(16).cast::() = - _rt::as_i32(e); + *base.add(16).cast::() = _rt::as_i32(e); } None => { *base.add(12).cast::() = (0i32) as u8; @@ -1064,22 +994,18 @@ pub mod golem { *base.add(0).cast::() = (3i32) as u8; let vec4 = e; let len4 = vec4.len(); - let layout4 = - _rt::alloc::Layout::from_size_align_unchecked( - vec4.len() * 1, - 1, - ); + let layout4 = _rt::alloc::Layout::from_size_align_unchecked( + vec4.len() * 1, + 1, + ); let result4 = if layout4.size() != 0 { - let ptr = - _rt::alloc::alloc(layout4).cast::(); + let ptr = _rt::alloc::alloc(layout4).cast::(); if ptr.is_null() { _rt::alloc::handle_alloc_error(layout4); } ptr } else { - { - ::core::ptr::null_mut() - } + ::core::ptr::null_mut() }; for (i, e) in vec4.into_iter().enumerate() { let base = result4.add(i * 1); @@ -1087,14 +1013,12 @@ pub mod golem { *base.add(0).cast::() = (match e { true => 1, false => 0, - }) - as u8; + }) as u8; } } *base.add(12).cast::() = len4; *base.add(8).cast::<*mut u8>() = result4; - cleanup_list - .extend_from_slice(&[(result4, layout4)]); + cleanup_list.extend_from_slice(&[(result4, layout4)]); } WitNode::TupleValue(e) => { *base.add(0).cast::() = (4i32) as u8; @@ -1117,8 +1041,7 @@ pub mod golem { match e { Some(e) => { *base.add(8).cast::() = (1i32) as u8; - *base.add(12).cast::() = - _rt::as_i32(e); + *base.add(12).cast::() = _rt::as_i32(e); } None => { *base.add(8).cast::() = (0i32) as u8; @@ -1132,14 +1055,11 @@ pub mod golem { *base.add(8).cast::() = (0i32) as u8; match e { Some(e) => { - *base.add(12).cast::() = - (1i32) as u8; - *base.add(16).cast::() = - _rt::as_i32(e); + *base.add(12).cast::() = (1i32) as u8; + *base.add(16).cast::() = _rt::as_i32(e); } None => { - *base.add(12).cast::() = - (0i32) as u8; + *base.add(12).cast::() = (0i32) as u8; } }; } @@ -1147,14 +1067,11 @@ pub mod golem { *base.add(8).cast::() = (1i32) as u8; match e { Some(e) => { - *base.add(12).cast::() = - (1i32) as u8; - *base.add(16).cast::() = - _rt::as_i32(e); + *base.add(12).cast::() = (1i32) as u8; + *base.add(16).cast::() = _rt::as_i32(e); } None => { - *base.add(12).cast::() = - (0i32) as u8; + *base.add(12).cast::() = (0i32) as u8; } }; } @@ -1166,8 +1083,7 @@ pub mod golem { } WitNode::PrimU16(e) => { *base.add(0).cast::() = (9i32) as u8; - *base.add(8).cast::() = - (_rt::as_i32(e)) as u16; + *base.add(8).cast::() = (_rt::as_i32(e)) as u16; } WitNode::PrimU32(e) => { *base.add(0).cast::() = (10i32) as u8; @@ -1183,8 +1099,7 @@ pub mod golem { } WitNode::PrimS16(e) => { *base.add(0).cast::() = (13i32) as u8; - *base.add(8).cast::() = - (_rt::as_i32(e)) as u16; + *base.add(8).cast::() = (_rt::as_i32(e)) as u16; } WitNode::PrimS32(e) => { *base.add(0).cast::() = (14i32) as u8; @@ -1211,8 +1126,7 @@ pub mod golem { *base.add(8).cast::() = (match e { true => 1, false => 0, - }) - as u8; + }) as u8; } WitNode::PrimString(e) => { *base.add(0).cast::() = (20i32) as u8; @@ -1255,7 +1169,6 @@ pub mod golem { _: *mut u8, ); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import( _: i32, @@ -1303,7 +1216,6 @@ pub mod golem { len18, len18, ); - _rt::string_lift(bytes18) }; RpcError::ProtocolError(e28) @@ -1318,7 +1230,6 @@ pub mod golem { len21, len21, ); - _rt::string_lift(bytes21) }; RpcError::Denied(e28) @@ -1333,7 +1244,6 @@ pub mod golem { len24, len24, ); - _rt::string_lift(bytes24) }; RpcError::NotFound(e28) @@ -1349,13 +1259,11 @@ pub mod golem { len27, len27, ); - _rt::string_lift(bytes27) }; RpcError::RemoteInternalError(e28) } }; - v28 }; Err(e) @@ -1379,8 +1287,10 @@ pub mod golem { let len0 = vec0.len(); let vec12 = function_params; let len12 = vec12.len(); - let layout12 = - _rt::alloc::Layout::from_size_align_unchecked(vec12.len() * 8, 4); + let layout12 = _rt::alloc::Layout::from_size_align_unchecked( + vec12.len() * 8, + 4, + ); let result12 = if layout12.size() != 0 { let ptr = _rt::alloc::alloc(layout12).cast::(); if ptr.is_null() { @@ -1388,9 +1298,7 @@ pub mod golem { } ptr } else { - { - ::core::ptr::null_mut() - } + ::core::ptr::null_mut() }; for (i, e) in vec12.into_iter().enumerate() { let base = result12.add(i * 8); @@ -1409,9 +1317,7 @@ pub mod golem { } ptr } else { - { - ::core::ptr::null_mut() - } + ::core::ptr::null_mut() }; for (i, e) in vec11.into_iter().enumerate() { let base = result11.add(i * 24); @@ -1432,8 +1338,7 @@ pub mod golem { match t3_1 { Some(e) => { *base.add(12).cast::() = (1i32) as u8; - *base.add(16).cast::() = - _rt::as_i32(e); + *base.add(16).cast::() = _rt::as_i32(e); } None => { *base.add(12).cast::() = (0i32) as u8; @@ -1448,22 +1353,18 @@ pub mod golem { *base.add(0).cast::() = (3i32) as u8; let vec4 = e; let len4 = vec4.len(); - let layout4 = - _rt::alloc::Layout::from_size_align_unchecked( - vec4.len() * 1, - 1, - ); + let layout4 = _rt::alloc::Layout::from_size_align_unchecked( + vec4.len() * 1, + 1, + ); let result4 = if layout4.size() != 0 { - let ptr = - _rt::alloc::alloc(layout4).cast::(); + let ptr = _rt::alloc::alloc(layout4).cast::(); if ptr.is_null() { _rt::alloc::handle_alloc_error(layout4); } ptr } else { - { - ::core::ptr::null_mut() - } + ::core::ptr::null_mut() }; for (i, e) in vec4.into_iter().enumerate() { let base = result4.add(i * 1); @@ -1471,14 +1372,12 @@ pub mod golem { *base.add(0).cast::() = (match e { true => 1, false => 0, - }) - as u8; + }) as u8; } } *base.add(12).cast::() = len4; *base.add(8).cast::<*mut u8>() = result4; - cleanup_list - .extend_from_slice(&[(result4, layout4)]); + cleanup_list.extend_from_slice(&[(result4, layout4)]); } WitNode::TupleValue(e) => { *base.add(0).cast::() = (4i32) as u8; @@ -1501,8 +1400,7 @@ pub mod golem { match e { Some(e) => { *base.add(8).cast::() = (1i32) as u8; - *base.add(12).cast::() = - _rt::as_i32(e); + *base.add(12).cast::() = _rt::as_i32(e); } None => { *base.add(8).cast::() = (0i32) as u8; @@ -1516,14 +1414,11 @@ pub mod golem { *base.add(8).cast::() = (0i32) as u8; match e { Some(e) => { - *base.add(12).cast::() = - (1i32) as u8; - *base.add(16).cast::() = - _rt::as_i32(e); + *base.add(12).cast::() = (1i32) as u8; + *base.add(16).cast::() = _rt::as_i32(e); } None => { - *base.add(12).cast::() = - (0i32) as u8; + *base.add(12).cast::() = (0i32) as u8; } }; } @@ -1531,14 +1426,11 @@ pub mod golem { *base.add(8).cast::() = (1i32) as u8; match e { Some(e) => { - *base.add(12).cast::() = - (1i32) as u8; - *base.add(16).cast::() = - _rt::as_i32(e); + *base.add(12).cast::() = (1i32) as u8; + *base.add(16).cast::() = _rt::as_i32(e); } None => { - *base.add(12).cast::() = - (0i32) as u8; + *base.add(12).cast::() = (0i32) as u8; } }; } @@ -1550,8 +1442,7 @@ pub mod golem { } WitNode::PrimU16(e) => { *base.add(0).cast::() = (9i32) as u8; - *base.add(8).cast::() = - (_rt::as_i32(e)) as u16; + *base.add(8).cast::() = (_rt::as_i32(e)) as u16; } WitNode::PrimU32(e) => { *base.add(0).cast::() = (10i32) as u8; @@ -1567,8 +1458,7 @@ pub mod golem { } WitNode::PrimS16(e) => { *base.add(0).cast::() = (13i32) as u8; - *base.add(8).cast::() = - (_rt::as_i32(e)) as u16; + *base.add(8).cast::() = (_rt::as_i32(e)) as u16; } WitNode::PrimS32(e) => { *base.add(0).cast::() = (14i32) as u8; @@ -1595,8 +1485,7 @@ pub mod golem { *base.add(8).cast::() = (match e { true => 1, false => 0, - }) - as u8; + }) as u8; } WitNode::PrimString(e) => { *base.add(0).cast::() = (20i32) as u8; @@ -1625,7 +1514,6 @@ pub mod golem { cleanup_list.extend_from_slice(&[(result11, layout11)]); } } - #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "golem:rpc/types@0.1.0")] extern "C" { @@ -1638,9 +1526,14 @@ pub mod golem { _: usize, ) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8, _: usize) -> i32 { + fn wit_import( + _: i32, + _: *mut u8, + _: usize, + _: *mut u8, + _: usize, + ) -> i32 { unreachable!() } let ret = wit_import( @@ -1672,13 +1565,14 @@ pub mod golem { #[link_name = "[method]future-invoke-result.subscribe"] fn wit_import(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) -> i32 { unreachable!() } let ret = wit_import((self).handle() as i32); - super::super::super::wasi::io::poll::Pollable::from_handle(ret as u32) + super::super::super::wasi::io::poll::Pollable::from_handle( + ret as u32, + ) } } } @@ -1688,7 +1582,9 @@ pub mod golem { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 20]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 20]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 20], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "golem:rpc/types@0.1.0")] @@ -1696,7 +1592,6 @@ pub mod golem { #[link_name = "[method]future-invoke-result.get"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -1708,7 +1603,6 @@ pub mod golem { 1 => { let e = { let l2 = i32::from(*ptr0.add(4).cast::()); - match l2 { 0 => { let e = { @@ -1720,366 +1614,256 @@ pub mod golem { for i in 0..len50 { let base = base50.add(i * 24); let e50 = { - let l5 = - i32::from(*base.add(0).cast::()); + let l5 = i32::from(*base.add(0).cast::()); let v49 = match l5 { 0 => { let e49 = { - let l6 = *base - .add(8) - .cast::<*mut u8>(); - let l7 = *base - .add(12) - .cast::(); + let l6 = *base.add(8).cast::<*mut u8>(); + let l7 = *base.add(12).cast::(); let len8 = l7; - - _rt::Vec::from_raw_parts( - l6.cast(), - len8, - len8, - ) + _rt::Vec::from_raw_parts(l6.cast(), len8, len8) }; WitNode::RecordValue(e49) } 1 => { let e49 = { - let l9 = - *base.add(8).cast::(); - let l10 = i32::from( - *base.add(12).cast::(), - ); - - (l9 as u32, match l10 { - 0 => None, - 1 => { - let e = { - let l11 = *base.add(16).cast::(); - - l11 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }) + let l9 = *base.add(8).cast::(); + let l10 = i32::from(*base.add(12).cast::()); + ( + l9 as u32, + match l10 { + 0 => None, + 1 => { + let e = { + let l11 = *base.add(16).cast::(); + l11 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + ) }; WitNode::VariantValue(e49) } 2 => { let e49 = { - let l12 = - *base.add(8).cast::(); - + let l12 = *base.add(8).cast::(); l12 as u32 }; WitNode::EnumValue(e49) } 3 => { let e49 = { - let l13 = *base - .add(8) - .cast::<*mut u8>(); - let l14 = *base - .add(12) - .cast::(); + let l13 = *base.add(8).cast::<*mut u8>(); + let l14 = *base.add(12).cast::(); let base16 = l13; let len16 = l14; - let mut result16 = - _rt::Vec::with_capacity( - len16, - ); + let mut result16 = _rt::Vec::with_capacity(len16); for i in 0..len16 { - let base = - base16.add(i * 1); + let base = base16.add(i * 1); let e16 = { - let l15 = i32::from( - *base - .add(0) - .cast::(), - ); - - _rt::bool_lift( - l15 as u8, - ) + let l15 = i32::from(*base.add(0).cast::()); + _rt::bool_lift(l15 as u8) }; result16.push(e16); } - _rt::cabi_dealloc( - base16, - len16 * 1, - 1, - ); - + _rt::cabi_dealloc(base16, len16 * 1, 1); result16 }; WitNode::FlagsValue(e49) } 4 => { let e49 = { - let l17 = *base - .add(8) - .cast::<*mut u8>(); - let l18 = *base - .add(12) - .cast::(); + let l17 = *base.add(8).cast::<*mut u8>(); + let l18 = *base.add(12).cast::(); let len19 = l18; - - _rt::Vec::from_raw_parts( - l17.cast(), - len19, - len19, - ) + _rt::Vec::from_raw_parts(l17.cast(), len19, len19) }; WitNode::TupleValue(e49) } 5 => { let e49 = { - let l20 = *base - .add(8) - .cast::<*mut u8>(); - let l21 = *base - .add(12) - .cast::(); + let l20 = *base.add(8).cast::<*mut u8>(); + let l21 = *base.add(12).cast::(); let len22 = l21; - - _rt::Vec::from_raw_parts( - l20.cast(), - len22, - len22, - ) + _rt::Vec::from_raw_parts(l20.cast(), len22, len22) }; WitNode::ListValue(e49) } 6 => { let e49 = { - let l23 = i32::from( - *base.add(8).cast::(), - ); - + let l23 = i32::from(*base.add(8).cast::()); match l23 { - 0 => None, - 1 => { - let e = { - let l24 = *base.add(12).cast::(); - - l24 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } + 0 => None, + 1 => { + let e = { + let l24 = *base.add(12).cast::(); + l24 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } }; WitNode::OptionValue(e49) } 7 => { let e49 = { - let l25 = i32::from( - *base.add(8).cast::(), - ); - + let l25 = i32::from(*base.add(8).cast::()); match l25 { - 0 => { - let e = { - let l26 = i32::from(*base.add(12).cast::()); - - match l26 { - 0 => None, - 1 => { - let e = { - let l27 = *base.add(16).cast::(); - - l27 - }; - Some(e) + 0 => { + let e = { + let l26 = i32::from(*base.add(12).cast::()); + match l26 { + 0 => None, + 1 => { + let e = { + let l27 = *base.add(16).cast::(); + l27 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + Ok(e) } - _ => _rt::invalid_enum_discriminant(), - } - }; - Ok(e) - } - 1 => { - let e = { - let l28 = i32::from(*base.add(12).cast::()); - - match l28 { - 0 => None, 1 => { - let e = { - let l29 = *base.add(16).cast::(); - - l29 - }; - Some(e) + let e = { + let l28 = i32::from(*base.add(12).cast::()); + match l28 { + 0 => None, + 1 => { + let e = { + let l29 = *base.add(16).cast::(); + l29 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + Err(e) } _ => _rt::invalid_enum_discriminant(), - } - }; - Err(e) - } - _ => _rt::invalid_enum_discriminant(), - } + } }; WitNode::ResultValue(e49) } 8 => { let e49 = { - let l30 = i32::from( - *base.add(8).cast::(), - ); - + let l30 = i32::from(*base.add(8).cast::()); l30 as u8 }; WitNode::PrimU8(e49) } 9 => { let e49 = { - let l31 = i32::from( - *base.add(8).cast::(), - ); - + let l31 = i32::from(*base.add(8).cast::()); l31 as u16 }; WitNode::PrimU16(e49) } 10 => { let e49 = { - let l32 = - *base.add(8).cast::(); - + let l32 = *base.add(8).cast::(); l32 as u32 }; WitNode::PrimU32(e49) } 11 => { let e49 = { - let l33 = - *base.add(8).cast::(); - + let l33 = *base.add(8).cast::(); l33 as u64 }; WitNode::PrimU64(e49) } 12 => { let e49 = { - let l34 = i32::from( - *base.add(8).cast::(), - ); - + let l34 = i32::from(*base.add(8).cast::()); l34 as i8 }; WitNode::PrimS8(e49) } 13 => { let e49 = { - let l35 = i32::from( - *base.add(8).cast::(), - ); - + let l35 = i32::from(*base.add(8).cast::()); l35 as i16 }; WitNode::PrimS16(e49) } 14 => { let e49 = { - let l36 = - *base.add(8).cast::(); - + let l36 = *base.add(8).cast::(); l36 }; WitNode::PrimS32(e49) } 15 => { let e49 = { - let l37 = - *base.add(8).cast::(); - + let l37 = *base.add(8).cast::(); l37 }; WitNode::PrimS64(e49) } 16 => { let e49 = { - let l38 = - *base.add(8).cast::(); - + let l38 = *base.add(8).cast::(); l38 }; WitNode::PrimFloat32(e49) } 17 => { let e49 = { - let l39 = - *base.add(8).cast::(); - + let l39 = *base.add(8).cast::(); l39 }; WitNode::PrimFloat64(e49) } 18 => { let e49 = { - let l40 = - *base.add(8).cast::(); - + let l40 = *base.add(8).cast::(); _rt::char_lift(l40 as u32) }; WitNode::PrimChar(e49) } 19 => { let e49 = { - let l41 = i32::from( - *base.add(8).cast::(), - ); - + let l41 = i32::from(*base.add(8).cast::()); _rt::bool_lift(l41 as u8) }; WitNode::PrimBool(e49) } 20 => { let e49 = { - let l42 = *base - .add(8) - .cast::<*mut u8>(); - let l43 = *base - .add(12) - .cast::(); + let l42 = *base.add(8).cast::<*mut u8>(); + let l43 = *base.add(12).cast::(); let len44 = l43; - let bytes44 = - _rt::Vec::from_raw_parts( - l42.cast(), - len44, - len44, - ); - + let bytes44 = _rt::Vec::from_raw_parts( + l42.cast(), + len44, + len44, + ); _rt::string_lift(bytes44) }; WitNode::PrimString(e49) } n => { - debug_assert_eq!( - n, 21, - "invalid enum discriminant" - ); + debug_assert_eq!(n, 21, "invalid enum discriminant"); let e49 = { - let l45 = *base - .add(8) - .cast::<*mut u8>(); - let l46 = *base - .add(12) - .cast::(); + let l45 = *base.add(8).cast::<*mut u8>(); + let l46 = *base.add(12).cast::(); let len47 = l46; - let bytes47 = - _rt::Vec::from_raw_parts( - l45.cast(), - len47, - len47, - ); - let l48 = - *base.add(16).cast::(); - + let bytes47 = _rt::Vec::from_raw_parts( + l45.cast(), + len47, + len47, + ); + let l48 = *base.add(16).cast::(); ( Uri { - value: _rt::string_lift( - bytes47, - ), + value: _rt::string_lift(bytes47), }, l48 as u64, ) @@ -2087,13 +1871,11 @@ pub mod golem { WitNode::Handle(e49) } }; - v49 }; result50.push(e50); } _rt::cabi_dealloc(base50, len50 * 24, 8); - WitValue { nodes: result50 } }; Ok(e) @@ -2104,8 +1886,7 @@ pub mod golem { let v64 = match l51 { 0 => { let e64 = { - let l52 = - *ptr0.add(12).cast::<*mut u8>(); + let l52 = *ptr0.add(12).cast::<*mut u8>(); let l53 = *ptr0.add(16).cast::(); let len54 = l53; let bytes54 = _rt::Vec::from_raw_parts( @@ -2113,15 +1894,13 @@ pub mod golem { len54, len54, ); - _rt::string_lift(bytes54) }; RpcError::ProtocolError(e64) } 1 => { let e64 = { - let l55 = - *ptr0.add(12).cast::<*mut u8>(); + let l55 = *ptr0.add(12).cast::<*mut u8>(); let l56 = *ptr0.add(16).cast::(); let len57 = l56; let bytes57 = _rt::Vec::from_raw_parts( @@ -2129,15 +1908,13 @@ pub mod golem { len57, len57, ); - _rt::string_lift(bytes57) }; RpcError::Denied(e64) } 2 => { let e64 = { - let l58 = - *ptr0.add(12).cast::<*mut u8>(); + let l58 = *ptr0.add(12).cast::<*mut u8>(); let l59 = *ptr0.add(16).cast::(); let len60 = l59; let bytes60 = _rt::Vec::from_raw_parts( @@ -2145,19 +1922,14 @@ pub mod golem { len60, len60, ); - _rt::string_lift(bytes60) }; RpcError::NotFound(e64) } n => { - debug_assert_eq!( - n, 3, - "invalid enum discriminant" - ); + debug_assert_eq!(n, 3, "invalid enum discriminant"); let e64 = { - let l61 = - *ptr0.add(12).cast::<*mut u8>(); + let l61 = *ptr0.add(12).cast::<*mut u8>(); let l62 = *ptr0.add(16).cast::(); let len63 = l62; let bytes63 = _rt::Vec::from_raw_parts( @@ -2165,13 +1937,11 @@ pub mod golem { len63, len63, ); - _rt::string_lift(bytes63) }; RpcError::RemoteInternalError(e64) } }; - v64 }; Err(e) @@ -2189,26 +1959,24 @@ pub mod golem { } } } -#[allow(dead_code)] +#[rustfmt::skip] +#[allow(dead_code, clippy::all)] pub mod wasi { - #[allow(dead_code)] pub mod io { + /// A poll API intended to let users wait for I/O events on multiple handles + /// at once. #[allow(dead_code, clippy::all)] pub mod poll { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::__link_custom_section_describing_imports; use super::super::super::_rt; /// `pollable` epresents a single I/O event which may be ready, or not. - #[derive(Debug)] #[repr(transparent)] pub struct Pollable { handle: _rt::Resource, } - impl Pollable { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { @@ -2216,24 +1984,20 @@ pub mod wasi { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for Pollable { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:io/poll@0.2.0")] @@ -2241,12 +2005,10 @@ pub mod wasi { #[link_name = "[resource-drop]pollable"] fn drop(_: u32); } - drop(_handle); } } } - impl Pollable { #[allow(unused_unsafe, clippy::all)] /// Return the readiness of a pollable. This function never blocks. @@ -2260,7 +2022,6 @@ pub mod wasi { #[link_name = "[method]pollable.ready"] fn wit_import(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) -> i32 { unreachable!() @@ -2285,7 +2046,6 @@ pub mod wasi { #[link_name = "[method]pollable.block"] fn wit_import(_: i32); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) { unreachable!() @@ -2320,7 +2080,10 @@ pub mod wasi { let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); let vec0 = in_; let len0 = vec0.len(); - let layout0 = _rt::alloc::Layout::from_size_align_unchecked(vec0.len() * 4, 4); + let layout0 = _rt::alloc::Layout::from_size_align_unchecked( + vec0.len() * 4, + 4, + ); let result0 = if layout0.size() != 0 { let ptr = _rt::alloc::alloc(layout0).cast::(); if ptr.is_null() { @@ -2328,9 +2091,7 @@ pub mod wasi { } ptr } else { - { - ::core::ptr::null_mut() - } + ::core::ptr::null_mut() }; for (i, e) in vec0.into_iter().enumerate() { let base = result0.add(i * 4); @@ -2345,7 +2106,6 @@ pub mod wasi { #[link_name = "poll"] fn wit_import(_: *mut u8, _: usize, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8, _: usize, _: *mut u8) { unreachable!() @@ -2363,12 +2123,11 @@ pub mod wasi { } } } +#[rustfmt::skip] mod _rt { - use core::fmt; use core::marker; use core::sync::atomic::{AtomicU32, Ordering::Relaxed}; - /// A type which represents a component model resource, either imported or /// exported into this component. /// @@ -2383,16 +2142,9 @@ mod _rt { /// resources. #[repr(transparent)] pub struct Resource { - // NB: This would ideally be `u32` but it is not. The fact that this has - // interior mutability is not exposed in the API of this type except for the - // `take_handle` method which is supposed to in theory be private. - // - // This represents, almost all the time, a valid handle value. When it's - // invalid it's stored as `u32::MAX`. handle: AtomicU32, _marker: marker::PhantomData, } - /// A trait which all wasm resources implement, namely providing the ability to /// drop a resource. /// @@ -2402,7 +2154,6 @@ mod _rt { /// Invokes the `[resource-drop]...` intrinsic. unsafe fn drop(handle: u32); } - impl Resource { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { @@ -2412,7 +2163,6 @@ mod _rt { _marker: marker::PhantomData, } } - /// Takes ownership of the handle owned by `resource`. /// /// Note that this ideally would be `into_handle` taking `Resource` by @@ -2429,31 +2179,21 @@ mod _rt { pub fn take_handle(resource: &Resource) -> u32 { resource.handle.swap(u32::MAX, Relaxed) } - #[doc(hidden)] pub fn handle(resource: &Resource) -> u32 { resource.handle.load(Relaxed) } } - impl fmt::Debug for Resource { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("Resource") - .field("handle", &self.handle) - .finish() + f.debug_struct("Resource").field("handle", &self.handle).finish() } } - impl Drop for Resource { fn drop(&mut self) { unsafe { match self.handle.load(Relaxed) { - // If this handle was "taken" then don't do anything in the - // destructor. u32::MAX => {} - - // ... but otherwise do actually destroy it with the imported - // component model intrinsic as defined through `T`. other => T::drop(other), } } @@ -2470,143 +2210,119 @@ mod _rt { val != 0 } } + pub use alloc_crate::vec::Vec; pub use alloc_crate::alloc; pub use alloc_crate::string::String; - pub use alloc_crate::vec::Vec; - pub fn as_i32(t: T) -> i32 { t.as_i32() } - pub trait AsI32 { fn as_i32(self) -> i32; } - impl<'a, T: Copy + AsI32> AsI32 for &'a T { fn as_i32(self) -> i32 { (*self).as_i32() } } - impl AsI32 for i32 { #[inline] fn as_i32(self) -> i32 { self as i32 } } - impl AsI32 for u32 { #[inline] fn as_i32(self) -> i32 { self as i32 } } - impl AsI32 for i16 { #[inline] fn as_i32(self) -> i32 { self as i32 } } - impl AsI32 for u16 { #[inline] fn as_i32(self) -> i32 { self as i32 } } - impl AsI32 for i8 { #[inline] fn as_i32(self) -> i32 { self as i32 } } - impl AsI32 for u8 { #[inline] fn as_i32(self) -> i32 { self as i32 } } - impl AsI32 for char { #[inline] fn as_i32(self) -> i32 { self as i32 } } - impl AsI32 for usize { #[inline] fn as_i32(self) -> i32 { self as i32 } } - pub fn as_i64(t: T) -> i64 { t.as_i64() } - pub trait AsI64 { fn as_i64(self) -> i64; } - impl<'a, T: Copy + AsI64> AsI64 for &'a T { fn as_i64(self) -> i64 { (*self).as_i64() } } - impl AsI64 for i64 { #[inline] fn as_i64(self) -> i64 { self as i64 } } - impl AsI64 for u64 { #[inline] fn as_i64(self) -> i64 { self as i64 } } - pub fn as_f32(t: T) -> f32 { t.as_f32() } - pub trait AsF32 { fn as_f32(self) -> f32; } - impl<'a, T: Copy + AsF32> AsF32 for &'a T { fn as_f32(self) -> f32 { (*self).as_f32() } } - impl AsF32 for f32 { #[inline] fn as_f32(self) -> f32 { self as f32 } } - pub fn as_f64(t: T) -> f64 { t.as_f64() } - pub trait AsF64 { fn as_f64(self) -> f64; } - impl<'a, T: Copy + AsF64> AsF64 for &'a T { fn as_f64(self) -> f64 { (*self).as_f64() } } - impl AsF64 for f64 { #[inline] fn as_f64(self) -> f64 { @@ -2625,7 +2341,7 @@ mod _rt { return; } let layout = alloc::Layout::from_size_align_unchecked(size, align); - alloc::dealloc(ptr as *mut u8, layout); + alloc::dealloc(ptr, layout); } pub unsafe fn char_lift(val: u32) -> char { if cfg!(debug_assertions) { @@ -2643,16 +2359,15 @@ mod _rt { } extern crate alloc as alloc_crate; } - #[cfg(target_arch = "wasm32")] -#[link_section = "component-type:wit-bindgen:0.25.0:wit-value:encoded world"] +#[link_section = "component-type:wit-bindgen:0.36.0:golem:rpc@0.1.0:wit-value-world:encoded world"] #[doc(hidden)] -pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 1310] = *b"\ -\0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\x9e\x09\x01A\x02\x01\ +pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 1322] = *b"\ +\0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\xa4\x09\x01A\x02\x01\ A\x05\x01B\x0a\x04\0\x08pollable\x03\x01\x01h\0\x01@\x01\x04self\x01\0\x7f\x04\0\ \x16[method]pollable.ready\x01\x02\x01@\x01\x04self\x01\x01\0\x04\0\x16[method]p\ ollable.block\x01\x03\x01p\x01\x01py\x01@\x01\x02in\x04\0\x05\x04\0\x04poll\x01\x06\ -\x03\x01\x12wasi:io/poll@0.2.0\x05\0\x02\x03\0\0\x08pollable\x01B*\x02\x03\x02\x01\ +\x03\0\x12wasi:io/poll@0.2.0\x05\0\x02\x03\0\0\x08pollable\x01B*\x02\x03\x02\x01\ \x01\x04\0\x08pollable\x03\0\0\x01z\x04\0\x0anode-index\x03\0\x02\x01r\x01\x05va\ lues\x04\0\x03uri\x03\0\x04\x01p\x03\x01k\x03\x01o\x02y\x07\x01p\x7f\x01j\x01\x07\ \x01\x07\x01o\x02\x05w\x01q\x16\x0crecord-value\x01\x06\0\x0dvariant-value\x01\x08\ @@ -2673,13 +2388,11 @@ d]wasm-rpc.invoke\x01\x1c\x01i\x14\x01@\x03\x04self\x17\x0dfunction-names\x0ffun ction-params\x18\0\x1d\x04\0'[method]wasm-rpc.async-invoke-and-await\x01\x1e\x01\ h\x14\x01i\x01\x01@\x01\x04self\x1f\0\x20\x04\0&[method]future-invoke-result.sub\ scribe\x01!\x01k\x19\x01@\x01\x04self\x1f\0\"\x04\0\x20[method]future-invoke-res\ -ult.get\x01#\x03\x01\x15golem:rpc/types@0.1.0\x05\x02\x04\x01\x19golem:rpc/wit-v\ -alue@0.1.0\x04\0\x0b\x0f\x01\0\x09wit-value\x03\0\0\0G\x09producers\x01\x0cproce\ -ssed-by\x02\x0dwit-component\x070.208.1\x10wit-bindgen-rust\x060.25.0"; - +ult.get\x01#\x03\0\x15golem:rpc/types@0.1.0\x05\x02\x04\0\x1fgolem:rpc/wit-value\ +-world@0.1.0\x04\0\x0b\x15\x01\0\x0fwit-value-world\x03\0\0\0G\x09producers\x01\x0c\ +processed-by\x02\x0dwit-component\x070.220.0\x10wit-bindgen-rust\x060.36.0"; #[inline(never)] #[doc(hidden)] -#[cfg(target_arch = "wasm32")] pub fn __link_custom_section_describing_imports() { wit_bindgen_rt::maybe_link_cabi_realloc(); }