diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6682c72..008c6f0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,8 +19,8 @@ on: env: CARGO_TERM_COLOR: always - CARGO_COMPONENT_VERSION: 0.14.0 - RUST_VERSION: "1.80" + CARGO_COMPONENT_VERSION: 0.21.1 + RUST_VERSION: "1.86" WASI_SDK_VERSION: "22.0" WASI_SDK_RELEASE: wasi-sdk-22 @@ -35,7 +35,7 @@ jobs: rustup toolchain install ${{ env.RUST_VERSION }} --component clippy --component rustfmt rustup default ${{ env.RUST_VERSION }} - name: Install Wasm Rust target - run: rustup target add wasm32-wasip1 && rustup target add wasm32-wasi && rustup target add wasm32-unknown-unknown + run: rustup target add wasm32-wasip1 && rustup target add wasm32-unknown-unknown - name: Install cargo-component uses: baptiste0928/cargo-install@v3 with: @@ -75,7 +75,7 @@ jobs: rustup toolchain install ${{ env.RUST_VERSION }} --component clippy --component rustfmt --no-self-update rustup default ${{ env.RUST_VERSION }} - name: "Install Wasm Rust target" - run: rustup target add wasm32-wasip1 && rustup target add wasm32-wasi && rustup target add wasm32-unknown-unknown + run: rustup target add wasm32-wasip1 && rustup target add wasm32-unknown-unknown - name: Install cargo-component uses: baptiste0928/cargo-install@v3 with: @@ -108,7 +108,7 @@ jobs: rustup toolchain install ${{ env.RUST_VERSION }} --component clippy --component rustfmt --no-self-update rustup default ${{ env.RUST_VERSION }} - name: "Install Wasm Rust target" - run: rustup target add wasm32-wasip1 && rustup target add wasm32-wasi && rustup target add wasm32-unknown-unknown + run: rustup target add wasm32-wasip1 && rustup target add wasm32-unknown-unknown - name: Install cargo-component uses: baptiste0928/cargo-install@v3 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 61a2fab..f74677a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,8 +18,8 @@ concurrency: ${{ github.workflow }} env: CARGO_TERM_COLOR: always - CARGO_COMPONENT_VERSION: 0.14.0 - RUST_VERSION: "1.80" + CARGO_COMPONENT_VERSION: 0.21.1 + RUST_VERSION: "1.86" WASI_SDK_VERSION: "22.0" WASI_SDK_RELEASE: wasi-sdk-22 @@ -81,7 +81,7 @@ jobs: run: rustup target add --toolchain ${{ env.RUST_VERSION }} ${{ matrix.config.target }} - name: "Install Wasm Rust target" - run: rustup target add wasm32-wasip1 --toolchain ${{ env.RUST_VERSION }} && rustup target add wasm32-wasi --toolchain ${{ env.RUST_VERSION }} && rustup target add wasm32-unknown-unknown --toolchain ${{ env.RUST_VERSION }} + run: rustup target add wasm32-wasip1 --toolchain ${{ env.RUST_VERSION }} && rustup target add wasm32-unknown-unknown --toolchain ${{ env.RUST_VERSION }} - name: Install cargo-component uses: baptiste0928/cargo-install@v3 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8a0681d..de8cba6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,6 +2,12 @@ ## Building from source -To build `spin-test` from source, you'll need to [download the `WASI_SDK`](https://github.com/WebAssembly/wasi-sdk/releases/) (needed for the C compiler used to compile some C dependencies). Once you have the SDK on your machine somewhere, point to it via the `WASI_SDK_PATH` environment variable. +To build `spin-test` from source, you'll need to [download the `WASI_SDK`](https://github.com/WebAssembly/wasi-sdk/releases/) (needed for the C compiler used to compile some C dependencies). + +Once you have the SDK on your machine somewhere, point to it via the `WASI_SDK_PATH` environment variable: + +```bash +export WASI_SDK_PATH=~/.wasi-sdk-22.0 +``` You can then run `cargo build --release` to build `spin-test`. \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index b014fbc..fbefce0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,44 +1,21 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" -version = "0.21.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] [[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "ahash" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" -dependencies = [ - "getrandom", - "once_cell", - "version_check", -] - -[[package]] -name = "ahash" -version = "0.8.11" +name = "adler2" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" [[package]] name = "aho-corasick" @@ -50,10 +27,10 @@ dependencies = [ ] [[package]] -name = "aliasable" -version = "0.1.3" +name = "allocator-api2" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "ambient-authority" @@ -61,6 +38,12 @@ version = "0.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e9d4ee0d472d1cd2e28c97dfa124b3d8d992e10eb0a035f33f5d12e3a177ba3b" +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + [[package]] name = "android_system_properties" version = "0.1.5" @@ -72,9 +55,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.14" +version = "0.6.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" +checksum = "301af1932e46185686725e0fad2f8f2aa7da69dd70bf6ecc44d6b703844a3933" dependencies = [ "anstyle", "anstyle-parse", @@ -87,99 +70,183 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.7" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" +checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" [[package]] name = "anstyle-parse" -version = "0.2.4" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.3" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" +checksum = "6c8bdeb6047d8983be085bab0ba1472e6dc604e7041dbf6fcd5e71523014fae9" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.3" +version = "3.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" +checksum = "403f75924867bb1033c59fbf0797484329750cfbe3c4325cd33127941fabc882" dependencies = [ "anstyle", - "windows-sys 0.52.0", + "once_cell_polyfill", + "windows-sys 0.59.0", ] [[package]] name = "anyhow" -version = "1.0.83" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25bdb32cbbdce2b519a9cd7df3a678443100e265d5e25ca763b7572a5104f5f3" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" [[package]] name = "arbitrary" -version = "1.3.2" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dde20b3d026af13f561bdd0f15edf01fc734f0dafcedbaf42bba506a9517f223" + +[[package]] +name = "async-compression" +version = "0.4.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40f6024f3f856663b45fd0c9b6f2024034a702f453549449e0d84a305900dad4" +dependencies = [ + "flate2", + "futures-core", + "memchr", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "async-stream" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" +dependencies = [ + "async-stream-impl", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", +] [[package]] name = "async-trait" -version = "0.1.80" +version = "0.1.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" +checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.103", ] [[package]] -name = "atty" -version = "0.2.14" +name = "atomic-waker" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "auditable-serde" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c7bf8143dfc3c0258df908843e169b5cc5fcf76c7718bd66135ef4a9cd558c5" dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", + "semver", + "serde", + "serde_json", + "topological-sort", ] [[package]] name = "autocfg" -version = "1.3.0" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "axum" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" +dependencies = [ + "async-trait", + "axum-core", + "bytes", + "futures-util", + "http 1.3.1", + "http-body", + "http-body-util", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "sync_wrapper", + "tower 0.5.2", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-core" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http 1.3.1", + "http-body", + "http-body-util", + "mime", + "pin-project-lite", + "rustversion", + "sync_wrapper", + "tower-layer", + "tower-service", +] [[package]] name = "backtrace" -version = "0.3.71" +version = "0.3.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", "miniz_oxide", - "object 0.32.2", + "object", "rustc-demangle", + "windows-targets 0.52.6", ] -[[package]] -name = "base64" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" - [[package]] name = "base64" version = "0.22.1" @@ -188,15 +255,9 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.5.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" [[package]] name = "block-buffer" @@ -209,9 +270,12 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "793db76d6187cd04dff33004d8e6c9cc4e05cd330500379d2394209271b4aeee" +dependencies = [ + "allocator-api2", +] [[package]] name = "byteorder" @@ -221,39 +285,39 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "cap-fs-ext" -version = "3.0.0" +version = "3.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "769f8cd02eb04d57f14e2e371ebb533f96817f9b2525d73a5c72b61ca7973747" +checksum = "e41cc18551193fe8fa6f15c1e3c799bc5ec9e2cfbfaa8ed46f37013e3e6c173c" dependencies = [ "cap-primitives", "cap-std", "io-lifetimes", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "cap-net-ext" -version = "3.0.0" +version = "3.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ff6d3fb274292a9af283417e383afe6ded1fe66f6472d2c781216d3d80c218" +checksum = "9f83833816c66c986e913b22ac887cec216ea09301802054316fc5301809702c" dependencies = [ "cap-primitives", "cap-std", - "rustix", + "rustix 1.0.7", "smallvec", ] [[package]] name = "cap-primitives" -version = "3.0.0" +version = "3.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90a0b44fc796b1a84535a63753d50ba3972c4db55c7255c186f79140e63d56d0" +checksum = "0a1e394ed14f39f8bc26f59d4c0c010dbe7f0a1b9bafff451b1f98b67c8af62a" dependencies = [ "ambient-authority", "fs-set-times", @@ -261,16 +325,17 @@ dependencies = [ "io-lifetimes", "ipnet", "maybe-owned", - "rustix", - "windows-sys 0.52.0", + "rustix 1.0.7", + "rustix-linux-procfs", + "windows-sys 0.59.0", "winx", ] [[package]] name = "cap-rand" -version = "3.0.0" +version = "3.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4327f08daac33a99bb03c54ae18c8f32c3ba31c728a33ddf683c6c6a5043de68" +checksum = "0acb89ccf798a28683f00089d0630dfaceec087234eae0d308c05ddeaa941b40" dependencies = [ "ambient-authority", "rand", @@ -278,52 +343,66 @@ dependencies = [ [[package]] name = "cap-std" -version = "3.0.0" +version = "3.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266626ce180cf9709f317d0bf9754e3a5006359d87f4bf792f06c9c5f1b63c0f" +checksum = "07c0355ca583dd58f176c3c12489d684163861ede3c9efa6fd8bba314c984189" dependencies = [ "cap-primitives", "io-extras", "io-lifetimes", - "rustix", + "rustix 1.0.7", ] [[package]] name = "cap-time-ext" -version = "3.0.0" +version = "3.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1353421ba83c19da60726e35db0a89abef984b3be183ff6f58c5b8084fcd0c5" +checksum = "491af520b8770085daa0466978c75db90368c71896523f2464214e38359b1a5b" dependencies = [ "ambient-authority", "cap-primitives", "iana-time-zone", "once_cell", - "rustix", + "rustix 1.0.7", "winx", ] [[package]] name = "cc" -version = "1.0.97" +version = "1.2.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099a5357d84c4c61eb35fc8eafa9a79a902c2f76911e5747ced4e032edd8d9b4" +checksum = "d487aa071b5f64da6f19a3e848e3578944b726ee5a4854b82172f02aa876bfdc" dependencies = [ "jobserver", "libc", - "once_cell", + "shlex", ] [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" + +[[package]] +name = "chrono" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "wasm-bindgen", + "windows-link", +] [[package]] name = "clap" -version = "4.5.4" +version = "4.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" +checksum = "40b6887a1d8685cebccf115538db5c0efe625ccac9696ad45c409d96566e910f" dependencies = [ "clap_builder", "clap_derive", @@ -331,9 +410,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.2" +version = "4.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" +checksum = "e0c66c08ce9f0c698cbce5c0279d0bb6ac936d8674174fe48f736533b964f59e" dependencies = [ "anstream", "anstyle", @@ -343,21 +422,21 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.4" +version = "4.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" +checksum = "d2c7947ae4cc3d851207c1adb5b5e260ff0cca11446b1d6d1423788e442257ce" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.103", ] [[package]] name = "clap_lex" -version = "0.7.0" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" +checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" [[package]] name = "cobs" @@ -367,9 +446,9 @@ checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" [[package]] name = "colorchoice" -version = "1.0.1" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" [[package]] name = "conformance-tests" @@ -379,7 +458,7 @@ dependencies = [ "anyhow", "flate2", "json5", - "libtest-mimic", + "libtest-mimic 0.7.3", "reqwest", "serde", "tar", @@ -398,98 +477,134 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpp_demangle" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8227005286ec39567949b33df9896bcadfa6051bccca2488129f108ca23119" +checksum = "96e58d342ad113c2b878f16d5d034c03be492ae460cdbc02b7f0f2284d310c7d" dependencies = [ "cfg-if", ] [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" dependencies = [ "libc", ] +[[package]] +name = "cranelift-assembler-x64" +version = "0.120.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ff8e35182c7372df00447cb90a04e584e032c42b9b9b6e8c50ddaaf0d7900d5" +dependencies = [ + "cranelift-assembler-x64-meta", +] + +[[package]] +name = "cranelift-assembler-x64-meta" +version = "0.120.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14220f9c2698015c3b94dc6b84ae045c1c45509ddc406e43c6139252757fdb7a" +dependencies = [ + "cranelift-srcgen", +] + [[package]] name = "cranelift-bforest" -version = "0.109.0" +version = "0.120.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b6b33d7e757a887989eb18b35712b2a67d96171ec3149d1bfb657b29b7b367c" +checksum = "d372ef2777ceefd75829e1390211ac240e9196bc60699218f7ea2419038288ee" dependencies = [ "cranelift-entity", ] +[[package]] +name = "cranelift-bitset" +version = "0.120.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56323783e423818fa89ce8078e90a3913d2a6e0810399bfce8ebd7ee87baa81f" +dependencies = [ + "serde", + "serde_derive", +] + [[package]] name = "cranelift-codegen" -version = "0.109.0" +version = "0.120.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9acf15cb22be42d07c3b57d7856329cb228b7315d385346149df2566ad5e4aa" +checksum = "74ffb780aab6186c6e9ba26519654b1ac55a09c0a866f6088a4efbbd84da68ed" dependencies = [ "bumpalo", + "cranelift-assembler-x64", "cranelift-bforest", + "cranelift-bitset", "cranelift-codegen-meta", "cranelift-codegen-shared", "cranelift-control", "cranelift-entity", "cranelift-isle", "gimli", - "hashbrown 0.14.5", + "hashbrown 0.15.4", "log", + "pulley-interpreter", "regalloc2", "rustc-hash", + "serde", "smallvec", "target-lexicon", ] [[package]] name = "cranelift-codegen-meta" -version = "0.109.0" +version = "0.120.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e934d301392b73b3f8b0540391fb82465a0f179a3cee7c726482ac4727efcc97" +checksum = "c23ef13814d3b39c869650d5961128cbbecad83fbdff4e6836a03ecf6862d7ed" dependencies = [ + "cranelift-assembler-x64-meta", "cranelift-codegen-shared", + "cranelift-srcgen", + "pulley-interpreter", ] [[package]] name = "cranelift-codegen-shared" -version = "0.109.0" +version = "0.120.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb2a2566b3d54b854dfb288b3b187f6d3d17d6f762c92898207eba302931da" +checksum = "b9f623300657679f847803ce80811454bfff89cea4f6bf684be5c468d4a73631" [[package]] name = "cranelift-control" -version = "0.109.0" +version = "0.120.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0100f33b704cdacd01ad66ff41f8c5030d57cbff078e2a4e49ab1822591299fa" +checksum = "31f4168af69989aa6b91fab46799ed4df6096f3209f4a6c8fb4358f49c60188f" dependencies = [ "arbitrary", ] [[package]] name = "cranelift-entity" -version = "0.109.0" +version = "0.120.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8cfdc315e5d18997093e040a8d234bea1ac1e118a716d3e30f40d449e78207b" +checksum = "ca6fa9bae1c8de26d71ac2162f069447610fd91e7780cb480ee0d76ac81eabb8" dependencies = [ + "cranelift-bitset", "serde", "serde_derive", ] [[package]] name = "cranelift-frontend" -version = "0.109.0" +version = "0.120.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f74b84f16af2e982b0c0c72233503d9d55cbfe3865dbe807ca28dc6642a28b5" +checksum = "b8219205608aa0b0e6769b580284a7e055c7e0c323c1041cde7ca078add3e412" dependencies = [ "cranelift-codegen", "log", @@ -499,15 +614,15 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.109.0" +version = "0.120.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adf306d3dde705fb94bd48082f01d38c4ededc74293a4c007805f610bf08bc6e" +checksum = "588d0c5964f10860b04043e55aab26d7f7a206b0fd4f10c5260e8aa5773832bd" [[package]] name = "cranelift-native" -version = "0.109.0" +version = "0.120.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ea0ebdef7aff4a79bcbc8b6495f31315f16b3bf311152f472eaa8d679352581" +checksum = "19ed3c94cb97b14f92b6a94a1d45ef8c851f6a2ad9114e5d91d233f7da638fed" dependencies = [ "cranelift-codegen", "libc", @@ -515,35 +630,25 @@ dependencies = [ ] [[package]] -name = "cranelift-wasm" -version = "0.109.0" +name = "cranelift-srcgen" +version = "0.120.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d549108a1942065cdbac3bb96c2952afa0e1b9a3beff4b08c4308ac72257576d" -dependencies = [ - "cranelift-codegen", - "cranelift-entity", - "cranelift-frontend", - "itertools", - "log", - "smallvec", - "wasmparser 0.209.1", - "wasmtime-types", -] +checksum = "85256fac1519a7d25a040c1d850fba67478f3f021ad5fdf738ba4425ee862dbf" [[package]] name = "crc32fast" -version = "1.4.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] [[package]] name = "crossbeam-deque" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" dependencies = [ "crossbeam-epoch", "crossbeam-utils", @@ -560,9 +665,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crypto-common" @@ -605,22 +710,23 @@ dependencies = [ [[package]] name = "dirs" -version = "4.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" +checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" dependencies = [ "dirs-sys", ] [[package]] name = "dirs-sys" -version = "0.3.7" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" dependencies = [ "libc", - "redox_users", - "winapi", + "option-ext", + "redox_users 0.5.0", + "windows-sys 0.60.2", ] [[package]] @@ -630,21 +736,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" dependencies = [ "libc", - "redox_users", + "redox_users 0.4.6", "winapi", ] [[package]] -name = "dotenvy" -version = "0.15.7" +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", +] + +[[package]] +name = "dyn-clone" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" +checksum = "1c7a8fb8a9fbf66c1f703fe16184d10ca0ee9d23be5b4436400408ba54a95005" [[package]] name = "either" -version = "1.11.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] name = "embedded-io" @@ -652,20 +769,26 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" +[[package]] +name = "embedded-io" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" + [[package]] name = "encoding_rs" -version = "0.8.34" +version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" dependencies = [ "cfg-if", ] [[package]] name = "env_filter" -version = "0.1.0" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" +checksum = "186e05a59d4c50738528153b83b0b0194d3a29507dfec16eccd4b342903397d0" dependencies = [ "log", "regex", @@ -673,47 +796,38 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.3" +version = "0.11.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b35839ba51819680ba087cd351788c9a3c476841207e0b8cee0b04722343b9" +checksum = "13c863f0904021b108aa8b2f55046443e6b1ebde8fd4a15c399893aae4fa069f" dependencies = [ "anstream", "anstyle", "env_filter", - "humantime", + "jiff", "log", ] [[package]] name = "equivalent" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" -version = "0.3.9" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "cea14ef9355e3beab063703aa9dab15afd25f0667c341310c1e5274bb1d0da18" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "escape8259" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba4f4911e3666fcd7826997b4745c8224295a6f3072f1418c3067b97a67557ee" -dependencies = [ - "rustversion", -] - -[[package]] -name = "fallible-iterator" -version = "0.2.0" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" +checksum = "5692dd7b5a1978a5aeb0ce83b7655c58ca8efdcb79d21036ea249da95afec2c6" [[package]] name = "fallible-iterator" @@ -729,31 +843,31 @@ checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" [[package]] name = "fastrand" -version = "2.1.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "fd-lock" -version = "4.0.2" +version = "4.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e5768da2206272c81ef0b5e951a41862938a6070da63bcea197899942d3b947" +checksum = "0ce92ff622d6dadf7349484f42c93271a0d49b7cc4d466a936405bacbe10aa78" dependencies = [ "cfg-if", - "rustix", - "windows-sys 0.52.0", + "rustix 1.0.7", + "windows-sys 0.59.0", ] [[package]] name = "filetime" -version = "0.2.23" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" dependencies = [ "cfg-if", "libc", - "redox_syscall", - "windows-sys 0.52.0", + "libredox", + "windows-sys 0.59.0", ] [[package]] @@ -764,9 +878,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.30" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" +checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d" dependencies = [ "crc32fast", "miniz_oxide", @@ -778,6 +892,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + [[package]] name = "foreign-types" version = "0.3.2" @@ -804,13 +924,13 @@ dependencies = [ [[package]] name = "fs-set-times" -version = "0.20.1" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "033b337d725b97690d86893f9de22b67b80dcc4e9ad815f348254c38119db8fb" +checksum = "94e7099f6313ecacbe1256e8ff9d617b75d1bcb16a6fddef94866d225a01a14a" dependencies = [ "io-lifetimes", - "rustix", - "windows-sys 0.52.0", + "rustix 1.0.7", + "windows-sys 0.59.0", ] [[package]] @@ -825,9 +945,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -840,9 +960,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -850,15 +970,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -867,38 +987,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.103", ] [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -927,7 +1047,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "27d12c0aed7f1e24276a241aadc4cb8ea9f83000f34bc062b7cc2d51e3b0fabd" dependencies = [ - "bitflags 2.5.0", + "bitflags", "debugid", "fxhash", "serde", @@ -946,60 +1066,63 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.15" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.1+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" dependencies = [ "cfg-if", "libc", - "wasi", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", ] [[package]] name = "gimli" -version = "0.28.1" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" dependencies = [ - "fallible-iterator 0.3.0", - "indexmap 2.2.6", + "fallible-iterator", + "indexmap 2.9.0", "stable_deref_trait", ] [[package]] name = "glob" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "h2" -version = "0.4.4" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "816ec7294445779408f36fe57bc5b7fc1cf59664059096c65f905c1c61f58069" +checksum = "a9421a676d1b147b16b82c9225157dc629087ef8ec4d5e2960f9437a90dac0a5" dependencies = [ + "atomic-waker", "bytes", "fnv", "futures-core", "futures-sink", - "futures-util", - "http", - "indexmap 2.2.6", + "http 1.3.1", + "indexmap 2.9.0", "slab", "tokio", "tokio-util", "tracing", ] -[[package]] -name = "hashbrown" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" -dependencies = [ - "ahash 0.7.8", -] - [[package]] name = "hashbrown" version = "0.12.3" @@ -1008,30 +1131,21 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash 0.8.11", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" dependencies = [ - "ahash 0.8.11", + "foldhash", "serde", ] [[package]] name = "hashlink" -version = "0.7.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7249a3129cbc1ffccd74857f81464a323a152173cdb134e0fd81bc803b29facf" +checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1" dependencies = [ - "hashbrown 0.11.2", + "hashbrown 0.15.4", ] [[package]] @@ -1051,24 +1165,26 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" -version = "0.1.19" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" [[package]] -name = "hermit-abi" -version = "0.3.9" +name = "http" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes", + "fnv", + "itoa", +] [[package]] name = "http" -version = "1.1.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" dependencies = [ "bytes", "fnv", @@ -1077,32 +1193,32 @@ dependencies = [ [[package]] name = "http-body" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", - "http", + "http 1.3.1", ] [[package]] name = "http-body-util" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" dependencies = [ "bytes", "futures-core", - "http", + "http 1.3.1", "http-body", "pin-project-lite", ] [[package]] name = "httparse" -version = "1.8.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" [[package]] name = "httpdate" @@ -1110,23 +1226,17 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" -[[package]] -name = "humantime" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" - [[package]] name = "hyper" -version = "1.3.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" +checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" dependencies = [ "bytes", "futures-channel", "futures-util", "h2", - "http", + "http 1.3.1", "http-body", "httparse", "httpdate", @@ -1137,6 +1247,35 @@ dependencies = [ "want", ] +[[package]] +name = "hyper-rustls" +version = "0.27.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" +dependencies = [ + "http 1.3.1", + "hyper", + "hyper-util", + "rustls 0.23.28", + "rustls-pki-types", + "tokio", + "tokio-rustls 0.26.2", + "tower-service", +] + +[[package]] +name = "hyper-timeout" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b90d566bffbce6a75bd8b09a05aa8c2cb1fabb6cb348f8840c9e4c90a0d83b0" +dependencies = [ + "hyper", + "hyper-util", + "pin-project-lite", + "tokio", + "tower-service", +] + [[package]] name = "hyper-tls" version = "0.6.0" @@ -1155,34 +1294,41 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.3" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" +checksum = "dc2fdfdbff08affe55bb779f33b053aa1fe5dd5b54c257343c17edfa55711bdb" dependencies = [ + "base64", "bytes", "futures-channel", + "futures-core", "futures-util", - "http", + "http 1.3.1", "http-body", "hyper", + "ipnet", + "libc", + "percent-encoding", "pin-project-lite", "socket2", + "system-configuration", "tokio", - "tower", "tower-service", "tracing", + "windows-registry", ] [[package]] name = "iana-time-zone" -version = "0.1.60" +version = "0.1.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", + "log", "wasm-bindgen", "windows-core", ] @@ -1196,6 +1342,92 @@ dependencies = [ "cc", ] +[[package]] +name = "icu_collections" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" +dependencies = [ + "displaydoc", + "potential_utf", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" + +[[package]] +name = "icu_properties" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "potential_utf", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" + +[[package]] +name = "icu_provider" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" +dependencies = [ + "displaydoc", + "icu_locale_core", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + [[package]] name = "id-arena" version = "2.2.1" @@ -1204,12 +1436,23 @@ checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005" [[package]] name = "idna" -version = "0.5.0" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "icu_normalizer", + "icu_properties", ] [[package]] @@ -1220,51 +1463,82 @@ checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown 0.12.3", - "serde", ] [[package]] name = "indexmap" -version = "2.2.6" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" dependencies = [ "equivalent", - "hashbrown 0.14.5", + "hashbrown 0.15.4", "serde", ] [[package]] name = "io-extras" -version = "0.18.2" +version = "0.18.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9f046b9af244f13b3bd939f55d16830ac3a201e8a9ba9661bfcb03e2be72b9b" +checksum = "2285ddfe3054097ef4b2fe909ef8c3bcd1ea52a8f0d274416caebeef39f04a65" dependencies = [ "io-lifetimes", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "io-lifetimes" -version = "2.0.3" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06432fb54d3be7964ecd3649233cddf80db2832f47fec34c01f65b3d9d774983" + +[[package]] +name = "ip_network" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2f047c0a98b2f299aa5d6d7088443570faae494e9ae1305e48be000c9e0eb1" + +[[package]] +name = "ip_network_table" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4099b7cfc5c5e2fe8c5edf3f6f7adf7a714c9cc697534f63a5a5da30397cb2c0" +dependencies = [ + "ip_network", + "ip_network_table-deps-treebitmap", +] + +[[package]] +name = "ip_network_table-deps-treebitmap" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a611371471e98973dbcab4e0ec66c31a10bc356eeb4d54a0e05eac8158fe38c" +checksum = "8e537132deb99c0eb4b752f0346b6a836200eaaa3516dd7e5514b63930a09e5d" [[package]] name = "ipnet" -version = "2.9.0" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" + +[[package]] +name = "iri-string" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "dbc5ebe9c3a1a7a5127f920a418f7585e9e758e911d0466ed004f393b0e380b2" +dependencies = [ + "memchr", + "serde", +] [[package]] name = "is-terminal" -version = "0.4.12" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" +checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" dependencies = [ - "hermit-abi 0.3.9", + "hermit-abi", "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1275,24 +1549,24 @@ checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" [[package]] name = "is_terminal_polyfill" -version = "1.70.0" +version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itertools" -version = "0.12.1" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" dependencies = [ "either", ] [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "ittapi" @@ -1314,21 +1588,47 @@ dependencies = [ "cc", ] +[[package]] +name = "jiff" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be1f93b8b1eb69c77f24bbb0afdf66f54b632ee39af40ca21c4365a1d7347e49" +dependencies = [ + "jiff-static", + "log", + "portable-atomic", + "portable-atomic-util", + "serde", +] + +[[package]] +name = "jiff-static" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03343451ff899767262ec32146f6d559dd759fdadf42ff0e227c7c48f72594b4" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", +] + [[package]] name = "jobserver" -version = "0.1.31" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" +checksum = "38f262f097c174adebe41eb73d66ae9c06b2844fb0da69969647bbddd9b0538a" dependencies = [ + "getrandom 0.3.3", "libc", ] [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" dependencies = [ + "once_cell", "wasm-bindgen", ] @@ -1345,9 +1645,9 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "leb128" @@ -1355,17 +1655,23 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" +[[package]] +name = "leb128fmt" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" + [[package]] name = "libc" -version = "0.2.154" +version = "0.2.174" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" +checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" [[package]] name = "libm" -version = "0.2.8" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" [[package]] name = "libredox" @@ -1373,15 +1679,16 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.5.0", + "bitflags", "libc", + "redox_syscall", ] [[package]] name = "libsqlite3-sys" -version = "0.22.2" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290b64917f8b0cb885d9de0f9959fe1f775d7fa12f1da2db9001c1c8ab60f89d" +checksum = "91632f3b4fb6bd1d72aa3d78f41ffecfcf2b1a6648d8c241dbe7dbfaf4875e15" dependencies = [ "cc", "pkg-config", @@ -1400,17 +1707,41 @@ dependencies = [ "threadpool", ] +[[package]] +name = "libtest-mimic" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5297962ef19edda4ce33aaa484386e0a5b3d7f2f4e037cbeee00503ef6b29d33" +dependencies = [ + "anstream", + "anstyle", + "clap", + "escape8259", +] + [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "linux-raw-sys" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" + +[[package]] +name = "litemap" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" [[package]] name = "log" -version = "0.4.21" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "mach2" @@ -1421,6 +1752,21 @@ dependencies = [ "libc", ] +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "matchit" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" + [[package]] name = "maybe-owned" version = "0.3.4" @@ -1429,9 +1775,9 @@ checksum = "4facc753ae494aeb6e3c22f839b158aebd4f9270f55cd3c79906c45476c47ab4" [[package]] name = "memchr" -version = "2.7.2" +version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" [[package]] name = "memfd" @@ -1439,16 +1785,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" dependencies = [ - "rustix", -] - -[[package]] -name = "memoffset" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" -dependencies = [ - "autocfg", + "rustix 0.38.44", ] [[package]] @@ -1459,22 +1796,22 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" dependencies = [ - "adler", + "adler2", ] [[package]] name = "mio" -version = "0.8.11" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" dependencies = [ "libc", - "wasi", - "windows-sys 0.48.0", + "wasi 0.11.1+wasi-snapshot-preview1", + "windows-sys 0.59.0", ] [[package]] @@ -1490,11 +1827,10 @@ dependencies = [ [[package]] name = "native-tls" -version = "0.2.11" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" dependencies = [ - "lazy_static", "libc", "log", "openssl", @@ -1507,49 +1843,65 @@ dependencies = [ ] [[package]] -name = "num_cpus" -version = "1.16.0" +name = "nu-ansi-term" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" dependencies = [ - "hermit-abi 0.3.9", - "libc", + "overload", + "winapi", ] [[package]] -name = "object" -version = "0.32.2" +name = "num-traits" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ - "memchr", + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" +dependencies = [ + "hermit-abi", + "libc", ] [[package]] name = "object" -version = "0.36.0" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "crc32fast", - "hashbrown 0.14.5", - "indexmap 2.2.6", + "hashbrown 0.15.4", + "indexmap 2.9.0", "memchr", ] [[package]] name = "once_cell" -version = "1.19.0" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" [[package]] name = "openssl" -version = "0.10.66" +version = "0.10.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" +checksum = "8505734d46c8ab1e19a1dce3aef597ad87dcb4c37e7188231769bd6bd51cebf8" dependencies = [ - "bitflags 2.5.0", + "bitflags", "cfg-if", "foreign-types", "libc", @@ -1566,20 +1918,20 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.103", ] [[package]] name = "openssl-probe" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" [[package]] name = "openssl-sys" -version = "0.9.103" +version = "0.9.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" +checksum = "90096e2e47630d78b7d1c20952dc621f957103f8bc2c8359ec81290d75238571" dependencies = [ "cc", "libc", @@ -1588,44 +1940,120 @@ dependencies = [ ] [[package]] -name = "ouroboros" -version = "0.18.3" +name = "opentelemetry" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b7be5a8a3462b752f4be3ff2b2bf2f7f1d00834902e46be2a4d68b87b0573c" +checksum = "236e667b670a5cdf90c258f5a55794ec5ac5027e960c224bff8367a59e1e6426" dependencies = [ - "aliasable", - "ouroboros_macro", - "static_assertions", + "futures-core", + "futures-sink", + "js-sys", + "pin-project-lite", + "thiserror 2.0.12", + "tracing", ] [[package]] -name = "ouroboros_macro" -version = "0.18.3" +name = "opentelemetry-appender-tracing" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b645dcde5f119c2c454a92d0dfa271a2a3b205da92e4292a68ead4bdbfde1f33" +checksum = "c513c7af3bec30113f3d4620134ff923295f1e9c580fda2b8abe0831f925ddc0" dependencies = [ - "heck 0.4.1", - "itertools", - "proc-macro2", - "proc-macro2-diagnostics", - "quote", - "syn 2.0.63", + "opentelemetry", + "tracing", + "tracing-core", + "tracing-subscriber", ] [[package]] -name = "owo-colors" -version = "4.0.0" +name = "opentelemetry-http" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caff54706df99d2a78a5a4e3455ff45448d81ef1bb63c22cd14052ca0e993a3f" +checksum = "a8863faf2910030d139fb48715ad5ff2f35029fc5f244f6d5f689ddcf4d26253" dependencies = [ - "supports-color", + "async-trait", + "bytes", + "http 1.3.1", + "opentelemetry", + "reqwest", + "tracing", ] [[package]] -name = "paste" -version = "1.0.15" +name = "opentelemetry-otlp" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bef114c6d41bea83d6dc60eb41720eedd0261a67af57b66dd2b84ac46c01d91" +dependencies = [ + "async-trait", + "futures-core", + "http 1.3.1", + "opentelemetry", + "opentelemetry-http", + "opentelemetry-proto", + "opentelemetry_sdk", + "prost", + "reqwest", + "thiserror 2.0.12", + "tokio", + "tonic", + "tracing", +] + +[[package]] +name = "opentelemetry-proto" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f8870d3024727e99212eb3bb1762ec16e255e3e6f58eeb3dc8db1aa226746d" +dependencies = [ + "opentelemetry", + "opentelemetry_sdk", + "prost", + "tonic", +] + +[[package]] +name = "opentelemetry_sdk" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +checksum = "84dfad6042089c7fc1f6118b7040dc2eb4ab520abbf410b79dc481032af39570" +dependencies = [ + "async-trait", + "futures-channel", + "futures-executor", + "futures-util", + "glob", + "opentelemetry", + "percent-encoding", + "rand", + "serde_json", + "thiserror 2.0.12", + "tokio", + "tokio-stream", + "tracing", +] + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "owo-colors" +version = "4.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26995317201fa17f3656c36716aed4a7c81743a9634ac4c99c0eeda495db0cec" +dependencies = [ + "supports-color 2.1.0", + "supports-color 3.0.2", +] [[package]] name = "percent-encoding" @@ -1635,20 +2063,20 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.10" +version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "560131c633294438da9f7c4b08189194b20946c8274c6b9e38881a7874dc8ee8" +checksum = "1db05f56d34358a8b1066f67cbb203ee3e7ed2ba674a6263a1d5ec6db2204323" dependencies = [ "memchr", - "thiserror", + "thiserror 2.0.12", "ucd-trie", ] [[package]] name = "pest_derive" -version = "2.7.10" +version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26293c9193fbca7b1a3bf9b79dc1e388e927e6cacaa78b4a3ab705a1d3d41459" +checksum = "bb056d9e8ea77922845ec74a1c4e8fb17e7c218cc4fc11a15c5d25e189aa40bc" dependencies = [ "pest", "pest_generator", @@ -1656,24 +2084,23 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.10" +version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ec22af7d3fb470a85dd2ca96b7c577a1eb4ef6f1683a9fe9a8c16e136c04687" +checksum = "87e404e638f781eb3202dc82db6760c8ae8a1eeef7fb3fa8264b2ef280504966" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.103", ] [[package]] name = "pest_meta" -version = "2.7.10" +version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a240022f37c361ec1878d646fc5b7d7c4d28d5946e1a80ad5a7a4f4ca0bdcd" +checksum = "edd1101f170f5903fde0914f899bb503d9ff5271d7ba76bbb70bea63690cc0d5" dependencies = [ - "once_cell", "pest", "sha2", ] @@ -1685,34 +2112,34 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.2.6", + "indexmap 2.9.0", ] [[package]] name = "pin-project" -version = "1.1.5" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.5" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.103", ] [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pin-utils" @@ -1722,67 +2149,132 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[package]] +name = "portable-atomic" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" + +[[package]] +name = "portable-atomic-util" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507" +dependencies = [ + "portable-atomic", +] [[package]] name = "postcard" -version = "1.0.8" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a55c51ee6c0db07e68448e336cf8ea4131a620edefebf9893e759b2d793420f8" +checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" dependencies = [ "cobs", - "embedded-io", + "embedded-io 0.4.0", + "embedded-io 0.6.1", "serde", ] +[[package]] +name = "potential_utf" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585" +dependencies = [ + "zerovec", +] + [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "prettyplease" +version = "0.2.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "6837b9e10d61f45f987d50808f83d1ee3d206c66acf650c3e4ae2e1f6ddedf55" +dependencies = [ + "proc-macro2", + "syn 2.0.103", +] [[package]] name = "proc-macro2" -version = "1.0.82" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] [[package]] -name = "proc-macro2-diagnostics" -version = "0.10.1" +name = "prost" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" +checksum = "2796faa41db3ec313a31f7624d9286acf277b52de526150b7e69f3debf891ee5" dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-derive" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d" +dependencies = [ + "anyhow", + "itertools", "proc-macro2", "quote", - "syn 2.0.63", - "version_check", - "yansi", + "syn 2.0.103", ] [[package]] name = "psm" -version = "0.1.21" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" +checksum = "6e944464ec8536cd1beb0bbfd96987eb5e3b72f2ecdafdc5c769a37f1fa2ae1f" dependencies = [ "cc", ] +[[package]] +name = "pulley-interpreter" +version = "33.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aeb99cb5a3ada8e95a246d09f5fdb609f021bf740efd3ca9bddf458e3293a6a0" +dependencies = [ + "cranelift-bitset", + "log", + "wasmtime-math", +] + [[package]] name = "quote" -version = "1.0.36" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + [[package]] name = "rand" version = "0.8.5" @@ -1810,7 +2302,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom", + "getrandom 0.2.16", ] [[package]] @@ -1835,107 +2327,150 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.4.1" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +checksum = "0d04b7d0ee6b4a0207a0a7adb104d23ecb0b47d6beae7152d0fa34b692b29fd6" dependencies = [ - "bitflags 1.3.2", + "bitflags", ] [[package]] name = "redox_users" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ - "getrandom", + "getrandom 0.2.16", "libredox", - "thiserror", + "thiserror 1.0.69", +] + +[[package]] +name = "redox_users" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd6f9d3d47bdd2ad6945c5015a226ec6155d0bcdfd8f7cd29f86b71f8de99d2b" +dependencies = [ + "getrandom 0.2.16", + "libredox", + "thiserror 2.0.12", ] [[package]] name = "regalloc2" -version = "0.9.3" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad156d539c879b7a24a363a2016d77961786e71f48f2e2fc8302a92abd2429a6" +checksum = "5216b1837de2149f8bc8e6d5f88a9326b63b8c836ed58ce4a0a29ec736a59734" dependencies = [ - "hashbrown 0.13.2", + "allocator-api2", + "bumpalo", + "hashbrown 0.15.4", "log", "rustc-hash", - "slice-group-by", "smallvec", ] [[package]] name = "regex" -version = "1.10.4" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", - "regex-automata", - "regex-syntax", + "regex-automata 0.4.9", + "regex-syntax 0.8.5", ] [[package]] name = "regex-automata" -version = "0.4.6" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-syntax 0.8.5", ] [[package]] name = "regex-syntax" -version = "0.8.3" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwest" -version = "0.12.4" +version = "0.12.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" +checksum = "eabf4c97d9130e2bf606614eb937e86edac8292eaa6f422f995d7e8de1eb1813" dependencies = [ - "base64 0.22.1", + "async-compression", + "base64", "bytes", "encoding_rs", "futures-channel", "futures-core", "futures-util", "h2", - "http", + "http 1.3.1", "http-body", "http-body-util", "hyper", + "hyper-rustls", "hyper-tls", "hyper-util", - "ipnet", "js-sys", "log", "mime", "native-tls", - "once_cell", "percent-encoding", "pin-project-lite", - "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", "tokio-native-tls", + "tokio-util", + "tower 0.5.2", + "tower-http", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", + "wasm-streams", "web-sys", - "winreg", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.16", + "libc", + "untrusted", + "windows-sys 0.52.0", ] [[package]] @@ -1953,98 +2488,188 @@ name = "router" version = "0.1.0" dependencies = [ "anyhow", - "spin-http", + "spin-http-routes", "spin-manifest", "toml", - "wit-bindgen-rt", + "wit-bindgen-rt 0.42.1", ] [[package]] name = "rusqlite" -version = "0.25.4" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c4b1eaf239b47034fb450ee9cdedd7d0226571689d8823030c4b6c2cb407152" +checksum = "3de23c3319433716cf134eed225fe9986bc24f63bed9be9f20c329029e672dc7" dependencies = [ - "bitflags 1.3.2", - "fallible-iterator 0.2.0", + "bitflags", + "fallible-iterator", "fallible-streaming-iterator", "hashlink", "libsqlite3-sys", - "memchr", "smallvec", ] [[package]] name = "rustc-demangle" -version = "0.1.24" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f" [[package]] name = "rustc-hash" -version = "1.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ - "bitflags 2.5.0", + "bitflags", + "errno", + "libc", + "linux-raw-sys 0.4.15", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustix" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" +dependencies = [ + "bitflags", "errno", - "itoa", "libc", - "linux-raw-sys", + "linux-raw-sys 0.9.4", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustix-linux-procfs" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fc84bf7e9aa16c4f2c758f27412dc9841341e16aa682d9c7ac308fe3ee12056" +dependencies = [ "once_cell", - "windows-sys 0.52.0", + "rustix 1.0.7", ] [[package]] -name = "rustls-pemfile" -version = "2.1.2" +name = "rustls" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" +checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" dependencies = [ - "base64 0.22.1", + "log", + "ring", "rustls-pki-types", + "rustls-webpki 0.102.8", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls" +version = "0.23.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7160e3e10bf4535308537f3c4e1641468cd0e485175d6163087c0393c7d46643" +dependencies = [ + "log", + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki 0.103.3", + "subtle", + "zeroize", ] [[package]] name = "rustls-pki-types" -version = "1.7.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" +checksum = "229a4a4c221013e7e1f1a043678c5cc39fe5171437c88fb47151a21e6f5b5c79" +dependencies = [ + "zeroize", +] + +[[package]] +name = "rustls-webpki" +version = "0.102.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustls-webpki" +version = "0.103.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4a72fe2bcf7a6ac6fd7d0b9e5cb68aeb7d4c0a0271730218b3e92d43b4eb435" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] [[package]] name = "rustversion" -version = "1.0.16" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "092474d1a01ea8278f69e6a358998405fae5b8b963ddaeb2b0b04a128bf1dfb0" +checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" [[package]] name = "ryu" -version = "1.0.18" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "schannel" -version = "0.1.23" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", +] + +[[package]] +name = "schemars" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615" +dependencies = [ + "dyn-clone", + "indexmap 2.9.0", + "schemars_derive", + "semver", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32e265784ad618884abaea0600a9adf15393368d840e0222d101a072f3f7534d" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.103", ] [[package]] name = "security-framework" -version = "2.11.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.5.0", + "bitflags", "core-foundation", "core-foundation-sys", "libc", @@ -2053,9 +2678,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.0" +version = "2.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" +checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" dependencies = [ "core-foundation-sys", "libc", @@ -2063,60 +2688,72 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.23" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.201" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "780f1cebed1629e4753a1a38a3c72d30b97ec044f0aef68cb26650a3c5cf363c" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.201" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", +] + +[[package]] +name = "serde_derive_internals" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5e405930b9796f1c00bee880d03fc7e0bb4b9a11afc776885ffe84320da2865" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.103", ] [[package]] name = "serde_json" -version = "1.0.117" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] [[package]] name = "serde_qs" -version = "0.12.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0431a35568651e363364210c91983c1da5eb29404d9f0928b67d4ebcfa7d330c" +checksum = "f3faaf9e727533a19351a43cc5a8de957372163c7d35cc48c90b75cdda13c352" dependencies = [ "percent-encoding", "serde", - "thiserror", + "thiserror 2.0.12", ] [[package]] name = "serde_spanned" -version = "0.6.5" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" dependencies = [ "serde", ] @@ -2135,9 +2772,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.8" +version = "0.10.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" dependencies = [ "cfg-if", "cpufeatures", @@ -2145,34 +2782,31 @@ dependencies = [ ] [[package]] -name = "shellexpand" -version = "2.1.2" +name = "sharded-slab" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ccc8076840c4da029af4f87e4e8daeb0fca6b87bbb02e10cb60b791450e11e4" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ - "dirs", + "lazy_static", ] [[package]] -name = "slab" -version = "0.4.9" +name = "shlex" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] -name = "slice-group-by" -version = "0.3.1" +name = "slab" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" +checksum = "04dc19736151f35336d325007ac991178d504a119863a2fcb3758cdb5e52c50d" [[package]] name = "smallvec" -version = "1.13.2" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" dependencies = [ "serde", ] @@ -2199,9 +2833,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.7" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" dependencies = [ "libc", "windows-sys 0.52.0", @@ -2209,17 +2843,28 @@ dependencies = [ [[package]] name = "spdx" -version = "0.10.4" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29ef1a0fa1e39ac22972c8db23ff89aea700ab96aa87114e1fb55937a631a0c9" +checksum = "58b69356da67e2fc1f542c71ea7e654a361a79c938e4424392ecf4fa065d2193" dependencies = [ "smallvec", ] +[[package]] +name = "spin-app" +version = "3.4.0-pre0" +source = "git+https://github.com/spinframework/spin?rev=1d48156da083843453ecaf627c7f976306a8210d#1d48156da083843453ecaf627c7f976306a8210d" +dependencies = [ + "anyhow", + "serde", + "serde_json", + "spin-locked-app", +] + [[package]] name = "spin-common" -version = "2.6.0-pre0" -source = "git+https://github.com/fermyon/spin#424bff5c5949ca71e73f69cb551d4104c71504a8" +version = "3.4.0-pre0" +source = "git+https://github.com/spinframework/spin?rev=1d48156da083843453ecaf627c7f976306a8210d#1d48156da083843453ecaf627c7f976306a8210d" dependencies = [ "anyhow", "dirs", @@ -2231,21 +2876,23 @@ dependencies = [ [[package]] name = "spin-componentize" -version = "2.6.0-pre0" -source = "git+https://github.com/fermyon/spin#424bff5c5949ca71e73f69cb551d4104c71504a8" +version = "3.4.0-pre0" +source = "git+https://github.com/spinframework/spin?rev=1d48156da083843453ecaf627c7f976306a8210d#1d48156da083843453ecaf627c7f976306a8210d" dependencies = [ "anyhow", - "wasm-encoder 0.200.0", - "wasmparser 0.200.0", - "wit-component 0.200.0", - "wit-parser 0.200.0", + "tracing", + "wasm-encoder 0.230.0", + "wasm-metadata 0.230.0", + "wasmparser 0.230.0", + "wit-component 0.230.0", + "wit-parser 0.230.0", ] [[package]] name = "spin-executor" -version = "3.0.1" +version = "3.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2df1a5e2cc70a628c9ea6914770c234cc4a292218091e6707ae8be68b4a5de76" +checksum = "8d11baf86ca52100e8742ea43d2c342cf4d75b94f8a85454cf44fd108cdd71d5" dependencies = [ "futures", "once_cell", @@ -2254,54 +2901,165 @@ dependencies = [ [[package]] name = "spin-expressions" -version = "2.6.0-pre0" -source = "git+https://github.com/fermyon/spin#424bff5c5949ca71e73f69cb551d4104c71504a8" +version = "3.4.0-pre0" +source = "git+https://github.com/spinframework/spin?rev=1d48156da083843453ecaf627c7f976306a8210d#1d48156da083843453ecaf627c7f976306a8210d" dependencies = [ "anyhow", "async-trait", - "dotenvy", - "once_cell", + "futures", + "spin-locked-app", + "thiserror 2.0.12", +] + +[[package]] +name = "spin-factor-outbound-http" +version = "3.4.0-pre0" +source = "git+https://github.com/spinframework/spin?rev=1d48156da083843453ecaf627c7f976306a8210d#1d48156da083843453ecaf627c7f976306a8210d" +dependencies = [ + "anyhow", + "http 1.3.1", + "http-body-util", + "hyper", + "reqwest", + "rustls 0.23.28", + "spin-factor-outbound-networking", + "spin-factors", + "spin-telemetry", + "spin-world", + "tokio", + "tokio-rustls 0.26.2", + "tracing", + "wasmtime", + "wasmtime-wasi", + "wasmtime-wasi-http", +] + +[[package]] +name = "spin-factor-outbound-networking" +version = "3.4.0-pre0" +source = "git+https://github.com/spinframework/spin?rev=1d48156da083843453ecaf627c7f976306a8210d#1d48156da083843453ecaf627c7f976306a8210d" +dependencies = [ + "anyhow", + "futures-util", + "http 1.3.1", + "ip_network", + "rustls 0.23.28", + "rustls-pki-types", "serde", + "spin-factor-variables", + "spin-factor-wasi", + "spin-factors", "spin-locked-app", - "thiserror", + "spin-manifest", + "spin-outbound-networking-config", + "spin-serde", + "tracing", + "url", + "webpki-roots 0.26.11", +] + +[[package]] +name = "spin-factor-variables" +version = "3.4.0-pre0" +source = "git+https://github.com/spinframework/spin?rev=1d48156da083843453ecaf627c7f976306a8210d#1d48156da083843453ecaf627c7f976306a8210d" +dependencies = [ + "spin-expressions", + "spin-factors", + "spin-world", + "tracing", +] + +[[package]] +name = "spin-factor-wasi" +version = "3.4.0-pre0" +source = "git+https://github.com/spinframework/spin?rev=1d48156da083843453ecaf627c7f976306a8210d#1d48156da083843453ecaf627c7f976306a8210d" +dependencies = [ + "async-trait", + "bytes", + "spin-common", + "spin-factors", + "tokio", + "wasmtime", + "wasmtime-wasi", +] + +[[package]] +name = "spin-factors" +version = "3.4.0-pre0" +source = "git+https://github.com/spinframework/spin?rev=1d48156da083843453ecaf627c7f976306a8210d#1d48156da083843453ecaf627c7f976306a8210d" +dependencies = [ + "anyhow", + "serde", + "spin-app", + "spin-factors-derive", + "thiserror 2.0.12", + "toml", + "wasmtime", +] + +[[package]] +name = "spin-factors-derive" +version = "3.4.0-pre0" +source = "git+https://github.com/spinframework/spin?rev=1d48156da083843453ecaf627c7f976306a8210d#1d48156da083843453ecaf627c7f976306a8210d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", ] [[package]] name = "spin-http" -version = "2.6.0-pre0" -source = "git+https://github.com/fermyon/spin#424bff5c5949ca71e73f69cb551d4104c71504a8" +version = "3.4.0-pre0" +source = "git+https://github.com/spinframework/spin?rev=1d48156da083843453ecaf627c7f976306a8210d#1d48156da083843453ecaf627c7f976306a8210d" dependencies = [ "anyhow", - "http", + "http 1.3.1", "http-body-util", "hyper", - "indexmap 1.9.3", + "indexmap 2.9.0", + "percent-encoding", + "routefinder", + "serde", + "spin-factor-outbound-http", + "spin-http-routes", + "tracing", + "wasmtime", + "wasmtime-wasi", + "wasmtime-wasi-http", +] + +[[package]] +name = "spin-http-routes" +version = "3.4.0-pre0" +source = "git+https://github.com/spinframework/spin?rev=1d48156da083843453ecaf627c7f976306a8210d#1d48156da083843453ecaf627c7f976306a8210d" +dependencies = [ + "anyhow", + "indexmap 2.9.0", "percent-encoding", "routefinder", "serde", - "spin-locked-app", "tracing", ] [[package]] name = "spin-locked-app" -version = "2.6.0-pre0" -source = "git+https://github.com/fermyon/spin#424bff5c5949ca71e73f69cb551d4104c71504a8" +version = "3.4.0-pre0" +source = "git+https://github.com/spinframework/spin?rev=1d48156da083843453ecaf627c7f976306a8210d#1d48156da083843453ecaf627c7f976306a8210d" dependencies = [ "anyhow", "async-trait", - "ouroboros", + "itertools", "serde", "serde_json", "spin-serde", - "thiserror", + "thiserror 2.0.12", ] [[package]] name = "spin-macro" -version = "3.0.1" +version = "3.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef3d03e5a205a641d85ace3af1604b39dba63d3ffe3865a71bda02fb482ae60a" +checksum = "988ffe27470862bf28fe9b4f0268361040d4732cd86bcaebe45aa3d3b3e3d896" dependencies = [ "anyhow", "bytes", @@ -2312,63 +3070,90 @@ dependencies = [ [[package]] name = "spin-manifest" -version = "2.6.0-pre0" -source = "git+https://github.com/fermyon/spin#424bff5c5949ca71e73f69cb551d4104c71504a8" +version = "3.4.0-pre0" +source = "git+https://github.com/spinframework/spin?rev=1d48156da083843453ecaf627c7f976306a8210d#1d48156da083843453ecaf627c7f976306a8210d" dependencies = [ "anyhow", - "indexmap 1.9.3", + "indexmap 2.9.0", + "schemars", + "semver", "serde", "spin-serde", "terminal", - "thiserror", + "thiserror 2.0.12", "toml", "url", + "wasm-pkg-common", ] [[package]] -name = "spin-outbound-networking" -version = "2.6.0-pre0" -source = "git+https://github.com/fermyon/spin#424bff5c5949ca71e73f69cb551d4104c71504a8" +name = "spin-outbound-networking-config" +version = "3.4.0-pre0" +source = "git+https://github.com/spinframework/spin?rev=1d48156da083843453ecaf627c7f976306a8210d#1d48156da083843453ecaf627c7f976306a8210d" dependencies = [ "anyhow", - "http", - "ipnet", + "futures-util", + "http 1.3.1", + "ip_network", + "ip_network_table", "spin-expressions", - "spin-locked-app", - "terminal", + "tracing", "url", "urlencoding", ] [[package]] name = "spin-sdk" -version = "3.0.1" +version = "3.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed97f54a15f2d8b1fa15e436d88bacb95a5b379a3e0f8fbd8042eb8696ca048a" +checksum = "f845e889d8431740806e04704ac5aa619466dfaef626f3c15952ecf823913e01" dependencies = [ "anyhow", "async-trait", "bytes", + "chrono", "form_urlencoded", "futures", - "http", + "http 1.3.1", "once_cell", "routefinder", "serde", "serde_json", "spin-executor", "spin-macro", - "thiserror", + "thiserror 1.0.69", "wit-bindgen 0.16.0", ] [[package]] name = "spin-serde" -version = "2.6.0-pre0" -source = "git+https://github.com/fermyon/spin#424bff5c5949ca71e73f69cb551d4104c71504a8" +version = "3.4.0-pre0" +source = "git+https://github.com/spinframework/spin?rev=1d48156da083843453ecaf627c7f976306a8210d#1d48156da083843453ecaf627c7f976306a8210d" dependencies = [ - "base64 0.21.7", + "anyhow", + "base64", + "schemars", + "semver", "serde", + "wasm-pkg-common", +] + +[[package]] +name = "spin-telemetry" +version = "3.4.0-pre0" +source = "git+https://github.com/spinframework/spin?rev=1d48156da083843453ecaf627c7f976306a8210d#1d48156da083843453ecaf627c7f976306a8210d" +dependencies = [ + "anyhow", + "http 0.2.12", + "http 1.3.1", + "opentelemetry", + "opentelemetry-appender-tracing", + "opentelemetry-otlp", + "opentelemetry_sdk", + "terminal", + "tracing", + "tracing-opentelemetry", + "tracing-subscriber", ] [[package]] @@ -2381,7 +3166,7 @@ dependencies = [ "glob", "http-body-util", "hyper", - "libtest-mimic", + "libtest-mimic 0.8.1", "log", "owo-colors", "spin-common", @@ -2394,8 +3179,8 @@ dependencies = [ "wac-graph", "wasmtime", "wasmtime-wasi", - "wit-component 0.211.1", - "wit-parser 0.211.1", + "wit-component 0.235.0", + "wit-parser 0.235.0", ] [[package]] @@ -2415,7 +3200,7 @@ name = "spin-test-sdk" version = "0.1.0" dependencies = [ "spin-test-sdk-macro", - "wit-bindgen 0.26.0", + "wit-bindgen 0.42.1", ] [[package]] @@ -2425,9 +3210,9 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.63", - "wit-component 0.211.1", - "wit-parser 0.211.1", + "syn 2.0.103", + "wit-component 0.235.0", + "wit-parser 0.235.0", ] [[package]] @@ -2442,10 +3227,19 @@ dependencies = [ "spin-expressions", "spin-locked-app", "spin-manifest", - "spin-outbound-networking", + "spin-outbound-networking-config", "spin-serde", "toml", - "wit-bindgen-rt", + "wit-bindgen-rt 0.42.1", +] + +[[package]] +name = "spin-world" +version = "3.4.0-pre0" +source = "git+https://github.com/spinframework/spin?rev=1d48156da083843453ecaf627c7f976306a8210d#1d48156da083843453ecaf627c7f976306a8210d" +dependencies = [ + "async-trait", + "wasmtime", ] [[package]] @@ -2472,6 +3266,12 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + [[package]] name = "supports-color" version = "2.1.0" @@ -2482,6 +3282,15 @@ dependencies = [ "is_ci", ] +[[package]] +name = "supports-color" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c64fc7232dd8d2e4ac5ce4ef302b1d81e0b80d055b9d77c7c4f51f6aa4c867d6" +dependencies = [ + "is_ci", +] + [[package]] name = "syn" version = "1.0.109" @@ -2495,9 +3304,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.63" +version = "2.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf5be731623ca1a1fb7d8be6f261a3be6d3e2337b8a1f97be944d020c8fcb704" +checksum = "e4307e30089d6fd6aff212f2da3a1f9e32f3223b1f010fb09b7c95f90f3ca1e8" dependencies = [ "proc-macro2", "quote", @@ -2506,26 +3315,40 @@ dependencies = [ [[package]] name = "sync_wrapper" -version = "0.1.2" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", +] [[package]] name = "system-configuration" -version = "0.5.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ - "bitflags 1.3.2", + "bitflags", "core-foundation", "system-configuration-sys", ] [[package]] name = "system-configuration-sys" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" dependencies = [ "core-foundation-sys", "libc", @@ -2533,25 +3356,25 @@ dependencies = [ [[package]] name = "system-interface" -version = "0.27.2" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b858526d22750088a9b3cf2e3c2aacebd5377f13adeec02860c30d09113010a6" +checksum = "cc4592f674ce18521c2a81483873a49596655b179f71c5e05d10c1fe66c78745" dependencies = [ - "bitflags 2.5.0", + "bitflags", "cap-fs-ext", "cap-std", "fd-lock", "io-lifetimes", - "rustix", - "windows-sys 0.52.0", + "rustix 0.38.44", + "windows-sys 0.59.0", "winx", ] [[package]] name = "tar" -version = "0.4.40" +version = "0.4.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" +checksum = "1d863878d212c87a19c1a610eb53bb01fe12951c0501cf5a0d65f724914a667a" dependencies = [ "filetime", "libc", @@ -2560,26 +3383,27 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.14" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" +checksum = "e502f78cdbb8ba4718f566c418c52bc729126ffd16baee5baa718cf25dd5a69a" [[package]] name = "temp-dir" -version = "0.1.13" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f227968ec00f0e5322f9b8173c7a0cbcff6181a0a5b28e9892491c286277231" +checksum = "83176759e9416cf81ee66cb6508dbfe9c96f20b8b56265a39917551c23c70964" [[package]] name = "tempfile" -version = "3.10.1" +version = "3.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" dependencies = [ - "cfg-if", "fastrand", - "rustix", - "windows-sys 0.52.0", + "getrandom 0.3.3", + "once_cell", + "rustix 1.0.7", + "windows-sys 0.59.0", ] [[package]] @@ -2593,11 +3417,9 @@ dependencies = [ [[package]] name = "terminal" -version = "2.6.0-pre0" -source = "git+https://github.com/fermyon/spin#424bff5c5949ca71e73f69cb551d4104c71504a8" +version = "3.4.0-pre0" +source = "git+https://github.com/spinframework/spin?rev=1d48156da083843453ecaf627c7f976306a8210d#1d48156da083843453ecaf627c7f976306a8210d" dependencies = [ - "atty", - "once_cell", "termcolor", ] @@ -2616,22 +3438,51 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.60" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl 2.0.12", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "579e9083ca58dd9dcf91a9923bb9054071b9ebbd800b342194c9feb0ee89fc18" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ - "thiserror-impl", + "proc-macro2", + "quote", + "syn 2.0.103", ] [[package]] name = "thiserror-impl" -version = "1.0.60" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2470041c06ec3ac1ab38d0356a6119054dedaea53e12fbefc0de730a1c08524" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.103", +] + +[[package]] +name = "thread_local" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" +dependencies = [ + "cfg-if", ] [[package]] @@ -2644,34 +3495,40 @@ dependencies = [ ] [[package]] -name = "tinyvec" -version = "1.6.0" +name = "tinystr" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" dependencies = [ - "tinyvec_macros", + "displaydoc", + "zerovec", ] -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - [[package]] name = "tokio" -version = "1.37.0" +version = "1.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +checksum = "75ef51a33ef1da925cea3e4eb122833cb377c61439ca401b770f54902b806779" dependencies = [ "backtrace", "bytes", "libc", "mio", - "num_cpus", "pin-project-lite", "socket2", - "windows-sys 0.48.0", + "tokio-macros", + "windows-sys 0.52.0", +] + +[[package]] +name = "tokio-macros" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", ] [[package]] @@ -2684,11 +3541,43 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-rustls" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" +dependencies = [ + "rustls 0.22.4", + "rustls-pki-types", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b" +dependencies = [ + "rustls 0.23.28", + "tokio", +] + +[[package]] +name = "tokio-stream" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + [[package]] name = "tokio-util" -version = "0.7.11" +version = "0.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +checksum = "66a539a9ad6d5d281510d5bd368c973d636c02dbf8a67300bfb6b950696ad7df" dependencies = [ "bytes", "futures-core", @@ -2699,11 +3588,11 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.12" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" +checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.9.0", "serde", "serde_spanned", "toml_datetime", @@ -2712,26 +3601,69 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.22.12" +version = "0.22.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3328d4f68a705b2a4498da1d580585d39a6510f98318a2cec3018a7ec61ddef" +checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.9.0", "serde", "serde_spanned", "toml_datetime", + "toml_write", "winnow", ] +[[package]] +name = "toml_write" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" + +[[package]] +name = "tonic" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877c5b330756d856ffcc4553ab34a5684481ade925ecc54bcd1bf02b1d0d4d52" +dependencies = [ + "async-stream", + "async-trait", + "axum", + "base64", + "bytes", + "h2", + "http 1.3.1", + "http-body", + "http-body-util", + "hyper", + "hyper-timeout", + "hyper-util", + "percent-encoding", + "pin-project", + "prost", + "socket2", + "tokio", + "tokio-stream", + "tower 0.4.13", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "topological-sort" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea68304e134ecd095ac6c3574494fc62b909f416c4fca77e440530221e549d3d" + [[package]] name = "tower" version = "0.4.13" @@ -2740,31 +3672,68 @@ checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" dependencies = [ "futures-core", "futures-util", + "indexmap 1.9.3", "pin-project", "pin-project-lite", + "rand", + "slab", "tokio", + "tokio-util", "tower-layer", "tower-service", "tracing", ] +[[package]] +name = "tower" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-http" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adc82fd73de2a9722ac5da747f12383d2bfdb93591ee6c58486e0097890f05f2" +dependencies = [ + "bitflags", + "bytes", + "futures-util", + "http 1.3.1", + "http-body", + "iri-string", + "pin-project-lite", + "tower 0.5.2", + "tower-layer", + "tower-service", +] + [[package]] name = "tower-layer" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "log", "pin-project-lite", @@ -2774,86 +3743,136 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.103", ] [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" dependencies = [ "once_cell", + "valuable", ] [[package]] -name = "try-lock" -version = "0.2.5" +name = "tracing-opentelemetry" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +checksum = "721f2d2569dce9f3dfbbddee5906941e953bfcdf736a62da3377f5751650cc36" +dependencies = [ + "js-sys", + "once_cell", + "opentelemetry", + "opentelemetry_sdk", + "smallvec", + "tracing", + "tracing-core", + "tracing-subscriber", + "web-time", +] [[package]] -name = "typenum" -version = "1.17.0" +name = "tracing-serde" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +checksum = "704b1aeb7be0d0a84fc9828cae51dab5970fee5088f83d1dd7ee6f6246fc6ff1" +dependencies = [ + "serde", + "tracing-core", +] [[package]] -name = "ucd-trie" -version = "0.1.6" +name = "tracing-subscriber" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "serde", + "serde_json", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-serde", +] + +[[package]] +name = "trait-variant" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70977707304198400eb4835a78f6a9f928bf41bba420deb8fdb175cd965d77a7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", +] + +[[package]] +name = "try-lock" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] -name = "unicode-bidi" -version = "0.3.15" +name = "typenum" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" [[package]] -name = "unicode-ident" -version = "1.0.12" +name = "ucd-trie" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" [[package]] -name = "unicode-normalization" -version = "0.1.23" +name = "unicode-ident" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" -dependencies = [ - "tinyvec", -] +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "unicode-segmentation" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" [[package]] name = "unicode-width" -version = "0.1.12" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" +checksum = "4a1a07cc7db3810833284e8d372ccdc6da29741639ecc70c9ec107df0fa6154c" [[package]] name = "unicode-xid" -version = "0.2.4" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "untrusted" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.0" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", "idna", @@ -2866,17 +3885,33 @@ version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.8.0" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cf4199d1e5d15ddd86a694e4d0dffa9c323ce759fea589f00fef9d81cc1931d" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "valuable" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" [[package]] name = "vcpkg" @@ -2886,41 +3921,41 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "wac-graph" -version = "0.3.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d726a22b5a7ab4c10e17c3851440a7ce4ae3fa073d9456f48b46167ed50995ab" +checksum = "1dcc86eda3243819bb0b8cd37ec1ac3c104e8dd3a63303efaae3f598a325b11c" dependencies = [ "anyhow", "id-arena", - "indexmap 2.2.6", + "indexmap 2.9.0", "log", "petgraph", "semver", - "thiserror", + "thiserror 1.0.69", "wac-types", - "wasm-encoder 0.202.0", - "wasm-metadata 0.202.0", - "wasmparser 0.202.0", + "wasm-encoder 0.229.0", + "wasm-metadata 0.229.0", + "wasmparser 0.229.0", ] [[package]] name = "wac-types" -version = "0.3.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd72bacccdcb7c90168c1075215a1f9fd62f59d98e0e9e3c9a73bf5f4d3f94d5" +checksum = "271949d040a6b9a20bda4942bad2c85fb10636a9e86d10fda8092b3dd9467f7c" dependencies = [ "anyhow", "id-arena", - "indexmap 2.2.6", + "indexmap 2.9.0", "semver", - "wasm-encoder 0.202.0", - "wasmparser 0.202.0", + "wasm-encoder 0.229.0", + "wasmparser 0.229.0", ] [[package]] @@ -2934,52 +3969,63 @@ dependencies = [ [[package]] name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasi" +version = "0.14.2+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +dependencies = [ + "wit-bindgen-rt 0.39.0", +] [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" dependencies = [ "cfg-if", + "once_cell", + "rustversion", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" dependencies = [ "bumpalo", "log", - "once_cell", "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.103", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.42" +version = "0.4.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" dependencies = [ "cfg-if", "js-sys", + "once_cell", "wasm-bindgen", "web-sys", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2987,22 +4033,25 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.103", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] [[package]] name = "wasm-encoder" @@ -3024,39 +4073,32 @@ dependencies = [ [[package]] name = "wasm-encoder" -version = "0.200.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e3fb0c8fbddd78aa6095b850dfeedbc7506cf5f81e633f69cf8f2333ab84b9" -dependencies = [ - "leb128", -] - -[[package]] -name = "wasm-encoder" -version = "0.202.0" +version = "0.229.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfd106365a7f5f7aa3c1916a98cbb3ad477f5ff96ddb130285a91c6e7429e67a" +checksum = "38ba1d491ecacb085a2552025c10a675a6fddcbd03b1fc9b36c536010ce265d2" dependencies = [ - "leb128", + "leb128fmt", + "wasmparser 0.229.0", ] [[package]] name = "wasm-encoder" -version = "0.209.1" +version = "0.230.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b4a05336882dae732ce6bd48b7e11fe597293cb72c13da4f35d7d5f8d53b2a7" +checksum = "d4349d0943718e6e434b51b9639e876293093dca4b96384fb136ab5bd5ce6660" dependencies = [ - "leb128", + "leb128fmt", + "wasmparser 0.230.0", ] [[package]] name = "wasm-encoder" -version = "0.211.1" +version = "0.235.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e7d931a1120ef357f32b74547646b6fa68ea25e377772b72874b131a9ed70d4" +checksum = "b3bc393c395cb621367ff02d854179882b9a351b4e0c93d1397e6090b53a5c2a" dependencies = [ - "leb128", - "wasmparser 0.211.1", + "leb128fmt", + "wasmparser 0.235.0", ] [[package]] @@ -3066,7 +4108,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "18ebaa7bd0f9e7a5e5dd29b9a998acf21c4abed74265524dd7e85934597bfb10" dependencies = [ "anyhow", - "indexmap 2.2.6", + "indexmap 2.9.0", "serde", "serde_derive", "serde_json", @@ -3077,66 +4119,82 @@ dependencies = [ [[package]] name = "wasm-metadata" -version = "0.200.0" +version = "0.229.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b8cc0c21f46d55b0aaa419cacce1eadcf28eaebd0e1488d6a6313ee71a586" +checksum = "78fdb7d29a79191ab363dc90c1ddd3a1e880ffd5348d92d48482393a9e6c5f4d" dependencies = [ "anyhow", - "indexmap 2.2.6", + "auditable-serde", + "flate2", + "indexmap 2.9.0", "serde", "serde_derive", "serde_json", "spdx", - "wasm-encoder 0.200.0", - "wasmparser 0.200.0", + "url", + "wasm-encoder 0.229.0", + "wasmparser 0.229.0", ] [[package]] name = "wasm-metadata" -version = "0.202.0" +version = "0.230.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "094aea3cb90e09f16ee25a4c0e324b3e8c934e7fd838bfa039aef5352f44a917" +checksum = "1a52e010df5494f4289ccc68ce0c2a8c17555225a5e55cc41b98f5ea28d0844b" dependencies = [ "anyhow", - "indexmap 2.2.6", + "auditable-serde", + "flate2", + "indexmap 2.9.0", "serde", "serde_derive", "serde_json", "spdx", - "wasm-encoder 0.202.0", - "wasmparser 0.202.0", + "url", + "wasm-encoder 0.230.0", + "wasmparser 0.230.0", ] [[package]] name = "wasm-metadata" -version = "0.209.1" +version = "0.235.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d32029ce424f6d3c2b39b4419fb45a0e2d84fb0751e0c0a32b7ce8bd5d97f46" +checksum = "b055604ba04189d54b8c0ab2c2fc98848f208e103882d5c0b984f045d5ea4d20" dependencies = [ "anyhow", - "indexmap 2.2.6", - "serde", - "serde_derive", - "serde_json", - "spdx", - "wasm-encoder 0.209.1", - "wasmparser 0.209.1", + "indexmap 2.9.0", + "wasm-encoder 0.235.0", + "wasmparser 0.235.0", ] [[package]] -name = "wasm-metadata" -version = "0.211.1" +name = "wasm-pkg-common" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f56bad1c68558c44e7f60be865117dc9d8c3a066bcf3b2232cb9a9858965fd5" +checksum = "7cab484707abc3826aaab22f19e0b73ec27114b3d14bc9fc7dadcd35f101438f" dependencies = [ "anyhow", - "indexmap 2.2.6", + "bytes", + "futures-util", + "http 1.3.1", + "semver", "serde", - "serde_derive", "serde_json", - "spdx", - "wasm-encoder 0.211.1", - "wasmparser 0.211.1", + "sha2", + "thiserror 1.0.69", +] + +[[package]] +name = "wasm-streams" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", ] [[package]] @@ -3152,7 +4210,7 @@ version = "0.118.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77f1154f1ab868e2a01d9834a805faca7bf8b50d041b4ca714d005d0dab1c50c" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.9.0", "semver", ] @@ -3162,101 +4220,90 @@ version = "0.121.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9dbe55c8f9d0dbd25d9447a5a889ff90c0cc3feaa7395310d3d826b2c703eaab" dependencies = [ - "bitflags 2.5.0", - "indexmap 2.2.6", - "semver", -] - -[[package]] -name = "wasmparser" -version = "0.200.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a03f65ac876612140c57ff6c3b8fe4990067cce97c2cfdb07368a3cc3354b062" -dependencies = [ - "bitflags 2.5.0", - "indexmap 2.2.6", + "bitflags", + "indexmap 2.9.0", "semver", ] [[package]] name = "wasmparser" -version = "0.202.0" +version = "0.229.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6998515d3cf3f8b980ef7c11b29a9b1017d4cf86b99ae93b546992df9931413" +checksum = "0cc3b1f053f5d41aa55640a1fa9b6d1b8a9e4418d118ce308d20e24ff3575a8c" dependencies = [ - "bitflags 2.5.0", - "indexmap 2.2.6", + "bitflags", + "hashbrown 0.15.4", + "indexmap 2.9.0", "semver", + "serde", ] [[package]] name = "wasmparser" -version = "0.209.1" +version = "0.230.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07035cc9a9b41e62d3bb3a3815a66ab87c993c06fe1cf6b2a3f2a18499d937db" +checksum = "808198a69b5a0535583370a51d459baa14261dfab04800c4864ee9e1a14346ed" dependencies = [ - "ahash 0.8.11", - "bitflags 2.5.0", - "hashbrown 0.14.5", - "indexmap 2.2.6", + "bitflags", + "hashbrown 0.15.4", + "indexmap 2.9.0", "semver", "serde", ] [[package]] name = "wasmparser" -version = "0.211.1" +version = "0.235.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3189cc8a91f547390e2f043ca3b3e3fe0892f7d581767fd4e4b7f3dc3fe8e561" +checksum = "161296c618fa2d63f6ed5fffd1112937e803cb9ec71b32b01a76321555660917" dependencies = [ - "ahash 0.8.11", - "bitflags 2.5.0", - "hashbrown 0.14.5", - "indexmap 2.2.6", + "bitflags", + "hashbrown 0.15.4", + "indexmap 2.9.0", "semver", ] [[package]] name = "wasmprinter" -version = "0.209.1" +version = "0.229.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceca8ae6eaa8c7c87b33c25c53bdf299f8c2a764aee1179402ff7652ef3a6859" +checksum = "d25dac01892684a99b8fbfaf670eb6b56edea8a096438c75392daeb83156ae2e" dependencies = [ "anyhow", - "wasmparser 0.209.1", + "termcolor", + "wasmparser 0.229.0", ] [[package]] name = "wasmtime" -version = "22.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "786d8b5e7a4d54917c5ebe555b9667337e5f93383f49bddaaeec2eba68093b45" +checksum = "15396de4fce22e431aa913a9d17325665e72a39aaa7972c8aeae7507eff6144f" dependencies = [ "addr2line", "anyhow", "async-trait", + "bitflags", "bumpalo", "cc", "cfg-if", "encoding_rs", "fxprof-processed-profile", "gimli", - "hashbrown 0.14.5", - "indexmap 2.2.6", + "hashbrown 0.15.4", + "indexmap 2.9.0", "ittapi", "libc", - "libm", "log", "mach2", "memfd", - "memoffset", - "object 0.36.0", + "object", "once_cell", - "paste", "postcard", "psm", + "pulley-interpreter", "rayon", - "rustix", + "rustix 1.0.7", "semver", "serde", "serde_derive", @@ -3264,8 +4311,9 @@ dependencies = [ "smallvec", "sptr", "target-lexicon", - "wasm-encoder 0.209.1", - "wasmparser 0.209.1", + "trait-variant", + "wasm-encoder 0.229.0", + "wasmparser 0.229.0", "wasmtime-asm-macros", "wasmtime-cache", "wasmtime-component-macro", @@ -3275,68 +4323,69 @@ dependencies = [ "wasmtime-fiber", "wasmtime-jit-debug", "wasmtime-jit-icache-coherence", + "wasmtime-math", "wasmtime-slab", "wasmtime-versioned-export-macros", "wasmtime-winch", "wat", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "wasmtime-asm-macros" -version = "22.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d697d99c341d4a9ffb72f3af7a02124d233eeb59aee010f36d88e97cca553d5e" +checksum = "c8d13b1a25d9b77ce42b4641a797e8c0bde0643b9ad5aaa36ce7e00cf373ffab" dependencies = [ "cfg-if", ] [[package]] name = "wasmtime-cache" -version = "22.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "916610f9ae9a6c22deb25bba2e6247ba9f00b093d30620875203b91328a1adfa" +checksum = "dfc77a5e7d358c0180745021735de789e0d8d64a9eb740d54cee525a164f0343" dependencies = [ "anyhow", - "base64 0.21.7", + "base64", "directories-next", "log", "postcard", - "rustix", + "rustix 1.0.7", "serde", "serde_derive", "sha2", "toml", - "windows-sys 0.52.0", + "windows-sys 0.59.0", "zstd", ] [[package]] name = "wasmtime-component-macro" -version = "22.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b29b462b068e73b5b27fae092a27f47e5937cabf6b26be2779c978698a52feca" +checksum = "be73f1c13b25cf7c062ea2f3aba8a92abe4284a14b49e866e4962824802da5cf" dependencies = [ "anyhow", "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.103", "wasmtime-component-util", "wasmtime-wit-bindgen", - "wit-parser 0.209.1", + "wit-parser 0.229.0", ] [[package]] name = "wasmtime-component-util" -version = "22.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d2912c53d9054984b380dfbd7579f9c3681b2a73b903a56bd71a1c4f175f1e" +checksum = "1cba282555a9f2443f4e40e415772ea98acabbc341e9b3b905f541ff304cbc5e" [[package]] name = "wasmtime-cranelift" -version = "22.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3975deafea000457ba84355c7c0fce0372937204f77026510b7b454f28a3a65" +checksum = "a0c2c2e083dc4c119cca61cc42ca6b3711b75ed9823f77b684ee009c74f939d8" dependencies = [ "anyhow", "cfg-if", @@ -3345,120 +4394,120 @@ dependencies = [ "cranelift-entity", "cranelift-frontend", "cranelift-native", - "cranelift-wasm", "gimli", + "itertools", "log", - "object 0.36.0", + "object", + "pulley-interpreter", + "smallvec", "target-lexicon", - "thiserror", - "wasmparser 0.209.1", + "thiserror 2.0.12", + "wasmparser 0.229.0", "wasmtime-environ", "wasmtime-versioned-export-macros", ] [[package]] name = "wasmtime-environ" -version = "22.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f444e900e848b884d8a8a2949b6f5b92af642a3e663ff8fbe78731143a55be61" +checksum = "357542664493b1359727f235b615ae74f63bd46aa4d0c587b09e3b060eb0b8ef" dependencies = [ "anyhow", "cpp_demangle", + "cranelift-bitset", "cranelift-entity", "gimli", - "indexmap 2.2.6", + "indexmap 2.9.0", "log", - "object 0.36.0", + "object", "postcard", "rustc-demangle", + "semver", "serde", "serde_derive", + "smallvec", "target-lexicon", - "wasm-encoder 0.209.1", - "wasmparser 0.209.1", + "wasm-encoder 0.229.0", + "wasmparser 0.229.0", "wasmprinter", "wasmtime-component-util", - "wasmtime-types", ] [[package]] name = "wasmtime-fiber" -version = "22.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ded58eb2d1bf0dcd2182d0ccd7055c4b10b50d711514f1d73f61515d0fa829d" +checksum = "d83e697b13d6ae9eff31edac86673aabaf8dbf20267f2aa20e831dd01da480a3" dependencies = [ "anyhow", "cc", "cfg-if", - "rustix", + "rustix 1.0.7", "wasmtime-asm-macros", "wasmtime-versioned-export-macros", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "wasmtime-jit-debug" -version = "22.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bc54198c6720f098210a85efb3ba8c078d1de4d373cdb6778850a66ae088d11" +checksum = "6748fe974240d45e6bb25ac8e9a600be36f77347253cbbb35bd2d72e01ff0ece" dependencies = [ - "object 0.36.0", - "once_cell", - "rustix", + "cc", + "object", + "rustix 1.0.7", "wasmtime-versioned-export-macros", ] [[package]] name = "wasmtime-jit-icache-coherence" -version = "22.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5afe2f0499542f9a4bcfa1b55bfdda803b6ade4e7c93c6b99e0f39dba44b0a91" +checksum = "175e924dbc944c185808466d1e90b5a7feb610f3b9abdfe26f8ee25fd1086d1c" dependencies = [ "anyhow", "cfg-if", "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] -name = "wasmtime-slab" -version = "22.0.0" +name = "wasmtime-math" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a7de1f2bec5bbb35d532e61c85c049dc84ae671df60492f90b954ecf21169e7" +checksum = "0d9448adcd9c5980c0eac1630794bd1be3cf573c28d0630f7d3184405b36bcfe" +dependencies = [ + "libm", +] [[package]] -name = "wasmtime-types" -version = "22.0.0" +name = "wasmtime-slab" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "412463e9000e14cf6856be48628d2213c20c153e29ffc22b036980c892ea6964" -dependencies = [ - "cranelift-entity", - "serde", - "serde_derive", - "smallvec", - "wasmparser 0.209.1", -] +checksum = "b50f7c227d6a925d9dfd0fbfdbf06877cb2fe387bb3248049706b19b5f86e560" [[package]] name = "wasmtime-versioned-export-macros" -version = "22.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de5a9bc4f44ceeb168e9e8e3be4e0b4beb9095b468479663a9e24c667e36826f" +checksum = "55b39ffeda28be925babb2d45067d8ba2c67d2227328c5364d23b4152eba9950" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.103", ] [[package]] name = "wasmtime-wasi" -version = "22.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8abb1301089ed8e0b4840f539cba316a73ac382090f1b25d22d8c8eed8df49c7" +checksum = "1d357e5699ed32103d0dab897c3965fd66f1ba29a37072d441199e7febe6324e" dependencies = [ "anyhow", "async-trait", - "bitflags 2.5.0", + "bitflags", "bytes", "cap-fs-ext", "cap-net-ext", @@ -3469,30 +4518,66 @@ dependencies = [ "futures", "io-extras", "io-lifetimes", - "once_cell", - "rustix", + "rustix 1.0.7", "system-interface", - "thiserror", + "thiserror 2.0.12", "tokio", "tracing", "url", "wasmtime", + "wasmtime-wasi-io", "wiggle", - "windows-sys 0.52.0", + "windows-sys 0.59.0", +] + +[[package]] +name = "wasmtime-wasi-http" +version = "33.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7db9276689904ae7ed4359253d120015ec20cd14fc4c311db2f10a87576c44ab" +dependencies = [ + "anyhow", + "async-trait", + "bytes", + "futures", + "http 1.3.1", + "http-body", + "http-body-util", + "hyper", + "rustls 0.22.4", + "tokio", + "tokio-rustls 0.25.0", + "tracing", + "wasmtime", + "wasmtime-wasi", + "webpki-roots 0.26.11", +] + +[[package]] +name = "wasmtime-wasi-io" +version = "33.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43418871afd46c188231e4d822d375c0660c7a1484db3f7f247e552186e971a2" +dependencies = [ + "anyhow", + "async-trait", + "bytes", + "futures", + "wasmtime", ] [[package]] name = "wasmtime-winch" -version = "22.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed4db238a0241df2d15f79ad17b3a37a27f2ea6cb885894d81b42ae107544466" +checksum = "1f180e6a8c0724608cd2d55ceb7d03ed3a729ca78fcd34a6756f36cf9a5fd546" dependencies = [ "anyhow", "cranelift-codegen", "gimli", - "object 0.36.0", + "object", "target-lexicon", - "wasmparser 0.209.1", + "wasmparser 0.229.0", "wasmtime-cranelift", "wasmtime-environ", "winch-codegen", @@ -3500,14 +4585,14 @@ dependencies = [ [[package]] name = "wasmtime-wit-bindgen" -version = "22.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc077306b38288262e5ba01d4b21532a6987416cdc0aedf04bb06c22a68fdc" +checksum = "6f8d793a398e2974d562e65c8d366f39a942fe1ce7970244d9d6e5f96f29b534" dependencies = [ "anyhow", - "heck 0.4.1", - "indexmap 2.2.6", - "wit-parser 0.209.1", + "heck 0.5.0", + "indexmap 2.9.0", + "wit-parser 0.229.0", ] [[package]] @@ -3521,46 +4606,74 @@ dependencies = [ [[package]] name = "wast" -version = "211.0.1" +version = "235.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b25506dd82d00da6b14a87436b3d52b1d264083fa79cdb72a0d1b04a8595ccaa" +checksum = "1eda4293f626c99021bb3a6fbe4fbbe90c0e31a5ace89b5f620af8925de72e13" dependencies = [ "bumpalo", - "leb128", + "leb128fmt", "memchr", "unicode-width", - "wasm-encoder 0.211.1", + "wasm-encoder 0.235.0", ] [[package]] name = "wat" -version = "1.211.1" +version = "1.235.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb716ca6c86eecac2d82541ffc39860118fc0af9309c4f2670637bea2e1bdd7d" +checksum = "e777e0327115793cb96ab220b98f85327ec3d11f34ec9e8d723264522ef206aa" dependencies = [ - "wast 211.0.1", + "wast 235.0.0", ] [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" dependencies = [ "js-sys", "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9" +dependencies = [ + "webpki-roots 1.0.0", +] + +[[package]] +name = "webpki-roots" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2853738d1cc4f2da3a225c18ec6c3721abb31961096e9dbf5ab35fa88b19cfdb" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "wiggle" -version = "22.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29830e5d01c182d24b94092c697aa7ab0ee97d22e78a2bf40ca91eae6ebca5c2" +checksum = "73aed697b5eb6a5726dca57f85199f73c61dee669e58faab71086eb7eda6b077" dependencies = [ "anyhow", "async-trait", - "bitflags 2.5.0", - "thiserror", + "bitflags", + "thiserror 2.0.12", "tracing", "wasmtime", "wiggle-macro", @@ -3568,28 +4681,27 @@ dependencies = [ [[package]] name = "wiggle-generate" -version = "22.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "557567f2793508760cd855f7659b7a0b9dc4dbc451f53f1415d6943a15311ade" +checksum = "d477015cda1d476b7e45d50eeb93d9038df8f24827007669065292651b26d225" dependencies = [ "anyhow", - "heck 0.4.1", + "heck 0.5.0", "proc-macro2", "quote", - "shellexpand", - "syn 2.0.63", + "syn 2.0.103", "witx", ] [[package]] name = "wiggle-macro" -version = "22.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc26129a8aea20b62c961d1b9ab4a3c3b56b10042ed85d004f8678af0f21ba6e" +checksum = "71ac603ee46847d2e3c142ba715d326f1045155c7758f4e8dd001d5f92810c12" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.103", "wiggle-generate", ] @@ -3611,11 +4723,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -3626,37 +4738,91 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "winch-codegen" -version = "0.20.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c6915884e731b2db0d8cf08cb64474cb69221a161675fd3c135f91febc3daa" +checksum = "ad3072bf7c270d5e29a3d69744c81665dd3adb6e60f123925393a1c150bf9ec4" dependencies = [ "anyhow", + "cranelift-assembler-x64", "cranelift-codegen", "gimli", "regalloc2", "smallvec", "target-lexicon", - "wasmparser 0.209.1", + "thiserror 2.0.12", + "wasmparser 0.229.0", "wasmtime-cranelift", "wasmtime-environ", ] [[package]] name = "windows-core" -version = "0.52.0" +version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" dependencies = [ - "windows-targets 0.52.5", + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", ] [[package]] -name = "windows-sys" -version = "0.48.0" +name = "windows-implement" +version = "0.60.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", +] + +[[package]] +name = "windows-interface" +version = "0.59.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", +] + +[[package]] +name = "windows-link" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" + +[[package]] +name = "windows-registry" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +checksum = "b3bab093bdd303a1240bb99b8aba8ea8a69ee19d34c9e2ef9594e708a4878820" dependencies = [ - "windows-targets 0.48.5", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-result" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +dependencies = [ + "windows-link", ] [[package]] @@ -3665,157 +4831,172 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.2", ] [[package]] name = "windows-targets" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] name = "windows-targets" -version = "0.52.5" +version = "0.53.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef" dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" [[package]] name = "windows_aarch64_msvc" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_aarch64_msvc" -version = "0.52.5" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" [[package]] name = "windows_i686_gnu" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnu" -version = "0.52.5" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" [[package]] name = "windows_i686_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" [[package]] name = "windows_i686_msvc" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" [[package]] name = "windows_x86_64_gnu" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnu" -version = "0.52.5" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" [[package]] name = "windows_x86_64_msvc" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" [[package]] name = "winnow" -version = "0.6.8" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c52e9c97a68071b23e836c9380edae937f17b9c4667bd021973efc689f618d" +checksum = "74c7b26e3480b707944fc872477815d29a8e429d2f93a1ce000f5fa84a15cbcd" dependencies = [ "memchr", ] -[[package]] -name = "winreg" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - [[package]] name = "winx" -version = "0.36.3" +version = "0.36.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9643b83820c0cd246ecabe5fa454dd04ba4fa67996369466d0747472d337346" +checksum = "3f3fd376f71958b862e7afb20cfe5a22830e1963462f3a17f49d82a6c1d1f42d" dependencies = [ - "bitflags 2.5.0", - "windows-sys 0.52.0", + "bitflags", + "windows-sys 0.59.0", ] [[package]] @@ -3824,18 +5005,18 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b76f1d099678b4f69402a421e888bbe71bf20320c2f3f3565d0e7484dbe5bc20" dependencies = [ - "bitflags 2.5.0", + "bitflags", "wit-bindgen-rust-macro 0.16.0", ] [[package]] name = "wit-bindgen" -version = "0.26.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a84376ff4f74ed07674a1157c0bd19e6627ab01fc90952a27ccefb52a24530f0" +checksum = "fa5b79cd8cb4b27a9be3619090c03cbb87fe7b1c6de254b4c9b4477188828af8" dependencies = [ - "wit-bindgen-rt", - "wit-bindgen-rust-macro 0.26.0", + "wit-bindgen-rt 0.42.1", + "wit-bindgen-rust-macro 0.42.1", ] [[package]] @@ -3851,22 +5032,33 @@ dependencies = [ [[package]] name = "wit-bindgen-core" -version = "0.26.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36d4706efb67fadfbbde77955b299b111dd096e6776d8c6561d92f6147941880" +checksum = "e35e550f614e16db196e051d22b0d4c94dd6f52c90cb1016240f71b9db332631" dependencies = [ "anyhow", "heck 0.5.0", - "wit-parser 0.209.1", + "wit-parser 0.230.0", +] + +[[package]] +name = "wit-bindgen-rt" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +dependencies = [ + "bitflags", ] [[package]] name = "wit-bindgen-rt" -version = "0.26.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c7526379ace8709ee9ab9f2bb50f112d95581063a59ef3097d9c10153886c9" +checksum = "051105bab12bc78e161f8dfb3596e772dd6a01ebf9c4840988e00347e744966a" dependencies = [ - "bitflags 2.5.0", + "bitflags", + "futures", + "once_cell", ] [[package]] @@ -3884,16 +5076,18 @@ dependencies = [ [[package]] name = "wit-bindgen-rust" -version = "0.26.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514295193d1a2f42e6a948cd7d9fd81e2b8fadc319667dcf19fd7aceaf2113a2" +checksum = "cb1e0a91fc85f4ef70e0b81cd86c2b49539d3cd14766fd82396184aadf8cb7d7" dependencies = [ "anyhow", "heck 0.5.0", - "indexmap 2.2.6", - "wasm-metadata 0.209.1", - "wit-bindgen-core 0.26.0", - "wit-component 0.209.1", + "indexmap 2.9.0", + "prettyplease", + "syn 2.0.103", + "wasm-metadata 0.230.0", + "wit-bindgen-core 0.42.1", + "wit-component 0.230.0", ] [[package]] @@ -3905,7 +5099,7 @@ dependencies = [ "anyhow", "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.103", "wit-bindgen-core 0.16.0", "wit-bindgen-rust 0.16.0", "wit-component 0.18.2", @@ -3913,16 +5107,17 @@ dependencies = [ [[package]] name = "wit-bindgen-rust-macro" -version = "0.26.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0409a3356ca02599aff78f717968fd7f12df4bf879f325e2a97b45c84c90fff" +checksum = "ce69f52c5737705881d5da5a1dd06f47f8098d094a8d65a3e44292942edb571f" dependencies = [ "anyhow", + "prettyplease", "proc-macro2", "quote", - "syn 2.0.63", - "wit-bindgen-core 0.26.0", - "wit-bindgen-rust 0.26.0", + "syn 2.0.103", + "wit-bindgen-core 0.42.1", + "wit-bindgen-rust 0.42.1", ] [[package]] @@ -3932,8 +5127,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b8a35a2a9992898c9d27f1664001860595a4bc99d32dd3599d547412e17d7e2" dependencies = [ "anyhow", - "bitflags 2.5.0", - "indexmap 2.2.6", + "bitflags", + "indexmap 2.9.0", "log", "serde", "serde_derive", @@ -3946,59 +5141,40 @@ dependencies = [ [[package]] name = "wit-component" -version = "0.200.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39979723340baea490b87b11b2abae05f149d86f2b55c18d41d78a2a2b284c16" -dependencies = [ - "anyhow", - "bitflags 2.5.0", - "indexmap 2.2.6", - "log", - "serde", - "serde_derive", - "serde_json", - "wasm-encoder 0.200.0", - "wasm-metadata 0.200.0", - "wasmparser 0.200.0", - "wit-parser 0.200.0", -] - -[[package]] -name = "wit-component" -version = "0.209.1" +version = "0.230.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a2bb5b039f9cb03425e1d5a6e54b441ca4ca1b1d4fa6a0924db67a55168f99" +checksum = "b607b15ead6d0e87f5d1613b4f18c04d4e80ceeada5ffa608d8360e6909881df" dependencies = [ "anyhow", - "bitflags 2.5.0", - "indexmap 2.2.6", + "bitflags", + "indexmap 2.9.0", "log", "serde", "serde_derive", "serde_json", - "wasm-encoder 0.209.1", - "wasm-metadata 0.209.1", - "wasmparser 0.209.1", - "wit-parser 0.209.1", + "wasm-encoder 0.230.0", + "wasm-metadata 0.230.0", + "wasmparser 0.230.0", + "wit-parser 0.230.0", ] [[package]] name = "wit-component" -version = "0.211.1" +version = "0.235.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "079a38b7d679867424bf2bcbdd553a2acf364525307e43dfb910fa4a2c6fd9f2" +checksum = "64a57a11109cc553396f89f3a38a158a97d0b1adaec113bd73e0f64d30fb601f" dependencies = [ "anyhow", - "bitflags 2.5.0", - "indexmap 2.2.6", + "bitflags", + "indexmap 2.9.0", "log", "serde", "serde_derive", "serde_json", - "wasm-encoder 0.211.1", - "wasm-metadata 0.211.1", - "wasmparser 0.211.1", - "wit-parser 0.211.1", + "wasm-encoder 0.235.0", + "wasm-metadata 0.235.0", + "wasmparser 0.235.0", + "wit-parser 0.235.0", ] [[package]] @@ -4009,7 +5185,7 @@ checksum = "316b36a9f0005f5aa4b03c39bc3728d045df136f8c13a73b7db4510dec725e08" dependencies = [ "anyhow", "id-arena", - "indexmap 2.2.6", + "indexmap 2.9.0", "log", "semver", "serde", @@ -4020,56 +5196,56 @@ dependencies = [ [[package]] name = "wit-parser" -version = "0.200.0" +version = "0.229.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f717576b37f01c15696bda7f6f13868367b9c5913485f9f0ec8e59fd28c8e13" +checksum = "459c6ba62bf511d6b5f2a845a2a736822e38059c1cfa0b644b467bbbfae4efa6" dependencies = [ "anyhow", "id-arena", - "indexmap 2.2.6", + "indexmap 2.9.0", "log", "semver", "serde", "serde_derive", "serde_json", "unicode-xid", - "wasmparser 0.200.0", + "wasmparser 0.229.0", ] [[package]] name = "wit-parser" -version = "0.209.1" +version = "0.230.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e79b9e3c0b6bb589dec46317e645851e0db2734c44e2be5e251b03ff4a51269" +checksum = "679fde5556495f98079a8e6b9ef8c887f731addaffa3d48194075c1dd5cd611b" dependencies = [ "anyhow", "id-arena", - "indexmap 2.2.6", + "indexmap 2.9.0", "log", "semver", "serde", "serde_derive", "serde_json", "unicode-xid", - "wasmparser 0.209.1", + "wasmparser 0.230.0", ] [[package]] name = "wit-parser" -version = "0.211.1" +version = "0.235.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3cc90c50c7ec8a824b5d2cddddff13b2dc12b7a96bf8684d11474223c2ea22f" +checksum = "0a1f95a87d03a33e259af286b857a95911eb46236a0f726cbaec1227b3dfc67a" dependencies = [ "anyhow", "id-arena", - "indexmap 2.2.6", + "indexmap 2.9.0", "log", "semver", "serde", "serde_derive", "serde_json", "unicode-xid", - "wasmparser 0.211.1", + "wasmparser 0.235.0", ] [[package]] @@ -4080,70 +5256,153 @@ checksum = "e366f27a5cabcddb2706a78296a40b8fcc451e1a6aba2fc1d94b4a01bdaaef4b" dependencies = [ "anyhow", "log", - "thiserror", + "thiserror 1.0.69", "wast 35.0.2", ] +[[package]] +name = "writeable" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" + [[package]] name = "xattr" -version = "1.3.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" +checksum = "0d65cbf2f12c15564212d48f4e3dfb87923d25d611f2aed18f4cb23f0413d89e" dependencies = [ "libc", - "linux-raw-sys", - "rustix", + "rustix 1.0.7", ] [[package]] -name = "yansi" -version = "1.0.1" +name = "yoke" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" +checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", + "synstructure", +] [[package]] name = "zerocopy" -version = "0.7.34" +version = "0.8.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.34" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", +] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" + +[[package]] +name = "zerotrie" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a05eb080e015ba39cc9e23bbe5e7fb04d5fb040350f99f34e338d5fdd294428" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" +checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.103", ] [[package]] name = "zstd" -version = "0.13.1" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d789b1514203a1120ad2429eae43a7bd32b90976a7bb8a05f7ec02fa88cc23a" +checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a" dependencies = [ "zstd-safe", ] [[package]] name = "zstd-safe" -version = "7.1.0" +version = "7.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd99b45c6bc03a018c8b8a86025678c87e55526064e38f9df301989dce7ec0a" +checksum = "8f49c4d5f0abb602a93fb8736af2a4f4dd9512e36f7f570d66e65ff867ed3b9d" dependencies = [ "zstd-sys", ] [[package]] name = "zstd-sys" -version = "2.0.10+zstd.1.5.6" +version = "2.0.15+zstd.1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" +checksum = "eb81183ddd97d0c74cedf1d50d85c8d08c1b8b68ee863bdee9e706eedba1a237" dependencies = [ "cc", "pkg-config", diff --git a/Cargo.toml b/Cargo.toml index eb23695..09a98ab 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,21 +8,21 @@ anyhow = { workspace = true } clap = { version = "4.5", features = ["derive"] } env_logger = "0.11" glob = "0.3" -http-body-util = "0.1.1" +http-body-util = "0.1" hyper = "1.0" -libtest-mimic = "0.7" +libtest-mimic = "0.8" log = "0.4" -owo-colors = { version = "4.0.0", features = ["supports-colors"] } -spin-common = { git = "https://github.com/fermyon/spin" } -spin-componentize = { git = "https://github.com/fermyon/spin" } -spin-http = { git = "https://github.com/fermyon/spin", default-features = false } +owo-colors = { version = "4", features = ["supports-colors"] } +spin-common = { git = "https://github.com/spinframework/spin", rev = "1d48156da083843453ecaf627c7f976306a8210d" } +spin-componentize = { git = "https://github.com/spinframework/spin", rev = "1d48156da083843453ecaf627c7f976306a8210d" } +spin-http = { git = "https://github.com/spinframework/spin", default-features = false, rev = "1d48156da083843453ecaf627c7f976306a8210d" } spin-manifest = { workspace = true } -temp-dir = "0.1.13" +temp-dir = "0.1.16" tokio = "1.0" toml = { workspace = true } -wac-graph = "0.3" -wasmtime = "22.0" -wasmtime-wasi = "22.0" +wac-graph = "0.7" +wasmtime = "33.0" +wasmtime-wasi = "33.0" wit-component = { workspace = true } wit-parser = { workspace = true } @@ -36,11 +36,11 @@ members = [ [workspace.dependencies] anyhow = "1.0" -spin-expressions = { git = "https://github.com/fermyon/spin" } -spin-manifest = { git = "https://github.com/fermyon/spin" } -spin-outbound-networking = { git = "https://github.com/fermyon/spin" } -spin-serde = { git = "https://github.com/fermyon/spin" } +spin-expressions = { git = "https://github.com/spinframework/spin", rev = "1d48156da083843453ecaf627c7f976306a8210d" } +spin-manifest = { git = "https://github.com/spinframework/spin", rev = "1d48156da083843453ecaf627c7f976306a8210d" } +spin-factor-outbound-networking = { git = "https://github.com/spinframework/spin", rev = "1d48156da083843453ecaf627c7f976306a8210d" } +spin-serde = { git = "https://github.com/spinframework/spin", rev = "1d48156da083843453ecaf627c7f976306a8210d" } toml = { version = "0.8", features = ["preserve_order"] } -wit-bindgen-rt = { version = "0.26", features = ["bitflags"] } -wit-component = "0.211" -wit-parser = "0.211" +wit-bindgen-rt = { version = "0.42", features = ["bitflags"] } +wit-component = "0.235" +wit-parser = "0.235" diff --git a/README.md b/README.md index 4e803ba..168c1a2 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Before using `spin-test`, make sure you've [installed Spin](https://developer.fe To install `spin-test` as a Spin plugin, run the following: ``` -spin plugin install -u https://github.com/fermyon/spin-test/releases/download/canary/spin-test.json +spin plugin install -u https://github.com/spinframework/spin-test/releases/download/canary/spin-test.json ``` This will install the plugin which can be invoked with `spin test`. @@ -28,13 +28,13 @@ To install a version of `spin-test` plugin that has been locally built using `ca spin pluginify -i ``` -Note: the [`pluginify`](https://github.com/fermyon/spin-plugins/blob/main/manifests/pluginify/pluginify.json) plugin is a pre-requisite. +Note: the [`pluginify`](https://github.com/spinframework/spin-plugins/blob/main/manifests/pluginify/pluginify.json) plugin is a pre-requisite. ### Or install `spin-test` (stand alone) Alternatively, to install `spin-test` as a stand alone binary, run `cargo build --release` from this directory and ensure that the resulting binary is located on your path. -If you'd rather not build from source, you can find a pre-built binary inside the plugin tarballs included in [any release](https://github.com/fermyon/spin-test/releases). In the latest stable release or in the canary release, find the tarball asset corresponding to the appropriate machine architecture, download the tarball, unarchive it, and retrieve the `test` binary inside it. Place this binary somewhere on your path as `spin-test` and invoke by running `spin-test`. +If you'd rather not build from source, you can find a pre-built binary inside the plugin tarballs included in [any release](https://github.com/spinframework/spin-test/releases). In the latest stable release or in the canary release, find the tarball asset corresponding to the appropriate machine architecture, download the tarball, unarchive it, and retrieve the `test` binary inside it. Place this binary somewhere on your path as `spin-test` and invoke by running `spin-test`. ### Create a Spin App @@ -55,7 +55,7 @@ Next, we'll need to tell `spin-test` where our test lives and how to build it. W ```toml [component.my-component.tool.spin-test] # A relative path to where the built test component binary will live. -source = "target/wasm32-wasi/release/test.wasm" +source = "target/wasm32-wasip1/release/test.wasm" # A command for building the target component. build = "cargo component build --release" # The directory where the `build` command should be run. diff --git a/build.rs b/build.rs index 59b99b2..bfb3d7d 100644 --- a/build.rs +++ b/build.rs @@ -34,8 +34,17 @@ fn ensure_wasi_sdk() -> Vec<(&'static str, String)> { clang_path.display() ); } + let wasi_sysroot = format!("{}/{}", wasi_sdk_path_string, "share/wasi-sysroot"); + if !std::path::Path::new(&wasi_sysroot).exists() { + panic!( + "WASI_SDK_PATH is set to a path that does not contain share/wasi-sysroot: {}", + wasi_sysroot + ); + } + vec![ ("WASI_SDK_PATH", wasi_sdk_path_string), + ("CC", format!("{clang_path_string} --sysroot={wasi_sysroot}")), ("CC_wasm32_wasi", clang_path_string), ("LIBSQLITE3_FLAGS", "-DSQLITE_OS_OTHER -USQLITE_TEMP_STORE -DSQLITE_TEMP_STORE=3 -USQLITE_THREADSAFE -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOCALTIME -DSQLITE_OMIT_LOAD_EXTENSION -DLONGDOUBLE_TYPE=double".to_string()), @@ -68,7 +77,7 @@ fn cargo_component_build<'a>( "--target", match target { Target::Wasm32UnknownUnknown => "wasm32-unknown-unknown", - Target::Wasm32Wasi => "wasm32-wasi", + Target::Wasm32Wasi => "wasm32-wasip1", }, "--release", "--target-dir", @@ -98,11 +107,7 @@ fn run<'a, 'b>( cmd.arg("-c"); cmd.envs(env); - let c = args - .into_iter() - .map(Into::into) - .collect::>() - .join(" "); + let c = args.into_iter().collect::>().join(" "); cmd.arg(&c); (c, cmd.output().unwrap()) diff --git a/conformance-tests/Cargo.toml b/conformance-tests/Cargo.toml index a6ba1d9..7fece51 100644 --- a/conformance-tests/Cargo.toml +++ b/conformance-tests/Cargo.toml @@ -8,5 +8,5 @@ anyhow = "1.0" conformance-tests = { git = "https://github.com/fermyon/conformance-tests", rev = "387b7f375df59e6254a7c29cf4a53507a9f46d32" } test-environment = { git = "https://github.com/fermyon/conformance-tests", rev = "387b7f375df59e6254a7c29cf4a53507a9f46d32" } spin-test = { path = ".." } -wasmtime = "22.0" -wasmtime-wasi = "22.0" +wasmtime = "33.0" +wasmtime-wasi = "33.0" diff --git a/conformance-tests/src/main.rs b/conformance-tests/src/main.rs index 4f4bc25..06c4a6e 100644 --- a/conformance-tests/src/main.rs +++ b/conformance-tests/src/main.rs @@ -57,13 +57,15 @@ fn substitution(key: &str, value: &str) -> Option { struct StoreData { manifest: String, - ctx: wasmtime_wasi::WasiCtx, + ctx: wasmtime_wasi::p2::WasiCtx, table: wasmtime::component::ResourceTable, } impl StoreData { fn new(manifest: String) -> Self { - let ctx = wasmtime_wasi::WasiCtxBuilder::new().inherit_stdio().build(); + let ctx = wasmtime_wasi::p2::WasiCtxBuilder::new() + .inherit_stdio() + .build(); let table = wasmtime::component::ResourceTable::default(); Self { manifest, @@ -73,12 +75,14 @@ impl StoreData { } } -impl wasmtime_wasi::WasiView for StoreData { - fn table(&mut self) -> &mut wasmtime_wasi::ResourceTable { +impl wasmtime_wasi::p2::IoView for StoreData { + fn table(&mut self) -> &mut wasmtime::component::ResourceTable { &mut self.table } +} - fn ctx(&mut self) -> &mut wasmtime_wasi::WasiCtx { +impl wasmtime_wasi::p2::WasiView for StoreData { + fn ctx(&mut self) -> &mut wasmtime_wasi::p2::WasiCtx { &mut self.ctx } } diff --git a/conformance-tests/src/runtime.rs b/conformance-tests/src/runtime.rs index 7864eb8..2f70f36 100644 --- a/conformance-tests/src/runtime.rs +++ b/conformance-tests/src/runtime.rs @@ -16,8 +16,8 @@ mod bindings { world: "virtualized-app", path: "../host-wit", with: { - "wasi:io": wasmtime_wasi::bindings::io, - "wasi:clocks": wasmtime_wasi::bindings::clocks, + "wasi:io": wasmtime_wasi::p2::bindings::io, + "wasi:clocks": wasmtime_wasi::p2::bindings::clocks, } }); } @@ -33,7 +33,7 @@ pub(crate) struct SpinTest { impl SpinTest { pub fn new(manifest: String, component_path: PathBuf) -> anyhow::Result { let mut engine_config = wasmtime::Config::new(); - engine_config.cache_config_load_default()?; + engine_config.cache(Some(wasmtime::Cache::new(wasmtime::CacheConfig::new())?)); let engine = wasmtime::Engine::new(&engine_config)?; let mut store = wasmtime::Store::new(&engine, super::StoreData::new(manifest)); @@ -42,10 +42,10 @@ impl SpinTest { let component = spin_test::virtualize_app(component).context("failed to virtualize app")?; let component = wasmtime::component::Component::new(&engine, component)?; - wasmtime_wasi::add_to_linker_sync(&mut linker)?; + wasmtime_wasi::p2::add_to_linker_sync(&mut linker)?; bindings::VirtualizedApp::add_to_linker(&mut linker, |x| x)?; - let (instance, _) = bindings::VirtualizedApp::instantiate(&mut store, &component, &linker)?; + let instance = bindings::VirtualizedApp::instantiate(&mut store, &component, &linker)?; Ok(Self { instance, store }) } @@ -349,7 +349,7 @@ struct IncomingBody<'a> { resource: wasmtime::component::ResourceAny, } -impl<'a> IncomingBody<'a> { +impl IncomingBody<'_> { fn stream( &self, store: &mut wasmtime::Store, @@ -369,7 +369,7 @@ struct InputStream<'a> { resource: wasmtime::component::ResourceAny, } -impl<'a> InputStream<'a> { +impl InputStream<'_> { fn blocking_read( &self, store: &mut wasmtime::Store, @@ -388,7 +388,7 @@ struct OutgoingBody<'a> { resource: wasmtime::component::ResourceAny, } -impl<'a> OutgoingBody<'a> { +impl OutgoingBody<'_> { fn write(&self, store: &mut wasmtime::Store) -> anyhow::Result> { let stream = match self.guest.call_write(store, self.resource)? { Ok(s) => s, @@ -406,7 +406,7 @@ struct OutputStream<'a> { resource: wasmtime::component::ResourceAny, } -impl<'a> OutputStream<'a> { +impl OutputStream<'_> { fn blocking_write_and_flush( &self, store: &mut wasmtime::Store, diff --git a/crates/router/Cargo.toml b/crates/router/Cargo.toml index f43e35b..c51e839 100644 --- a/crates/router/Cargo.toml +++ b/crates/router/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" [dependencies] anyhow = { workspace = true } -spin-http = { git = "https://github.com/fermyon/spin", default-features = false } +spin-http-routes = { git = "https://github.com/spinframework/spin", rev = "1d48156da083843453ecaf627c7f976306a8210d" } spin-manifest = { workspace = true } toml = { workspace = true } wit-bindgen-rt = { workspace = true } diff --git a/crates/router/src/bindings.rs b/crates/router/src/bindings.rs index f79061c..1e5cd69 100644 --- a/crates/router/src/bindings.rs +++ b/crates/router/src/bindings.rs @@ -1,53 +1,57 @@ -// Generated by `wit-bindgen` 0.25.0. DO NOT EDIT! +// Generated by `wit-bindgen` 0.41.0. DO NOT EDIT! // Options used: +// * runtime_path: "wit_bindgen_rt" pub type OutgoingRequest = wasi::http::types::OutgoingRequest; pub type IncomingRequest = wasi::http::types::IncomingRequest; pub type IncomingBody = wasi::http::types::IncomingBody; #[allow(unused_unsafe, clippy::all)] pub fn get_manifest() -> _rt::String { unsafe { - #[repr(align(4))] - struct RetArea([::core::mem::MaybeUninit; 8]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct RetArea( + [::core::mem::MaybeUninit; 2 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 2 * ::core::mem::size_of::<*const u8>()], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "$root")] - extern "C" { + unsafe extern "C" { #[link_name = "get-manifest"] - fn wit_import(_: *mut u8); + fn wit_import1(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: *mut u8) { + unsafe extern "C" fn wit_import1(_: *mut u8) { unreachable!() } - wit_import(ptr0); - let l1 = *ptr0.add(0).cast::<*mut u8>(); - let l2 = *ptr0.add(4).cast::(); - let len3 = l2; - let bytes3 = _rt::Vec::from_raw_parts(l1.cast(), len3, len3); - _rt::string_lift(bytes3) + unsafe { wit_import1(ptr0) }; + let l2 = *ptr0.add(0).cast::<*mut u8>(); + let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::(); + let len4 = l3; + let bytes4 = _rt::Vec::from_raw_parts(l2.cast(), len4, len4); + let result5 = _rt::string_lift(bytes4); + result5 } } #[allow(unused_unsafe, clippy::all)] -pub fn set_component_id(component_id: &str) { +pub fn set_component_id(component_id: &str) -> () { unsafe { let vec0 = component_id; let ptr0 = vec0.as_ptr().cast::(); let len0 = vec0.len(); - #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "$root")] - extern "C" { + unsafe extern "C" { #[link_name = "set-component-id"] - fn wit_import(_: *mut u8, _: usize); + fn wit_import1(_: *mut u8, _: usize); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: *mut u8, _: usize) { + unsafe extern "C" fn wit_import1(_: *mut u8, _: usize) { unreachable!() } - wit_import(ptr0.cast_mut(), len0); + unsafe { wit_import1(ptr0.cast_mut(), len0) }; } } #[allow(unused_unsafe, clippy::all)] @@ -63,60 +67,69 @@ pub fn new_request( }; #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "$root")] - extern "C" { + unsafe extern "C" { #[link_name = "new-request"] - fn wit_import(_: i32, _: i32, _: i32) -> i32; + fn wit_import1(_: i32, _: i32, _: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: i32, _: i32) -> i32 { + unsafe extern "C" fn wit_import1(_: i32, _: i32, _: i32) -> i32 { unreachable!() } - let ret = wit_import((&request).take_handle() as i32, result0_0, result0_1); - wasi::http::types::IncomingRequest::from_handle(ret as u32) + let ret = unsafe { + wit_import1((&request).take_handle() as i32, result0_0, result0_1) + }; + unsafe { wasi::http::types::IncomingRequest::from_handle(ret as u32) } } } -#[allow(dead_code)] +#[rustfmt::skip] +#[allow(dead_code, clippy::all)] pub mod wasi { - #[allow(dead_code)] pub mod cli { - #[allow(dead_code, clippy::all)] + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod stdout { #[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; pub type OutputStream = super::super::super::wasi::io::streams::OutputStream; #[allow(unused_unsafe, clippy::all)] pub fn get_stdout() -> OutputStream { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:cli/stdout@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "get-stdout"] - fn wit_import() -> i32; + fn wit_import0() -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import() -> i32 { + unsafe extern "C" fn wit_import0() -> i32 { unreachable!() } - let ret = wit_import(); - super::super::super::wasi::io::streams::OutputStream::from_handle(ret as u32) + let ret = unsafe { wit_import0() }; + unsafe { + super::super::super::wasi::io::streams::OutputStream::from_handle( + ret as u32, + ) + } } } } } - #[allow(dead_code)] pub mod clocks { - #[allow(dead_code, clippy::all)] + /// WASI Monotonic Clock is a clock API intended to let users measure elapsed + /// time. + /// + /// It is intended to be portable at least between Unix-family platforms and + /// Windows. + /// + /// A monotonic clock is a clock which has an unspecified initial value, and + /// successive reads of the clock will produce non-decreasing values. + /// + /// It is intended for measuring elapsed time. + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod monotonic_clock { #[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; /// An instant in time, in nanoseconds. An instant is relative to an @@ -134,16 +147,15 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:clocks/monotonic-clock@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "now"] - fn wit_import() -> i64; + fn wit_import0() -> i64; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import() -> i64 { + unsafe extern "C" fn wit_import0() -> i64 { unreachable!() } - let ret = wit_import(); + let ret = unsafe { wit_import0() }; ret as u64 } } @@ -154,16 +166,15 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:clocks/monotonic-clock@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "resolution"] - fn wit_import() -> i64; + fn wit_import0() -> i64; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import() -> i64 { + unsafe extern "C" fn wit_import0() -> i64 { unreachable!() } - let ret = wit_import(); + let ret = unsafe { wit_import0() }; ret as u64 } } @@ -174,17 +185,20 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:clocks/monotonic-clock@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "subscribe-instant"] - fn wit_import(_: i64) -> i32; + fn wit_import0(_: i64) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i64) -> i32 { + unsafe extern "C" fn wit_import0(_: i64) -> i32 { unreachable!() } - let ret = wit_import(_rt::as_i64(when)); - super::super::super::wasi::io::poll::Pollable::from_handle(ret as u32) + let ret = unsafe { wit_import0(_rt::as_i64(when)) }; + unsafe { + super::super::super::wasi::io::poll::Pollable::from_handle( + ret as u32, + ) + } } } #[allow(unused_unsafe, clippy::all)] @@ -195,30 +209,33 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:clocks/monotonic-clock@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "subscribe-duration"] - fn wit_import(_: i64) -> i32; + fn wit_import0(_: i64) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i64) -> i32 { + unsafe extern "C" fn wit_import0(_: i64) -> i32 { unreachable!() } - let ret = wit_import(_rt::as_i64(when)); - super::super::super::wasi::io::poll::Pollable::from_handle(ret as u32) + let ret = unsafe { wit_import0(_rt::as_i64(when)) }; + unsafe { + super::super::super::wasi::io::poll::Pollable::from_handle( + ret as u32, + ) + } } } } } - #[allow(dead_code)] pub mod http { - #[allow(dead_code, clippy::all)] + /// This interface defines all of the types and methods for implementing + /// HTTP Requests and Responses, both incoming and outgoing, as well as + /// their headers, trailers, and bodies. + #[allow(dead_code, async_fn_in_trait, unused_imports, 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 Duration = super::super::super::wasi::clocks::monotonic_clock::Duration; pub type InputStream = super::super::super::wasi::io::streams::InputStream; @@ -240,7 +257,10 @@ pub mod wasi { Other(_rt::String), } impl ::core::fmt::Debug for Method { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { Method::Get => f.debug_tuple("Method::Get").finish(), Method::Head => f.debug_tuple("Method::Head").finish(), @@ -251,7 +271,9 @@ pub mod wasi { Method::Options => f.debug_tuple("Method::Options").finish(), Method::Trace => f.debug_tuple("Method::Trace").finish(), Method::Patch => f.debug_tuple("Method::Patch").finish(), - Method::Other(e) => f.debug_tuple("Method::Other").field(e).finish(), + Method::Other(e) => { + f.debug_tuple("Method::Other").field(e).finish() + } } } } @@ -263,11 +285,16 @@ pub mod wasi { Other(_rt::String), } impl ::core::fmt::Debug for Scheme { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { Scheme::Http => f.debug_tuple("Scheme::Http").finish(), Scheme::Https => f.debug_tuple("Scheme::Https").finish(), - Scheme::Other(e) => f.debug_tuple("Scheme::Other").field(e).finish(), + Scheme::Other(e) => { + f.debug_tuple("Scheme::Other").field(e).finish() + } } } } @@ -278,7 +305,10 @@ pub mod wasi { pub info_code: Option, } impl ::core::fmt::Debug for DnsErrorPayload { - 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("DnsErrorPayload") .field("rcode", &self.rcode) .field("info-code", &self.info_code) @@ -292,7 +322,10 @@ pub mod wasi { pub alert_message: Option<_rt::String>, } impl ::core::fmt::Debug for TlsAlertReceivedPayload { - 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("TlsAlertReceivedPayload") .field("alert-id", &self.alert_id) .field("alert-message", &self.alert_message) @@ -306,7 +339,10 @@ pub mod wasi { pub field_size: Option, } impl ::core::fmt::Debug for FieldSizePayload { - 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("FieldSizePayload") .field("field-name", &self.field_name) .field("field-size", &self.field_size) @@ -314,7 +350,7 @@ pub mod wasi { } } /// These cases are inspired by the IANA HTTP Proxy Error Types: - /// https://www.iana.org/assignments/http-proxy-status/http-proxy-status.xhtml#table-http-proxy-error-types + /// https://www.iana.org/assignments/http-proxy-status/http-proxy-status.xhtml#table-http-proxy-error-types #[derive(Clone)] pub enum ErrorCode { DnsTimeout, @@ -363,9 +399,14 @@ pub mod wasi { InternalError(Option<_rt::String>), } impl ::core::fmt::Debug for ErrorCode { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { - ErrorCode::DnsTimeout => f.debug_tuple("ErrorCode::DnsTimeout").finish(), + ErrorCode::DnsTimeout => { + f.debug_tuple("ErrorCode::DnsTimeout").finish() + } ErrorCode::DnsError(e) => { f.debug_tuple("ErrorCode::DnsError").field(e).finish() } @@ -405,76 +446,90 @@ pub mod wasi { ErrorCode::TlsCertificateError => { f.debug_tuple("ErrorCode::TlsCertificateError").finish() } - ErrorCode::TlsAlertReceived(e) => f - .debug_tuple("ErrorCode::TlsAlertReceived") - .field(e) - .finish(), + ErrorCode::TlsAlertReceived(e) => { + f.debug_tuple("ErrorCode::TlsAlertReceived") + .field(e) + .finish() + } ErrorCode::HttpRequestDenied => { f.debug_tuple("ErrorCode::HttpRequestDenied").finish() } - ErrorCode::HttpRequestLengthRequired => f - .debug_tuple("ErrorCode::HttpRequestLengthRequired") - .finish(), - ErrorCode::HttpRequestBodySize(e) => f - .debug_tuple("ErrorCode::HttpRequestBodySize") - .field(e) - .finish(), - ErrorCode::HttpRequestMethodInvalid => f - .debug_tuple("ErrorCode::HttpRequestMethodInvalid") - .finish(), + ErrorCode::HttpRequestLengthRequired => { + f.debug_tuple("ErrorCode::HttpRequestLengthRequired") + .finish() + } + ErrorCode::HttpRequestBodySize(e) => { + f.debug_tuple("ErrorCode::HttpRequestBodySize") + .field(e) + .finish() + } + ErrorCode::HttpRequestMethodInvalid => { + f.debug_tuple("ErrorCode::HttpRequestMethodInvalid").finish() + } ErrorCode::HttpRequestUriInvalid => { f.debug_tuple("ErrorCode::HttpRequestUriInvalid").finish() } ErrorCode::HttpRequestUriTooLong => { f.debug_tuple("ErrorCode::HttpRequestUriTooLong").finish() } - ErrorCode::HttpRequestHeaderSectionSize(e) => f - .debug_tuple("ErrorCode::HttpRequestHeaderSectionSize") - .field(e) - .finish(), - ErrorCode::HttpRequestHeaderSize(e) => f - .debug_tuple("ErrorCode::HttpRequestHeaderSize") - .field(e) - .finish(), - ErrorCode::HttpRequestTrailerSectionSize(e) => f - .debug_tuple("ErrorCode::HttpRequestTrailerSectionSize") - .field(e) - .finish(), - ErrorCode::HttpRequestTrailerSize(e) => f - .debug_tuple("ErrorCode::HttpRequestTrailerSize") - .field(e) - .finish(), + ErrorCode::HttpRequestHeaderSectionSize(e) => { + f.debug_tuple("ErrorCode::HttpRequestHeaderSectionSize") + .field(e) + .finish() + } + ErrorCode::HttpRequestHeaderSize(e) => { + f.debug_tuple("ErrorCode::HttpRequestHeaderSize") + .field(e) + .finish() + } + ErrorCode::HttpRequestTrailerSectionSize(e) => { + f.debug_tuple("ErrorCode::HttpRequestTrailerSectionSize") + .field(e) + .finish() + } + ErrorCode::HttpRequestTrailerSize(e) => { + f.debug_tuple("ErrorCode::HttpRequestTrailerSize") + .field(e) + .finish() + } ErrorCode::HttpResponseIncomplete => { f.debug_tuple("ErrorCode::HttpResponseIncomplete").finish() } - ErrorCode::HttpResponseHeaderSectionSize(e) => f - .debug_tuple("ErrorCode::HttpResponseHeaderSectionSize") - .field(e) - .finish(), - ErrorCode::HttpResponseHeaderSize(e) => f - .debug_tuple("ErrorCode::HttpResponseHeaderSize") - .field(e) - .finish(), - ErrorCode::HttpResponseBodySize(e) => f - .debug_tuple("ErrorCode::HttpResponseBodySize") - .field(e) - .finish(), - ErrorCode::HttpResponseTrailerSectionSize(e) => f - .debug_tuple("ErrorCode::HttpResponseTrailerSectionSize") - .field(e) - .finish(), - ErrorCode::HttpResponseTrailerSize(e) => f - .debug_tuple("ErrorCode::HttpResponseTrailerSize") - .field(e) - .finish(), - ErrorCode::HttpResponseTransferCoding(e) => f - .debug_tuple("ErrorCode::HttpResponseTransferCoding") - .field(e) - .finish(), - ErrorCode::HttpResponseContentCoding(e) => f - .debug_tuple("ErrorCode::HttpResponseContentCoding") - .field(e) - .finish(), + ErrorCode::HttpResponseHeaderSectionSize(e) => { + f.debug_tuple("ErrorCode::HttpResponseHeaderSectionSize") + .field(e) + .finish() + } + ErrorCode::HttpResponseHeaderSize(e) => { + f.debug_tuple("ErrorCode::HttpResponseHeaderSize") + .field(e) + .finish() + } + ErrorCode::HttpResponseBodySize(e) => { + f.debug_tuple("ErrorCode::HttpResponseBodySize") + .field(e) + .finish() + } + ErrorCode::HttpResponseTrailerSectionSize(e) => { + f.debug_tuple("ErrorCode::HttpResponseTrailerSectionSize") + .field(e) + .finish() + } + ErrorCode::HttpResponseTrailerSize(e) => { + f.debug_tuple("ErrorCode::HttpResponseTrailerSize") + .field(e) + .finish() + } + ErrorCode::HttpResponseTransferCoding(e) => { + f.debug_tuple("ErrorCode::HttpResponseTransferCoding") + .field(e) + .finish() + } + ErrorCode::HttpResponseContentCoding(e) => { + f.debug_tuple("ErrorCode::HttpResponseContentCoding") + .field(e) + .finish() + } ErrorCode::HttpResponseTimeout => { f.debug_tuple("ErrorCode::HttpResponseTimeout").finish() } @@ -497,11 +552,13 @@ pub mod wasi { } } impl ::core::fmt::Display for ErrorCode { - 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 ErrorCode {} /// This type enumerates the different kinds of errors that may occur when /// setting or appending to a `fields` resource. @@ -519,22 +576,31 @@ pub mod wasi { Immutable, } impl ::core::fmt::Debug for HeaderError { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { HeaderError::InvalidSyntax => { f.debug_tuple("HeaderError::InvalidSyntax").finish() } - HeaderError::Forbidden => f.debug_tuple("HeaderError::Forbidden").finish(), - HeaderError::Immutable => f.debug_tuple("HeaderError::Immutable").finish(), + HeaderError::Forbidden => { + f.debug_tuple("HeaderError::Forbidden").finish() + } + HeaderError::Immutable => { + f.debug_tuple("HeaderError::Immutable").finish() + } } } } impl ::core::fmt::Display for HeaderError { - 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 HeaderError {} /// Field keys are always strings. pub type FieldKey = _rt::String; @@ -552,296 +618,248 @@ pub mod wasi { /// `incoming-request.headers`, `outgoing-request.headers`) might be be /// immutable. In an immutable fields, the `set`, `append`, and `delete` /// operations will fail with `header-error.immutable`. - #[derive(Debug)] #[repr(transparent)] pub struct Fields { handle: _rt::Resource, } - impl Fields { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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 Fields { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]fields"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - /// Headers is an alias for Fields. pub type Headers = Fields; /// Trailers is an alias for Fields. pub type Trailers = Fields; /// Represents an incoming HTTP Request. - #[derive(Debug)] #[repr(transparent)] pub struct IncomingRequest { handle: _rt::Resource, } - impl IncomingRequest { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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 IncomingRequest { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]incoming-request"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - /// Represents an outgoing HTTP Request. - #[derive(Debug)] #[repr(transparent)] pub struct OutgoingRequest { handle: _rt::Resource, } - impl OutgoingRequest { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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 OutgoingRequest { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]outgoing-request"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - /// Parameters for making an HTTP Request. Each of these parameters is /// currently an optional timeout applicable to the transport layer of the /// HTTP protocol. /// /// These timeouts are separate from any the user may use to bound a /// blocking call to `wasi:io/poll.poll`. - #[derive(Debug)] #[repr(transparent)] pub struct RequestOptions { handle: _rt::Resource, } - impl RequestOptions { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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 RequestOptions { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]request-options"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - /// Represents the ability to send an HTTP Response. /// /// This resource is used by the `wasi:http/incoming-handler` interface to /// allow a Response to be sent corresponding to the Request provided as the /// other argument to `incoming-handler.handle`. - #[derive(Debug)] #[repr(transparent)] pub struct ResponseOutparam { handle: _rt::Resource, } - impl ResponseOutparam { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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 ResponseOutparam { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]response-outparam"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - /// This type corresponds to the HTTP standard Status Code. pub type StatusCode = u16; /// Represents an incoming HTTP Response. - #[derive(Debug)] #[repr(transparent)] pub struct IncomingResponse { handle: _rt::Resource, } - impl IncomingResponse { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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 IncomingResponse { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]incoming-response"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - /// Represents an incoming HTTP Request or Response's Body. /// /// A body has both its contents - a stream of bytes - and a (possibly @@ -850,147 +868,123 @@ pub mod wasi { /// an `input-stream` and the delivery of trailers as a `future-trailers`, /// and ensures that the user of this interface may only be consuming either /// the body contents or waiting on trailers at any given time. - #[derive(Debug)] #[repr(transparent)] pub struct IncomingBody { handle: _rt::Resource, } - impl IncomingBody { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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 IncomingBody { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]incoming-body"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - /// Represents a future which may eventaully return trailers, or an error. /// /// In the case that the incoming HTTP Request or Response did not have any /// trailers, this future will resolve to the empty set of trailers once the /// complete Request or Response body has been received. - #[derive(Debug)] #[repr(transparent)] pub struct FutureTrailers { handle: _rt::Resource, } - impl FutureTrailers { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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 FutureTrailers { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]future-trailers"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - /// Represents an outgoing HTTP Response. - #[derive(Debug)] #[repr(transparent)] pub struct OutgoingResponse { handle: _rt::Resource, } - impl OutgoingResponse { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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 OutgoingResponse { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]outgoing-response"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - /// Represents an outgoing HTTP Request or Response's Body. /// /// A body has both its contents - a stream of bytes - and a (possibly @@ -1007,101 +1001,85 @@ pub mod wasi { /// error to the HTTP protocol by whatever means it has available, /// including: corrupting the body on the wire, aborting the associated /// Request, or sending a late status code for the Response. - #[derive(Debug)] #[repr(transparent)] pub struct OutgoingBody { handle: _rt::Resource, } - impl OutgoingBody { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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 OutgoingBody { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]outgoing-body"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - /// Represents a future which may eventaully return an incoming HTTP /// Response, or an error. /// /// This resource is returned by the `wasi:http/outgoing-handler` interface to /// provide the HTTP Response corresponding to the sent Request. - #[derive(Debug)] #[repr(transparent)] pub struct FutureIncomingResponse { handle: _rt::Resource, } - impl FutureIncomingResponse { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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 FutureIncomingResponse { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]future-incoming-response"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - #[allow(unused_unsafe, clippy::all)] /// Attempts to extract a http-related `error` from the wasi:io `error` /// provided. @@ -1117,64 +1095,76 @@ pub mod wasi { pub fn http_error_code(err: &IoError) -> Option { unsafe { #[repr(align(8))] - struct RetArea([::core::mem::MaybeUninit; 40]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 40]); + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 24 + 4 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 24 + + 4 * ::core::mem::size_of::<*const u8>()], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "http-error-code"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((err).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((err).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result66 = match l2 { 0 => None, 1 => { let e = { - let l2 = i32::from(*ptr0.add(8).cast::()); - let v64 = match l2 { + let l3 = i32::from(*ptr0.add(8).cast::()); + let v65 = match l3 { 0 => ErrorCode::DnsTimeout, 1 => { - let e64 = { - let l3 = i32::from(*ptr0.add(16).cast::()); - let l7 = i32::from(*ptr0.add(28).cast::()); - + let e65 = { + let l4 = i32::from(*ptr0.add(16).cast::()); + let l8 = i32::from( + *ptr0 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); DnsErrorPayload { - rcode: match l3 { + rcode: match l4 { 0 => None, 1 => { let e = { - let l4 = - *ptr0.add(20).cast::<*mut u8>(); - let l5 = *ptr0.add(24).cast::(); - let len6 = l5; - let bytes6 = _rt::Vec::from_raw_parts( - l4.cast(), - len6, - len6, + let l5 = *ptr0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l6 = *ptr0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len7 = l6; + let bytes7 = _rt::Vec::from_raw_parts( + l5.cast(), + len7, + len7, ); - - _rt::string_lift(bytes6) + _rt::string_lift(bytes7) }; Some(e) } _ => _rt::invalid_enum_discriminant(), }, - info_code: match l7 { + info_code: match l8 { 0 => None, 1 => { let e = { - let l8 = i32::from( - *ptr0.add(30).cast::(), + let l9 = i32::from( + *ptr0 + .add(18 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(), ); - - l8 as u16 + l9 as u16 }; Some(e) } @@ -1182,7 +1172,7 @@ pub mod wasi { }, } }; - ErrorCode::DnsError(e64) + ErrorCode::DnsError(e65) } 2 => ErrorCode::DestinationNotFound, 3 => ErrorCode::DestinationUnavailable, @@ -1197,40 +1187,42 @@ pub mod wasi { 12 => ErrorCode::TlsProtocolError, 13 => ErrorCode::TlsCertificateError, 14 => { - let e64 = { - let l9 = i32::from(*ptr0.add(16).cast::()); - let l11 = i32::from(*ptr0.add(20).cast::()); - + let e65 = { + let l10 = i32::from(*ptr0.add(16).cast::()); + let l12 = i32::from( + *ptr0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); TlsAlertReceivedPayload { - alert_id: match l9 { + alert_id: match l10 { 0 => None, 1 => { let e = { - let l10 = i32::from( - *ptr0.add(17).cast::(), - ); - - l10 as u8 + let l11 = i32::from(*ptr0.add(17).cast::()); + l11 as u8 }; Some(e) } _ => _rt::invalid_enum_discriminant(), }, - alert_message: match l11 { + alert_message: match l12 { 0 => None, 1 => { let e = { - let l12 = - *ptr0.add(24).cast::<*mut u8>(); - let l13 = *ptr0.add(28).cast::(); - let len14 = l13; - let bytes14 = _rt::Vec::from_raw_parts( - l12.cast(), - len14, - len14, + let l13 = *ptr0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l14 = *ptr0 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len15 = l14; + let bytes15 = _rt::Vec::from_raw_parts( + l13.cast(), + len15, + len15, ); - - _rt::string_lift(bytes14) + _rt::string_lift(bytes15) }; Some(e) } @@ -1238,102 +1230,99 @@ pub mod wasi { }, } }; - ErrorCode::TlsAlertReceived(e64) + ErrorCode::TlsAlertReceived(e65) } 15 => ErrorCode::HttpRequestDenied, 16 => ErrorCode::HttpRequestLengthRequired, 17 => { - let e64 = { - let l15 = i32::from(*ptr0.add(16).cast::()); - - match l15 { + let e65 = { + let l16 = i32::from(*ptr0.add(16).cast::()); + match l16 { 0 => None, 1 => { let e = { - let l16 = *ptr0.add(24).cast::(); - - l16 as u64 + let l17 = *ptr0.add(24).cast::(); + l17 as u64 }; Some(e) } _ => _rt::invalid_enum_discriminant(), } }; - ErrorCode::HttpRequestBodySize(e64) + ErrorCode::HttpRequestBodySize(e65) } 18 => ErrorCode::HttpRequestMethodInvalid, 19 => ErrorCode::HttpRequestUriInvalid, 20 => ErrorCode::HttpRequestUriTooLong, 21 => { - let e64 = { - let l17 = i32::from(*ptr0.add(16).cast::()); - - match l17 { + let e65 = { + let l18 = i32::from(*ptr0.add(16).cast::()); + match l18 { 0 => None, 1 => { let e = { - let l18 = *ptr0.add(20).cast::(); - - l18 as u32 + let l19 = *ptr0.add(20).cast::(); + l19 as u32 }; Some(e) } _ => _rt::invalid_enum_discriminant(), } }; - ErrorCode::HttpRequestHeaderSectionSize(e64) + ErrorCode::HttpRequestHeaderSectionSize(e65) } 22 => { - let e64 = { - let l19 = i32::from(*ptr0.add(16).cast::()); - - match l19 { + let e65 = { + let l20 = i32::from(*ptr0.add(16).cast::()); + match l20 { 0 => None, 1 => { let e = { - let l20 = - i32::from(*ptr0.add(20).cast::()); - let l24 = - i32::from(*ptr0.add(32).cast::()); - + let l21 = i32::from( + *ptr0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + let l25 = i32::from( + *ptr0 + .add(16 + 4 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); FieldSizePayload { - field_name: match l20 { + field_name: match l21 { 0 => None, 1 => { let e = { - let l21 = *ptr0 - .add(24) - .cast::<*mut u8>( - ); let l22 = *ptr0 - .add(28) + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l23 = *ptr0 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) .cast::(); - let len23 = l22; - let bytes23 = _rt::Vec::from_raw_parts(l21.cast(), len23, len23); - - _rt::string_lift(bytes23) + let len24 = l23; + let bytes24 = _rt::Vec::from_raw_parts( + l22.cast(), + len24, + len24, + ); + _rt::string_lift(bytes24) }; Some(e) } - _ => { - _rt::invalid_enum_discriminant() - } + _ => _rt::invalid_enum_discriminant(), }, - field_size: match l24 { + field_size: match l25 { 0 => None, 1 => { let e = { - let l25 = *ptr0 - .add(36) + let l26 = *ptr0 + .add(20 + 4 * ::core::mem::size_of::<*const u8>()) .cast::(); - - l25 as u32 + l26 as u32 }; Some(e) } - _ => { - _rt::invalid_enum_discriminant() - } + _ => _rt::invalid_enum_discriminant(), }, } }; @@ -1342,60 +1331,64 @@ pub mod wasi { _ => _rt::invalid_enum_discriminant(), } }; - ErrorCode::HttpRequestHeaderSize(e64) + ErrorCode::HttpRequestHeaderSize(e65) } 23 => { - let e64 = { - let l26 = i32::from(*ptr0.add(16).cast::()); - - match l26 { + let e65 = { + let l27 = i32::from(*ptr0.add(16).cast::()); + match l27 { 0 => None, 1 => { let e = { - let l27 = *ptr0.add(20).cast::(); - - l27 as u32 + let l28 = *ptr0.add(20).cast::(); + l28 as u32 }; Some(e) } _ => _rt::invalid_enum_discriminant(), } }; - ErrorCode::HttpRequestTrailerSectionSize(e64) + ErrorCode::HttpRequestTrailerSectionSize(e65) } 24 => { - let e64 = { - let l28 = i32::from(*ptr0.add(16).cast::()); - let l32 = i32::from(*ptr0.add(28).cast::()); - + let e65 = { + let l29 = i32::from(*ptr0.add(16).cast::()); + let l33 = i32::from( + *ptr0 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); FieldSizePayload { - field_name: match l28 { + field_name: match l29 { 0 => None, 1 => { let e = { - let l29 = - *ptr0.add(20).cast::<*mut u8>(); - let l30 = *ptr0.add(24).cast::(); - let len31 = l30; - let bytes31 = _rt::Vec::from_raw_parts( - l29.cast(), - len31, - len31, + let l30 = *ptr0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l31 = *ptr0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len32 = l31; + let bytes32 = _rt::Vec::from_raw_parts( + l30.cast(), + len32, + len32, ); - - _rt::string_lift(bytes31) + _rt::string_lift(bytes32) }; Some(e) } _ => _rt::invalid_enum_discriminant(), }, - field_size: match l32 { + field_size: match l33 { 0 => None, 1 => { let e = { - let l33 = *ptr0.add(32).cast::(); - - l33 as u32 + let l34 = *ptr0 + .add(20 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + l34 as u32 }; Some(e) } @@ -1403,61 +1396,65 @@ pub mod wasi { }, } }; - ErrorCode::HttpRequestTrailerSize(e64) + ErrorCode::HttpRequestTrailerSize(e65) } 25 => ErrorCode::HttpResponseIncomplete, 26 => { - let e64 = { - let l34 = i32::from(*ptr0.add(16).cast::()); - - match l34 { + let e65 = { + let l35 = i32::from(*ptr0.add(16).cast::()); + match l35 { 0 => None, 1 => { let e = { - let l35 = *ptr0.add(20).cast::(); - - l35 as u32 + let l36 = *ptr0.add(20).cast::(); + l36 as u32 }; Some(e) } _ => _rt::invalid_enum_discriminant(), } }; - ErrorCode::HttpResponseHeaderSectionSize(e64) + ErrorCode::HttpResponseHeaderSectionSize(e65) } 27 => { - let e64 = { - let l36 = i32::from(*ptr0.add(16).cast::()); - let l40 = i32::from(*ptr0.add(28).cast::()); - + let e65 = { + let l37 = i32::from(*ptr0.add(16).cast::()); + let l41 = i32::from( + *ptr0 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); FieldSizePayload { - field_name: match l36 { + field_name: match l37 { 0 => None, 1 => { let e = { - let l37 = - *ptr0.add(20).cast::<*mut u8>(); - let l38 = *ptr0.add(24).cast::(); - let len39 = l38; - let bytes39 = _rt::Vec::from_raw_parts( - l37.cast(), - len39, - len39, + let l38 = *ptr0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l39 = *ptr0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len40 = l39; + let bytes40 = _rt::Vec::from_raw_parts( + l38.cast(), + len40, + len40, ); - - _rt::string_lift(bytes39) + _rt::string_lift(bytes40) }; Some(e) } _ => _rt::invalid_enum_discriminant(), }, - field_size: match l40 { + field_size: match l41 { 0 => None, 1 => { let e = { - let l41 = *ptr0.add(32).cast::(); - - l41 as u32 + let l42 = *ptr0 + .add(20 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + l42 as u32 }; Some(e) } @@ -1465,79 +1462,81 @@ pub mod wasi { }, } }; - ErrorCode::HttpResponseHeaderSize(e64) + ErrorCode::HttpResponseHeaderSize(e65) } 28 => { - let e64 = { - let l42 = i32::from(*ptr0.add(16).cast::()); - - match l42 { + let e65 = { + let l43 = i32::from(*ptr0.add(16).cast::()); + match l43 { 0 => None, 1 => { let e = { - let l43 = *ptr0.add(24).cast::(); - - l43 as u64 + let l44 = *ptr0.add(24).cast::(); + l44 as u64 }; Some(e) } _ => _rt::invalid_enum_discriminant(), } }; - ErrorCode::HttpResponseBodySize(e64) + ErrorCode::HttpResponseBodySize(e65) } 29 => { - let e64 = { - let l44 = i32::from(*ptr0.add(16).cast::()); - - match l44 { + let e65 = { + let l45 = i32::from(*ptr0.add(16).cast::()); + match l45 { 0 => None, 1 => { let e = { - let l45 = *ptr0.add(20).cast::(); - - l45 as u32 + let l46 = *ptr0.add(20).cast::(); + l46 as u32 }; Some(e) } _ => _rt::invalid_enum_discriminant(), } }; - ErrorCode::HttpResponseTrailerSectionSize(e64) + ErrorCode::HttpResponseTrailerSectionSize(e65) } 30 => { - let e64 = { - let l46 = i32::from(*ptr0.add(16).cast::()); - let l50 = i32::from(*ptr0.add(28).cast::()); - + let e65 = { + let l47 = i32::from(*ptr0.add(16).cast::()); + let l51 = i32::from( + *ptr0 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); FieldSizePayload { - field_name: match l46 { + field_name: match l47 { 0 => None, 1 => { let e = { - let l47 = - *ptr0.add(20).cast::<*mut u8>(); - let l48 = *ptr0.add(24).cast::(); - let len49 = l48; - let bytes49 = _rt::Vec::from_raw_parts( - l47.cast(), - len49, - len49, + let l48 = *ptr0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l49 = *ptr0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len50 = l49; + let bytes50 = _rt::Vec::from_raw_parts( + l48.cast(), + len50, + len50, ); - - _rt::string_lift(bytes49) + _rt::string_lift(bytes50) }; Some(e) } _ => _rt::invalid_enum_discriminant(), }, - field_size: match l50 { + field_size: match l51 { 0 => None, 1 => { let e = { - let l51 = *ptr0.add(32).cast::(); - - l51 as u32 + let l52 = *ptr0 + .add(20 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + l52 as u32 }; Some(e) } @@ -1545,59 +1544,63 @@ pub mod wasi { }, } }; - ErrorCode::HttpResponseTrailerSize(e64) + ErrorCode::HttpResponseTrailerSize(e65) } 31 => { - let e64 = { - let l52 = i32::from(*ptr0.add(16).cast::()); - - match l52 { + let e65 = { + let l53 = i32::from(*ptr0.add(16).cast::()); + match l53 { 0 => None, 1 => { let e = { - let l53 = *ptr0.add(20).cast::<*mut u8>(); - let l54 = *ptr0.add(24).cast::(); - let len55 = l54; - let bytes55 = _rt::Vec::from_raw_parts( - l53.cast(), - len55, - len55, + let l54 = *ptr0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l55 = *ptr0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len56 = l55; + let bytes56 = _rt::Vec::from_raw_parts( + l54.cast(), + len56, + len56, ); - - _rt::string_lift(bytes55) + _rt::string_lift(bytes56) }; Some(e) } _ => _rt::invalid_enum_discriminant(), } }; - ErrorCode::HttpResponseTransferCoding(e64) + ErrorCode::HttpResponseTransferCoding(e65) } 32 => { - let e64 = { - let l56 = i32::from(*ptr0.add(16).cast::()); - - match l56 { + let e65 = { + let l57 = i32::from(*ptr0.add(16).cast::()); + match l57 { 0 => None, 1 => { let e = { - let l57 = *ptr0.add(20).cast::<*mut u8>(); - let l58 = *ptr0.add(24).cast::(); - let len59 = l58; - let bytes59 = _rt::Vec::from_raw_parts( - l57.cast(), - len59, - len59, + let l58 = *ptr0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l59 = *ptr0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len60 = l59; + let bytes60 = _rt::Vec::from_raw_parts( + l58.cast(), + len60, + len60, ); - - _rt::string_lift(bytes59) + _rt::string_lift(bytes60) }; Some(e) } _ => _rt::invalid_enum_discriminant(), } }; - ErrorCode::HttpResponseContentCoding(e64) + ErrorCode::HttpResponseContentCoding(e65) } 33 => ErrorCode::HttpResponseTimeout, 34 => ErrorCode::HttpUpgradeFailed, @@ -1606,39 +1609,41 @@ pub mod wasi { 37 => ErrorCode::ConfigurationError, n => { debug_assert_eq!(n, 38, "invalid enum discriminant"); - let e64 = { - let l60 = i32::from(*ptr0.add(16).cast::()); - - match l60 { + let e65 = { + let l61 = i32::from(*ptr0.add(16).cast::()); + match l61 { 0 => None, 1 => { let e = { - let l61 = *ptr0.add(20).cast::<*mut u8>(); - let l62 = *ptr0.add(24).cast::(); - let len63 = l62; - let bytes63 = _rt::Vec::from_raw_parts( - l61.cast(), - len63, - len63, + let l62 = *ptr0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l63 = *ptr0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len64 = l63; + let bytes64 = _rt::Vec::from_raw_parts( + l62.cast(), + len64, + len64, ); - - _rt::string_lift(bytes63) + _rt::string_lift(bytes64) }; Some(e) } _ => _rt::invalid_enum_discriminant(), } }; - ErrorCode::InternalError(e64) + ErrorCode::InternalError(e65) } }; - - v64 + v65 }; Some(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result66 } } impl Fields { @@ -1650,17 +1655,16 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[constructor]fields"] - fn wit_import() -> i32; + fn wit_import0() -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import() -> i32 { + unsafe extern "C" fn wit_import0() -> i32 { unreachable!() } - let ret = wit_import(); - Fields::from_handle(ret as u32) + let ret = unsafe { wit_import0() }; + unsafe { Fields::from_handle(ret as u32) } } } } @@ -1687,11 +1691,15 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 8], + ); let vec3 = entries; let len3 = vec3.len(); - let layout3 = - _rt::alloc::Layout::from_size_align_unchecked(vec3.len() * 16, 4); + let layout3 = _rt::alloc::Layout::from_size_align_unchecked( + vec3.len() * (4 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); let result3 = if layout3.size() != 0 { let ptr = _rt::alloc::alloc(layout3).cast::(); if ptr.is_null() { @@ -1699,56 +1707,60 @@ pub mod wasi { } ptr } else { - { - ::core::ptr::null_mut() - } + ::core::ptr::null_mut() }; for (i, e) in vec3.into_iter().enumerate() { - let base = result3.add(i * 16); + let base = result3 + .add(i * (4 * ::core::mem::size_of::<*const u8>())); { let (t0_0, t0_1) = e; let vec1 = t0_0; let ptr1 = vec1.as_ptr().cast::(); let len1 = vec1.len(); - *base.add(4).cast::() = len1; + *base + .add(::core::mem::size_of::<*const u8>()) + .cast::() = len1; *base.add(0).cast::<*mut u8>() = ptr1.cast_mut(); let vec2 = t0_1; let ptr2 = vec2.as_ptr().cast::(); let len2 = vec2.len(); - *base.add(12).cast::() = len2; - *base.add(8).cast::<*mut u8>() = ptr2.cast_mut(); + *base + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len2; + *base + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr2.cast_mut(); } } let ptr4 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[static]fields.from-list"] - fn wit_import(_: *mut u8, _: usize, _: *mut u8); + fn wit_import5(_: *mut u8, _: usize, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: *mut u8, _: usize, _: *mut u8) { + unsafe extern "C" fn wit_import5( + _: *mut u8, + _: usize, + _: *mut u8, + ) { unreachable!() } - wit_import(result3, len3, ptr4); - let l5 = i32::from(*ptr4.add(0).cast::()); - if layout3.size() != 0 { - _rt::alloc::dealloc(result3.cast(), layout3); - } - match l5 { + unsafe { wit_import5(result3, len3, ptr4) }; + let l6 = i32::from(*ptr4.add(0).cast::()); + let result10 = match l6 { 0 => { let e = { - let l6 = *ptr4.add(4).cast::(); - - Fields::from_handle(l6 as u32) + let l7 = *ptr4.add(4).cast::(); + unsafe { Fields::from_handle(l7 as u32) } }; Ok(e) } 1 => { let e = { - let l7 = i32::from(*ptr4.add(4).cast::()); - let v8 = match l7 { + let l8 = i32::from(*ptr4.add(4).cast::()); + let v9 = match l8 { 0 => HeaderError::InvalidSyntax, 1 => HeaderError::Forbidden, n => { @@ -1756,13 +1768,16 @@ pub mod wasi { HeaderError::Immutable } }; - - v8 + v9 }; Err(e) } _ => _rt::invalid_enum_discriminant(), + }; + if layout3.size() != 0 { + _rt::alloc::dealloc(result3.cast(), layout3); } + result10 } } } @@ -1772,45 +1787,73 @@ pub mod wasi { /// in this `fields`, an empty list is returned. However, if the key is /// present but empty, this is represented by a list with one or more /// empty field-values present. - pub fn get(&self, name: &FieldKey) -> _rt::Vec { + pub fn get(&self, name: &str) -> _rt::Vec { unsafe { - #[repr(align(4))] - struct RetArea([::core::mem::MaybeUninit; 8]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 2 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 2 + * ::core::mem::size_of::<*const u8>()], + ); let vec0 = name; let ptr0 = vec0.as_ptr().cast::(); let len0 = vec0.len(); let ptr1 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]fields.get"] - fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8); + fn wit_import2(_: i32, _: *mut u8, _: usize, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8) { + unsafe extern "C" fn wit_import2( + _: i32, + _: *mut u8, + _: usize, + _: *mut u8, + ) { unreachable!() } - wit_import((self).handle() as i32, ptr0.cast_mut(), len0, ptr1); - let l2 = *ptr1.add(0).cast::<*mut u8>(); - let l3 = *ptr1.add(4).cast::(); - let base7 = l2; - let len7 = l3; - let mut result7 = _rt::Vec::with_capacity(len7); - for i in 0..len7 { - let base = base7.add(i * 8); - let e7 = { - let l4 = *base.add(0).cast::<*mut u8>(); - let l5 = *base.add(4).cast::(); - let len6 = l5; - - _rt::Vec::from_raw_parts(l4.cast(), len6, len6) + unsafe { + wit_import2( + (self).handle() as i32, + ptr0.cast_mut(), + len0, + ptr1, + ) + }; + let l3 = *ptr1.add(0).cast::<*mut u8>(); + let l4 = *ptr1 + .add(::core::mem::size_of::<*const u8>()) + .cast::(); + let base8 = l3; + let len8 = l4; + let mut result8 = _rt::Vec::with_capacity(len8); + for i in 0..len8 { + let base = base8 + .add(i * (2 * ::core::mem::size_of::<*const u8>())); + let e8 = { + let l5 = *base.add(0).cast::<*mut u8>(); + let l6 = *base + .add(::core::mem::size_of::<*const u8>()) + .cast::(); + let len7 = l6; + _rt::Vec::from_raw_parts(l5.cast(), len7, len7) }; - result7.push(e7); + result8.push(e8); } - _rt::cabi_dealloc(base7, len7 * 8, 4); - result7 + _rt::cabi_dealloc( + base8, + len8 * (2 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); + let result9 = result8; + result9 } } } @@ -1818,24 +1861,28 @@ pub mod wasi { #[allow(unused_unsafe, clippy::all)] /// Returns `true` when the key is present in this `fields`. If the key is /// syntactically invalid, `false` is returned. - pub fn has(&self, name: &FieldKey) -> bool { + pub fn has(&self, name: &str) -> bool { unsafe { let vec0 = name; let ptr0 = vec0.as_ptr().cast::(); let len0 = vec0.len(); - #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]fields.has"] - fn wit_import(_: i32, _: *mut u8, _: usize) -> i32; + fn wit_import1(_: i32, _: *mut u8, _: usize) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8, _: usize) -> i32 { + unsafe extern "C" fn wit_import1( + _: i32, + _: *mut u8, + _: usize, + ) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32, ptr0.cast_mut(), len0); + let ret = unsafe { + wit_import1((self).handle() as i32, ptr0.cast_mut(), len0) + }; _rt::bool_lift(ret as u8) } } @@ -1848,20 +1895,24 @@ pub mod wasi { /// Fails with `header-error.immutable` if the `fields` are immutable. pub fn set( &self, - name: &FieldKey, + name: &str, value: &[FieldValue], ) -> Result<(), HeaderError> { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 2]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 2], + ); let vec0 = name; let ptr0 = vec0.as_ptr().cast::(); let len0 = vec0.len(); let vec2 = value; let len2 = vec2.len(); - let layout2 = - _rt::alloc::Layout::from_size_align_unchecked(vec2.len() * 8, 4); + let layout2 = _rt::alloc::Layout::from_size_align_unchecked( + vec2.len() * (2 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); let result2 = if layout2.size() != 0 { let ptr = _rt::alloc::alloc(layout2).cast::(); if ptr.is_null() { @@ -1869,26 +1920,27 @@ pub mod wasi { } ptr } else { - { - ::core::ptr::null_mut() - } + ::core::ptr::null_mut() }; for (i, e) in vec2.into_iter().enumerate() { - let base = result2.add(i * 8); + let base = result2 + .add(i * (2 * ::core::mem::size_of::<*const u8>())); { let vec1 = e; let ptr1 = vec1.as_ptr().cast::(); let len1 = vec1.len(); - *base.add(4).cast::() = len1; + *base + .add(::core::mem::size_of::<*const u8>()) + .cast::() = len1; *base.add(0).cast::<*mut u8>() = ptr1.cast_mut(); } } let ptr3 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]fields.set"] - fn wit_import( + fn wit_import4( _: i32, _: *mut u8, _: usize, @@ -1897,9 +1949,8 @@ pub mod wasi { _: *mut u8, ); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import( + unsafe extern "C" fn wit_import4( _: i32, _: *mut u8, _: usize, @@ -1909,27 +1960,26 @@ pub mod wasi { ) { unreachable!() } - wit_import( - (self).handle() as i32, - ptr0.cast_mut(), - len0, - result2, - len2, - ptr3, - ); - let l4 = i32::from(*ptr3.add(0).cast::()); - if layout2.size() != 0 { - _rt::alloc::dealloc(result2.cast(), layout2); - } - match l4 { + unsafe { + wit_import4( + (self).handle() as i32, + ptr0.cast_mut(), + len0, + result2, + len2, + ptr3, + ) + }; + let l5 = i32::from(*ptr3.add(0).cast::()); + let result8 = match l5 { 0 => { let e = (); Ok(e) } 1 => { let e = { - let l5 = i32::from(*ptr3.add(1).cast::()); - let v6 = match l5 { + let l6 = i32::from(*ptr3.add(1).cast::()); + let v7 = match l6 { 0 => HeaderError::InvalidSyntax, 1 => HeaderError::Forbidden, n => { @@ -1937,13 +1987,16 @@ pub mod wasi { HeaderError::Immutable } }; - - v6 + v7 }; Err(e) } _ => _rt::invalid_enum_discriminant(), + }; + if layout2.size() != 0 { + _rt::alloc::dealloc(result2.cast(), layout2); } + result8 } } } @@ -1953,37 +2006,50 @@ pub mod wasi { /// exist. /// /// Fails with `header-error.immutable` if the `fields` are immutable. - pub fn delete(&self, name: &FieldKey) -> Result<(), HeaderError> { + pub fn delete(&self, name: &str) -> Result<(), HeaderError> { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 2]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 2], + ); let vec0 = name; let ptr0 = vec0.as_ptr().cast::(); let len0 = vec0.len(); let ptr1 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]fields.delete"] - fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8); + fn wit_import2(_: i32, _: *mut u8, _: usize, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8) { + unsafe extern "C" fn wit_import2( + _: i32, + _: *mut u8, + _: usize, + _: *mut u8, + ) { unreachable!() } - wit_import((self).handle() as i32, ptr0.cast_mut(), len0, ptr1); - let l2 = i32::from(*ptr1.add(0).cast::()); - match l2 { + unsafe { + wit_import2( + (self).handle() as i32, + ptr0.cast_mut(), + len0, + ptr1, + ) + }; + let l3 = i32::from(*ptr1.add(0).cast::()); + let result6 = match l3 { 0 => { let e = (); Ok(e) } 1 => { let e = { - let l3 = i32::from(*ptr1.add(1).cast::()); - let v4 = match l3 { + let l4 = i32::from(*ptr1.add(1).cast::()); + let v5 = match l4 { 0 => HeaderError::InvalidSyntax, 1 => HeaderError::Forbidden, n => { @@ -1991,13 +2057,13 @@ pub mod wasi { HeaderError::Immutable } }; - - v4 + v5 }; Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result6 } } } @@ -2009,13 +2075,15 @@ pub mod wasi { /// Fails with `header-error.immutable` if the `fields` are immutable. pub fn append( &self, - name: &FieldKey, - value: &FieldValue, + name: &str, + value: &[u8], ) -> Result<(), HeaderError> { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 2]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 2], + ); let vec0 = name; let ptr0 = vec0.as_ptr().cast::(); let len0 = vec0.len(); @@ -2025,9 +2093,9 @@ pub mod wasi { let ptr2 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]fields.append"] - fn wit_import( + fn wit_import3( _: i32, _: *mut u8, _: usize, @@ -2036,9 +2104,8 @@ pub mod wasi { _: *mut u8, ); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import( + unsafe extern "C" fn wit_import3( _: i32, _: *mut u8, _: usize, @@ -2048,24 +2115,26 @@ pub mod wasi { ) { unreachable!() } - wit_import( - (self).handle() as i32, - ptr0.cast_mut(), - len0, - ptr1.cast_mut(), - len1, - ptr2, - ); - let l3 = i32::from(*ptr2.add(0).cast::()); - match l3 { + unsafe { + wit_import3( + (self).handle() as i32, + ptr0.cast_mut(), + len0, + ptr1.cast_mut(), + len1, + ptr2, + ) + }; + let l4 = i32::from(*ptr2.add(0).cast::()); + let result7 = match l4 { 0 => { let e = (); Ok(e) } 1 => { let e = { - let l4 = i32::from(*ptr2.add(1).cast::()); - let v5 = match l4 { + let l5 = i32::from(*ptr2.add(1).cast::()); + let v6 = match l5 { 0 => HeaderError::InvalidSyntax, 1 => HeaderError::Forbidden, n => { @@ -2073,13 +2142,13 @@ pub mod wasi { HeaderError::Immutable } }; - - v5 + v6 }; Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result7 } } } @@ -2093,47 +2162,71 @@ pub mod wasi { /// list with the same key. pub fn entries(&self) -> _rt::Vec<(FieldKey, FieldValue)> { unsafe { - #[repr(align(4))] - struct RetArea([::core::mem::MaybeUninit; 8]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 2 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 2 + * ::core::mem::size_of::<*const u8>()], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]fields.entries"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = *ptr0.add(0).cast::<*mut u8>(); - let l2 = *ptr0.add(4).cast::(); - let base9 = l1; - let len9 = l2; - let mut result9 = _rt::Vec::with_capacity(len9); - for i in 0..len9 { - let base = base9.add(i * 16); - let e9 = { - let l3 = *base.add(0).cast::<*mut u8>(); - let l4 = *base.add(4).cast::(); - let len5 = l4; - let bytes5 = _rt::Vec::from_raw_parts(l3.cast(), len5, len5); - let l6 = *base.add(8).cast::<*mut u8>(); - let l7 = *base.add(12).cast::(); - let len8 = l7; - + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = *ptr0.add(0).cast::<*mut u8>(); + let l3 = *ptr0 + .add(::core::mem::size_of::<*const u8>()) + .cast::(); + let base10 = l2; + let len10 = l3; + let mut result10 = _rt::Vec::with_capacity(len10); + for i in 0..len10 { + let base = base10 + .add(i * (4 * ::core::mem::size_of::<*const u8>())); + let e10 = { + let l4 = *base.add(0).cast::<*mut u8>(); + let l5 = *base + .add(::core::mem::size_of::<*const u8>()) + .cast::(); + let len6 = l5; + let bytes6 = _rt::Vec::from_raw_parts( + l4.cast(), + len6, + len6, + ); + let l7 = *base + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l8 = *base + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len9 = l8; ( - _rt::string_lift(bytes5), - _rt::Vec::from_raw_parts(l6.cast(), len8, len8), + _rt::string_lift(bytes6), + _rt::Vec::from_raw_parts(l7.cast(), len9, len9), ) }; - result9.push(e9); + result10.push(e10); } - _rt::cabi_dealloc(base9, len9 * 16, 4); - result9 + _rt::cabi_dealloc( + base10, + len10 * (4 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); + let result11 = result10; + result11 } } } @@ -2146,17 +2239,16 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]fields.clone"] - fn wit_import(_: i32) -> i32; + fn wit_import0(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32) -> i32 { + unsafe extern "C" fn wit_import0(_: i32) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32); - Fields::from_handle(ret as u32) + let ret = unsafe { wit_import0((self).handle() as i32) }; + unsafe { Fields::from_handle(ret as u32) } } } } @@ -2165,24 +2257,31 @@ pub mod wasi { /// Returns the method of the incoming request. pub fn method(&self) -> Method { unsafe { - #[repr(align(4))] - struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 3 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 3 + * ::core::mem::size_of::<*const u8>()], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]incoming-request.method"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - let v5 = match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let v6 = match l2 { 0 => Method::Get, 1 => Method::Head, 2 => Method::Post, @@ -2194,18 +2293,26 @@ pub mod wasi { 8 => Method::Patch, n => { debug_assert_eq!(n, 9, "invalid enum discriminant"); - let e5 = { - let l2 = *ptr0.add(4).cast::<*mut u8>(); - let l3 = *ptr0.add(8).cast::(); - let len4 = l3; - let bytes4 = _rt::Vec::from_raw_parts(l2.cast(), len4, len4); - - _rt::string_lift(bytes4) + let e6 = { + let l3 = *ptr0 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l4 = *ptr0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len5 = l4; + let bytes5 = _rt::Vec::from_raw_parts( + l3.cast(), + len5, + len5, + ); + _rt::string_lift(bytes5) }; - Method::Other(e5) + Method::Other(e6) } }; - v5 + let result7 = v6; + result7 } } } @@ -2214,38 +2321,53 @@ pub mod wasi { /// Returns the path with query parameters from the request, as a string. pub fn path_with_query(&self) -> Option<_rt::String> { unsafe { - #[repr(align(4))] - struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 3 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 3 + * ::core::mem::size_of::<*const u8>()], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]incoming-request.path-with-query"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result6 = match l2 { 0 => None, 1 => { let e = { - let l2 = *ptr0.add(4).cast::<*mut u8>(); - let l3 = *ptr0.add(8).cast::(); - let len4 = l3; - let bytes4 = _rt::Vec::from_raw_parts(l2.cast(), len4, len4); - - _rt::string_lift(bytes4) + let l3 = *ptr0 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l4 = *ptr0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len5 = l4; + let bytes5 = _rt::Vec::from_raw_parts( + l3.cast(), + len5, + len5, + ); + _rt::string_lift(bytes5) }; Some(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result6 } } } @@ -2254,52 +2376,67 @@ pub mod wasi { /// Returns the protocol scheme from the request. pub fn scheme(&self) -> Option { unsafe { - #[repr(align(4))] - struct RetArea([::core::mem::MaybeUninit; 16]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 16]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 4 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 4 + * ::core::mem::size_of::<*const u8>()], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]incoming-request.scheme"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result8 = match l2 { 0 => None, 1 => { let e = { - let l2 = i32::from(*ptr0.add(4).cast::()); - let v6 = match l2 { + let l3 = i32::from( + *ptr0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); + let v7 = match l3 { 0 => Scheme::Http, 1 => Scheme::Https, n => { debug_assert_eq!(n, 2, "invalid enum discriminant"); - let e6 = { - let l3 = *ptr0.add(8).cast::<*mut u8>(); - let l4 = *ptr0.add(12).cast::(); - let len5 = l4; - let bytes5 = - _rt::Vec::from_raw_parts(l3.cast(), len5, len5); - - _rt::string_lift(bytes5) + let e7 = { + let l4 = *ptr0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l5 = *ptr0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len6 = l5; + let bytes6 = _rt::Vec::from_raw_parts( + l4.cast(), + len6, + len6, + ); + _rt::string_lift(bytes6) }; - Scheme::Other(e6) + Scheme::Other(e7) } }; - - v6 + v7 }; Some(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result8 } } } @@ -2308,38 +2445,53 @@ pub mod wasi { /// Returns the authority from the request, if it was present. pub fn authority(&self) -> Option<_rt::String> { unsafe { - #[repr(align(4))] - struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 3 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 3 + * ::core::mem::size_of::<*const u8>()], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]incoming-request.authority"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result6 = match l2 { 0 => None, 1 => { let e = { - let l2 = *ptr0.add(4).cast::<*mut u8>(); - let l3 = *ptr0.add(8).cast::(); - let len4 = l3; - let bytes4 = _rt::Vec::from_raw_parts(l2.cast(), len4, len4); - - _rt::string_lift(bytes4) + let l3 = *ptr0 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l4 = *ptr0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len5 = l4; + let bytes5 = _rt::Vec::from_raw_parts( + l3.cast(), + len5, + len5, + ); + _rt::string_lift(bytes5) }; Some(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result6 } } } @@ -2357,17 +2509,16 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]incoming-request.headers"] - fn wit_import(_: i32) -> i32; + fn wit_import0(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32) -> i32 { + unsafe extern "C" fn wit_import0(_: i32) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32); - Fields::from_handle(ret as u32) + let ret = unsafe { wit_import0((self).handle() as i32) }; + unsafe { Fields::from_handle(ret as u32) } } } } @@ -2379,27 +2530,27 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 8], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]incoming-request.consume"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result4 = match l2 { 0 => { let e = { - let l2 = *ptr0.add(4).cast::(); - - IncomingBody::from_handle(l2 as u32) + let l3 = *ptr0.add(4).cast::(); + unsafe { IncomingBody::from_handle(l3 as u32) } }; Ok(e) } @@ -2408,7 +2559,8 @@ pub mod wasi { Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result4 } } } @@ -2428,17 +2580,18 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[constructor]outgoing-request"] - fn wit_import(_: i32) -> i32; + fn wit_import0(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32) -> i32 { + unsafe extern "C" fn wit_import0(_: i32) -> i32 { unreachable!() } - let ret = wit_import((&headers).take_handle() as i32); - OutgoingRequest::from_handle(ret as u32) + let ret = unsafe { + wit_import0((&headers).take_handle() as i32) + }; + unsafe { OutgoingRequest::from_handle(ret as u32) } } } } @@ -2454,27 +2607,27 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 8], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]outgoing-request.body"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result4 = match l2 { 0 => { let e = { - let l2 = *ptr0.add(4).cast::(); - - OutgoingBody::from_handle(l2 as u32) + let l3 = *ptr0.add(4).cast::(); + unsafe { OutgoingBody::from_handle(l3 as u32) } }; Ok(e) } @@ -2483,7 +2636,8 @@ pub mod wasi { Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result4 } } } @@ -2492,24 +2646,31 @@ pub mod wasi { /// Get the Method for the Request. pub fn method(&self) -> Method { unsafe { - #[repr(align(4))] - struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 3 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 3 + * ::core::mem::size_of::<*const u8>()], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]outgoing-request.method"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - let v5 = match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let v6 = match l2 { 0 => Method::Get, 1 => Method::Head, 2 => Method::Post, @@ -2521,18 +2682,26 @@ pub mod wasi { 8 => Method::Patch, n => { debug_assert_eq!(n, 9, "invalid enum discriminant"); - let e5 = { - let l2 = *ptr0.add(4).cast::<*mut u8>(); - let l3 = *ptr0.add(8).cast::(); - let len4 = l3; - let bytes4 = _rt::Vec::from_raw_parts(l2.cast(), len4, len4); - - _rt::string_lift(bytes4) + let e6 = { + let l3 = *ptr0 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l4 = *ptr0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len5 = l4; + let bytes5 = _rt::Vec::from_raw_parts( + l3.cast(), + len5, + len5, + ); + _rt::string_lift(bytes5) }; - Method::Other(e5) + Method::Other(e6) } }; - v5 + let result7 = v6; + result7 } } } @@ -2556,24 +2725,32 @@ pub mod wasi { let vec0 = e; let ptr0 = vec0.as_ptr().cast::(); let len0 = vec0.len(); - (9i32, ptr0.cast_mut(), len0) } }; - #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]outgoing-request.set-method"] - fn wit_import(_: i32, _: i32, _: *mut u8, _: usize) -> i32; + fn wit_import2(_: i32, _: i32, _: *mut u8, _: usize) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: i32, _: *mut u8, _: usize) -> i32 { + unsafe extern "C" fn wit_import2( + _: i32, + _: i32, + _: *mut u8, + _: usize, + ) -> i32 { unreachable!() } - let ret = - wit_import((self).handle() as i32, result1_0, result1_1, result1_2); + let ret = unsafe { + wit_import2( + (self).handle() as i32, + result1_0, + result1_1, + result1_2, + ) + }; match ret { 0 => { let e = (); @@ -2594,38 +2771,53 @@ pub mod wasi { /// When `none`, this represents an empty Path and empty Query. pub fn path_with_query(&self) -> Option<_rt::String> { unsafe { - #[repr(align(4))] - struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 3 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 3 + * ::core::mem::size_of::<*const u8>()], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]outgoing-request.path-with-query"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result6 = match l2 { 0 => None, 1 => { let e = { - let l2 = *ptr0.add(4).cast::<*mut u8>(); - let l3 = *ptr0.add(8).cast::(); - let len4 = l3; - let bytes4 = _rt::Vec::from_raw_parts(l2.cast(), len4, len4); - - _rt::string_lift(bytes4) + let l3 = *ptr0 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l4 = *ptr0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len5 = l4; + let bytes5 = _rt::Vec::from_raw_parts( + l3.cast(), + len5, + len5, + ); + _rt::string_lift(bytes5) }; Some(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result6 } } } @@ -2634,31 +2826,43 @@ pub mod wasi { /// Set the combination of the HTTP Path and Query for the Request. /// When `none`, this represents an empty Path and empty Query. Fails is the /// string given is not a syntactically valid path and query uri component. - pub fn set_path_with_query(&self, path_with_query: Option<&str>) -> Result<(), ()> { + pub fn set_path_with_query( + &self, + path_with_query: Option<&str>, + ) -> Result<(), ()> { unsafe { let (result1_0, result1_1, result1_2) = match path_with_query { Some(e) => { let vec0 = e; let ptr0 = vec0.as_ptr().cast::(); let len0 = vec0.len(); - (1i32, ptr0.cast_mut(), len0) } None => (0i32, ::core::ptr::null_mut(), 0usize), }; #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]outgoing-request.set-path-with-query"] - fn wit_import(_: i32, _: i32, _: *mut u8, _: usize) -> i32; + fn wit_import2(_: i32, _: i32, _: *mut u8, _: usize) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: i32, _: *mut u8, _: usize) -> i32 { + unsafe extern "C" fn wit_import2( + _: i32, + _: i32, + _: *mut u8, + _: usize, + ) -> i32 { unreachable!() } - let ret = - wit_import((self).handle() as i32, result1_0, result1_1, result1_2); + let ret = unsafe { + wit_import2( + (self).handle() as i32, + result1_0, + result1_1, + result1_2, + ) + }; match ret { 0 => { let e = (); @@ -2679,52 +2883,67 @@ pub mod wasi { /// implementation may choose an appropriate default scheme. pub fn scheme(&self) -> Option { unsafe { - #[repr(align(4))] - struct RetArea([::core::mem::MaybeUninit; 16]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 16]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 4 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 4 + * ::core::mem::size_of::<*const u8>()], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]outgoing-request.scheme"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result8 = match l2 { 0 => None, 1 => { let e = { - let l2 = i32::from(*ptr0.add(4).cast::()); - let v6 = match l2 { + let l3 = i32::from( + *ptr0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); + let v7 = match l3 { 0 => Scheme::Http, 1 => Scheme::Https, n => { debug_assert_eq!(n, 2, "invalid enum discriminant"); - let e6 = { - let l3 = *ptr0.add(8).cast::<*mut u8>(); - let l4 = *ptr0.add(12).cast::(); - let len5 = l4; - let bytes5 = - _rt::Vec::from_raw_parts(l3.cast(), len5, len5); - - _rt::string_lift(bytes5) + let e7 = { + let l4 = *ptr0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l5 = *ptr0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len6 = l5; + let bytes6 = _rt::Vec::from_raw_parts( + l4.cast(), + len6, + len6, + ); + _rt::string_lift(bytes6) }; - Scheme::Other(e6) + Scheme::Other(e7) } }; - - v6 + v7 }; Some(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result8 } } } @@ -2744,33 +2963,44 @@ pub mod wasi { let vec0 = e; let ptr0 = vec0.as_ptr().cast::(); let len0 = vec0.len(); - (2i32, ptr0.cast_mut(), len0) } }; - (1i32, result1_0, result1_1, result1_2) } None => (0i32, 0i32, ::core::ptr::null_mut(), 0usize), }; #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]outgoing-request.set-scheme"] - fn wit_import(_: i32, _: i32, _: i32, _: *mut u8, _: usize) -> i32; + fn wit_import3( + _: i32, + _: i32, + _: i32, + _: *mut u8, + _: usize, + ) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: i32, _: i32, _: *mut u8, _: usize) -> i32 { + unsafe extern "C" fn wit_import3( + _: i32, + _: i32, + _: i32, + _: *mut u8, + _: usize, + ) -> i32 { unreachable!() } - let ret = wit_import( - (self).handle() as i32, - result2_0, - result2_1, - result2_2, - result2_3, - ); + let ret = unsafe { + wit_import3( + (self).handle() as i32, + result2_0, + result2_1, + result2_2, + result2_3, + ) + }; match ret { 0 => { let e = (); @@ -2792,38 +3022,53 @@ pub mod wasi { /// HTTPS schemes always require an authority. pub fn authority(&self) -> Option<_rt::String> { unsafe { - #[repr(align(4))] - struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 3 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 3 + * ::core::mem::size_of::<*const u8>()], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]outgoing-request.authority"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result6 = match l2 { 0 => None, 1 => { let e = { - let l2 = *ptr0.add(4).cast::<*mut u8>(); - let l3 = *ptr0.add(8).cast::(); - let len4 = l3; - let bytes4 = _rt::Vec::from_raw_parts(l2.cast(), len4, len4); - - _rt::string_lift(bytes4) + let l3 = *ptr0 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l4 = *ptr0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len5 = l4; + let bytes5 = _rt::Vec::from_raw_parts( + l3.cast(), + len5, + len5, + ); + _rt::string_lift(bytes5) }; Some(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result6 } } } @@ -2840,24 +3085,33 @@ pub mod wasi { let vec0 = e; let ptr0 = vec0.as_ptr().cast::(); let len0 = vec0.len(); - (1i32, ptr0.cast_mut(), len0) } None => (0i32, ::core::ptr::null_mut(), 0usize), }; #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]outgoing-request.set-authority"] - fn wit_import(_: i32, _: i32, _: *mut u8, _: usize) -> i32; + fn wit_import2(_: i32, _: i32, _: *mut u8, _: usize) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: i32, _: *mut u8, _: usize) -> i32 { + unsafe extern "C" fn wit_import2( + _: i32, + _: i32, + _: *mut u8, + _: usize, + ) -> i32 { unreachable!() } - let ret = - wit_import((self).handle() as i32, result1_0, result1_1, result1_2); + let ret = unsafe { + wit_import2( + (self).handle() as i32, + result1_0, + result1_1, + result1_2, + ) + }; match ret { 0 => { let e = (); @@ -2886,17 +3140,16 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]outgoing-request.headers"] - fn wit_import(_: i32) -> i32; + fn wit_import0(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32) -> i32 { + unsafe extern "C" fn wit_import0(_: i32) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32); - Fields::from_handle(ret as u32) + let ret = unsafe { wit_import0((self).handle() as i32) }; + unsafe { Fields::from_handle(ret as u32) } } } } @@ -2907,17 +3160,16 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[constructor]request-options"] - fn wit_import() -> i32; + fn wit_import0() -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import() -> i32 { + unsafe extern "C" fn wit_import0() -> i32 { unreachable!() } - let ret = wit_import(); - RequestOptions::from_handle(ret as u32) + let ret = unsafe { wit_import0() }; + unsafe { RequestOptions::from_handle(ret as u32) } } } } @@ -2928,33 +3180,34 @@ pub mod wasi { unsafe { #[repr(align(8))] 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]request-options.connect-timeout"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result4 = match l2 { 0 => None, 1 => { let e = { - let l2 = *ptr0.add(8).cast::(); - - l2 as u64 + let l3 = *ptr0.add(8).cast::(); + l3 as u64 }; Some(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result4 } } } @@ -2962,7 +3215,10 @@ pub mod wasi { #[allow(unused_unsafe, clippy::all)] /// Set the timeout for the initial connect to the HTTP Server. An error /// return value indicates that this timeout is not supported. - pub fn set_connect_timeout(&self, duration: Option) -> Result<(), ()> { + pub fn set_connect_timeout( + &self, + duration: Option, + ) -> Result<(), ()> { unsafe { let (result0_0, result0_1) = match duration { Some(e) => (1i32, _rt::as_i64(e)), @@ -2970,16 +3226,17 @@ pub mod wasi { }; #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]request-options.set-connect-timeout"] - fn wit_import(_: i32, _: i32, _: i64) -> i32; + fn wit_import1(_: i32, _: i32, _: i64) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: i32, _: i64) -> i32 { + unsafe extern "C" fn wit_import1(_: i32, _: i32, _: i64) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32, result0_0, result0_1); + let ret = unsafe { + wit_import1((self).handle() as i32, result0_0, result0_1) + }; match ret { 0 => { let e = (); @@ -3001,33 +3258,34 @@ pub mod wasi { unsafe { #[repr(align(8))] 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]request-options.first-byte-timeout"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result4 = match l2 { 0 => None, 1 => { let e = { - let l2 = *ptr0.add(8).cast::(); - - l2 as u64 + let l3 = *ptr0.add(8).cast::(); + l3 as u64 }; Some(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result4 } } } @@ -3035,7 +3293,10 @@ pub mod wasi { #[allow(unused_unsafe, clippy::all)] /// Set the timeout for receiving the first byte of the Response body. An /// error return value indicates that this timeout is not supported. - pub fn set_first_byte_timeout(&self, duration: Option) -> Result<(), ()> { + pub fn set_first_byte_timeout( + &self, + duration: Option, + ) -> Result<(), ()> { unsafe { let (result0_0, result0_1) = match duration { Some(e) => (1i32, _rt::as_i64(e)), @@ -3043,16 +3304,17 @@ pub mod wasi { }; #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]request-options.set-first-byte-timeout"] - fn wit_import(_: i32, _: i32, _: i64) -> i32; + fn wit_import1(_: i32, _: i32, _: i64) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: i32, _: i64) -> i32 { + unsafe extern "C" fn wit_import1(_: i32, _: i32, _: i64) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32, result0_0, result0_1); + let ret = unsafe { + wit_import1((self).handle() as i32, result0_0, result0_1) + }; match ret { 0 => { let e = (); @@ -3075,33 +3337,34 @@ pub mod wasi { unsafe { #[repr(align(8))] 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]request-options.between-bytes-timeout"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result4 = match l2 { 0 => None, 1 => { let e = { - let l2 = *ptr0.add(8).cast::(); - - l2 as u64 + let l3 = *ptr0.add(8).cast::(); + l3 as u64 }; Some(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result4 } } } @@ -3121,16 +3384,17 @@ pub mod wasi { }; #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]request-options.set-between-bytes-timeout"] - fn wit_import(_: i32, _: i32, _: i64) -> i32; + fn wit_import1(_: i32, _: i32, _: i64) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: i32, _: i64) -> i32 { + unsafe extern "C" fn wit_import1(_: i32, _: i32, _: i64) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32, result0_0, result0_1); + let ret = unsafe { + wit_import1((self).handle() as i32, result0_0, result0_1) + }; match ret { 0 => { let e = (); @@ -3156,7 +3420,10 @@ pub mod wasi { /// /// The user may provide an `error` to `response` to allow the /// implementation determine how to respond with an HTTP error response. - pub fn set(param: ResponseOutparam, response: Result) { + pub fn set( + param: ResponseOutparam, + response: Result, + ) -> () { unsafe { let ( result38_0, @@ -3168,16 +3435,18 @@ pub mod wasi { result38_6, result38_7, ) = match &response { - Ok(e) => ( - 0i32, - (e).take_handle() as i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), + Ok(e) => { + ( + 0i32, + (e).take_handle() as i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } Err(e) => { let ( result37_0, @@ -3188,15 +3457,17 @@ pub mod wasi { result37_5, result37_6, ) = match e { - ErrorCode::DnsTimeout => ( - 0i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), + ErrorCode::DnsTimeout => { + ( + 0i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } ErrorCode::DnsError(e) => { let DnsErrorPayload { rcode: rcode0, @@ -3207,7 +3478,6 @@ pub mod wasi { let vec1 = e; let ptr1 = vec1.as_ptr().cast::(); let len1 = vec1.len(); - (1i32, ptr1.cast_mut(), len1) } None => (0i32, ::core::ptr::null_mut(), 0usize), @@ -3220,8 +3490,7 @@ pub mod wasi { 1i32, result2_0, { - let mut t = - ::core::mem::MaybeUninit::::uninit(); + let mut t = ::core::mem::MaybeUninit::::uninit(); t.as_mut_ptr().cast::<*mut u8>().write(result2_1); t }, @@ -3231,130 +3500,152 @@ pub mod wasi { 0i32, ) } - ErrorCode::DestinationNotFound => ( - 2i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::DestinationUnavailable => ( - 3i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::DestinationIpProhibited => ( - 4i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::DestinationIpUnroutable => ( - 5i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::ConnectionRefused => ( - 6i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::ConnectionTerminated => ( - 7i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::ConnectionTimeout => ( - 8i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::ConnectionReadTimeout => ( - 9i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::ConnectionWriteTimeout => ( - 10i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::ConnectionLimitReached => ( - 11i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::TlsProtocolError => ( - 12i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::TlsCertificateError => ( - 13i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::TlsAlertReceived(e) => { - let TlsAlertReceivedPayload { - alert_id: alert_id4, - alert_message: alert_message4, - } = e; - let (result5_0, result5_1) = match alert_id4 { - Some(e) => (1i32, _rt::as_i32(e)), - None => (0i32, 0i32), - }; - let (result7_0, result7_1, result7_2) = match alert_message4 - { - Some(e) => { - let vec6 = e; + ErrorCode::DestinationNotFound => { + ( + 2i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::DestinationUnavailable => { + ( + 3i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::DestinationIpProhibited => { + ( + 4i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::DestinationIpUnroutable => { + ( + 5i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::ConnectionRefused => { + ( + 6i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::ConnectionTerminated => { + ( + 7i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::ConnectionTimeout => { + ( + 8i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::ConnectionReadTimeout => { + ( + 9i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::ConnectionWriteTimeout => { + ( + 10i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::ConnectionLimitReached => { + ( + 11i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::TlsProtocolError => { + ( + 12i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::TlsCertificateError => { + ( + 13i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::TlsAlertReceived(e) => { + let TlsAlertReceivedPayload { + alert_id: alert_id4, + alert_message: alert_message4, + } = e; + let (result5_0, result5_1) = match alert_id4 { + Some(e) => (1i32, _rt::as_i32(e)), + None => (0i32, 0i32), + }; + let (result7_0, result7_1, result7_2) = match alert_message4 { + Some(e) => { + let vec6 = e; let ptr6 = vec6.as_ptr().cast::(); let len6 = vec6.len(); - (1i32, ptr6.cast_mut(), len6) } None => (0i32, ::core::ptr::null_mut(), 0usize), @@ -3362,33 +3653,35 @@ pub mod wasi { ( 14i32, result5_0, - ::core::mem::MaybeUninit::new( - i64::from(result5_1) as u64 - ), + ::core::mem::MaybeUninit::new(i64::from(result5_1) as u64), result7_0 as *mut u8, result7_1, result7_2, 0i32, ) } - ErrorCode::HttpRequestDenied => ( - 15i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::HttpRequestLengthRequired => ( - 16i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), + ErrorCode::HttpRequestDenied => { + ( + 15i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::HttpRequestLengthRequired => { + ( + 16i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } ErrorCode::HttpRequestBodySize(e) => { let (result8_0, result8_1) = match e { Some(e) => (1i32, _rt::as_i64(e)), @@ -3404,33 +3697,39 @@ pub mod wasi { 0i32, ) } - ErrorCode::HttpRequestMethodInvalid => ( - 18i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::HttpRequestUriInvalid => ( - 19i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::HttpRequestUriTooLong => ( - 20i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), + ErrorCode::HttpRequestMethodInvalid => { + ( + 18i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::HttpRequestUriInvalid => { + ( + 19i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::HttpRequestUriTooLong => { + ( + 20i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } ErrorCode::HttpRequestHeaderSectionSize(e) => { let (result9_0, result9_1) = match e { Some(e) => (1i32, _rt::as_i32(e)), @@ -3439,9 +3738,7 @@ pub mod wasi { ( 21i32, result9_0, - ::core::mem::MaybeUninit::new( - i64::from(result9_1) as u64 - ), + ::core::mem::MaybeUninit::new(i64::from(result9_1) as u64), ::core::ptr::null_mut(), ::core::ptr::null_mut(), 0usize, @@ -3462,43 +3759,36 @@ pub mod wasi { field_name: field_name10, field_size: field_size10, } = e; - let (result12_0, result12_1, result12_2) = - match field_name10 { - Some(e) => { - let vec11 = e; - let ptr11 = vec11.as_ptr().cast::(); - let len11 = vec11.len(); - - (1i32, ptr11.cast_mut(), len11) - } - None => { - (0i32, ::core::ptr::null_mut(), 0usize) - } - }; + let (result12_0, result12_1, result12_2) = match field_name10 { + Some(e) => { + let vec11 = e; + let ptr11 = vec11.as_ptr().cast::(); + let len11 = vec11.len(); + (1i32, ptr11.cast_mut(), len11) + } + None => (0i32, ::core::ptr::null_mut(), 0usize), + }; let (result13_0, result13_1) = match field_size10 { Some(e) => (1i32, _rt::as_i32(e)), None => (0i32, 0i32), }; ( - 1i32, result12_0, result12_1, result12_2, - result13_0, result13_1, + 1i32, + result12_0, + result12_1, + result12_2, + result13_0, + result13_1, ) } - None => ( - 0i32, - 0i32, - ::core::ptr::null_mut(), - 0usize, - 0i32, - 0i32, - ), + None => { + (0i32, 0i32, ::core::ptr::null_mut(), 0usize, 0i32, 0i32) + } }; ( 22i32, result14_0, - ::core::mem::MaybeUninit::new( - i64::from(result14_1) as u64 - ), + ::core::mem::MaybeUninit::new(i64::from(result14_1) as u64), result14_2, result14_3 as *mut u8, result14_4 as usize, @@ -3513,9 +3803,7 @@ pub mod wasi { ( 23i32, result15_0, - ::core::mem::MaybeUninit::new( - i64::from(result15_1) as u64 - ), + ::core::mem::MaybeUninit::new(i64::from(result15_1) as u64), ::core::ptr::null_mut(), ::core::ptr::null_mut(), 0usize, @@ -3527,17 +3815,15 @@ pub mod wasi { field_name: field_name16, field_size: field_size16, } = e; - let (result18_0, result18_1, result18_2) = - match field_name16 { - Some(e) => { - let vec17 = e; - let ptr17 = vec17.as_ptr().cast::(); - let len17 = vec17.len(); - - (1i32, ptr17.cast_mut(), len17) - } - None => (0i32, ::core::ptr::null_mut(), 0usize), - }; + let (result18_0, result18_1, result18_2) = match field_name16 { + Some(e) => { + let vec17 = e; + let ptr17 = vec17.as_ptr().cast::(); + let len17 = vec17.len(); + (1i32, ptr17.cast_mut(), len17) + } + None => (0i32, ::core::ptr::null_mut(), 0usize), + }; let (result19_0, result19_1) = match field_size16 { Some(e) => (1i32, _rt::as_i32(e)), None => (0i32, 0i32), @@ -3546,8 +3832,7 @@ pub mod wasi { 24i32, result18_0, { - let mut t = - ::core::mem::MaybeUninit::::uninit(); + let mut t = ::core::mem::MaybeUninit::::uninit(); t.as_mut_ptr().cast::<*mut u8>().write(result18_1); t }, @@ -3557,15 +3842,17 @@ pub mod wasi { 0i32, ) } - ErrorCode::HttpResponseIncomplete => ( - 25i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), + ErrorCode::HttpResponseIncomplete => { + ( + 25i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } ErrorCode::HttpResponseHeaderSectionSize(e) => { let (result20_0, result20_1) = match e { Some(e) => (1i32, _rt::as_i32(e)), @@ -3574,9 +3861,7 @@ pub mod wasi { ( 26i32, result20_0, - ::core::mem::MaybeUninit::new( - i64::from(result20_1) as u64 - ), + ::core::mem::MaybeUninit::new(i64::from(result20_1) as u64), ::core::ptr::null_mut(), ::core::ptr::null_mut(), 0usize, @@ -3588,17 +3873,15 @@ pub mod wasi { field_name: field_name21, field_size: field_size21, } = e; - let (result23_0, result23_1, result23_2) = - match field_name21 { - Some(e) => { - let vec22 = e; - let ptr22 = vec22.as_ptr().cast::(); - let len22 = vec22.len(); - - (1i32, ptr22.cast_mut(), len22) - } - None => (0i32, ::core::ptr::null_mut(), 0usize), - }; + let (result23_0, result23_1, result23_2) = match field_name21 { + Some(e) => { + let vec22 = e; + let ptr22 = vec22.as_ptr().cast::(); + let len22 = vec22.len(); + (1i32, ptr22.cast_mut(), len22) + } + None => (0i32, ::core::ptr::null_mut(), 0usize), + }; let (result24_0, result24_1) = match field_size21 { Some(e) => (1i32, _rt::as_i32(e)), None => (0i32, 0i32), @@ -3607,8 +3890,7 @@ pub mod wasi { 27i32, result23_0, { - let mut t = - ::core::mem::MaybeUninit::::uninit(); + let mut t = ::core::mem::MaybeUninit::::uninit(); t.as_mut_ptr().cast::<*mut u8>().write(result23_1); t }, @@ -3641,9 +3923,7 @@ pub mod wasi { ( 29i32, result26_0, - ::core::mem::MaybeUninit::new( - i64::from(result26_1) as u64 - ), + ::core::mem::MaybeUninit::new(i64::from(result26_1) as u64), ::core::ptr::null_mut(), ::core::ptr::null_mut(), 0usize, @@ -3655,17 +3935,15 @@ pub mod wasi { field_name: field_name27, field_size: field_size27, } = e; - let (result29_0, result29_1, result29_2) = - match field_name27 { - Some(e) => { - let vec28 = e; - let ptr28 = vec28.as_ptr().cast::(); - let len28 = vec28.len(); - - (1i32, ptr28.cast_mut(), len28) - } - None => (0i32, ::core::ptr::null_mut(), 0usize), - }; + let (result29_0, result29_1, result29_2) = match field_name27 { + Some(e) => { + let vec28 = e; + let ptr28 = vec28.as_ptr().cast::(); + let len28 = vec28.len(); + (1i32, ptr28.cast_mut(), len28) + } + None => (0i32, ::core::ptr::null_mut(), 0usize), + }; let (result30_0, result30_1) = match field_size27 { Some(e) => (1i32, _rt::as_i32(e)), None => (0i32, 0i32), @@ -3674,8 +3952,7 @@ pub mod wasi { 30i32, result29_0, { - let mut t = - ::core::mem::MaybeUninit::::uninit(); + let mut t = ::core::mem::MaybeUninit::::uninit(); t.as_mut_ptr().cast::<*mut u8>().write(result29_1); t }, @@ -3691,7 +3968,6 @@ pub mod wasi { let vec31 = e; let ptr31 = vec31.as_ptr().cast::(); let len31 = vec31.len(); - (1i32, ptr31.cast_mut(), len31) } None => (0i32, ::core::ptr::null_mut(), 0usize), @@ -3700,8 +3976,7 @@ pub mod wasi { 31i32, result32_0, { - let mut t = - ::core::mem::MaybeUninit::::uninit(); + let mut t = ::core::mem::MaybeUninit::::uninit(); t.as_mut_ptr().cast::<*mut u8>().write(result32_1); t }, @@ -3717,7 +3992,6 @@ pub mod wasi { let vec33 = e; let ptr33 = vec33.as_ptr().cast::(); let len33 = vec33.len(); - (1i32, ptr33.cast_mut(), len33) } None => (0i32, ::core::ptr::null_mut(), 0usize), @@ -3726,8 +4000,7 @@ pub mod wasi { 32i32, result34_0, { - let mut t = - ::core::mem::MaybeUninit::::uninit(); + let mut t = ::core::mem::MaybeUninit::::uninit(); t.as_mut_ptr().cast::<*mut u8>().write(result34_1); t }, @@ -3737,58 +4010,67 @@ pub mod wasi { 0i32, ) } - ErrorCode::HttpResponseTimeout => ( - 33i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::HttpUpgradeFailed => ( - 34i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::HttpProtocolError => ( - 35i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::LoopDetected => ( - 36i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::ConfigurationError => ( - 37i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), + ErrorCode::HttpResponseTimeout => { + ( + 33i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::HttpUpgradeFailed => { + ( + 34i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::HttpProtocolError => { + ( + 35i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::LoopDetected => { + ( + 36i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::ConfigurationError => { + ( + 37i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } ErrorCode::InternalError(e) => { let (result36_0, result36_1, result36_2) = match e { Some(e) => { let vec35 = e; let ptr35 = vec35.as_ptr().cast::(); let len35 = vec35.len(); - (1i32, ptr35.cast_mut(), len35) } None => (0i32, ::core::ptr::null_mut(), 0usize), @@ -3797,8 +4079,7 @@ pub mod wasi { 38i32, result36_0, { - let mut t = - ::core::mem::MaybeUninit::::uninit(); + let mut t = ::core::mem::MaybeUninit::::uninit(); t.as_mut_ptr().cast::<*mut u8>().write(result36_1); t }, @@ -3809,18 +4090,23 @@ pub mod wasi { ) } }; - ( - 1i32, result37_0, result37_1, result37_2, result37_3, - result37_4, result37_5, result37_6, + 1i32, + result37_0, + result37_1, + result37_2, + result37_3, + result37_4, + result37_5, + result37_6, ) } }; #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[static]response-outparam.set"] - fn wit_import( + fn wit_import39( _: i32, _: i32, _: i32, @@ -3832,9 +4118,8 @@ pub mod wasi { _: i32, ); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import( + unsafe extern "C" fn wit_import39( _: i32, _: i32, _: i32, @@ -3847,17 +4132,19 @@ pub mod wasi { ) { unreachable!() } - wit_import( - (¶m).take_handle() as i32, - result38_0, - result38_1, - result38_2, - result38_3, - result38_4, - result38_5, - result38_6, - result38_7, - ); + unsafe { + wit_import39( + (¶m).take_handle() as i32, + result38_0, + result38_1, + result38_2, + result38_3, + result38_4, + result38_5, + result38_6, + result38_7, + ) + }; } } } @@ -3868,16 +4155,15 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]incoming-response.status"] - fn wit_import(_: i32) -> i32; + fn wit_import0(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32) -> i32 { + unsafe extern "C" fn wit_import0(_: i32) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32); + let ret = unsafe { wit_import0((self).handle() as i32) }; ret as u16 } } @@ -3895,17 +4181,16 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]incoming-response.headers"] - fn wit_import(_: i32) -> i32; + fn wit_import0(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32) -> i32 { + unsafe extern "C" fn wit_import0(_: i32) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32); - Fields::from_handle(ret as u32) + let ret = unsafe { wit_import0((self).handle() as i32) }; + unsafe { Fields::from_handle(ret as u32) } } } } @@ -3917,27 +4202,27 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 8], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]incoming-response.consume"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result4 = match l2 { 0 => { let e = { - let l2 = *ptr0.add(4).cast::(); - - IncomingBody::from_handle(l2 as u32) + let l3 = *ptr0.add(4).cast::(); + unsafe { IncomingBody::from_handle(l3 as u32) } }; Ok(e) } @@ -3946,7 +4231,8 @@ pub mod wasi { Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result4 } } } @@ -3971,29 +4257,31 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 8], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]incoming-body.stream"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result4 = match l2 { 0 => { let e = { - let l2 = *ptr0.add(4).cast::(); - - super::super::super::wasi::io::streams::InputStream::from_handle( - l2 as u32, - ) + let l3 = *ptr0.add(4).cast::(); + unsafe { + super::super::super::wasi::io::streams::InputStream::from_handle( + l3 as u32, + ) + } }; Ok(e) } @@ -4002,7 +4290,8 @@ pub mod wasi { Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result4 } } } @@ -4014,17 +4303,16 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[static]incoming-body.finish"] - fn wit_import(_: i32) -> i32; + fn wit_import0(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32) -> i32 { + unsafe extern "C" fn wit_import0(_: i32) -> i32 { unreachable!() } - let ret = wit_import((&this).take_handle() as i32); - FutureTrailers::from_handle(ret as u32) + let ret = unsafe { wit_import0((&this).take_handle() as i32) }; + unsafe { FutureTrailers::from_handle(ret as u32) } } } } @@ -4037,17 +4325,20 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]future-trailers.subscribe"] - fn wit_import(_: i32) -> i32; + fn wit_import0(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32) -> i32 { + unsafe extern "C" fn wit_import0(_: i32) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32); - super::super::super::wasi::io::poll::Pollable::from_handle(ret as u32) + let ret = unsafe { wit_import0((self).handle() as i32) }; + unsafe { + super::super::super::wasi::io::poll::Pollable::from_handle( + ret as u32, + ) + } } } } @@ -4072,554 +4363,579 @@ pub mod wasi { /// resource is immutable, and a child. Use of the `set`, `append`, or /// `delete` methods will return an error, and the resource must be /// dropped before the parent `future-trailers` is dropped. - pub fn get(&self) -> Option, ErrorCode>, ()>> { + pub fn get( + &self, + ) -> Option, ErrorCode>, ()>> { unsafe { #[repr(align(8))] - struct RetArea([::core::mem::MaybeUninit; 56]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 56]); + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 40 + 4 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 40 + + 4 * ::core::mem::size_of::<*const u8>()], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]future-trailers.get"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result70 = match l2 { 0 => None, 1 => { let e = { - let l2 = i32::from(*ptr0.add(8).cast::()); - - match l2 { + let l3 = i32::from(*ptr0.add(8).cast::()); + match l3 { 0 => { let e = { - let l3 = i32::from(*ptr0.add(16).cast::()); - - match l3 { + let l4 = i32::from(*ptr0.add(16).cast::()); + match l4 { 0 => { - let e = - { - let l4 = i32::from( - *ptr0.add(24).cast::(), - ); - - match l4 { - 0 => None, - 1 => { - let e = { - let l5 = *ptr0.add(28).cast::(); - - Fields::from_handle(l5 as u32) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; + let e = { + let l5 = i32::from(*ptr0.add(24).cast::()); + match l5 { + 0 => None, + 1 => { + let e = { + let l6 = *ptr0.add(28).cast::(); + unsafe { Fields::from_handle(l6 as u32) } + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; Ok(e) } 1 => { let e = { - let l6 = i32::from( - *ptr0.add(24).cast::(), - ); - let v68 = match l6 { - 0 => { - ErrorCode::DnsTimeout - } - 1 => { - let e68 = { - let l7 = i32::from(*ptr0.add(32).cast::()); - let l11 = i32::from(*ptr0.add(44).cast::()); - - DnsErrorPayload{ - rcode: match l7 { - 0 => None, - 1 => { - let e = { - let l8 = *ptr0.add(36).cast::<*mut u8>(); - let l9 = *ptr0.add(40).cast::(); - let len10 = l9; - let bytes10 = _rt::Vec::from_raw_parts(l8.cast(), len10, len10); - - _rt::string_lift(bytes10) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - info_code: match l11 { - 0 => None, - 1 => { - let e = { - let l12 = i32::from(*ptr0.add(46).cast::()); - - l12 as u16 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } - }; - ErrorCode::DnsError(e68) - } - 2 => { - ErrorCode::DestinationNotFound - } - 3 => { - ErrorCode::DestinationUnavailable - } - 4 => { - ErrorCode::DestinationIpProhibited - } - 5 => { - ErrorCode::DestinationIpUnroutable - } - 6 => { - ErrorCode::ConnectionRefused - } - 7 => { - ErrorCode::ConnectionTerminated - } - 8 => { - ErrorCode::ConnectionTimeout - } - 9 => { - ErrorCode::ConnectionReadTimeout - } - 10 => { - ErrorCode::ConnectionWriteTimeout - } - 11 => { - ErrorCode::ConnectionLimitReached - } - 12 => { - ErrorCode::TlsProtocolError - } - 13 => { - ErrorCode::TlsCertificateError - } - 14 => { - let e68 = { - let l13 = i32::from(*ptr0.add(32).cast::()); - let l15 = i32::from(*ptr0.add(36).cast::()); - - TlsAlertReceivedPayload{ - alert_id: match l13 { - 0 => None, - 1 => { - let e = { - let l14 = i32::from(*ptr0.add(33).cast::()); - - l14 as u8 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - alert_message: match l15 { - 0 => None, - 1 => { - let e = { - let l16 = *ptr0.add(40).cast::<*mut u8>(); - let l17 = *ptr0.add(44).cast::(); - let len18 = l17; - let bytes18 = _rt::Vec::from_raw_parts(l16.cast(), len18, len18); - - _rt::string_lift(bytes18) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } - }; - ErrorCode::TlsAlertReceived(e68) - } - 15 => { - ErrorCode::HttpRequestDenied - } - 16 => { - ErrorCode::HttpRequestLengthRequired - } - 17 => { - let e68 = { - let l19 = i32::from(*ptr0.add(32).cast::()); - - match l19 { - 0 => None, - 1 => { - let e = { - let l20 = *ptr0.add(40).cast::(); - - l20 as u64 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpRequestBodySize(e68) - } - 18 => { - ErrorCode::HttpRequestMethodInvalid - } - 19 => { - ErrorCode::HttpRequestUriInvalid - } - 20 => { - ErrorCode::HttpRequestUriTooLong - } - 21 => { - let e68 = { - let l21 = i32::from(*ptr0.add(32).cast::()); - - match l21 { - 0 => None, - 1 => { - let e = { - let l22 = *ptr0.add(36).cast::(); - - l22 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpRequestHeaderSectionSize(e68) - } - 22 => { - let e68 = { - let l23 = i32::from(*ptr0.add(32).cast::()); - - match l23 { - 0 => None, - 1 => { - let e = { - let l24 = i32::from(*ptr0.add(36).cast::()); - let l28 = i32::from(*ptr0.add(48).cast::()); - - FieldSizePayload{ - field_name: match l24 { - 0 => None, - 1 => { - let e = { - let l25 = *ptr0.add(40).cast::<*mut u8>(); - let l26 = *ptr0.add(44).cast::(); - let len27 = l26; - let bytes27 = _rt::Vec::from_raw_parts(l25.cast(), len27, len27); - - _rt::string_lift(bytes27) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - field_size: match l28 { - 0 => None, - 1 => { - let e = { - let l29 = *ptr0.add(52).cast::(); - - l29 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpRequestHeaderSize(e68) - } - 23 => { - let e68 = { - let l30 = i32::from(*ptr0.add(32).cast::()); - - match l30 { - 0 => None, - 1 => { - let e = { - let l31 = *ptr0.add(36).cast::(); - - l31 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpRequestTrailerSectionSize(e68) - } - 24 => { - let e68 = { - let l32 = i32::from(*ptr0.add(32).cast::()); - let l36 = i32::from(*ptr0.add(44).cast::()); - - FieldSizePayload{ - field_name: match l32 { - 0 => None, - 1 => { - let e = { - let l33 = *ptr0.add(36).cast::<*mut u8>(); - let l34 = *ptr0.add(40).cast::(); - let len35 = l34; - let bytes35 = _rt::Vec::from_raw_parts(l33.cast(), len35, len35); - - _rt::string_lift(bytes35) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - field_size: match l36 { - 0 => None, - 1 => { - let e = { - let l37 = *ptr0.add(48).cast::(); - - l37 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } - }; - ErrorCode::HttpRequestTrailerSize(e68) - } - 25 => { - ErrorCode::HttpResponseIncomplete - } - 26 => { - let e68 = { - let l38 = i32::from(*ptr0.add(32).cast::()); - - match l38 { - 0 => None, - 1 => { - let e = { - let l39 = *ptr0.add(36).cast::(); - - l39 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpResponseHeaderSectionSize(e68) - } - 27 => { - let e68 = { - let l40 = i32::from(*ptr0.add(32).cast::()); - let l44 = i32::from(*ptr0.add(44).cast::()); - - FieldSizePayload{ - field_name: match l40 { - 0 => None, - 1 => { - let e = { - let l41 = *ptr0.add(36).cast::<*mut u8>(); - let l42 = *ptr0.add(40).cast::(); - let len43 = l42; - let bytes43 = _rt::Vec::from_raw_parts(l41.cast(), len43, len43); - - _rt::string_lift(bytes43) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - field_size: match l44 { - 0 => None, - 1 => { - let e = { - let l45 = *ptr0.add(48).cast::(); - - l45 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } - }; - ErrorCode::HttpResponseHeaderSize(e68) - } - 28 => { - let e68 = { - let l46 = i32::from(*ptr0.add(32).cast::()); - - match l46 { - 0 => None, - 1 => { - let e = { - let l47 = *ptr0.add(40).cast::(); - - l47 as u64 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpResponseBodySize(e68) - } - 29 => { - let e68 = { - let l48 = i32::from(*ptr0.add(32).cast::()); - - match l48 { - 0 => None, - 1 => { - let e = { - let l49 = *ptr0.add(36).cast::(); - - l49 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpResponseTrailerSectionSize(e68) - } - 30 => { - let e68 = { - let l50 = i32::from(*ptr0.add(32).cast::()); - let l54 = i32::from(*ptr0.add(44).cast::()); - - FieldSizePayload{ - field_name: match l50 { - 0 => None, - 1 => { - let e = { - let l51 = *ptr0.add(36).cast::<*mut u8>(); - let l52 = *ptr0.add(40).cast::(); - let len53 = l52; - let bytes53 = _rt::Vec::from_raw_parts(l51.cast(), len53, len53); - - _rt::string_lift(bytes53) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - field_size: match l54 { - 0 => None, - 1 => { - let e = { - let l55 = *ptr0.add(48).cast::(); - - l55 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } - }; - ErrorCode::HttpResponseTrailerSize(e68) - } - 31 => { - let e68 = { - let l56 = i32::from(*ptr0.add(32).cast::()); - - match l56 { - 0 => None, - 1 => { - let e = { - let l57 = *ptr0.add(36).cast::<*mut u8>(); - let l58 = *ptr0.add(40).cast::(); - let len59 = l58; - let bytes59 = _rt::Vec::from_raw_parts(l57.cast(), len59, len59); - - _rt::string_lift(bytes59) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpResponseTransferCoding(e68) - } - 32 => { - let e68 = { - let l60 = i32::from(*ptr0.add(32).cast::()); - - match l60 { - 0 => None, - 1 => { - let e = { - let l61 = *ptr0.add(36).cast::<*mut u8>(); - let l62 = *ptr0.add(40).cast::(); - let len63 = l62; - let bytes63 = _rt::Vec::from_raw_parts(l61.cast(), len63, len63); - - _rt::string_lift(bytes63) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpResponseContentCoding(e68) - } - 33 => { - ErrorCode::HttpResponseTimeout - } - 34 => { - ErrorCode::HttpUpgradeFailed - } - 35 => { - ErrorCode::HttpProtocolError - } - 36 => { - ErrorCode::LoopDetected - } - 37 => { - ErrorCode::ConfigurationError - } - n => { - debug_assert_eq!(n, 38, "invalid enum discriminant"); - let e68 = { - let l64 = i32::from(*ptr0.add(32).cast::()); - - match l64 { - 0 => None, - 1 => { - let e = { - let l65 = *ptr0.add(36).cast::<*mut u8>(); - let l66 = *ptr0.add(40).cast::(); - let len67 = l66; - let bytes67 = _rt::Vec::from_raw_parts(l65.cast(), len67, len67); - - _rt::string_lift(bytes67) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::InternalError(e68) - } - }; - - v68 + let l7 = i32::from(*ptr0.add(24).cast::()); + let v69 = match l7 { + 0 => ErrorCode::DnsTimeout, + 1 => { + let e69 = { + let l8 = i32::from(*ptr0.add(32).cast::()); + let l12 = i32::from( + *ptr0 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + DnsErrorPayload { + rcode: match l8 { + 0 => None, + 1 => { + let e = { + let l9 = *ptr0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l10 = *ptr0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len11 = l10; + let bytes11 = _rt::Vec::from_raw_parts( + l9.cast(), + len11, + len11, + ); + _rt::string_lift(bytes11) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + info_code: match l12 { + 0 => None, + 1 => { + let e = { + let l13 = i32::from( + *ptr0 + .add(34 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + l13 as u16 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } + }; + ErrorCode::DnsError(e69) + } + 2 => ErrorCode::DestinationNotFound, + 3 => ErrorCode::DestinationUnavailable, + 4 => ErrorCode::DestinationIpProhibited, + 5 => ErrorCode::DestinationIpUnroutable, + 6 => ErrorCode::ConnectionRefused, + 7 => ErrorCode::ConnectionTerminated, + 8 => ErrorCode::ConnectionTimeout, + 9 => ErrorCode::ConnectionReadTimeout, + 10 => ErrorCode::ConnectionWriteTimeout, + 11 => ErrorCode::ConnectionLimitReached, + 12 => ErrorCode::TlsProtocolError, + 13 => ErrorCode::TlsCertificateError, + 14 => { + let e69 = { + let l14 = i32::from(*ptr0.add(32).cast::()); + let l16 = i32::from( + *ptr0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + TlsAlertReceivedPayload { + alert_id: match l14 { + 0 => None, + 1 => { + let e = { + let l15 = i32::from(*ptr0.add(33).cast::()); + l15 as u8 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + alert_message: match l16 { + 0 => None, + 1 => { + let e = { + let l17 = *ptr0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l18 = *ptr0 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len19 = l18; + let bytes19 = _rt::Vec::from_raw_parts( + l17.cast(), + len19, + len19, + ); + _rt::string_lift(bytes19) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } + }; + ErrorCode::TlsAlertReceived(e69) + } + 15 => ErrorCode::HttpRequestDenied, + 16 => ErrorCode::HttpRequestLengthRequired, + 17 => { + let e69 = { + let l20 = i32::from(*ptr0.add(32).cast::()); + match l20 { + 0 => None, + 1 => { + let e = { + let l21 = *ptr0.add(40).cast::(); + l21 as u64 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpRequestBodySize(e69) + } + 18 => ErrorCode::HttpRequestMethodInvalid, + 19 => ErrorCode::HttpRequestUriInvalid, + 20 => ErrorCode::HttpRequestUriTooLong, + 21 => { + let e69 = { + let l22 = i32::from(*ptr0.add(32).cast::()); + match l22 { + 0 => None, + 1 => { + let e = { + let l23 = *ptr0.add(36).cast::(); + l23 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpRequestHeaderSectionSize(e69) + } + 22 => { + let e69 = { + let l24 = i32::from(*ptr0.add(32).cast::()); + match l24 { + 0 => None, + 1 => { + let e = { + let l25 = i32::from( + *ptr0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + let l29 = i32::from( + *ptr0 + .add(32 + 4 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + FieldSizePayload { + field_name: match l25 { + 0 => None, + 1 => { + let e = { + let l26 = *ptr0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l27 = *ptr0 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len28 = l27; + let bytes28 = _rt::Vec::from_raw_parts( + l26.cast(), + len28, + len28, + ); + _rt::string_lift(bytes28) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + field_size: match l29 { + 0 => None, + 1 => { + let e = { + let l30 = *ptr0 + .add(36 + 4 * ::core::mem::size_of::<*const u8>()) + .cast::(); + l30 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpRequestHeaderSize(e69) + } + 23 => { + let e69 = { + let l31 = i32::from(*ptr0.add(32).cast::()); + match l31 { + 0 => None, + 1 => { + let e = { + let l32 = *ptr0.add(36).cast::(); + l32 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpRequestTrailerSectionSize(e69) + } + 24 => { + let e69 = { + let l33 = i32::from(*ptr0.add(32).cast::()); + let l37 = i32::from( + *ptr0 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + FieldSizePayload { + field_name: match l33 { + 0 => None, + 1 => { + let e = { + let l34 = *ptr0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l35 = *ptr0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len36 = l35; + let bytes36 = _rt::Vec::from_raw_parts( + l34.cast(), + len36, + len36, + ); + _rt::string_lift(bytes36) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + field_size: match l37 { + 0 => None, + 1 => { + let e = { + let l38 = *ptr0 + .add(36 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + l38 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } + }; + ErrorCode::HttpRequestTrailerSize(e69) + } + 25 => ErrorCode::HttpResponseIncomplete, + 26 => { + let e69 = { + let l39 = i32::from(*ptr0.add(32).cast::()); + match l39 { + 0 => None, + 1 => { + let e = { + let l40 = *ptr0.add(36).cast::(); + l40 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpResponseHeaderSectionSize(e69) + } + 27 => { + let e69 = { + let l41 = i32::from(*ptr0.add(32).cast::()); + let l45 = i32::from( + *ptr0 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + FieldSizePayload { + field_name: match l41 { + 0 => None, + 1 => { + let e = { + let l42 = *ptr0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l43 = *ptr0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len44 = l43; + let bytes44 = _rt::Vec::from_raw_parts( + l42.cast(), + len44, + len44, + ); + _rt::string_lift(bytes44) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + field_size: match l45 { + 0 => None, + 1 => { + let e = { + let l46 = *ptr0 + .add(36 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + l46 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } + }; + ErrorCode::HttpResponseHeaderSize(e69) + } + 28 => { + let e69 = { + let l47 = i32::from(*ptr0.add(32).cast::()); + match l47 { + 0 => None, + 1 => { + let e = { + let l48 = *ptr0.add(40).cast::(); + l48 as u64 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpResponseBodySize(e69) + } + 29 => { + let e69 = { + let l49 = i32::from(*ptr0.add(32).cast::()); + match l49 { + 0 => None, + 1 => { + let e = { + let l50 = *ptr0.add(36).cast::(); + l50 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpResponseTrailerSectionSize(e69) + } + 30 => { + let e69 = { + let l51 = i32::from(*ptr0.add(32).cast::()); + let l55 = i32::from( + *ptr0 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + FieldSizePayload { + field_name: match l51 { + 0 => None, + 1 => { + let e = { + let l52 = *ptr0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l53 = *ptr0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len54 = l53; + let bytes54 = _rt::Vec::from_raw_parts( + l52.cast(), + len54, + len54, + ); + _rt::string_lift(bytes54) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + field_size: match l55 { + 0 => None, + 1 => { + let e = { + let l56 = *ptr0 + .add(36 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + l56 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } + }; + ErrorCode::HttpResponseTrailerSize(e69) + } + 31 => { + let e69 = { + let l57 = i32::from(*ptr0.add(32).cast::()); + match l57 { + 0 => None, + 1 => { + let e = { + let l58 = *ptr0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l59 = *ptr0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len60 = l59; + let bytes60 = _rt::Vec::from_raw_parts( + l58.cast(), + len60, + len60, + ); + _rt::string_lift(bytes60) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpResponseTransferCoding(e69) + } + 32 => { + let e69 = { + let l61 = i32::from(*ptr0.add(32).cast::()); + match l61 { + 0 => None, + 1 => { + let e = { + let l62 = *ptr0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l63 = *ptr0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len64 = l63; + let bytes64 = _rt::Vec::from_raw_parts( + l62.cast(), + len64, + len64, + ); + _rt::string_lift(bytes64) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpResponseContentCoding(e69) + } + 33 => ErrorCode::HttpResponseTimeout, + 34 => ErrorCode::HttpUpgradeFailed, + 35 => ErrorCode::HttpProtocolError, + 36 => ErrorCode::LoopDetected, + 37 => ErrorCode::ConfigurationError, + n => { + debug_assert_eq!(n, 38, "invalid enum discriminant"); + let e69 = { + let l65 = i32::from(*ptr0.add(32).cast::()); + match l65 { + 0 => None, + 1 => { + let e = { + let l66 = *ptr0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l67 = *ptr0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len68 = l67; + let bytes68 = _rt::Vec::from_raw_parts( + l66.cast(), + len68, + len68, + ); + _rt::string_lift(bytes68) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::InternalError(e69) + } + }; + v69 }; Err(e) } @@ -4638,7 +4954,8 @@ pub mod wasi { Some(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result70 } } } @@ -4653,17 +4970,18 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[constructor]outgoing-response"] - fn wit_import(_: i32) -> i32; + fn wit_import0(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32) -> i32 { + unsafe extern "C" fn wit_import0(_: i32) -> i32 { unreachable!() } - let ret = wit_import((&headers).take_handle() as i32); - OutgoingResponse::from_handle(ret as u32) + let ret = unsafe { + wit_import0((&headers).take_handle() as i32) + }; + unsafe { OutgoingResponse::from_handle(ret as u32) } } } } @@ -4674,16 +4992,15 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]outgoing-response.status-code"] - fn wit_import(_: i32) -> i32; + fn wit_import0(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32) -> i32 { + unsafe extern "C" fn wit_import0(_: i32) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32); + let ret = unsafe { wit_import0((self).handle() as i32) }; ret as u16 } } @@ -4692,20 +5009,24 @@ pub mod wasi { #[allow(unused_unsafe, clippy::all)] /// Set the HTTP Status Code for the Response. Fails if the status-code /// given is not a valid http status code. - pub fn set_status_code(&self, status_code: StatusCode) -> Result<(), ()> { + pub fn set_status_code( + &self, + status_code: StatusCode, + ) -> Result<(), ()> { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]outgoing-response.set-status-code"] - fn wit_import(_: i32, _: i32) -> i32; + fn wit_import0(_: i32, _: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: i32) -> i32 { + unsafe extern "C" fn wit_import0(_: i32, _: i32) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32, _rt::as_i32(status_code)); + let ret = unsafe { + wit_import0((self).handle() as i32, _rt::as_i32(status_code)) + }; match ret { 0 => { let e = (); @@ -4734,17 +5055,16 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]outgoing-response.headers"] - fn wit_import(_: i32) -> i32; + fn wit_import0(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32) -> i32 { + unsafe extern "C" fn wit_import0(_: i32) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32); - Fields::from_handle(ret as u32) + let ret = unsafe { wit_import0((self).handle() as i32) }; + unsafe { Fields::from_handle(ret as u32) } } } } @@ -4759,27 +5079,27 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 8], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]outgoing-response.body"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result4 = match l2 { 0 => { let e = { - let l2 = *ptr0.add(4).cast::(); - - OutgoingBody::from_handle(l2 as u32) + let l3 = *ptr0.add(4).cast::(); + unsafe { OutgoingBody::from_handle(l3 as u32) } }; Ok(e) } @@ -4788,7 +5108,8 @@ pub mod wasi { Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result4 } } } @@ -4807,27 +5128,31 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 8], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]outgoing-body.write"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result4 = match l2 { 0 => { let e = { - let l2 = *ptr0.add(4).cast::(); - - super::super::super::wasi::io::streams::OutputStream::from_handle(l2 as u32) + let l3 = *ptr0.add(4).cast::(); + unsafe { + super::super::super::wasi::io::streams::OutputStream::from_handle( + l3 as u32, + ) + } }; Ok(e) } @@ -4836,7 +5161,8 @@ pub mod wasi { Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result4 } } } @@ -4857,8 +5183,15 @@ pub mod wasi { ) -> Result<(), ErrorCode> { unsafe { #[repr(align(8))] - struct RetArea([::core::mem::MaybeUninit; 40]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 40]); + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 24 + 4 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 24 + + 4 * ::core::mem::size_of::<*const u8>()], + ); let (result0_0, result0_1) = match &trailers { Some(e) => (1i32, (e).take_handle() as i32), None => (0i32, 0i32), @@ -4866,64 +5199,79 @@ pub mod wasi { let ptr1 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[static]outgoing-body.finish"] - fn wit_import(_: i32, _: i32, _: i32, _: *mut u8); + fn wit_import2(_: i32, _: i32, _: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: i32, _: i32, _: *mut u8) { + unsafe extern "C" fn wit_import2( + _: i32, + _: i32, + _: i32, + _: *mut u8, + ) { unreachable!() } - wit_import((&this).take_handle() as i32, result0_0, result0_1, ptr1); - let l2 = i32::from(*ptr1.add(0).cast::()); - match l2 { + unsafe { + wit_import2( + (&this).take_handle() as i32, + result0_0, + result0_1, + ptr1, + ) + }; + let l3 = i32::from(*ptr1.add(0).cast::()); + let result67 = match l3 { 0 => { let e = (); Ok(e) } 1 => { let e = { - let l3 = i32::from(*ptr1.add(8).cast::()); - let v65 = match l3 { + let l4 = i32::from(*ptr1.add(8).cast::()); + let v66 = match l4 { 0 => ErrorCode::DnsTimeout, 1 => { - let e65 = { - let l4 = i32::from(*ptr1.add(16).cast::()); - let l8 = i32::from(*ptr1.add(28).cast::()); - + let e66 = { + let l5 = i32::from(*ptr1.add(16).cast::()); + let l9 = i32::from( + *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); DnsErrorPayload { - rcode: match l4 { + rcode: match l5 { 0 => None, 1 => { let e = { - let l5 = - *ptr1.add(20).cast::<*mut u8>(); - let l6 = - *ptr1.add(24).cast::(); - let len7 = l6; - let bytes7 = - _rt::Vec::from_raw_parts( - l5.cast(), - len7, - len7, - ); - - _rt::string_lift(bytes7) + let l6 = *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l7 = *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len8 = l7; + let bytes8 = _rt::Vec::from_raw_parts( + l6.cast(), + len8, + len8, + ); + _rt::string_lift(bytes8) }; Some(e) } _ => _rt::invalid_enum_discriminant(), }, - info_code: match l8 { + info_code: match l9 { 0 => None, 1 => { let e = { - let l9 = i32::from( - *ptr1.add(30).cast::(), + let l10 = i32::from( + *ptr1 + .add(18 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(), ); - - l9 as u16 + l10 as u16 }; Some(e) } @@ -4931,7 +5279,7 @@ pub mod wasi { }, } }; - ErrorCode::DnsError(e65) + ErrorCode::DnsError(e66) } 2 => ErrorCode::DestinationNotFound, 3 => ErrorCode::DestinationUnavailable, @@ -4946,42 +5294,42 @@ pub mod wasi { 12 => ErrorCode::TlsProtocolError, 13 => ErrorCode::TlsCertificateError, 14 => { - let e65 = { - let l10 = i32::from(*ptr1.add(16).cast::()); - let l12 = i32::from(*ptr1.add(20).cast::()); - + let e66 = { + let l11 = i32::from(*ptr1.add(16).cast::()); + let l13 = i32::from( + *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); TlsAlertReceivedPayload { - alert_id: match l10 { + alert_id: match l11 { 0 => None, 1 => { let e = { - let l11 = i32::from( - *ptr1.add(17).cast::(), - ); - - l11 as u8 + let l12 = i32::from(*ptr1.add(17).cast::()); + l12 as u8 }; Some(e) } _ => _rt::invalid_enum_discriminant(), }, - alert_message: match l12 { + alert_message: match l13 { 0 => None, 1 => { let e = { - let l13 = - *ptr1.add(24).cast::<*mut u8>(); - let l14 = - *ptr1.add(28).cast::(); - let len15 = l14; - let bytes15 = - _rt::Vec::from_raw_parts( - l13.cast(), - len15, - len15, - ); - - _rt::string_lift(bytes15) + let l14 = *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l15 = *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len16 = l15; + let bytes16 = _rt::Vec::from_raw_parts( + l14.cast(), + len16, + len16, + ); + _rt::string_lift(bytes16) }; Some(e) } @@ -4989,158 +5337,165 @@ pub mod wasi { }, } }; - ErrorCode::TlsAlertReceived(e65) + ErrorCode::TlsAlertReceived(e66) } 15 => ErrorCode::HttpRequestDenied, 16 => ErrorCode::HttpRequestLengthRequired, 17 => { - let e65 = { - let l16 = i32::from(*ptr1.add(16).cast::()); - - match l16 { + let e66 = { + let l17 = i32::from(*ptr1.add(16).cast::()); + match l17 { 0 => None, 1 => { let e = { - let l17 = *ptr1.add(24).cast::(); - - l17 as u64 + let l18 = *ptr1.add(24).cast::(); + l18 as u64 }; Some(e) } _ => _rt::invalid_enum_discriminant(), } }; - ErrorCode::HttpRequestBodySize(e65) + ErrorCode::HttpRequestBodySize(e66) } 18 => ErrorCode::HttpRequestMethodInvalid, 19 => ErrorCode::HttpRequestUriInvalid, 20 => ErrorCode::HttpRequestUriTooLong, 21 => { - let e65 = { - let l18 = i32::from(*ptr1.add(16).cast::()); - - match l18 { + let e66 = { + let l19 = i32::from(*ptr1.add(16).cast::()); + match l19 { 0 => None, 1 => { let e = { - let l19 = *ptr1.add(20).cast::(); - - l19 as u32 + let l20 = *ptr1.add(20).cast::(); + l20 as u32 }; Some(e) } _ => _rt::invalid_enum_discriminant(), } }; - ErrorCode::HttpRequestHeaderSectionSize(e65) + ErrorCode::HttpRequestHeaderSectionSize(e66) } 22 => { - let e65 = { - let l20 = i32::from(*ptr1.add(16).cast::()); - - match l20 { + let e66 = { + let l21 = i32::from(*ptr1.add(16).cast::()); + match l21 { 0 => None, 1 => { let e = { - let l21 = i32::from( - *ptr1.add(20).cast::(), + let l22 = i32::from( + *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(), ); - let l25 = i32::from( - *ptr1.add(32).cast::(), + let l26 = i32::from( + *ptr1 + .add(16 + 4 * ::core::mem::size_of::<*const u8>()) + .cast::(), ); - - FieldSizePayload{ - field_name: match l21 { - 0 => None, - 1 => { - let e = { - let l22 = *ptr1.add(24).cast::<*mut u8>(); - let l23 = *ptr1.add(28).cast::(); - let len24 = l23; - let bytes24 = _rt::Vec::from_raw_parts(l22.cast(), len24, len24); - - _rt::string_lift(bytes24) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - field_size: match l25 { - 0 => None, - 1 => { - let e = { - let l26 = *ptr1.add(36).cast::(); - - l26 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } + FieldSizePayload { + field_name: match l22 { + 0 => None, + 1 => { + let e = { + let l23 = *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l24 = *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len25 = l24; + let bytes25 = _rt::Vec::from_raw_parts( + l23.cast(), + len25, + len25, + ); + _rt::string_lift(bytes25) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + field_size: match l26 { + 0 => None, + 1 => { + let e = { + let l27 = *ptr1 + .add(20 + 4 * ::core::mem::size_of::<*const u8>()) + .cast::(); + l27 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } }; Some(e) } _ => _rt::invalid_enum_discriminant(), } }; - ErrorCode::HttpRequestHeaderSize(e65) + ErrorCode::HttpRequestHeaderSize(e66) } 23 => { - let e65 = { - let l27 = i32::from(*ptr1.add(16).cast::()); - - match l27 { + let e66 = { + let l28 = i32::from(*ptr1.add(16).cast::()); + match l28 { 0 => None, 1 => { let e = { - let l28 = *ptr1.add(20).cast::(); - - l28 as u32 + let l29 = *ptr1.add(20).cast::(); + l29 as u32 }; Some(e) } _ => _rt::invalid_enum_discriminant(), } }; - ErrorCode::HttpRequestTrailerSectionSize(e65) + ErrorCode::HttpRequestTrailerSectionSize(e66) } 24 => { - let e65 = { - let l29 = i32::from(*ptr1.add(16).cast::()); - let l33 = i32::from(*ptr1.add(28).cast::()); - + let e66 = { + let l30 = i32::from(*ptr1.add(16).cast::()); + let l34 = i32::from( + *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); FieldSizePayload { - field_name: match l29 { + field_name: match l30 { 0 => None, 1 => { let e = { - let l30 = - *ptr1.add(20).cast::<*mut u8>(); - let l31 = - *ptr1.add(24).cast::(); - let len32 = l31; - let bytes32 = - _rt::Vec::from_raw_parts( - l30.cast(), - len32, - len32, - ); - - _rt::string_lift(bytes32) + let l31 = *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l32 = *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len33 = l32; + let bytes33 = _rt::Vec::from_raw_parts( + l31.cast(), + len33, + len33, + ); + _rt::string_lift(bytes33) }; Some(e) } _ => _rt::invalid_enum_discriminant(), }, - field_size: match l33 { + field_size: match l34 { 0 => None, 1 => { let e = { - let l34 = - *ptr1.add(32).cast::(); - - l34 as u32 + let l35 = *ptr1 + .add(20 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + l35 as u32 }; Some(e) } @@ -5148,64 +5503,65 @@ pub mod wasi { }, } }; - ErrorCode::HttpRequestTrailerSize(e65) + ErrorCode::HttpRequestTrailerSize(e66) } 25 => ErrorCode::HttpResponseIncomplete, 26 => { - let e65 = { - let l35 = i32::from(*ptr1.add(16).cast::()); - - match l35 { + let e66 = { + let l36 = i32::from(*ptr1.add(16).cast::()); + match l36 { 0 => None, 1 => { let e = { - let l36 = *ptr1.add(20).cast::(); - - l36 as u32 + let l37 = *ptr1.add(20).cast::(); + l37 as u32 }; Some(e) } _ => _rt::invalid_enum_discriminant(), } }; - ErrorCode::HttpResponseHeaderSectionSize(e65) + ErrorCode::HttpResponseHeaderSectionSize(e66) } 27 => { - let e65 = { - let l37 = i32::from(*ptr1.add(16).cast::()); - let l41 = i32::from(*ptr1.add(28).cast::()); - + let e66 = { + let l38 = i32::from(*ptr1.add(16).cast::()); + let l42 = i32::from( + *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); FieldSizePayload { - field_name: match l37 { + field_name: match l38 { 0 => None, 1 => { let e = { - let l38 = - *ptr1.add(20).cast::<*mut u8>(); - let l39 = - *ptr1.add(24).cast::(); - let len40 = l39; - let bytes40 = - _rt::Vec::from_raw_parts( - l38.cast(), - len40, - len40, - ); - - _rt::string_lift(bytes40) + let l39 = *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l40 = *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len41 = l40; + let bytes41 = _rt::Vec::from_raw_parts( + l39.cast(), + len41, + len41, + ); + _rt::string_lift(bytes41) }; Some(e) } _ => _rt::invalid_enum_discriminant(), }, - field_size: match l41 { + field_size: match l42 { 0 => None, 1 => { let e = { - let l42 = - *ptr1.add(32).cast::(); - - l42 as u32 + let l43 = *ptr1 + .add(20 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + l43 as u32 }; Some(e) } @@ -5213,82 +5569,81 @@ pub mod wasi { }, } }; - ErrorCode::HttpResponseHeaderSize(e65) + ErrorCode::HttpResponseHeaderSize(e66) } 28 => { - let e65 = { - let l43 = i32::from(*ptr1.add(16).cast::()); - - match l43 { + let e66 = { + let l44 = i32::from(*ptr1.add(16).cast::()); + match l44 { 0 => None, 1 => { let e = { - let l44 = *ptr1.add(24).cast::(); - - l44 as u64 + let l45 = *ptr1.add(24).cast::(); + l45 as u64 }; Some(e) } _ => _rt::invalid_enum_discriminant(), } }; - ErrorCode::HttpResponseBodySize(e65) + ErrorCode::HttpResponseBodySize(e66) } 29 => { - let e65 = { - let l45 = i32::from(*ptr1.add(16).cast::()); - - match l45 { + let e66 = { + let l46 = i32::from(*ptr1.add(16).cast::()); + match l46 { 0 => None, 1 => { let e = { - let l46 = *ptr1.add(20).cast::(); - - l46 as u32 + let l47 = *ptr1.add(20).cast::(); + l47 as u32 }; Some(e) } _ => _rt::invalid_enum_discriminant(), } }; - ErrorCode::HttpResponseTrailerSectionSize(e65) + ErrorCode::HttpResponseTrailerSectionSize(e66) } 30 => { - let e65 = { - let l47 = i32::from(*ptr1.add(16).cast::()); - let l51 = i32::from(*ptr1.add(28).cast::()); - + let e66 = { + let l48 = i32::from(*ptr1.add(16).cast::()); + let l52 = i32::from( + *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); FieldSizePayload { - field_name: match l47 { + field_name: match l48 { 0 => None, 1 => { let e = { - let l48 = - *ptr1.add(20).cast::<*mut u8>(); - let l49 = - *ptr1.add(24).cast::(); - let len50 = l49; - let bytes50 = - _rt::Vec::from_raw_parts( - l48.cast(), - len50, - len50, - ); - - _rt::string_lift(bytes50) + let l49 = *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l50 = *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len51 = l50; + let bytes51 = _rt::Vec::from_raw_parts( + l49.cast(), + len51, + len51, + ); + _rt::string_lift(bytes51) }; Some(e) } _ => _rt::invalid_enum_discriminant(), }, - field_size: match l51 { + field_size: match l52 { 0 => None, 1 => { let e = { - let l52 = - *ptr1.add(32).cast::(); - - l52 as u32 + let l53 = *ptr1 + .add(20 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + l53 as u32 }; Some(e) } @@ -5296,61 +5651,63 @@ pub mod wasi { }, } }; - ErrorCode::HttpResponseTrailerSize(e65) + ErrorCode::HttpResponseTrailerSize(e66) } 31 => { - let e65 = { - let l53 = i32::from(*ptr1.add(16).cast::()); - - match l53 { + let e66 = { + let l54 = i32::from(*ptr1.add(16).cast::()); + match l54 { 0 => None, 1 => { let e = { - let l54 = - *ptr1.add(20).cast::<*mut u8>(); - let l55 = *ptr1.add(24).cast::(); - let len56 = l55; - let bytes56 = _rt::Vec::from_raw_parts( - l54.cast(), - len56, - len56, + let l55 = *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l56 = *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len57 = l56; + let bytes57 = _rt::Vec::from_raw_parts( + l55.cast(), + len57, + len57, ); - - _rt::string_lift(bytes56) + _rt::string_lift(bytes57) }; Some(e) } _ => _rt::invalid_enum_discriminant(), } }; - ErrorCode::HttpResponseTransferCoding(e65) + ErrorCode::HttpResponseTransferCoding(e66) } 32 => { - let e65 = { - let l57 = i32::from(*ptr1.add(16).cast::()); - - match l57 { + let e66 = { + let l58 = i32::from(*ptr1.add(16).cast::()); + match l58 { 0 => None, 1 => { let e = { - let l58 = - *ptr1.add(20).cast::<*mut u8>(); - let l59 = *ptr1.add(24).cast::(); - let len60 = l59; - let bytes60 = _rt::Vec::from_raw_parts( - l58.cast(), - len60, - len60, + let l59 = *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l60 = *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len61 = l60; + let bytes61 = _rt::Vec::from_raw_parts( + l59.cast(), + len61, + len61, ); - - _rt::string_lift(bytes60) + _rt::string_lift(bytes61) }; Some(e) } _ => _rt::invalid_enum_discriminant(), } }; - ErrorCode::HttpResponseContentCoding(e65) + ErrorCode::HttpResponseContentCoding(e66) } 33 => ErrorCode::HttpResponseTimeout, 34 => ErrorCode::HttpUpgradeFailed, @@ -5359,40 +5716,41 @@ pub mod wasi { 37 => ErrorCode::ConfigurationError, n => { debug_assert_eq!(n, 38, "invalid enum discriminant"); - let e65 = { - let l61 = i32::from(*ptr1.add(16).cast::()); - - match l61 { + let e66 = { + let l62 = i32::from(*ptr1.add(16).cast::()); + match l62 { 0 => None, 1 => { let e = { - let l62 = - *ptr1.add(20).cast::<*mut u8>(); - let l63 = *ptr1.add(24).cast::(); - let len64 = l63; - let bytes64 = _rt::Vec::from_raw_parts( - l62.cast(), - len64, - len64, + let l63 = *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l64 = *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len65 = l64; + let bytes65 = _rt::Vec::from_raw_parts( + l63.cast(), + len65, + len65, ); - - _rt::string_lift(bytes64) + _rt::string_lift(bytes65) }; Some(e) } _ => _rt::invalid_enum_discriminant(), } }; - ErrorCode::InternalError(e65) + ErrorCode::InternalError(e66) } }; - - v65 + v66 }; Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result67 } } } @@ -5405,17 +5763,20 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]future-incoming-response.subscribe"] - fn wit_import(_: i32) -> i32; + fn wit_import0(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32) -> i32 { + unsafe extern "C" fn wit_import0(_: i32) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32); - super::super::super::wasi::io::poll::Pollable::from_handle(ret as u32) + let ret = unsafe { wit_import0((self).handle() as i32) }; + unsafe { + super::super::super::wasi::io::poll::Pollable::from_handle( + ret as u32, + ) + } } } } @@ -5435,540 +5796,569 @@ pub mod wasi { /// occured. Errors may also occur while consuming the response body, /// but those will be reported by the `incoming-body` and its /// `output-stream` child. - pub fn get(&self) -> Option, ()>> { + pub fn get( + &self, + ) -> Option, ()>> { unsafe { #[repr(align(8))] - struct RetArea([::core::mem::MaybeUninit; 56]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 56]); + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 40 + 4 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 40 + + 4 * ::core::mem::size_of::<*const u8>()], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]future-incoming-response.get"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result69 = match l2 { 0 => None, 1 => { let e = { - let l2 = i32::from(*ptr0.add(8).cast::()); - - match l2 { - 0 => { - let e = { - let l3 = i32::from(*ptr0.add(16).cast::()); - - match l3 { - 0 => { - let e = { - let l4 = *ptr0.add(24).cast::(); - - IncomingResponse::from_handle(l4 as u32) - }; - Ok(e) - } - 1 => { - let e = { - let l5 = i32::from( - *ptr0.add(24).cast::(), - ); - let v67 = match l5 { - 0 => { - ErrorCode::DnsTimeout - } - 1 => { - let e67 = { - let l6 = i32::from(*ptr0.add(32).cast::()); - let l10 = i32::from(*ptr0.add(44).cast::()); - - DnsErrorPayload{ - rcode: match l6 { - 0 => None, - 1 => { - let e = { - let l7 = *ptr0.add(36).cast::<*mut u8>(); - let l8 = *ptr0.add(40).cast::(); - let len9 = l8; - let bytes9 = _rt::Vec::from_raw_parts(l7.cast(), len9, len9); - - _rt::string_lift(bytes9) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - info_code: match l10 { - 0 => None, - 1 => { - let e = { - let l11 = i32::from(*ptr0.add(46).cast::()); - - l11 as u16 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } - }; - ErrorCode::DnsError(e67) - } - 2 => { - ErrorCode::DestinationNotFound - } - 3 => { - ErrorCode::DestinationUnavailable - } - 4 => { - ErrorCode::DestinationIpProhibited - } - 5 => { - ErrorCode::DestinationIpUnroutable - } - 6 => { - ErrorCode::ConnectionRefused - } - 7 => { - ErrorCode::ConnectionTerminated - } - 8 => { - ErrorCode::ConnectionTimeout - } - 9 => { - ErrorCode::ConnectionReadTimeout - } - 10 => { - ErrorCode::ConnectionWriteTimeout - } - 11 => { - ErrorCode::ConnectionLimitReached - } - 12 => { - ErrorCode::TlsProtocolError - } - 13 => { - ErrorCode::TlsCertificateError - } - 14 => { - let e67 = { - let l12 = i32::from(*ptr0.add(32).cast::()); - let l14 = i32::from(*ptr0.add(36).cast::()); - - TlsAlertReceivedPayload{ - alert_id: match l12 { - 0 => None, - 1 => { - let e = { - let l13 = i32::from(*ptr0.add(33).cast::()); - - l13 as u8 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - alert_message: match l14 { - 0 => None, - 1 => { - let e = { - let l15 = *ptr0.add(40).cast::<*mut u8>(); - let l16 = *ptr0.add(44).cast::(); - let len17 = l16; - let bytes17 = _rt::Vec::from_raw_parts(l15.cast(), len17, len17); - - _rt::string_lift(bytes17) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } - }; - ErrorCode::TlsAlertReceived(e67) - } - 15 => { - ErrorCode::HttpRequestDenied - } - 16 => { - ErrorCode::HttpRequestLengthRequired - } - 17 => { - let e67 = { - let l18 = i32::from(*ptr0.add(32).cast::()); - - match l18 { - 0 => None, - 1 => { - let e = { - let l19 = *ptr0.add(40).cast::(); - - l19 as u64 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpRequestBodySize(e67) - } - 18 => { - ErrorCode::HttpRequestMethodInvalid - } - 19 => { - ErrorCode::HttpRequestUriInvalid - } - 20 => { - ErrorCode::HttpRequestUriTooLong - } - 21 => { - let e67 = { - let l20 = i32::from(*ptr0.add(32).cast::()); - - match l20 { - 0 => None, - 1 => { - let e = { - let l21 = *ptr0.add(36).cast::(); - - l21 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpRequestHeaderSectionSize(e67) - } - 22 => { - let e67 = { - let l22 = i32::from(*ptr0.add(32).cast::()); - - match l22 { - 0 => None, - 1 => { - let e = { - let l23 = i32::from(*ptr0.add(36).cast::()); - let l27 = i32::from(*ptr0.add(48).cast::()); - - FieldSizePayload{ - field_name: match l23 { - 0 => None, - 1 => { - let e = { - let l24 = *ptr0.add(40).cast::<*mut u8>(); - let l25 = *ptr0.add(44).cast::(); - let len26 = l25; - let bytes26 = _rt::Vec::from_raw_parts(l24.cast(), len26, len26); - - _rt::string_lift(bytes26) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - field_size: match l27 { - 0 => None, - 1 => { - let e = { - let l28 = *ptr0.add(52).cast::(); - - l28 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpRequestHeaderSize(e67) - } - 23 => { - let e67 = { - let l29 = i32::from(*ptr0.add(32).cast::()); - - match l29 { - 0 => None, - 1 => { - let e = { - let l30 = *ptr0.add(36).cast::(); - - l30 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpRequestTrailerSectionSize(e67) - } - 24 => { - let e67 = { - let l31 = i32::from(*ptr0.add(32).cast::()); - let l35 = i32::from(*ptr0.add(44).cast::()); - - FieldSizePayload{ - field_name: match l31 { - 0 => None, - 1 => { - let e = { - let l32 = *ptr0.add(36).cast::<*mut u8>(); - let l33 = *ptr0.add(40).cast::(); - let len34 = l33; - let bytes34 = _rt::Vec::from_raw_parts(l32.cast(), len34, len34); - - _rt::string_lift(bytes34) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - field_size: match l35 { - 0 => None, - 1 => { - let e = { - let l36 = *ptr0.add(48).cast::(); - - l36 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } - }; - ErrorCode::HttpRequestTrailerSize(e67) - } - 25 => { - ErrorCode::HttpResponseIncomplete - } - 26 => { - let e67 = { - let l37 = i32::from(*ptr0.add(32).cast::()); - - match l37 { - 0 => None, - 1 => { - let e = { - let l38 = *ptr0.add(36).cast::(); - - l38 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpResponseHeaderSectionSize(e67) - } - 27 => { - let e67 = { - let l39 = i32::from(*ptr0.add(32).cast::()); - let l43 = i32::from(*ptr0.add(44).cast::()); - - FieldSizePayload{ - field_name: match l39 { - 0 => None, - 1 => { - let e = { - let l40 = *ptr0.add(36).cast::<*mut u8>(); - let l41 = *ptr0.add(40).cast::(); - let len42 = l41; - let bytes42 = _rt::Vec::from_raw_parts(l40.cast(), len42, len42); - - _rt::string_lift(bytes42) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - field_size: match l43 { - 0 => None, - 1 => { - let e = { - let l44 = *ptr0.add(48).cast::(); - - l44 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } - }; - ErrorCode::HttpResponseHeaderSize(e67) - } - 28 => { - let e67 = { - let l45 = i32::from(*ptr0.add(32).cast::()); - - match l45 { - 0 => None, - 1 => { - let e = { - let l46 = *ptr0.add(40).cast::(); - - l46 as u64 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpResponseBodySize(e67) - } - 29 => { - let e67 = { - let l47 = i32::from(*ptr0.add(32).cast::()); - - match l47 { - 0 => None, - 1 => { - let e = { - let l48 = *ptr0.add(36).cast::(); - - l48 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpResponseTrailerSectionSize(e67) - } - 30 => { - let e67 = { - let l49 = i32::from(*ptr0.add(32).cast::()); - let l53 = i32::from(*ptr0.add(44).cast::()); - - FieldSizePayload{ - field_name: match l49 { - 0 => None, - 1 => { - let e = { - let l50 = *ptr0.add(36).cast::<*mut u8>(); - let l51 = *ptr0.add(40).cast::(); - let len52 = l51; - let bytes52 = _rt::Vec::from_raw_parts(l50.cast(), len52, len52); - - _rt::string_lift(bytes52) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - field_size: match l53 { - 0 => None, - 1 => { - let e = { - let l54 = *ptr0.add(48).cast::(); - - l54 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } - }; - ErrorCode::HttpResponseTrailerSize(e67) - } - 31 => { - let e67 = { - let l55 = i32::from(*ptr0.add(32).cast::()); - - match l55 { - 0 => None, - 1 => { - let e = { - let l56 = *ptr0.add(36).cast::<*mut u8>(); - let l57 = *ptr0.add(40).cast::(); - let len58 = l57; - let bytes58 = _rt::Vec::from_raw_parts(l56.cast(), len58, len58); - - _rt::string_lift(bytes58) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpResponseTransferCoding(e67) - } - 32 => { - let e67 = { - let l59 = i32::from(*ptr0.add(32).cast::()); - - match l59 { - 0 => None, - 1 => { - let e = { - let l60 = *ptr0.add(36).cast::<*mut u8>(); - let l61 = *ptr0.add(40).cast::(); - let len62 = l61; - let bytes62 = _rt::Vec::from_raw_parts(l60.cast(), len62, len62); - - _rt::string_lift(bytes62) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpResponseContentCoding(e67) - } - 33 => { - ErrorCode::HttpResponseTimeout - } - 34 => { - ErrorCode::HttpUpgradeFailed - } - 35 => { - ErrorCode::HttpProtocolError - } - 36 => { - ErrorCode::LoopDetected - } - 37 => { - ErrorCode::ConfigurationError - } - n => { - debug_assert_eq!(n, 38, "invalid enum discriminant"); - let e67 = { - let l63 = i32::from(*ptr0.add(32).cast::()); - - match l63 { - 0 => None, - 1 => { - let e = { - let l64 = *ptr0.add(36).cast::<*mut u8>(); - let l65 = *ptr0.add(40).cast::(); - let len66 = l65; - let bytes66 = _rt::Vec::from_raw_parts(l64.cast(), len66, len66); - - _rt::string_lift(bytes66) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::InternalError(e67) - } - }; - - v67 + let l3 = i32::from(*ptr0.add(8).cast::()); + match l3 { + 0 => { + let e = { + let l4 = i32::from(*ptr0.add(16).cast::()); + match l4 { + 0 => { + let e = { + let l5 = *ptr0.add(24).cast::(); + unsafe { IncomingResponse::from_handle(l5 as u32) } + }; + Ok(e) + } + 1 => { + let e = { + let l6 = i32::from(*ptr0.add(24).cast::()); + let v68 = match l6 { + 0 => ErrorCode::DnsTimeout, + 1 => { + let e68 = { + let l7 = i32::from(*ptr0.add(32).cast::()); + let l11 = i32::from( + *ptr0 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + DnsErrorPayload { + rcode: match l7 { + 0 => None, + 1 => { + let e = { + let l8 = *ptr0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l9 = *ptr0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len10 = l9; + let bytes10 = _rt::Vec::from_raw_parts( + l8.cast(), + len10, + len10, + ); + _rt::string_lift(bytes10) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + info_code: match l11 { + 0 => None, + 1 => { + let e = { + let l12 = i32::from( + *ptr0 + .add(34 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + l12 as u16 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } + }; + ErrorCode::DnsError(e68) + } + 2 => ErrorCode::DestinationNotFound, + 3 => ErrorCode::DestinationUnavailable, + 4 => ErrorCode::DestinationIpProhibited, + 5 => ErrorCode::DestinationIpUnroutable, + 6 => ErrorCode::ConnectionRefused, + 7 => ErrorCode::ConnectionTerminated, + 8 => ErrorCode::ConnectionTimeout, + 9 => ErrorCode::ConnectionReadTimeout, + 10 => ErrorCode::ConnectionWriteTimeout, + 11 => ErrorCode::ConnectionLimitReached, + 12 => ErrorCode::TlsProtocolError, + 13 => ErrorCode::TlsCertificateError, + 14 => { + let e68 = { + let l13 = i32::from(*ptr0.add(32).cast::()); + let l15 = i32::from( + *ptr0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + TlsAlertReceivedPayload { + alert_id: match l13 { + 0 => None, + 1 => { + let e = { + let l14 = i32::from(*ptr0.add(33).cast::()); + l14 as u8 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + alert_message: match l15 { + 0 => None, + 1 => { + let e = { + let l16 = *ptr0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l17 = *ptr0 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len18 = l17; + let bytes18 = _rt::Vec::from_raw_parts( + l16.cast(), + len18, + len18, + ); + _rt::string_lift(bytes18) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } + }; + ErrorCode::TlsAlertReceived(e68) + } + 15 => ErrorCode::HttpRequestDenied, + 16 => ErrorCode::HttpRequestLengthRequired, + 17 => { + let e68 = { + let l19 = i32::from(*ptr0.add(32).cast::()); + match l19 { + 0 => None, + 1 => { + let e = { + let l20 = *ptr0.add(40).cast::(); + l20 as u64 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpRequestBodySize(e68) + } + 18 => ErrorCode::HttpRequestMethodInvalid, + 19 => ErrorCode::HttpRequestUriInvalid, + 20 => ErrorCode::HttpRequestUriTooLong, + 21 => { + let e68 = { + let l21 = i32::from(*ptr0.add(32).cast::()); + match l21 { + 0 => None, + 1 => { + let e = { + let l22 = *ptr0.add(36).cast::(); + l22 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpRequestHeaderSectionSize(e68) + } + 22 => { + let e68 = { + let l23 = i32::from(*ptr0.add(32).cast::()); + match l23 { + 0 => None, + 1 => { + let e = { + let l24 = i32::from( + *ptr0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + let l28 = i32::from( + *ptr0 + .add(32 + 4 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + FieldSizePayload { + field_name: match l24 { + 0 => None, + 1 => { + let e = { + let l25 = *ptr0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l26 = *ptr0 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len27 = l26; + let bytes27 = _rt::Vec::from_raw_parts( + l25.cast(), + len27, + len27, + ); + _rt::string_lift(bytes27) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + field_size: match l28 { + 0 => None, + 1 => { + let e = { + let l29 = *ptr0 + .add(36 + 4 * ::core::mem::size_of::<*const u8>()) + .cast::(); + l29 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpRequestHeaderSize(e68) + } + 23 => { + let e68 = { + let l30 = i32::from(*ptr0.add(32).cast::()); + match l30 { + 0 => None, + 1 => { + let e = { + let l31 = *ptr0.add(36).cast::(); + l31 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpRequestTrailerSectionSize(e68) + } + 24 => { + let e68 = { + let l32 = i32::from(*ptr0.add(32).cast::()); + let l36 = i32::from( + *ptr0 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + FieldSizePayload { + field_name: match l32 { + 0 => None, + 1 => { + let e = { + let l33 = *ptr0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l34 = *ptr0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len35 = l34; + let bytes35 = _rt::Vec::from_raw_parts( + l33.cast(), + len35, + len35, + ); + _rt::string_lift(bytes35) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + field_size: match l36 { + 0 => None, + 1 => { + let e = { + let l37 = *ptr0 + .add(36 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + l37 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } + }; + ErrorCode::HttpRequestTrailerSize(e68) + } + 25 => ErrorCode::HttpResponseIncomplete, + 26 => { + let e68 = { + let l38 = i32::from(*ptr0.add(32).cast::()); + match l38 { + 0 => None, + 1 => { + let e = { + let l39 = *ptr0.add(36).cast::(); + l39 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpResponseHeaderSectionSize(e68) + } + 27 => { + let e68 = { + let l40 = i32::from(*ptr0.add(32).cast::()); + let l44 = i32::from( + *ptr0 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + FieldSizePayload { + field_name: match l40 { + 0 => None, + 1 => { + let e = { + let l41 = *ptr0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l42 = *ptr0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len43 = l42; + let bytes43 = _rt::Vec::from_raw_parts( + l41.cast(), + len43, + len43, + ); + _rt::string_lift(bytes43) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + field_size: match l44 { + 0 => None, + 1 => { + let e = { + let l45 = *ptr0 + .add(36 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + l45 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } + }; + ErrorCode::HttpResponseHeaderSize(e68) + } + 28 => { + let e68 = { + let l46 = i32::from(*ptr0.add(32).cast::()); + match l46 { + 0 => None, + 1 => { + let e = { + let l47 = *ptr0.add(40).cast::(); + l47 as u64 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpResponseBodySize(e68) + } + 29 => { + let e68 = { + let l48 = i32::from(*ptr0.add(32).cast::()); + match l48 { + 0 => None, + 1 => { + let e = { + let l49 = *ptr0.add(36).cast::(); + l49 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpResponseTrailerSectionSize(e68) + } + 30 => { + let e68 = { + let l50 = i32::from(*ptr0.add(32).cast::()); + let l54 = i32::from( + *ptr0 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + FieldSizePayload { + field_name: match l50 { + 0 => None, + 1 => { + let e = { + let l51 = *ptr0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l52 = *ptr0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len53 = l52; + let bytes53 = _rt::Vec::from_raw_parts( + l51.cast(), + len53, + len53, + ); + _rt::string_lift(bytes53) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + field_size: match l54 { + 0 => None, + 1 => { + let e = { + let l55 = *ptr0 + .add(36 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + l55 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } + }; + ErrorCode::HttpResponseTrailerSize(e68) + } + 31 => { + let e68 = { + let l56 = i32::from(*ptr0.add(32).cast::()); + match l56 { + 0 => None, + 1 => { + let e = { + let l57 = *ptr0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l58 = *ptr0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len59 = l58; + let bytes59 = _rt::Vec::from_raw_parts( + l57.cast(), + len59, + len59, + ); + _rt::string_lift(bytes59) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpResponseTransferCoding(e68) + } + 32 => { + let e68 = { + let l60 = i32::from(*ptr0.add(32).cast::()); + match l60 { + 0 => None, + 1 => { + let e = { + let l61 = *ptr0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l62 = *ptr0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len63 = l62; + let bytes63 = _rt::Vec::from_raw_parts( + l61.cast(), + len63, + len63, + ); + _rt::string_lift(bytes63) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpResponseContentCoding(e68) + } + 33 => ErrorCode::HttpResponseTimeout, + 34 => ErrorCode::HttpUpgradeFailed, + 35 => ErrorCode::HttpProtocolError, + 36 => ErrorCode::LoopDetected, + 37 => ErrorCode::ConfigurationError, + n => { + debug_assert_eq!(n, 38, "invalid enum discriminant"); + let e68 = { + let l64 = i32::from(*ptr0.add(32).cast::()); + match l64 { + 0 => None, + 1 => { + let e = { + let l65 = *ptr0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l66 = *ptr0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len67 = l66; + let bytes67 = _rt::Vec::from_raw_parts( + l65.cast(), + len67, + len67, + ); + _rt::string_lift(bytes67) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::InternalError(e68) + } + }; + v68 }; Err(e) } @@ -5987,19 +6377,19 @@ pub mod wasi { Some(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result69 } } } } - - #[allow(dead_code, clippy::all)] + /// This interface defines a handler of incoming HTTP Requests. It should + /// be exported by components which can respond to HTTP Requests. + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod incoming_handler { #[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; pub type IncomingRequest = super::super::super::wasi::http::types::IncomingRequest; pub type ResponseOutparam = super::super::super::wasi::http::types::ResponseOutparam; #[allow(unused_unsafe, clippy::all)] @@ -6013,83 +6403,78 @@ pub mod wasi { /// The implementor of this function must write a response to the /// `response-outparam` before returning, or else the caller will respond /// with an error on its behalf. - pub fn handle(request: IncomingRequest, response_out: ResponseOutparam) { + pub fn handle( + request: IncomingRequest, + response_out: ResponseOutparam, + ) -> () { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/incoming-handler@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "handle"] - fn wit_import(_: i32, _: i32); + fn wit_import0(_: i32, _: i32); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: i32) { + unsafe extern "C" fn wit_import0(_: i32, _: i32) { unreachable!() } - wit_import( - (&request).take_handle() as i32, - (&response_out).take_handle() as i32, - ); + unsafe { + wit_import0( + (&request).take_handle() as i32, + (&response_out).take_handle() as i32, + ) + }; } } } } - #[allow(dead_code)] pub mod io { - #[allow(dead_code, clippy::all)] + /// A poll API intended to let users wait for I/O events on multiple handles + /// at once. + #[allow(dead_code, async_fn_in_trait, unused_imports, 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` represents 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 { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]pollable"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - impl Pollable { #[allow(unused_unsafe, clippy::all)] /// Return the readiness of a pollable. This function never blocks. @@ -6099,16 +6484,15 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/poll@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]pollable.ready"] - fn wit_import(_: i32) -> i32; + fn wit_import0(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32) -> i32 { + unsafe extern "C" fn wit_import0(_: i32) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32); + let ret = unsafe { wit_import0((self).handle() as i32) }; _rt::bool_lift(ret as u8) } } @@ -6120,20 +6504,19 @@ pub mod wasi { /// /// This function is equivalent to calling `poll.poll` on a list /// containing only this pollable. - pub fn block(&self) { + pub fn block(&self) -> () { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/poll@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]pollable.block"] - fn wit_import(_: i32); + fn wit_import0(_: i32); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32) { + unsafe extern "C" fn wit_import0(_: i32) { unreachable!() } - wit_import((self).handle() as i32); + unsafe { wit_import0((self).handle() as i32) }; } } } @@ -6158,12 +6541,23 @@ pub mod wasi { /// being reaedy for I/O. pub fn poll(in_: &[&Pollable]) -> _rt::Vec { unsafe { - #[repr(align(4))] - struct RetArea([::core::mem::MaybeUninit; 8]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 2 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 2 + * ::core::mem::size_of::<*const u8>()], + ); 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() { @@ -6171,9 +6565,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); @@ -6184,34 +6576,33 @@ pub mod wasi { let ptr1 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/poll@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "poll"] - fn wit_import(_: *mut u8, _: usize, _: *mut u8); + fn wit_import2(_: *mut u8, _: usize, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: *mut u8, _: usize, _: *mut u8) { + unsafe extern "C" fn wit_import2(_: *mut u8, _: usize, _: *mut u8) { unreachable!() } - wit_import(result0, len0, ptr1); - let l2 = *ptr1.add(0).cast::<*mut u8>(); - let l3 = *ptr1.add(4).cast::(); - let len4 = l3; + unsafe { wit_import2(result0, len0, ptr1) }; + let l3 = *ptr1.add(0).cast::<*mut u8>(); + let l4 = *ptr1 + .add(::core::mem::size_of::<*const u8>()) + .cast::(); + let len5 = l4; + let result6 = _rt::Vec::from_raw_parts(l3.cast(), len5, len5); if layout0.size() != 0 { _rt::alloc::dealloc(result0.cast(), layout0); } - _rt::Vec::from_raw_parts(l2.cast(), len4, len4) + result6 } } } - - #[allow(dead_code, clippy::all)] + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod error { #[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; /// A resource which represents some error information. /// @@ -6232,51 +6623,43 @@ pub mod wasi { /// /// The set of functions which can "downcast" an `error` into a more /// concrete type is open. - #[derive(Debug)] #[repr(transparent)] pub struct Error { handle: _rt::Resource, } - impl Error { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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 Error { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:io/error@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]error"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - impl Error { #[allow(unused_unsafe, clippy::all)] /// Returns a string that is suitable to assist humans in debugging @@ -6288,39 +6671,51 @@ pub mod wasi { /// hazard. pub fn to_debug_string(&self) -> _rt::String { unsafe { - #[repr(align(4))] - struct RetArea([::core::mem::MaybeUninit; 8]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 2 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 2 + * ::core::mem::size_of::<*const u8>()], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/error@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]error.to-debug-string"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = *ptr0.add(0).cast::<*mut u8>(); - let l2 = *ptr0.add(4).cast::(); - let len3 = l2; - let bytes3 = _rt::Vec::from_raw_parts(l1.cast(), len3, len3); - _rt::string_lift(bytes3) + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = *ptr0.add(0).cast::<*mut u8>(); + let l3 = *ptr0 + .add(::core::mem::size_of::<*const u8>()) + .cast::(); + let len4 = l3; + let bytes4 = _rt::Vec::from_raw_parts(l2.cast(), len4, len4); + let result5 = _rt::string_lift(bytes4); + result5 } } } } - - #[allow(dead_code, clippy::all)] + /// WASI I/O is an I/O abstraction API which is currently focused on providing + /// stream types. + /// + /// In the future, the component model is expected to add built-in stream types; + /// when it does, they are expected to subsume this API. + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod streams { #[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 Error = super::super::super::wasi::io::error::Error; pub type Pollable = super::super::super::wasi::io::poll::Pollable; @@ -6336,22 +6731,30 @@ pub mod wasi { Closed, } impl ::core::fmt::Debug for StreamError { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { - StreamError::LastOperationFailed(e) => f - .debug_tuple("StreamError::LastOperationFailed") - .field(e) - .finish(), - StreamError::Closed => f.debug_tuple("StreamError::Closed").finish(), + StreamError::LastOperationFailed(e) => { + f.debug_tuple("StreamError::LastOperationFailed") + .field(e) + .finish() + } + StreamError::Closed => { + f.debug_tuple("StreamError::Closed").finish() + } } } } impl ::core::fmt::Display for StreamError { - 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 StreamError {} /// An input bytestream. /// @@ -6361,51 +6764,43 @@ pub mod wasi { /// available, which could even be zero. To wait for data to be available, /// use the `subscribe` function to obtain a `pollable` which can be polled /// for using `wasi:io/poll`. - #[derive(Debug)] #[repr(transparent)] pub struct InputStream { handle: _rt::Resource, } - impl InputStream { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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 InputStream { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:io/streams@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]input-stream"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - /// An output bytestream. /// /// `output-stream`s are *non-blocking* to the extent practical on @@ -6414,51 +6809,43 @@ pub mod wasi { /// promptly, which could even be zero. To wait for the stream to be ready to /// accept data, the `subscribe` function to obtain a `pollable` which can be /// polled for using `wasi:io/poll`. - #[derive(Debug)] #[repr(transparent)] pub struct OutputStream { handle: _rt::Resource, } - impl OutputStream { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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 OutputStream { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:io/streams@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]output-stream"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - impl InputStream { #[allow(unused_unsafe, clippy::all)] /// Perform a non-blocking read from the stream. @@ -6489,58 +6876,77 @@ pub mod wasi { /// less than `len` in size while more bytes are available for reading. pub fn read(&self, len: u64) -> Result<_rt::Vec, StreamError> { unsafe { - #[repr(align(4))] - struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 3 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 3 + * ::core::mem::size_of::<*const u8>()], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]input-stream.read"] - fn wit_import(_: i32, _: i64, _: *mut u8); + fn wit_import1(_: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: i64, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: i64, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, _rt::as_i64(&len), ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { + wit_import1((self).handle() as i32, _rt::as_i64(&len), ptr0) + }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result9 = match l2 { 0 => { let e = { - let l2 = *ptr0.add(4).cast::<*mut u8>(); - let l3 = *ptr0.add(8).cast::(); - let len4 = l3; - - _rt::Vec::from_raw_parts(l2.cast(), len4, len4) + let l3 = *ptr0 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l4 = *ptr0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len5 = l4; + _rt::Vec::from_raw_parts(l3.cast(), len5, len5) }; Ok(e) } 1 => { let e = { - let l5 = i32::from(*ptr0.add(4).cast::()); - let v7 = match l5 { + let l6 = i32::from( + *ptr0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); + let v8 = match l6 { 0 => { - let e7 = { - let l6 = *ptr0.add(8).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l6 as u32) + let e8 = { + let l7 = *ptr0 + .add(4 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(); + unsafe { + super::super::super::wasi::io::error::Error::from_handle( + l7 as u32, + ) + } }; - StreamError::LastOperationFailed(e7) + StreamError::LastOperationFailed(e8) } n => { debug_assert_eq!(n, 1, "invalid enum discriminant"); StreamError::Closed } }; - - v7 + v8 }; Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result9 } } } @@ -6548,60 +6954,82 @@ pub mod wasi { #[allow(unused_unsafe, clippy::all)] /// Read bytes from a stream, after blocking until at least one byte can /// be read. Except for blocking, behavior is identical to `read`. - pub fn blocking_read(&self, len: u64) -> Result<_rt::Vec, StreamError> { + pub fn blocking_read( + &self, + len: u64, + ) -> Result<_rt::Vec, StreamError> { unsafe { - #[repr(align(4))] - struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 3 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 3 + * ::core::mem::size_of::<*const u8>()], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]input-stream.blocking-read"] - fn wit_import(_: i32, _: i64, _: *mut u8); + fn wit_import1(_: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: i64, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: i64, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, _rt::as_i64(&len), ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { + wit_import1((self).handle() as i32, _rt::as_i64(&len), ptr0) + }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result9 = match l2 { 0 => { let e = { - let l2 = *ptr0.add(4).cast::<*mut u8>(); - let l3 = *ptr0.add(8).cast::(); - let len4 = l3; - - _rt::Vec::from_raw_parts(l2.cast(), len4, len4) + let l3 = *ptr0 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l4 = *ptr0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len5 = l4; + _rt::Vec::from_raw_parts(l3.cast(), len5, len5) }; Ok(e) } 1 => { let e = { - let l5 = i32::from(*ptr0.add(4).cast::()); - let v7 = match l5 { + let l6 = i32::from( + *ptr0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); + let v8 = match l6 { 0 => { - let e7 = { - let l6 = *ptr0.add(8).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l6 as u32) + let e8 = { + let l7 = *ptr0 + .add(4 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(); + unsafe { + super::super::super::wasi::io::error::Error::from_handle( + l7 as u32, + ) + } }; - StreamError::LastOperationFailed(e7) + StreamError::LastOperationFailed(e8) } n => { debug_assert_eq!(n, 1, "invalid enum discriminant"); StreamError::Closed } }; - - v7 + v8 }; Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result9 } } } @@ -6615,54 +7043,59 @@ pub mod wasi { unsafe { #[repr(align(8))] 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]input-stream.skip"] - fn wit_import(_: i32, _: i64, _: *mut u8); + fn wit_import1(_: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: i64, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: i64, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, _rt::as_i64(&len), ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { + wit_import1((self).handle() as i32, _rt::as_i64(&len), ptr0) + }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result7 = match l2 { 0 => { let e = { - let l2 = *ptr0.add(8).cast::(); - - l2 as u64 + let l3 = *ptr0.add(8).cast::(); + l3 as u64 }; Ok(e) } 1 => { let e = { - let l3 = i32::from(*ptr0.add(8).cast::()); - let v5 = match l3 { + let l4 = i32::from(*ptr0.add(8).cast::()); + let v6 = match l4 { 0 => { - let e5 = { - let l4 = *ptr0.add(12).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l4 as u32) + let e6 = { + let l5 = *ptr0.add(12).cast::(); + unsafe { + super::super::super::wasi::io::error::Error::from_handle( + l5 as u32, + ) + } }; - StreamError::LastOperationFailed(e5) + StreamError::LastOperationFailed(e6) } n => { debug_assert_eq!(n, 1, "invalid enum discriminant"); StreamError::Closed } }; - - v5 + v6 }; Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result7 } } } @@ -6674,54 +7107,59 @@ pub mod wasi { unsafe { #[repr(align(8))] 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]input-stream.blocking-skip"] - fn wit_import(_: i32, _: i64, _: *mut u8); + fn wit_import1(_: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: i64, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: i64, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, _rt::as_i64(&len), ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { + wit_import1((self).handle() as i32, _rt::as_i64(&len), ptr0) + }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result7 = match l2 { 0 => { let e = { - let l2 = *ptr0.add(8).cast::(); - - l2 as u64 + let l3 = *ptr0.add(8).cast::(); + l3 as u64 }; Ok(e) } 1 => { let e = { - let l3 = i32::from(*ptr0.add(8).cast::()); - let v5 = match l3 { + let l4 = i32::from(*ptr0.add(8).cast::()); + let v6 = match l4 { 0 => { - let e5 = { - let l4 = *ptr0.add(12).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l4 as u32) + let e6 = { + let l5 = *ptr0.add(12).cast::(); + unsafe { + super::super::super::wasi::io::error::Error::from_handle( + l5 as u32, + ) + } }; - StreamError::LastOperationFailed(e5) + StreamError::LastOperationFailed(e6) } n => { debug_assert_eq!(n, 1, "invalid enum discriminant"); StreamError::Closed } }; - - v5 + v6 }; Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result7 } } } @@ -6737,17 +7175,20 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]input-stream.subscribe"] - fn wit_import(_: i32) -> i32; + fn wit_import0(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32) -> i32 { + unsafe extern "C" fn wit_import0(_: i32) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32); - super::super::super::wasi::io::poll::Pollable::from_handle(ret as u32) + let ret = unsafe { wit_import0((self).handle() as i32) }; + unsafe { + super::super::super::wasi::io::poll::Pollable::from_handle( + ret as u32, + ) + } } } } @@ -6766,54 +7207,57 @@ pub mod wasi { unsafe { #[repr(align(8))] 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]output-stream.check-write"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result7 = match l2 { 0 => { let e = { - let l2 = *ptr0.add(8).cast::(); - - l2 as u64 + let l3 = *ptr0.add(8).cast::(); + l3 as u64 }; Ok(e) } 1 => { let e = { - let l3 = i32::from(*ptr0.add(8).cast::()); - let v5 = match l3 { + let l4 = i32::from(*ptr0.add(8).cast::()); + let v6 = match l4 { 0 => { - let e5 = { - let l4 = *ptr0.add(12).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l4 as u32) + let e6 = { + let l5 = *ptr0.add(12).cast::(); + unsafe { + super::super::super::wasi::io::error::Error::from_handle( + l5 as u32, + ) + } }; - StreamError::LastOperationFailed(e5) + StreamError::LastOperationFailed(e6) } n => { debug_assert_eq!(n, 1, "invalid enum discriminant"); StreamError::Closed } }; - - v5 + v6 }; Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result7 } } } @@ -6836,53 +7280,69 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 12], + ); let vec0 = contents; let ptr0 = vec0.as_ptr().cast::(); let len0 = vec0.len(); let ptr1 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]output-stream.write"] - fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8); + fn wit_import2(_: i32, _: *mut u8, _: usize, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8) { + unsafe extern "C" fn wit_import2( + _: i32, + _: *mut u8, + _: usize, + _: *mut u8, + ) { unreachable!() } - wit_import((self).handle() as i32, ptr0.cast_mut(), len0, ptr1); - let l2 = i32::from(*ptr1.add(0).cast::()); - match l2 { + unsafe { + wit_import2( + (self).handle() as i32, + ptr0.cast_mut(), + len0, + ptr1, + ) + }; + let l3 = i32::from(*ptr1.add(0).cast::()); + let result7 = match l3 { 0 => { let e = (); Ok(e) } 1 => { let e = { - let l3 = i32::from(*ptr1.add(4).cast::()); - let v5 = match l3 { + let l4 = i32::from(*ptr1.add(4).cast::()); + let v6 = match l4 { 0 => { - let e5 = { - let l4 = *ptr1.add(8).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l4 as u32) + let e6 = { + let l5 = *ptr1.add(8).cast::(); + unsafe { + super::super::super::wasi::io::error::Error::from_handle( + l5 as u32, + ) + } }; - StreamError::LastOperationFailed(e5) + StreamError::LastOperationFailed(e6) } n => { debug_assert_eq!(n, 1, "invalid enum discriminant"); StreamError::Closed } }; - - v5 + v6 }; Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result7 } } } @@ -6898,13 +7358,13 @@ pub mod wasi { /// ```text /// let pollable = this.subscribe(); /// while !contents.is_empty() { - /// // Wait for the stream to become writable - /// pollable.block(); - /// let Ok(n) = this.check-write(); // eliding error handling - /// let len = min(n, contents.len()); - /// let (chunk, rest) = contents.split_at(len); - /// this.write(chunk ); // eliding error handling - /// contents = rest; + /// // Wait for the stream to become writable + /// pollable.block(); + /// let Ok(n) = this.check-write(); // eliding error handling + /// let len = min(n, contents.len()); + /// let (chunk, rest) = contents.split_at(len); + /// this.write(chunk ); // eliding error handling + /// contents = rest; /// } /// this.flush(); /// // Wait for completion of `flush` @@ -6912,57 +7372,76 @@ pub mod wasi { /// // Check for any errors that arose during `flush` /// let _ = this.check-write(); // eliding error handling /// ``` - pub fn blocking_write_and_flush(&self, contents: &[u8]) -> Result<(), StreamError> { + pub fn blocking_write_and_flush( + &self, + contents: &[u8], + ) -> Result<(), StreamError> { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 12], + ); let vec0 = contents; let ptr0 = vec0.as_ptr().cast::(); let len0 = vec0.len(); let ptr1 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]output-stream.blocking-write-and-flush"] - fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8); + fn wit_import2(_: i32, _: *mut u8, _: usize, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8) { + unsafe extern "C" fn wit_import2( + _: i32, + _: *mut u8, + _: usize, + _: *mut u8, + ) { unreachable!() } - wit_import((self).handle() as i32, ptr0.cast_mut(), len0, ptr1); - let l2 = i32::from(*ptr1.add(0).cast::()); - match l2 { + unsafe { + wit_import2( + (self).handle() as i32, + ptr0.cast_mut(), + len0, + ptr1, + ) + }; + let l3 = i32::from(*ptr1.add(0).cast::()); + let result7 = match l3 { 0 => { let e = (); Ok(e) } 1 => { let e = { - let l3 = i32::from(*ptr1.add(4).cast::()); - let v5 = match l3 { + let l4 = i32::from(*ptr1.add(4).cast::()); + let v6 = match l4 { 0 => { - let e5 = { - let l4 = *ptr1.add(8).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l4 as u32) + let e6 = { + let l5 = *ptr1.add(8).cast::(); + unsafe { + super::super::super::wasi::io::error::Error::from_handle( + l5 as u32, + ) + } }; - StreamError::LastOperationFailed(e5) + StreamError::LastOperationFailed(e6) } n => { debug_assert_eq!(n, 1, "invalid enum discriminant"); StreamError::Closed } }; - - v5 + v6 }; Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result7 } } } @@ -6982,50 +7461,54 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 12], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]output-stream.flush"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result6 = match l2 { 0 => { let e = (); Ok(e) } 1 => { let e = { - let l2 = i32::from(*ptr0.add(4).cast::()); - let v4 = match l2 { + let l3 = i32::from(*ptr0.add(4).cast::()); + let v5 = match l3 { 0 => { - let e4 = { - let l3 = *ptr0.add(8).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l3 as u32) + let e5 = { + let l4 = *ptr0.add(8).cast::(); + unsafe { + super::super::super::wasi::io::error::Error::from_handle( + l4 as u32, + ) + } }; - StreamError::LastOperationFailed(e4) + StreamError::LastOperationFailed(e5) } n => { debug_assert_eq!(n, 1, "invalid enum discriminant"); StreamError::Closed } }; - - v4 + v5 }; Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result6 } } } @@ -7037,50 +7520,54 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 12], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]output-stream.blocking-flush"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result6 = match l2 { 0 => { let e = (); Ok(e) } 1 => { let e = { - let l2 = i32::from(*ptr0.add(4).cast::()); - let v4 = match l2 { + let l3 = i32::from(*ptr0.add(4).cast::()); + let v5 = match l3 { 0 => { - let e4 = { - let l3 = *ptr0.add(8).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l3 as u32) + let e5 = { + let l4 = *ptr0.add(8).cast::(); + unsafe { + super::super::super::wasi::io::error::Error::from_handle( + l4 as u32, + ) + } }; - StreamError::LastOperationFailed(e4) + StreamError::LastOperationFailed(e5) } n => { debug_assert_eq!(n, 1, "invalid enum discriminant"); StreamError::Closed } }; - - v4 + v5 }; Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result6 } } } @@ -7100,17 +7587,20 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]output-stream.subscribe"] - fn wit_import(_: i32) -> i32; + fn wit_import0(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32) -> i32 { + unsafe extern "C" fn wit_import0(_: i32) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32); - super::super::super::wasi::io::poll::Pollable::from_handle(ret as u32) + let ret = unsafe { wit_import0((self).handle() as i32) }; + unsafe { + super::super::super::wasi::io::poll::Pollable::from_handle( + ret as u32, + ) + } } } } @@ -7126,50 +7616,56 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 12], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]output-stream.write-zeroes"] - fn wit_import(_: i32, _: i64, _: *mut u8); + fn wit_import1(_: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: i64, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: i64, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, _rt::as_i64(&len), ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { + wit_import1((self).handle() as i32, _rt::as_i64(&len), ptr0) + }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result6 = match l2 { 0 => { let e = (); Ok(e) } 1 => { let e = { - let l2 = i32::from(*ptr0.add(4).cast::()); - let v4 = match l2 { + let l3 = i32::from(*ptr0.add(4).cast::()); + let v5 = match l3 { 0 => { - let e4 = { - let l3 = *ptr0.add(8).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l3 as u32) + let e5 = { + let l4 = *ptr0.add(8).cast::(); + unsafe { + super::super::super::wasi::io::error::Error::from_handle( + l4 as u32, + ) + } }; - StreamError::LastOperationFailed(e4) + StreamError::LastOperationFailed(e5) } n => { debug_assert_eq!(n, 1, "invalid enum discriminant"); StreamError::Closed } }; - - v4 + v5 }; Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result6 } } } @@ -7186,12 +7682,12 @@ pub mod wasi { /// ```text /// let pollable = this.subscribe(); /// while num_zeroes != 0 { - /// // Wait for the stream to become writable - /// pollable.block(); - /// let Ok(n) = this.check-write(); // eliding error handling - /// let len = min(n, num_zeroes); - /// this.write-zeroes(len); // eliding error handling - /// num_zeroes -= len; + /// // Wait for the stream to become writable + /// pollable.block(); + /// let Ok(n) = this.check-write(); // eliding error handling + /// let len = min(n, num_zeroes); + /// this.write-zeroes(len); // eliding error handling + /// num_zeroes -= len; /// } /// this.flush(); /// // Wait for completion of `flush` @@ -7199,54 +7695,63 @@ pub mod wasi { /// // Check for any errors that arose during `flush` /// let _ = this.check-write(); // eliding error handling /// ``` - pub fn blocking_write_zeroes_and_flush(&self, len: u64) -> Result<(), StreamError> { + pub fn blocking_write_zeroes_and_flush( + &self, + len: u64, + ) -> Result<(), StreamError> { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 12], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]output-stream.blocking-write-zeroes-and-flush"] - fn wit_import(_: i32, _: i64, _: *mut u8); + fn wit_import1(_: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: i64, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: i64, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, _rt::as_i64(&len), ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { + wit_import1((self).handle() as i32, _rt::as_i64(&len), ptr0) + }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result6 = match l2 { 0 => { let e = (); Ok(e) } 1 => { let e = { - let l2 = i32::from(*ptr0.add(4).cast::()); - let v4 = match l2 { + let l3 = i32::from(*ptr0.add(4).cast::()); + let v5 = match l3 { 0 => { - let e4 = { - let l3 = *ptr0.add(8).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l3 as u32) + let e5 = { + let l4 = *ptr0.add(8).cast::(); + unsafe { + super::super::super::wasi::io::error::Error::from_handle( + l4 as u32, + ) + } }; - StreamError::LastOperationFailed(e4) + StreamError::LastOperationFailed(e5) } n => { debug_assert_eq!(n, 1, "invalid enum discriminant"); StreamError::Closed } }; - - v4 + v5 }; Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result6 } } } @@ -7265,63 +7770,77 @@ pub mod wasi { /// /// This function returns the number of bytes transferred; it may be less /// than `len`. - pub fn splice(&self, src: &InputStream, len: u64) -> Result { + pub fn splice( + &self, + src: &InputStream, + len: u64, + ) -> Result { unsafe { #[repr(align(8))] 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]output-stream.splice"] - fn wit_import(_: i32, _: i32, _: i64, _: *mut u8); + fn wit_import1(_: i32, _: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: i32, _: i64, _: *mut u8) { + unsafe extern "C" fn wit_import1( + _: i32, + _: i32, + _: i64, + _: *mut u8, + ) { unreachable!() } - wit_import( - (self).handle() as i32, - (src).handle() as i32, - _rt::as_i64(&len), - ptr0, - ); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { + wit_import1( + (self).handle() as i32, + (src).handle() as i32, + _rt::as_i64(&len), + ptr0, + ) + }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result7 = match l2 { 0 => { let e = { - let l2 = *ptr0.add(8).cast::(); - - l2 as u64 + let l3 = *ptr0.add(8).cast::(); + l3 as u64 }; Ok(e) } 1 => { let e = { - let l3 = i32::from(*ptr0.add(8).cast::()); - let v5 = match l3 { + let l4 = i32::from(*ptr0.add(8).cast::()); + let v6 = match l4 { 0 => { - let e5 = { - let l4 = *ptr0.add(12).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l4 as u32) + let e6 = { + let l5 = *ptr0.add(12).cast::(); + unsafe { + super::super::super::wasi::io::error::Error::from_handle( + l5 as u32, + ) + } }; - StreamError::LastOperationFailed(e5) + StreamError::LastOperationFailed(e6) } n => { debug_assert_eq!(n, 1, "invalid enum discriminant"); StreamError::Closed } }; - - v5 + v6 }; Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result7 } } } @@ -7340,89 +7859,106 @@ pub mod wasi { unsafe { #[repr(align(8))] 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]output-stream.blocking-splice"] - fn wit_import(_: i32, _: i32, _: i64, _: *mut u8); + fn wit_import1(_: i32, _: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: i32, _: i64, _: *mut u8) { + unsafe extern "C" fn wit_import1( + _: i32, + _: i32, + _: i64, + _: *mut u8, + ) { unreachable!() } - wit_import( - (self).handle() as i32, - (src).handle() as i32, - _rt::as_i64(&len), - ptr0, - ); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { + wit_import1( + (self).handle() as i32, + (src).handle() as i32, + _rt::as_i64(&len), + ptr0, + ) + }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result7 = match l2 { 0 => { let e = { - let l2 = *ptr0.add(8).cast::(); - - l2 as u64 + let l3 = *ptr0.add(8).cast::(); + l3 as u64 }; Ok(e) } 1 => { let e = { - let l3 = i32::from(*ptr0.add(8).cast::()); - let v5 = match l3 { + let l4 = i32::from(*ptr0.add(8).cast::()); + let v6 = match l4 { 0 => { - let e5 = { - let l4 = *ptr0.add(12).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l4 as u32) + let e6 = { + let l5 = *ptr0.add(12).cast::(); + unsafe { + super::super::super::wasi::io::error::Error::from_handle( + l5 as u32, + ) + } }; - StreamError::LastOperationFailed(e5) + StreamError::LastOperationFailed(e6) } n => { debug_assert_eq!(n, 1, "invalid enum discriminant"); StreamError::Closed } }; - - v5 + v6 }; Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result7 } } } } } } -#[allow(dead_code)] +#[rustfmt::skip] +#[allow(dead_code, clippy::all)] pub mod exports { - #[allow(dead_code)] pub mod wasi { - #[allow(dead_code)] pub mod http { - #[allow(dead_code, clippy::all)] + /// This interface defines a handler of incoming HTTP Requests. It should + /// be exported by components which can respond to HTTP Requests. + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod incoming_handler { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; - pub type IncomingRequest = - super::super::super::super::wasi::http::types::IncomingRequest; - pub type ResponseOutparam = - super::super::super::super::wasi::http::types::ResponseOutparam; + pub type IncomingRequest = super::super::super::super::wasi::http::types::IncomingRequest; + pub type ResponseOutparam = super::super::super::super::wasi::http::types::ResponseOutparam; #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_handle_cabi(arg0: i32, arg1: i32) { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - T::handle(super::super::super::super::wasi::http::types::IncomingRequest::from_handle(arg0 as u32), super::super::super::super::wasi::http::types::ResponseOutparam::from_handle(arg1 as u32)); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + T::handle( + unsafe { + super::super::super::super::wasi::http::types::IncomingRequest::from_handle( + arg0 as u32, + ) + }, + unsafe { + super::super::super::super::wasi::http::types::ResponseOutparam::from_handle( + arg1 as u32, + ) + }, + ); } pub trait Guest { /// This function is invoked with an incoming HTTP Request, and a resource @@ -7435,31 +7971,33 @@ pub mod exports { /// The implementor of this function must write a response to the /// `response-outparam` before returning, or else the caller will respond /// with an error on its behalf. - fn handle(request: IncomingRequest, response_out: ResponseOutparam); + fn handle( + request: IncomingRequest, + response_out: ResponseOutparam, + ) -> (); } #[doc(hidden)] - - macro_rules! __export_wasi_http_incoming_handler_0_2_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "wasi:http/incoming-handler@0.2.0#handle"] - unsafe extern "C" fn export_handle(arg0: i32,arg1: i32,) { - $($path_to_types)*::_export_handle_cabi::<$ty>(arg0, arg1) - } - };); - } + macro_rules! __export_wasi_http_incoming_handler_0_2_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "wasi:http/incoming-handler@0.2.0#handle")] unsafe extern "C" fn + export_handle(arg0 : i32, arg1 : i32,) { unsafe { + $($path_to_types)*:: _export_handle_cabi::<$ty > (arg0, arg1) } } + }; + }; + } #[doc(hidden)] pub(crate) use __export_wasi_http_incoming_handler_0_2_0_cabi; } } } } +#[rustfmt::skip] mod _rt { - + #![allow(dead_code, clippy::all)] 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. /// @@ -7474,16 +8012,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. /// @@ -7493,7 +8024,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 { @@ -7503,7 +8033,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 @@ -7520,31 +8049,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), } } @@ -7561,30 +8080,25 @@ mod _rt { val != 0 } } - pub use alloc_crate::alloc; pub use alloc_crate::vec::Vec; - + pub use alloc_crate::alloc; 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 { @@ -7603,7 +8117,7 @@ mod _rt { if cfg!(debug_assertions) { panic!("invalid enum discriminant") } else { - core::hint::unreachable_unchecked() + unsafe { core::hint::unreachable_unchecked() } } } pub unsafe fn cabi_dealloc(ptr: *mut u8, size: usize, align: usize) { @@ -7611,88 +8125,75 @@ 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 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 } } - #[cfg(target_arch = "wasm32")] pub fn run_ctors_once() { wit_bindgen_rt::run_ctors_once(); } extern crate alloc as alloc_crate; } - -/// Generates `#[no_mangle]` functions to export the specified type as the -/// root implementation of all generated traits. +/// Generates `#[unsafe(no_mangle)]` functions to export the specified type as +/// the root implementation of all generated traits. /// /// For more information see the documentation of `wit_bindgen::generate!`. /// @@ -7709,159 +8210,162 @@ mod _rt { /// ``` #[allow(unused_macros)] #[doc(hidden)] - macro_rules! __export_router_impl { - ($ty:ident) => (self::export!($ty with_types_in self);); - ($ty:ident with_types_in $($path_to_types_root:tt)*) => ( - $($path_to_types_root)*::exports::wasi::http::incoming_handler::__export_wasi_http_incoming_handler_0_2_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::wasi::http::incoming_handler); - ) + ($ty:ident) => { + self::export!($ty with_types_in self); + }; + ($ty:ident with_types_in $($path_to_types_root:tt)*) => { + $($path_to_types_root)*:: + exports::wasi::http::incoming_handler::__export_wasi_http_incoming_handler_0_2_0_cabi!($ty + with_types_in $($path_to_types_root)*:: exports::wasi::http::incoming_handler); + }; } #[doc(inline)] pub(crate) use __export_router_impl as export; - #[cfg(target_arch = "wasm32")] -#[link_section = "component-type:wit-bindgen:0.25.0:router:encoded world"] +#[unsafe( + link_section = "component-type:wit-bindgen:0.41.0:fermyon:router:router:encoded world" +)] #[doc(hidden)] +#[allow(clippy::octal_escapes)] pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 6758] = *b"\ \0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\xe93\x01A\x02\x01A&\x01\ B\x0a\x04\0\x08pollable\x03\x01\x01h\0\x01@\x01\x04self\x01\0\x7f\x04\0\x16[meth\ od]pollable.ready\x01\x02\x01@\x01\x04self\x01\x01\0\x04\0\x16[method]pollable.b\ -lock\x01\x03\x01p\x01\x01py\x01@\x01\x02in\x04\0\x05\x04\0\x04poll\x01\x06\x03\x01\ +lock\x01\x03\x01p\x01\x01py\x01@\x01\x02in\x04\0\x05\x04\0\x04poll\x01\x06\x03\0\ \x12wasi:io/poll@0.2.0\x05\0\x02\x03\0\0\x08pollable\x01B\x0f\x02\x03\x02\x01\x01\ \x04\0\x08pollable\x03\0\0\x01w\x04\0\x07instant\x03\0\x02\x01w\x04\0\x08duratio\ n\x03\0\x04\x01@\0\0\x03\x04\0\x03now\x01\x06\x01@\0\0\x05\x04\0\x0aresolution\x01\ \x07\x01i\x01\x01@\x01\x04when\x03\0\x08\x04\0\x11subscribe-instant\x01\x09\x01@\ -\x01\x04when\x05\0\x08\x04\0\x12subscribe-duration\x01\x0a\x03\x01!wasi:clocks/m\ -onotonic-clock@0.2.0\x05\x02\x01B\x04\x04\0\x05error\x03\x01\x01h\0\x01@\x01\x04\ -self\x01\0s\x04\0\x1d[method]error.to-debug-string\x01\x02\x03\x01\x13wasi:io/er\ -ror@0.2.0\x05\x03\x02\x03\0\x02\x05error\x01B(\x02\x03\x02\x01\x04\x04\0\x05erro\ -r\x03\0\0\x02\x03\x02\x01\x01\x04\0\x08pollable\x03\0\x02\x01i\x01\x01q\x02\x15l\ -ast-operation-failed\x01\x04\0\x06closed\0\0\x04\0\x0cstream-error\x03\0\x05\x04\ -\0\x0cinput-stream\x03\x01\x04\0\x0doutput-stream\x03\x01\x01h\x07\x01p}\x01j\x01\ -\x0a\x01\x06\x01@\x02\x04self\x09\x03lenw\0\x0b\x04\0\x19[method]input-stream.re\ -ad\x01\x0c\x04\0\"[method]input-stream.blocking-read\x01\x0c\x01j\x01w\x01\x06\x01\ -@\x02\x04self\x09\x03lenw\0\x0d\x04\0\x19[method]input-stream.skip\x01\x0e\x04\0\ -\"[method]input-stream.blocking-skip\x01\x0e\x01i\x03\x01@\x01\x04self\x09\0\x0f\ -\x04\0\x1e[method]input-stream.subscribe\x01\x10\x01h\x08\x01@\x01\x04self\x11\0\ -\x0d\x04\0![method]output-stream.check-write\x01\x12\x01j\0\x01\x06\x01@\x02\x04\ -self\x11\x08contents\x0a\0\x13\x04\0\x1b[method]output-stream.write\x01\x14\x04\0\ -.[method]output-stream.blocking-write-and-flush\x01\x14\x01@\x01\x04self\x11\0\x13\ -\x04\0\x1b[method]output-stream.flush\x01\x15\x04\0$[method]output-stream.blocki\ -ng-flush\x01\x15\x01@\x01\x04self\x11\0\x0f\x04\0\x1f[method]output-stream.subsc\ -ribe\x01\x16\x01@\x02\x04self\x11\x03lenw\0\x13\x04\0\"[method]output-stream.wri\ -te-zeroes\x01\x17\x04\05[method]output-stream.blocking-write-zeroes-and-flush\x01\ -\x17\x01@\x03\x04self\x11\x03src\x09\x03lenw\0\x0d\x04\0\x1c[method]output-strea\ -m.splice\x01\x18\x04\0%[method]output-stream.blocking-splice\x01\x18\x03\x01\x15\ -wasi:io/streams@0.2.0\x05\x05\x02\x03\0\x01\x08duration\x02\x03\0\x03\x0cinput-s\ -tream\x02\x03\0\x03\x0doutput-stream\x01B\xc0\x01\x02\x03\x02\x01\x06\x04\0\x08d\ -uration\x03\0\0\x02\x03\x02\x01\x07\x04\0\x0cinput-stream\x03\0\x02\x02\x03\x02\x01\ -\x08\x04\0\x0doutput-stream\x03\0\x04\x02\x03\x02\x01\x04\x04\0\x08io-error\x03\0\ -\x06\x02\x03\x02\x01\x01\x04\0\x08pollable\x03\0\x08\x01q\x0a\x03get\0\0\x04head\ -\0\0\x04post\0\0\x03put\0\0\x06delete\0\0\x07connect\0\0\x07options\0\0\x05trace\ -\0\0\x05patch\0\0\x05other\x01s\0\x04\0\x06method\x03\0\x0a\x01q\x03\x04HTTP\0\0\ -\x05HTTPS\0\0\x05other\x01s\0\x04\0\x06scheme\x03\0\x0c\x01ks\x01k{\x01r\x02\x05\ -rcode\x0e\x09info-code\x0f\x04\0\x11DNS-error-payload\x03\0\x10\x01k}\x01r\x02\x08\ -alert-id\x12\x0dalert-message\x0e\x04\0\x1aTLS-alert-received-payload\x03\0\x13\x01\ -ky\x01r\x02\x0afield-name\x0e\x0afield-size\x15\x04\0\x12field-size-payload\x03\0\ -\x16\x01kw\x01k\x17\x01q'\x0bDNS-timeout\0\0\x09DNS-error\x01\x11\0\x15destinati\ -on-not-found\0\0\x17destination-unavailable\0\0\x19destination-IP-prohibited\0\0\ -\x19destination-IP-unroutable\0\0\x12connection-refused\0\0\x15connection-termin\ -ated\0\0\x12connection-timeout\0\0\x17connection-read-timeout\0\0\x18connection-\ -write-timeout\0\0\x18connection-limit-reached\0\0\x12TLS-protocol-error\0\0\x15T\ -LS-certificate-error\0\0\x12TLS-alert-received\x01\x14\0\x13HTTP-request-denied\0\ -\0\x1cHTTP-request-length-required\0\0\x16HTTP-request-body-size\x01\x18\0\x1bHT\ -TP-request-method-invalid\0\0\x18HTTP-request-URI-invalid\0\0\x19HTTP-request-UR\ -I-too-long\0\0\x20HTTP-request-header-section-size\x01\x15\0\x18HTTP-request-hea\ -der-size\x01\x19\0!HTTP-request-trailer-section-size\x01\x15\0\x19HTTP-request-t\ -railer-size\x01\x17\0\x18HTTP-response-incomplete\0\0!HTTP-response-header-secti\ -on-size\x01\x15\0\x19HTTP-response-header-size\x01\x17\0\x17HTTP-response-body-s\ -ize\x01\x18\0\"HTTP-response-trailer-section-size\x01\x15\0\x1aHTTP-response-tra\ -iler-size\x01\x17\0\x1dHTTP-response-transfer-coding\x01\x0e\0\x1cHTTP-response-\ -content-coding\x01\x0e\0\x15HTTP-response-timeout\0\0\x13HTTP-upgrade-failed\0\0\ -\x13HTTP-protocol-error\0\0\x0dloop-detected\0\0\x13configuration-error\0\0\x0ei\ -nternal-error\x01\x0e\0\x04\0\x0aerror-code\x03\0\x1a\x01q\x03\x0einvalid-syntax\ -\0\0\x09forbidden\0\0\x09immutable\0\0\x04\0\x0cheader-error\x03\0\x1c\x01s\x04\0\ -\x09field-key\x03\0\x1e\x01p}\x04\0\x0bfield-value\x03\0\x20\x04\0\x06fields\x03\ -\x01\x04\0\x07headers\x03\0\"\x04\0\x08trailers\x03\0\"\x04\0\x10incoming-reques\ -t\x03\x01\x04\0\x10outgoing-request\x03\x01\x04\0\x0frequest-options\x03\x01\x04\ -\0\x11response-outparam\x03\x01\x01{\x04\0\x0bstatus-code\x03\0)\x04\0\x11incomi\ -ng-response\x03\x01\x04\0\x0dincoming-body\x03\x01\x04\0\x0ffuture-trailers\x03\x01\ -\x04\0\x11outgoing-response\x03\x01\x04\0\x0doutgoing-body\x03\x01\x04\0\x18futu\ -re-incoming-response\x03\x01\x01i\"\x01@\0\01\x04\0\x13[constructor]fields\x012\x01\ -o\x02\x1f!\x01p3\x01j\x011\x01\x1d\x01@\x01\x07entries4\05\x04\0\x18[static]fiel\ -ds.from-list\x016\x01h\"\x01p!\x01@\x02\x04self7\x04name\x1f\08\x04\0\x12[method\ -]fields.get\x019\x01@\x02\x04self7\x04name\x1f\0\x7f\x04\0\x12[method]fields.has\ -\x01:\x01j\0\x01\x1d\x01@\x03\x04self7\x04name\x1f\x05value8\0;\x04\0\x12[method\ -]fields.set\x01<\x01@\x02\x04self7\x04name\x1f\0;\x04\0\x15[method]fields.delete\ -\x01=\x01@\x03\x04self7\x04name\x1f\x05value!\0;\x04\0\x15[method]fields.append\x01\ ->\x01@\x01\x04self7\04\x04\0\x16[method]fields.entries\x01?\x01@\x01\x04self7\01\ -\x04\0\x14[method]fields.clone\x01@\x01h%\x01@\x01\x04self\xc1\0\0\x0b\x04\0\x1f\ -[method]incoming-request.method\x01B\x01@\x01\x04self\xc1\0\0\x0e\x04\0([method]\ -incoming-request.path-with-query\x01C\x01k\x0d\x01@\x01\x04self\xc1\0\0\xc4\0\x04\ -\0\x1f[method]incoming-request.scheme\x01E\x04\0\"[method]incoming-request.autho\ -rity\x01C\x01i#\x01@\x01\x04self\xc1\0\0\xc6\0\x04\0\x20[method]incoming-request\ -.headers\x01G\x01i,\x01j\x01\xc8\0\0\x01@\x01\x04self\xc1\0\0\xc9\0\x04\0\x20[me\ -thod]incoming-request.consume\x01J\x01i&\x01@\x01\x07headers\xc6\0\0\xcb\0\x04\0\ -\x1d[constructor]outgoing-request\x01L\x01h&\x01i/\x01j\x01\xce\0\0\x01@\x01\x04\ -self\xcd\0\0\xcf\0\x04\0\x1d[method]outgoing-request.body\x01P\x01@\x01\x04self\xcd\ -\0\0\x0b\x04\0\x1f[method]outgoing-request.method\x01Q\x01j\0\0\x01@\x02\x04self\ -\xcd\0\x06method\x0b\0\xd2\0\x04\0#[method]outgoing-request.set-method\x01S\x01@\ -\x01\x04self\xcd\0\0\x0e\x04\0([method]outgoing-request.path-with-query\x01T\x01\ -@\x02\x04self\xcd\0\x0fpath-with-query\x0e\0\xd2\0\x04\0,[method]outgoing-reques\ -t.set-path-with-query\x01U\x01@\x01\x04self\xcd\0\0\xc4\0\x04\0\x1f[method]outgo\ -ing-request.scheme\x01V\x01@\x02\x04self\xcd\0\x06scheme\xc4\0\0\xd2\0\x04\0#[me\ -thod]outgoing-request.set-scheme\x01W\x04\0\"[method]outgoing-request.authority\x01\ -T\x01@\x02\x04self\xcd\0\x09authority\x0e\0\xd2\0\x04\0&[method]outgoing-request\ -.set-authority\x01X\x01@\x01\x04self\xcd\0\0\xc6\0\x04\0\x20[method]outgoing-req\ -uest.headers\x01Y\x01i'\x01@\0\0\xda\0\x04\0\x1c[constructor]request-options\x01\ -[\x01h'\x01k\x01\x01@\x01\x04self\xdc\0\0\xdd\0\x04\0'[method]request-options.co\ -nnect-timeout\x01^\x01@\x02\x04self\xdc\0\x08duration\xdd\0\0\xd2\0\x04\0+[metho\ -d]request-options.set-connect-timeout\x01_\x04\0*[method]request-options.first-b\ -yte-timeout\x01^\x04\0.[method]request-options.set-first-byte-timeout\x01_\x04\0\ --[method]request-options.between-bytes-timeout\x01^\x04\01[method]request-option\ -s.set-between-bytes-timeout\x01_\x01i(\x01i.\x01j\x01\xe1\0\x01\x1b\x01@\x02\x05\ -param\xe0\0\x08response\xe2\0\x01\0\x04\0\x1d[static]response-outparam.set\x01c\x01\ -h+\x01@\x01\x04self\xe4\0\0*\x04\0\x20[method]incoming-response.status\x01e\x01@\ -\x01\x04self\xe4\0\0\xc6\0\x04\0![method]incoming-response.headers\x01f\x01@\x01\ -\x04self\xe4\0\0\xc9\0\x04\0![method]incoming-response.consume\x01g\x01h,\x01i\x03\ -\x01j\x01\xe9\0\0\x01@\x01\x04self\xe8\0\0\xea\0\x04\0\x1c[method]incoming-body.\ -stream\x01k\x01i-\x01@\x01\x04this\xc8\0\0\xec\0\x04\0\x1c[static]incoming-body.\ -finish\x01m\x01h-\x01i\x09\x01@\x01\x04self\xee\0\0\xef\0\x04\0![method]future-t\ -railers.subscribe\x01p\x01i$\x01k\xf1\0\x01j\x01\xf2\0\x01\x1b\x01j\x01\xf3\0\0\x01\ -k\xf4\0\x01@\x01\x04self\xee\0\0\xf5\0\x04\0\x1b[method]future-trailers.get\x01v\ -\x01@\x01\x07headers\xc6\0\0\xe1\0\x04\0\x1e[constructor]outgoing-response\x01w\x01\ -h.\x01@\x01\x04self\xf8\0\0*\x04\0%[method]outgoing-response.status-code\x01y\x01\ -@\x02\x04self\xf8\0\x0bstatus-code*\0\xd2\0\x04\0)[method]outgoing-response.set-\ -status-code\x01z\x01@\x01\x04self\xf8\0\0\xc6\0\x04\0![method]outgoing-response.\ -headers\x01{\x01@\x01\x04self\xf8\0\0\xcf\0\x04\0\x1e[method]outgoing-response.b\ -ody\x01|\x01h/\x01i\x05\x01j\x01\xfe\0\0\x01@\x01\x04self\xfd\0\0\xff\0\x04\0\x1b\ -[method]outgoing-body.write\x01\x80\x01\x01j\0\x01\x1b\x01@\x02\x04this\xce\0\x08\ -trailers\xf2\0\0\x81\x01\x04\0\x1c[static]outgoing-body.finish\x01\x82\x01\x01h0\ -\x01@\x01\x04self\x83\x01\0\xef\0\x04\0*[method]future-incoming-response.subscri\ -be\x01\x84\x01\x01i+\x01j\x01\x85\x01\x01\x1b\x01j\x01\x86\x01\0\x01k\x87\x01\x01\ -@\x01\x04self\x83\x01\0\x88\x01\x04\0$[method]future-incoming-response.get\x01\x89\ -\x01\x01h\x07\x01k\x1b\x01@\x01\x03err\x8a\x01\0\x8b\x01\x04\0\x0fhttp-error-cod\ -e\x01\x8c\x01\x03\x01\x15wasi:http/types@0.2.0\x05\x09\x02\x03\0\x04\x10incoming\ --request\x02\x03\0\x04\x11response-outparam\x01B\x08\x02\x03\x02\x01\x0a\x04\0\x10\ -incoming-request\x03\0\0\x02\x03\x02\x01\x0b\x04\0\x11response-outparam\x03\0\x02\ -\x01i\x01\x01i\x03\x01@\x02\x07request\x04\x0cresponse-out\x05\x01\0\x04\0\x06ha\ -ndle\x01\x06\x03\x01\x20wasi:http/incoming-handler@0.2.0\x05\x0c\x01B\x05\x02\x03\ -\x02\x01\x08\x04\0\x0doutput-stream\x03\0\0\x01i\x01\x01@\0\0\x02\x04\0\x0aget-s\ -tdout\x01\x03\x03\x01\x15wasi:cli/stdout@0.2.0\x05\x0d\x02\x03\0\x04\x10outgoing\ --request\x03\0\x10outgoing-request\x03\0\x0e\x03\0\x10incoming-request\x03\0\x0a\ -\x02\x03\0\x04\x0dincoming-body\x03\0\x0dincoming-body\x03\0\x11\x01@\0\0s\x03\0\ -\x0cget-manifest\x01\x13\x01@\x01\x0ccomponent-ids\x01\0\x03\0\x10set-component-\ -id\x01\x14\x01i\x0f\x01i\x12\x01k\x16\x01i\x10\x01@\x02\x07request\x15\x0dincomi\ -ng-body\x17\0\x18\x03\0\x0bnew-request\x01\x19\x01B\x08\x02\x03\x02\x01\x0a\x04\0\ -\x10incoming-request\x03\0\0\x02\x03\x02\x01\x0b\x04\0\x11response-outparam\x03\0\ -\x02\x01i\x01\x01i\x03\x01@\x02\x07request\x04\x0cresponse-out\x05\x01\0\x04\0\x06\ -handle\x01\x06\x04\x01\x20wasi:http/incoming-handler@0.2.0\x05\x1a\x04\x01\x15fe\ -rmyon:router/router\x04\0\x0b\x0c\x01\0\x06router\x03\0\0\0G\x09producers\x01\x0c\ -processed-by\x02\x0dwit-component\x070.208.1\x10wit-bindgen-rust\x060.25.0"; - +\x01\x04when\x05\0\x08\x04\0\x12subscribe-duration\x01\x0a\x03\0!wasi:clocks/mon\ +otonic-clock@0.2.0\x05\x02\x01B\x04\x04\0\x05error\x03\x01\x01h\0\x01@\x01\x04se\ +lf\x01\0s\x04\0\x1d[method]error.to-debug-string\x01\x02\x03\0\x13wasi:io/error@\ +0.2.0\x05\x03\x02\x03\0\x02\x05error\x01B(\x02\x03\x02\x01\x04\x04\0\x05error\x03\ +\0\0\x02\x03\x02\x01\x01\x04\0\x08pollable\x03\0\x02\x01i\x01\x01q\x02\x15last-o\ +peration-failed\x01\x04\0\x06closed\0\0\x04\0\x0cstream-error\x03\0\x05\x04\0\x0c\ +input-stream\x03\x01\x04\0\x0doutput-stream\x03\x01\x01h\x07\x01p}\x01j\x01\x0a\x01\ +\x06\x01@\x02\x04self\x09\x03lenw\0\x0b\x04\0\x19[method]input-stream.read\x01\x0c\ +\x04\0\"[method]input-stream.blocking-read\x01\x0c\x01j\x01w\x01\x06\x01@\x02\x04\ +self\x09\x03lenw\0\x0d\x04\0\x19[method]input-stream.skip\x01\x0e\x04\0\"[method\ +]input-stream.blocking-skip\x01\x0e\x01i\x03\x01@\x01\x04self\x09\0\x0f\x04\0\x1e\ +[method]input-stream.subscribe\x01\x10\x01h\x08\x01@\x01\x04self\x11\0\x0d\x04\0\ +![method]output-stream.check-write\x01\x12\x01j\0\x01\x06\x01@\x02\x04self\x11\x08\ +contents\x0a\0\x13\x04\0\x1b[method]output-stream.write\x01\x14\x04\0.[method]ou\ +tput-stream.blocking-write-and-flush\x01\x14\x01@\x01\x04self\x11\0\x13\x04\0\x1b\ +[method]output-stream.flush\x01\x15\x04\0$[method]output-stream.blocking-flush\x01\ +\x15\x01@\x01\x04self\x11\0\x0f\x04\0\x1f[method]output-stream.subscribe\x01\x16\ +\x01@\x02\x04self\x11\x03lenw\0\x13\x04\0\"[method]output-stream.write-zeroes\x01\ +\x17\x04\05[method]output-stream.blocking-write-zeroes-and-flush\x01\x17\x01@\x03\ +\x04self\x11\x03src\x09\x03lenw\0\x0d\x04\0\x1c[method]output-stream.splice\x01\x18\ +\x04\0%[method]output-stream.blocking-splice\x01\x18\x03\0\x15wasi:io/streams@0.\ +2.0\x05\x05\x02\x03\0\x01\x08duration\x02\x03\0\x03\x0cinput-stream\x02\x03\0\x03\ +\x0doutput-stream\x01B\xc0\x01\x02\x03\x02\x01\x06\x04\0\x08duration\x03\0\0\x02\ +\x03\x02\x01\x07\x04\0\x0cinput-stream\x03\0\x02\x02\x03\x02\x01\x08\x04\0\x0dou\ +tput-stream\x03\0\x04\x02\x03\x02\x01\x04\x04\0\x08io-error\x03\0\x06\x02\x03\x02\ +\x01\x01\x04\0\x08pollable\x03\0\x08\x01q\x0a\x03get\0\0\x04head\0\0\x04post\0\0\ +\x03put\0\0\x06delete\0\0\x07connect\0\0\x07options\0\0\x05trace\0\0\x05patch\0\0\ +\x05other\x01s\0\x04\0\x06method\x03\0\x0a\x01q\x03\x04HTTP\0\0\x05HTTPS\0\0\x05\ +other\x01s\0\x04\0\x06scheme\x03\0\x0c\x01ks\x01k{\x01r\x02\x05rcode\x0e\x09info\ +-code\x0f\x04\0\x11DNS-error-payload\x03\0\x10\x01k}\x01r\x02\x08alert-id\x12\x0d\ +alert-message\x0e\x04\0\x1aTLS-alert-received-payload\x03\0\x13\x01ky\x01r\x02\x0a\ +field-name\x0e\x0afield-size\x15\x04\0\x12field-size-payload\x03\0\x16\x01kw\x01\ +k\x17\x01q'\x0bDNS-timeout\0\0\x09DNS-error\x01\x11\0\x15destination-not-found\0\ +\0\x17destination-unavailable\0\0\x19destination-IP-prohibited\0\0\x19destinatio\ +n-IP-unroutable\0\0\x12connection-refused\0\0\x15connection-terminated\0\0\x12co\ +nnection-timeout\0\0\x17connection-read-timeout\0\0\x18connection-write-timeout\0\ +\0\x18connection-limit-reached\0\0\x12TLS-protocol-error\0\0\x15TLS-certificate-\ +error\0\0\x12TLS-alert-received\x01\x14\0\x13HTTP-request-denied\0\0\x1cHTTP-req\ +uest-length-required\0\0\x16HTTP-request-body-size\x01\x18\0\x1bHTTP-request-met\ +hod-invalid\0\0\x18HTTP-request-URI-invalid\0\0\x19HTTP-request-URI-too-long\0\0\ +\x20HTTP-request-header-section-size\x01\x15\0\x18HTTP-request-header-size\x01\x19\ +\0!HTTP-request-trailer-section-size\x01\x15\0\x19HTTP-request-trailer-size\x01\x17\ +\0\x18HTTP-response-incomplete\0\0!HTTP-response-header-section-size\x01\x15\0\x19\ +HTTP-response-header-size\x01\x17\0\x17HTTP-response-body-size\x01\x18\0\"HTTP-r\ +esponse-trailer-section-size\x01\x15\0\x1aHTTP-response-trailer-size\x01\x17\0\x1d\ +HTTP-response-transfer-coding\x01\x0e\0\x1cHTTP-response-content-coding\x01\x0e\0\ +\x15HTTP-response-timeout\0\0\x13HTTP-upgrade-failed\0\0\x13HTTP-protocol-error\0\ +\0\x0dloop-detected\0\0\x13configuration-error\0\0\x0einternal-error\x01\x0e\0\x04\ +\0\x0aerror-code\x03\0\x1a\x01q\x03\x0einvalid-syntax\0\0\x09forbidden\0\0\x09im\ +mutable\0\0\x04\0\x0cheader-error\x03\0\x1c\x01s\x04\0\x09field-key\x03\0\x1e\x01\ +p}\x04\0\x0bfield-value\x03\0\x20\x04\0\x06fields\x03\x01\x04\0\x07headers\x03\0\ +\"\x04\0\x08trailers\x03\0\"\x04\0\x10incoming-request\x03\x01\x04\0\x10outgoing\ +-request\x03\x01\x04\0\x0frequest-options\x03\x01\x04\0\x11response-outparam\x03\ +\x01\x01{\x04\0\x0bstatus-code\x03\0)\x04\0\x11incoming-response\x03\x01\x04\0\x0d\ +incoming-body\x03\x01\x04\0\x0ffuture-trailers\x03\x01\x04\0\x11outgoing-respons\ +e\x03\x01\x04\0\x0doutgoing-body\x03\x01\x04\0\x18future-incoming-response\x03\x01\ +\x01i\"\x01@\0\01\x04\0\x13[constructor]fields\x012\x01o\x02\x1f!\x01p3\x01j\x01\ +1\x01\x1d\x01@\x01\x07entries4\05\x04\0\x18[static]fields.from-list\x016\x01h\"\x01\ +p!\x01@\x02\x04self7\x04name\x1f\08\x04\0\x12[method]fields.get\x019\x01@\x02\x04\ +self7\x04name\x1f\0\x7f\x04\0\x12[method]fields.has\x01:\x01j\0\x01\x1d\x01@\x03\ +\x04self7\x04name\x1f\x05value8\0;\x04\0\x12[method]fields.set\x01<\x01@\x02\x04\ +self7\x04name\x1f\0;\x04\0\x15[method]fields.delete\x01=\x01@\x03\x04self7\x04na\ +me\x1f\x05value!\0;\x04\0\x15[method]fields.append\x01>\x01@\x01\x04self7\04\x04\ +\0\x16[method]fields.entries\x01?\x01@\x01\x04self7\01\x04\0\x14[method]fields.c\ +lone\x01@\x01h%\x01@\x01\x04self\xc1\0\0\x0b\x04\0\x1f[method]incoming-request.m\ +ethod\x01B\x01@\x01\x04self\xc1\0\0\x0e\x04\0([method]incoming-request.path-with\ +-query\x01C\x01k\x0d\x01@\x01\x04self\xc1\0\0\xc4\0\x04\0\x1f[method]incoming-re\ +quest.scheme\x01E\x04\0\"[method]incoming-request.authority\x01C\x01i#\x01@\x01\x04\ +self\xc1\0\0\xc6\0\x04\0\x20[method]incoming-request.headers\x01G\x01i,\x01j\x01\ +\xc8\0\0\x01@\x01\x04self\xc1\0\0\xc9\0\x04\0\x20[method]incoming-request.consum\ +e\x01J\x01i&\x01@\x01\x07headers\xc6\0\0\xcb\0\x04\0\x1d[constructor]outgoing-re\ +quest\x01L\x01h&\x01i/\x01j\x01\xce\0\0\x01@\x01\x04self\xcd\0\0\xcf\0\x04\0\x1d\ +[method]outgoing-request.body\x01P\x01@\x01\x04self\xcd\0\0\x0b\x04\0\x1f[method\ +]outgoing-request.method\x01Q\x01j\0\0\x01@\x02\x04self\xcd\0\x06method\x0b\0\xd2\ +\0\x04\0#[method]outgoing-request.set-method\x01S\x01@\x01\x04self\xcd\0\0\x0e\x04\ +\0([method]outgoing-request.path-with-query\x01T\x01@\x02\x04self\xcd\0\x0fpath-\ +with-query\x0e\0\xd2\0\x04\0,[method]outgoing-request.set-path-with-query\x01U\x01\ +@\x01\x04self\xcd\0\0\xc4\0\x04\0\x1f[method]outgoing-request.scheme\x01V\x01@\x02\ +\x04self\xcd\0\x06scheme\xc4\0\0\xd2\0\x04\0#[method]outgoing-request.set-scheme\ +\x01W\x04\0\"[method]outgoing-request.authority\x01T\x01@\x02\x04self\xcd\0\x09a\ +uthority\x0e\0\xd2\0\x04\0&[method]outgoing-request.set-authority\x01X\x01@\x01\x04\ +self\xcd\0\0\xc6\0\x04\0\x20[method]outgoing-request.headers\x01Y\x01i'\x01@\0\0\ +\xda\0\x04\0\x1c[constructor]request-options\x01[\x01h'\x01k\x01\x01@\x01\x04sel\ +f\xdc\0\0\xdd\0\x04\0'[method]request-options.connect-timeout\x01^\x01@\x02\x04s\ +elf\xdc\0\x08duration\xdd\0\0\xd2\0\x04\0+[method]request-options.set-connect-ti\ +meout\x01_\x04\0*[method]request-options.first-byte-timeout\x01^\x04\0.[method]r\ +equest-options.set-first-byte-timeout\x01_\x04\0-[method]request-options.between\ +-bytes-timeout\x01^\x04\01[method]request-options.set-between-bytes-timeout\x01_\ +\x01i(\x01i.\x01j\x01\xe1\0\x01\x1b\x01@\x02\x05param\xe0\0\x08response\xe2\0\x01\ +\0\x04\0\x1d[static]response-outparam.set\x01c\x01h+\x01@\x01\x04self\xe4\0\0*\x04\ +\0\x20[method]incoming-response.status\x01e\x01@\x01\x04self\xe4\0\0\xc6\0\x04\0\ +![method]incoming-response.headers\x01f\x01@\x01\x04self\xe4\0\0\xc9\0\x04\0![me\ +thod]incoming-response.consume\x01g\x01h,\x01i\x03\x01j\x01\xe9\0\0\x01@\x01\x04\ +self\xe8\0\0\xea\0\x04\0\x1c[method]incoming-body.stream\x01k\x01i-\x01@\x01\x04\ +this\xc8\0\0\xec\0\x04\0\x1c[static]incoming-body.finish\x01m\x01h-\x01i\x09\x01\ +@\x01\x04self\xee\0\0\xef\0\x04\0![method]future-trailers.subscribe\x01p\x01i$\x01\ +k\xf1\0\x01j\x01\xf2\0\x01\x1b\x01j\x01\xf3\0\0\x01k\xf4\0\x01@\x01\x04self\xee\0\ +\0\xf5\0\x04\0\x1b[method]future-trailers.get\x01v\x01@\x01\x07headers\xc6\0\0\xe1\ +\0\x04\0\x1e[constructor]outgoing-response\x01w\x01h.\x01@\x01\x04self\xf8\0\0*\x04\ +\0%[method]outgoing-response.status-code\x01y\x01@\x02\x04self\xf8\0\x0bstatus-c\ +ode*\0\xd2\0\x04\0)[method]outgoing-response.set-status-code\x01z\x01@\x01\x04se\ +lf\xf8\0\0\xc6\0\x04\0![method]outgoing-response.headers\x01{\x01@\x01\x04self\xf8\ +\0\0\xcf\0\x04\0\x1e[method]outgoing-response.body\x01|\x01h/\x01i\x05\x01j\x01\xfe\ +\0\0\x01@\x01\x04self\xfd\0\0\xff\0\x04\0\x1b[method]outgoing-body.write\x01\x80\ +\x01\x01j\0\x01\x1b\x01@\x02\x04this\xce\0\x08trailers\xf2\0\0\x81\x01\x04\0\x1c\ +[static]outgoing-body.finish\x01\x82\x01\x01h0\x01@\x01\x04self\x83\x01\0\xef\0\x04\ +\0*[method]future-incoming-response.subscribe\x01\x84\x01\x01i+\x01j\x01\x85\x01\ +\x01\x1b\x01j\x01\x86\x01\0\x01k\x87\x01\x01@\x01\x04self\x83\x01\0\x88\x01\x04\0\ +$[method]future-incoming-response.get\x01\x89\x01\x01h\x07\x01k\x1b\x01@\x01\x03\ +err\x8a\x01\0\x8b\x01\x04\0\x0fhttp-error-code\x01\x8c\x01\x03\0\x15wasi:http/ty\ +pes@0.2.0\x05\x09\x02\x03\0\x04\x10outgoing-request\x03\0\x10outgoing-request\x03\ +\0\x0a\x02\x03\0\x04\x10incoming-request\x03\0\x10incoming-request\x03\0\x0c\x02\ +\x03\0\x04\x0dincoming-body\x03\0\x0dincoming-body\x03\0\x0e\x02\x03\0\x04\x11re\ +sponse-outparam\x01B\x08\x02\x03\x02\x01\x0c\x04\0\x10incoming-request\x03\0\0\x02\ +\x03\x02\x01\x10\x04\0\x11response-outparam\x03\0\x02\x01i\x01\x01i\x03\x01@\x02\ +\x07request\x04\x0cresponse-out\x05\x01\0\x04\0\x06handle\x01\x06\x03\0\x20wasi:\ +http/incoming-handler@0.2.0\x05\x11\x01@\0\0s\x03\0\x0cget-manifest\x01\x12\x01@\ +\x01\x0ccomponent-ids\x01\0\x03\0\x10set-component-id\x01\x13\x01B\x05\x02\x03\x02\ +\x01\x08\x04\0\x0doutput-stream\x03\0\0\x01i\x01\x01@\0\0\x02\x04\0\x0aget-stdou\ +t\x01\x03\x03\0\x15wasi:cli/stdout@0.2.0\x05\x14\x01i\x0b\x01i\x0f\x01k\x16\x01i\ +\x0d\x01@\x02\x07request\x15\x0dincoming-body\x17\0\x18\x03\0\x0bnew-request\x01\ +\x19\x01B\x08\x02\x03\x02\x01\x0c\x04\0\x10incoming-request\x03\0\0\x02\x03\x02\x01\ +\x10\x04\0\x11response-outparam\x03\0\x02\x01i\x01\x01i\x03\x01@\x02\x07request\x04\ +\x0cresponse-out\x05\x01\0\x04\0\x06handle\x01\x06\x04\0\x20wasi:http/incoming-h\ +andler@0.2.0\x05\x1a\x04\0\x15fermyon:router/router\x04\0\x0b\x0c\x01\0\x06route\ +r\x03\0\0\0G\x09producers\x01\x0cprocessed-by\x02\x0dwit-component\x070.227.1\x10\ +wit-bindgen-rust\x060.41.0"; #[inline(never)] #[doc(hidden)] -#[cfg(target_arch = "wasm32")] pub fn __link_custom_section_describing_imports() { wit_bindgen_rt::maybe_link_cabi_realloc(); } diff --git a/crates/router/src/lib.rs b/crates/router/src/lib.rs index c621454..36da043 100644 --- a/crates/router/src/lib.rs +++ b/crates/router/src/lib.rs @@ -1,7 +1,8 @@ #[allow(warnings)] +#[rustfmt::skip] mod bindings; -use std::fmt::Display; +use std::{borrow::Cow, fmt::Display}; use anyhow::Context as _; use bindings::{ @@ -11,7 +12,7 @@ use bindings::{ ErrorCode, Headers, IncomingRequest, OutgoingRequest, ResponseOutparam, Scheme, }, }; -use spin_http::routes::RouteMatch; +use spin_http_routes::{RouteMatch, Router}; /// Print to the standard output. /// @@ -39,7 +40,20 @@ impl Guest for Component { .get("http") .and_then(|c| c.get("base").and_then(|v| v.as_str())) .unwrap_or("/"); - let route_match = match find_matching_route(&manifest, &request, base) { + let router = router(&manifest, base); + let path_with_query = request + .path_with_query() + .unwrap_or_else(|| String::from("/")); + let path = path_with_query + .split_once('?') + .map(|(path, _)| path) + .unwrap_or(&path_with_query); + let route_match = router.as_ref().and_then(|r| { + r.route(path) + .map(RoutingResult::RouteFound) + .or(Ok(RoutingResult::RouteNotFound)) + }); + let route_match = match route_match { Err(e) => { set_error_response(response_out, e); return; @@ -69,16 +83,13 @@ fn set_error_response(response_out: ResponseOutparam, message: impl Display) { ); } -enum RoutingResult { - RouteFound(RouteMatch), +enum RoutingResult<'router, 'path> { + RouteFound(RouteMatch<'router, 'path>), RouteNotFound, } -fn find_matching_route( - manifest: &spin_manifest::schema::v2::AppManifest, - request: &IncomingRequest, - base: &str, -) -> anyhow::Result { +/// Create a router from the Spin manifest. +fn router(manifest: &spin_manifest::schema::v2::AppManifest, base: &str) -> anyhow::Result { let routes = manifest .triggers .get("http") @@ -101,19 +112,8 @@ fn find_matching_route( ) }) .collect::>(); - let path_with_query = request - .path_with_query() - .unwrap_or_else(|| String::from("/")); - let path = path_with_query - .split_once('?') - .map(|(path, _)| path) - .unwrap_or(&path_with_query); - let (router, _) = - spin_http::routes::Router::build(base, routes.iter().map(|(c, t)| (c.as_str(), t)))?; - router - .route(path) - .map(RoutingResult::RouteFound) - .or(Ok(RoutingResult::RouteNotFound)) + + Router::build(base, routes.iter().map(|(c, t)| (c.as_str(), t)), None) } /// Apply any request transformations needed for the given route. @@ -125,7 +125,10 @@ fn apply_request_transformations( let headers_to_add = calculate_default_headers(&request, base, route_match) .context("could not calculate default headers for request")? .into_iter() - .flat_map(|(k, v)| k.into_iter().map(move |s| (s, v.clone().into_bytes()))) + .flat_map(|(k, v)| { + k.into_iter() + .map(move |s| (s, v.clone().into_owned().into_bytes())) + }) .chain(request.headers().entries()); let headers = Headers::new(); for (key, value) in headers_to_add { @@ -148,11 +151,11 @@ const RAW_COMPONENT_ROUTE: [&str; 2] = ["SPIN_RAW_COMPONENT_ROUTE", "X_RAW_COMPO const BASE_PATH: [&str; 2] = ["SPIN_BASE_PATH", "X_BASE_PATH"]; const CLIENT_ADDR: [&str; 2] = ["SPIN_CLIENT_ADDR", "X_CLIENT_ADDR"]; -fn calculate_default_headers( +fn calculate_default_headers<'a>( req: &IncomingRequest, - base: &str, - route_match: &RouteMatch, -) -> anyhow::Result> { + base: &'a str, + route_match: &'a RouteMatch<'_, 'a>, +) -> anyhow::Result)>> { fn convert(s: &str) -> String { s.to_owned().replace('_', "-").to_ascii_lowercase() } @@ -181,7 +184,7 @@ fn calculate_default_headers( }; let host = req .headers() - .get(&"Host".to_owned()) + .get("Host") .into_iter() .find(|v| !v.is_empty()) .map(String::from_utf8) @@ -192,16 +195,16 @@ fn calculate_default_headers( let full_url = format!("{}://{}{}", scheme, host, abs_path); res.push((owned_path_info, path_info)); - res.push((owned_full_url, full_url)); - res.push((owned_matched_route, route_match.based_route().to_string())); + res.push((owned_full_url, full_url.into())); + res.push((owned_matched_route, route_match.based_route().into())); - res.push((owned_base_path, base.to_string())); + res.push((owned_base_path, base.into())); + res.push((owned_raw_component_route, route_match.raw_route().into())); res.push(( - owned_raw_component_route, - route_match.raw_route().to_string(), + owned_component_route, + route_match.raw_route_or_prefix().into(), )); - res.push((owned_component_route, route_match.raw_route_or_prefix())); - res.push((owned_client_addr, "127.0.0.1:0".to_owned())); + res.push((owned_client_addr, "127.0.0.1:0".into())); for (wild_name, wild_value) in route_match.named_wildcards() { let wild_header = convert(&format!( @@ -209,7 +212,7 @@ fn calculate_default_headers( wild_name.to_ascii_uppercase() )); let wild_wagi_header = convert(&format!("X_PATH_MATCH_{}", wild_name.to_ascii_uppercase())); - res.push(([wild_header, wild_wagi_header], wild_value.clone())); + res.push(([wild_header, wild_wagi_header], wild_value.into())); } Ok(res) diff --git a/crates/spin-test-sdk/Cargo.toml b/crates/spin-test-sdk/Cargo.toml index 6bc5f7f..c930929 100644 --- a/crates/spin-test-sdk/Cargo.toml +++ b/crates/spin-test-sdk/Cargo.toml @@ -5,4 +5,4 @@ edition = "2021" [dependencies] spin-test-sdk-macro = { path = "../spin-test-sdk-macro" } -wit-bindgen = "0.26" +wit-bindgen = "0.42" diff --git a/crates/spin-test-sdk/src/lib.rs b/crates/spin-test-sdk/src/lib.rs index d142146..06bf6d9 100644 --- a/crates/spin-test-sdk/src/lib.rs +++ b/crates/spin-test-sdk/src/lib.rs @@ -8,6 +8,7 @@ pub mod bindings { wit_bindgen::generate!({ world: "test-imports", path: "../../host-wit", + generate_all }); } diff --git a/crates/spin-test-virt/Cargo.lock b/crates/spin-test-virt/Cargo.lock deleted file mode 100644 index 87ceee9..0000000 --- a/crates/spin-test-virt/Cargo.lock +++ /dev/null @@ -1,3038 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "addr2line" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "ahash" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "aliasable" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" - -[[package]] -name = "ambient-authority" -version = "0.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9d4ee0d472d1cd2e28c97dfa124b3d8d992e10eb0a035f33f5d12e3a177ba3b" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "anstream" -version = "0.6.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "utf8parse", -] - -[[package]] -name = "anstyle" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" - -[[package]] -name = "anstyle-parse" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "anstyle-wincon" -version = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" -dependencies = [ - "anstyle", - "windows-sys 0.52.0", -] - -[[package]] -name = "anyhow" -version = "1.0.81" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" - -[[package]] -name = "arbitrary" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" - -[[package]] -name = "async-trait" -version = "0.1.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "461abc97219de0eaaf81fe3ef974a540158f3d079c2ab200f891f1a2ef201e85" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", -] - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "backtrace" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" -dependencies = [ - "addr2line", - "cc", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] - -[[package]] -name = "base64" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" - -[[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "bumpalo" -version = "3.15.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "bytes" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" - -[[package]] -name = "cap-fs-ext" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "769f8cd02eb04d57f14e2e371ebb533f96817f9b2525d73a5c72b61ca7973747" -dependencies = [ - "cap-primitives", - "cap-std", - "io-lifetimes", - "windows-sys 0.52.0", -] - -[[package]] -name = "cap-net-ext" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ff6d3fb274292a9af283417e383afe6ded1fe66f6472d2c781216d3d80c218" -dependencies = [ - "cap-primitives", - "cap-std", - "rustix", - "smallvec", -] - -[[package]] -name = "cap-primitives" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90a0b44fc796b1a84535a63753d50ba3972c4db55c7255c186f79140e63d56d0" -dependencies = [ - "ambient-authority", - "fs-set-times", - "io-extras", - "io-lifetimes", - "ipnet", - "maybe-owned", - "rustix", - "windows-sys 0.52.0", - "winx", -] - -[[package]] -name = "cap-rand" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4327f08daac33a99bb03c54ae18c8f32c3ba31c728a33ddf683c6c6a5043de68" -dependencies = [ - "ambient-authority", - "rand", -] - -[[package]] -name = "cap-std" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266626ce180cf9709f317d0bf9754e3a5006359d87f4bf792f06c9c5f1b63c0f" -dependencies = [ - "cap-primitives", - "io-extras", - "io-lifetimes", - "rustix", -] - -[[package]] -name = "cap-time-ext" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1353421ba83c19da60726e35db0a89abef984b3be183ff6f58c5b8084fcd0c5" -dependencies = [ - "ambient-authority", - "cap-primitives", - "iana-time-zone", - "once_cell", - "rustix", - "winx", -] - -[[package]] -name = "cc" -version = "1.0.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" -dependencies = [ - "jobserver", - "libc", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "colorchoice" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "cpp_demangle" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8227005286ec39567949b33df9896bcadfa6051bccca2488129f108ca23119" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "cpufeatures" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" -dependencies = [ - "libc", -] - -[[package]] -name = "cranelift-bforest" -version = "0.106.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b3775cc6cc00c90d29eebea55feedb2b0168e23f5415bab7859c4004d7323d1" -dependencies = [ - "cranelift-entity", -] - -[[package]] -name = "cranelift-codegen" -version = "0.106.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "637f3184ba5bfa48d425bad1d2e4faf5fcf619f5e0ca107edc6dc02f589d4d74" -dependencies = [ - "bumpalo", - "cranelift-bforest", - "cranelift-codegen-meta", - "cranelift-codegen-shared", - "cranelift-control", - "cranelift-entity", - "cranelift-isle", - "gimli", - "hashbrown 0.14.3", - "log", - "regalloc2", - "smallvec", - "target-lexicon", -] - -[[package]] -name = "cranelift-codegen-meta" -version = "0.106.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4b35b8240462341d94d31aab807cad704683988708261aecae3d57db48b7212" -dependencies = [ - "cranelift-codegen-shared", -] - -[[package]] -name = "cranelift-codegen-shared" -version = "0.106.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3cd1555aa9df1d6d8375732de41b4cb0d787006948d55b6d004d521e9efeb0" - -[[package]] -name = "cranelift-control" -version = "0.106.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14b31a562a10e98ab148fa146801e20665c5f9eda4fce9b2c5a3836575887d74" -dependencies = [ - "arbitrary", -] - -[[package]] -name = "cranelift-entity" -version = "0.106.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af1e0467700a3f4fccf5feddbaebdf8b0eb82535b06a9600c4bc5df40872e75d" -dependencies = [ - "serde", - "serde_derive", -] - -[[package]] -name = "cranelift-frontend" -version = "0.106.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cb918ee2c23939262efd1b99d76a21212ac7bd35129582133e21a22a6ff0467" -dependencies = [ - "cranelift-codegen", - "log", - "smallvec", - "target-lexicon", -] - -[[package]] -name = "cranelift-isle" -version = "0.106.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "966e4cfb23cf6d7f1d285d53a912baaffc5f06bcd9c9b0a2d8c66a184fae534b" - -[[package]] -name = "cranelift-native" -version = "0.106.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bea803aadfc4aabdfae7c3870f1b1f6dd4332f4091859e9758ef5fca6bf8cc87" -dependencies = [ - "cranelift-codegen", - "libc", - "target-lexicon", -] - -[[package]] -name = "cranelift-wasm" -version = "0.106.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d18a3572cd897555bba3621e568029417d8f5cc26aeede2d7cb0bad6afd916" -dependencies = [ - "cranelift-codegen", - "cranelift-entity", - "cranelift-frontend", - "itertools", - "log", - "smallvec", - "wasmparser 0.201.0", - "wasmtime-types", -] - -[[package]] -name = "crc32fast" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "debugid" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" -dependencies = [ - "uuid", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "crypto-common", -] - -[[package]] -name = "directories-next" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbc" -dependencies = [ - "cfg-if", - "dirs-sys-next", -] - -[[package]] -name = "dirs" -version = "4.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "dirs-sys" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - -[[package]] -name = "dirs-sys-next" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - -[[package]] -name = "dotenvy" -version = "0.15.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" - -[[package]] -name = "either" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" - -[[package]] -name = "encoding_rs" -version = "0.8.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "env_filter" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" -dependencies = [ - "log", - "regex", -] - -[[package]] -name = "env_logger" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b35839ba51819680ba087cd351788c9a3c476841207e0b8cee0b04722343b9" -dependencies = [ - "anstream", - "anstyle", - "env_filter", - "humantime", - "log", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fallible-iterator" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" - -[[package]] -name = "fastrand" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" - -[[package]] -name = "fd-lock" -version = "4.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e5768da2206272c81ef0b5e951a41862938a6070da63bcea197899942d3b947" -dependencies = [ - "cfg-if", - "rustix", - "windows-sys 0.52.0", -] - -[[package]] -name = "fixedbitset" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "form_urlencoded" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "fs-set-times" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "033b337d725b97690d86893f9de22b67b80dcc4e9ad815f348254c38119db8fb" -dependencies = [ - "io-lifetimes", - "rustix", - "windows-sys 0.52.0", -] - -[[package]] -name = "futures" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" - -[[package]] -name = "futures-io" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" - -[[package]] -name = "futures-sink" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" - -[[package]] -name = "futures-task" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" - -[[package]] -name = "futures-util" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" -dependencies = [ - "futures-core", - "futures-sink", - "futures-task", - "pin-project-lite", - "pin-utils", -] - -[[package]] -name = "fxhash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -dependencies = [ - "byteorder", -] - -[[package]] -name = "fxprof-processed-profile" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27d12c0aed7f1e24276a241aadc4cb8ea9f83000f34bc062b7cc2d51e3b0fabd" -dependencies = [ - "bitflags 2.5.0", - "debugid", - "fxhash", - "serde", - "serde_json", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "gimli" -version = "0.28.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" -dependencies = [ - "fallible-iterator", - "indexmap 2.2.6", - "stable_deref_trait", -] - -[[package]] -name = "h2" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51ee2dd2e4f378392eeff5d51618cd9a63166a2513846bbc55f21cfacd9199d4" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http", - "indexmap 2.2.6", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", -] - -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - -[[package]] -name = "host" -version = "0.1.0" -dependencies = [ - "http", - "http-body-util", - "hyper", - "spin-test-sdk", - "tokio", -] - -[[package]] -name = "http" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" -dependencies = [ - "bytes", - "http", -] - -[[package]] -name = "http-body-util" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" -dependencies = [ - "bytes", - "futures-core", - "http", - "http-body", - "pin-project-lite", -] - -[[package]] -name = "httparse" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" - -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" - -[[package]] -name = "humantime" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" - -[[package]] -name = "hyper" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "186548d73ac615b32a73aafe38fb4f56c0d340e110e5a200bcadbaf2e199263a" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "h2", - "http", - "http-body", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "smallvec", - "tokio", - "want", -] - -[[package]] -name = "iana-time-zone" -version = "0.1.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "id-arena" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005" - -[[package]] -name = "idna" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", -] - -[[package]] -name = "indexmap" -version = "2.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" -dependencies = [ - "equivalent", - "hashbrown 0.14.3", - "serde", -] - -[[package]] -name = "io-extras" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c301e73fb90e8a29e600a9f402d095765f74310d582916a952f618836a1bd1ed" -dependencies = [ - "io-lifetimes", - "windows-sys 0.52.0", -] - -[[package]] -name = "io-lifetimes" -version = "2.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a611371471e98973dbcab4e0ec66c31a10bc356eeb4d54a0e05eac8158fe38c" - -[[package]] -name = "ipnet" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" - -[[package]] -name = "itertools" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" - -[[package]] -name = "ittapi" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b996fe614c41395cdaedf3cf408a9534851090959d90d54a535f675550b64b1" -dependencies = [ - "anyhow", - "ittapi-sys", - "log", -] - -[[package]] -name = "ittapi-sys" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52f5385394064fa2c886205dba02598013ce83d3e92d33dbdc0c52fe0e7bf4fc" -dependencies = [ - "cc", -] - -[[package]] -name = "jobserver" -version = "0.1.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" -dependencies = [ - "libc", -] - -[[package]] -name = "js-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "leb128" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" - -[[package]] -name = "libc" -version = "0.2.153" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" - -[[package]] -name = "libredox" -version = "0.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" -dependencies = [ - "bitflags 2.5.0", - "libc", - "redox_syscall", -] - -[[package]] -name = "linux-raw-sys" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" - -[[package]] -name = "log" -version = "0.4.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" - -[[package]] -name = "mach" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" -dependencies = [ - "libc", -] - -[[package]] -name = "maybe-owned" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4facc753ae494aeb6e3c22f839b158aebd4f9270f55cd3c79906c45476c47ab4" - -[[package]] -name = "memchr" -version = "2.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" - -[[package]] -name = "memfd" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" -dependencies = [ - "rustix", -] - -[[package]] -name = "memoffset" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "miniz_oxide" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" -dependencies = [ - "adler", -] - -[[package]] -name = "mio" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" -dependencies = [ - "libc", - "wasi", - "windows-sys 0.48.0", -] - -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi 0.3.9", - "libc", -] - -[[package]] -name = "object" -version = "0.32.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" -dependencies = [ - "crc32fast", - "hashbrown 0.14.3", - "indexmap 2.2.6", - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "ouroboros" -version = "0.18.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b7be5a8a3462b752f4be3ff2b2bf2f7f1d00834902e46be2a4d68b87b0573c" -dependencies = [ - "aliasable", - "ouroboros_macro", - "static_assertions", -] - -[[package]] -name = "ouroboros_macro" -version = "0.18.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b645dcde5f119c2c454a92d0dfa271a2a3b205da92e4292a68ead4bdbfde1f33" -dependencies = [ - "heck", - "itertools", - "proc-macro2", - "proc-macro2-diagnostics", - "quote", - "syn", -] - -[[package]] -name = "paste" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" - -[[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - -[[package]] -name = "petgraph" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" -dependencies = [ - "fixedbitset", - "indexmap 2.2.6", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "pkg-config" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" - -[[package]] -name = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "proc-macro2" -version = "1.0.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "proc-macro2-diagnostics" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "version_check", - "yansi", -] - -[[package]] -name = "psm" -version = "0.1.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" -dependencies = [ - "cc", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - -[[package]] -name = "rayon" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4963ed1bc86e4f3ee217022bd855b297cef07fb9eac5dfa1f788b220b49b3bd" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_users" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" -dependencies = [ - "getrandom", - "libredox", - "thiserror", -] - -[[package]] -name = "regalloc2" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad156d539c879b7a24a363a2016d77961786e71f48f2e2fc8302a92abd2429a6" -dependencies = [ - "hashbrown 0.13.2", - "log", - "rustc-hash", - "slice-group-by", - "smallvec", -] - -[[package]] -name = "regex" -version = "1.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" - -[[package]] -name = "ring" -version = "0.17.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" -dependencies = [ - "cc", - "cfg-if", - "getrandom", - "libc", - "spin", - "untrusted", - "windows-sys 0.52.0", -] - -[[package]] -name = "router" -version = "0.1.0" -dependencies = [ - "bitflags 2.5.0", - "spin-manifest", - "toml", - "wit-bindgen-rt 0.22.0", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "rustix" -version = "0.38.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" -dependencies = [ - "bitflags 2.5.0", - "errno", - "itoa", - "libc", - "linux-raw-sys", - "once_cell", - "windows-sys 0.52.0", -] - -[[package]] -name = "rustls" -version = "0.21.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" -dependencies = [ - "log", - "ring", - "rustls-webpki", - "sct", -] - -[[package]] -name = "rustls-webpki" -version = "0.101.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "ryu" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" - -[[package]] -name = "sct" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "semver" -version = "1.0.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" -dependencies = [ - "serde", -] - -[[package]] -name = "serde" -version = "1.0.197" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.197" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.115" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_spanned" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" -dependencies = [ - "serde", -] - -[[package]] -name = "sha2" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "shellexpand" -version = "2.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ccc8076840c4da029af4f87e4e8daeb0fca6b87bbb02e10cb60b791450e11e4" -dependencies = [ - "dirs", -] - -[[package]] -name = "slab" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] - -[[package]] -name = "slice-group-by" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" - -[[package]] -name = "smallvec" -version = "1.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" - -[[package]] -name = "socket2" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "spdx" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29ef1a0fa1e39ac22972c8db23ff89aea700ab96aa87114e1fb55937a631a0c9" -dependencies = [ - "smallvec", -] - -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - -[[package]] -name = "spin-common" -version = "2.5.0-pre0" -source = "git+https://github.com/fermyon/spin#b86af6c7188e84f5824f7eef757c65ff2ad265c4" -dependencies = [ - "anyhow", - "dirs", - "sha2", - "tempfile", - "tokio", - "url", -] - -[[package]] -name = "spin-componentize" -version = "2.5.0-pre0" -source = "git+https://github.com/fermyon/spin#b86af6c7188e84f5824f7eef757c65ff2ad265c4" -dependencies = [ - "anyhow", - "wasm-encoder 0.200.0", - "wasmparser 0.200.0", - "wit-component", - "wit-parser 0.200.0", -] - -[[package]] -name = "spin-expressions" -version = "2.5.0-pre0" -source = "git+https://github.com/fermyon/spin#b86af6c7188e84f5824f7eef757c65ff2ad265c4" -dependencies = [ - "anyhow", - "async-trait", - "dotenvy", - "once_cell", - "serde", - "spin-locked-app", - "thiserror", -] - -[[package]] -name = "spin-locked-app" -version = "2.5.0-pre0" -source = "git+https://github.com/fermyon/spin#b86af6c7188e84f5824f7eef757c65ff2ad265c4" -dependencies = [ - "anyhow", - "async-trait", - "ouroboros", - "serde", - "serde_json", - "spin-serde", - "thiserror", -] - -[[package]] -name = "spin-manifest" -version = "2.5.0-pre0" -source = "git+https://github.com/fermyon/spin#b86af6c7188e84f5824f7eef757c65ff2ad265c4" -dependencies = [ - "anyhow", - "indexmap 1.9.3", - "serde", - "spin-serde", - "terminal", - "thiserror", - "toml", - "url", -] - -[[package]] -name = "spin-outbound-networking" -version = "2.5.0-pre0" -source = "git+https://github.com/fermyon/spin#b86af6c7188e84f5824f7eef757c65ff2ad265c4" -dependencies = [ - "anyhow", - "http", - "ipnet", - "spin-expressions", - "spin-locked-app", - "terminal", - "url", - "urlencoding", -] - -[[package]] -name = "spin-serde" -version = "2.5.0-pre0" -source = "git+https://github.com/fermyon/spin#b86af6c7188e84f5824f7eef757c65ff2ad265c4" -dependencies = [ - "base64", - "serde", -] - -[[package]] -name = "spin-test" -version = "0.1.0" -dependencies = [ - "env_logger", - "http-body-util", - "hyper", - "spin-common", - "spin-componentize", - "spin-manifest", - "tokio", - "wac-graph", - "wasmtime", - "wasmtime-wasi", - "wasmtime-wasi-http", -] - -[[package]] -name = "spin-test-sdk" -version = "0.1.0" -dependencies = [ - "anyhow", - "async-trait", - "http", - "http-body-util", - "hyper", - "tokio", - "wasmtime", - "wasmtime-wasi", - "wasmtime-wasi-http", -] - -[[package]] -name = "spin-test-virt" -version = "0.1.0" -dependencies = [ - "anyhow", - "bitflags 2.5.0", - "spin-expressions", - "spin-manifest", - "spin-outbound-networking", - "spin-serde", - "toml", - "wit-bindgen-rt 0.22.0", -] - -[[package]] -name = "sptr" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b9b39299b249ad65f3b7e96443bad61c02ca5cd3589f46cb6d610a0fd6c0d6a" - -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "syn" -version = "2.0.53" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7383cd0e49fff4b6b90ca5670bfd3e9d6a733b3f90c686605aa7eec8c4996032" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "system-interface" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aef1f9d4c1dbdd1cb3a63be9efd2f04d8ddbc919d46112982c76818ffc2f1a7" -dependencies = [ - "bitflags 2.5.0", - "cap-fs-ext", - "cap-std", - "fd-lock", - "io-lifetimes", - "rustix", - "windows-sys 0.52.0", - "winx", -] - -[[package]] -name = "target-lexicon" -version = "0.12.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" - -[[package]] -name = "tempfile" -version = "3.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" -dependencies = [ - "cfg-if", - "fastrand", - "rustix", - "windows-sys 0.52.0", -] - -[[package]] -name = "termcolor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "terminal" -version = "2.5.0-pre0" -source = "git+https://github.com/fermyon/spin#b86af6c7188e84f5824f7eef757c65ff2ad265c4" -dependencies = [ - "atty", - "once_cell", - "termcolor", -] - -[[package]] -name = "thiserror" -version = "1.0.58" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.58" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tinyvec" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - -[[package]] -name = "tokio" -version = "1.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" -dependencies = [ - "backtrace", - "bytes", - "libc", - "mio", - "num_cpus", - "pin-project-lite", - "socket2", - "tokio-macros", - "windows-sys 0.48.0", -] - -[[package]] -name = "tokio-macros" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tokio-rustls" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" -dependencies = [ - "rustls", - "tokio", -] - -[[package]] -name = "tokio-util" -version = "0.7.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", - "tracing", -] - -[[package]] -name = "toml" -version = "0.8.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" -dependencies = [ - "indexmap 2.2.6", - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit", -] - -[[package]] -name = "toml_datetime" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" -dependencies = [ - "serde", -] - -[[package]] -name = "toml_edit" -version = "0.22.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e40bb779c5187258fd7aad0eb68cb8706a0a81fa712fbea808ab43c4b8374c4" -dependencies = [ - "indexmap 2.2.6", - "serde", - "serde_spanned", - "toml_datetime", - "winnow", -] - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "try-lock" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" - -[[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-normalization" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "unicode-width" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" - -[[package]] -name = "unicode-xid" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" - -[[package]] -name = "untrusted" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" - -[[package]] -name = "url" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", -] - -[[package]] -name = "urlencoding" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" - -[[package]] -name = "utf8parse" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" - -[[package]] -name = "uuid" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wac-graph" -version = "0.1.0" -source = "git+https://github.com/peterhuene/wac#66c067254ecf9ad862a195e49d3465b656f4e517" -dependencies = [ - "anyhow", - "id-arena", - "indexmap 2.2.6", - "log", - "petgraph", - "semver", - "thiserror", - "wac-types", - "wasm-encoder 0.202.0", - "wasmparser 0.202.0", -] - -[[package]] -name = "wac-types" -version = "0.1.0" -source = "git+https://github.com/peterhuene/wac#66c067254ecf9ad862a195e49d3465b656f4e517" -dependencies = [ - "anyhow", - "id-arena", - "indexmap 2.2.6", - "semver", - "wasm-encoder 0.202.0", - "wasmparser 0.202.0", -] - -[[package]] -name = "want" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -dependencies = [ - "try-lock", -] - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasm-bindgen" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" - -[[package]] -name = "wasm-encoder" -version = "0.200.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e3fb0c8fbddd78aa6095b850dfeedbc7506cf5f81e633f69cf8f2333ab84b9" -dependencies = [ - "leb128", -] - -[[package]] -name = "wasm-encoder" -version = "0.201.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9c7d2731df60006819b013f64ccc2019691deccf6e11a1804bc850cd6748f1a" -dependencies = [ - "leb128", -] - -[[package]] -name = "wasm-encoder" -version = "0.202.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfd106365a7f5f7aa3c1916a98cbb3ad477f5ff96ddb130285a91c6e7429e67a" -dependencies = [ - "leb128", -] - -[[package]] -name = "wasm-metadata" -version = "0.200.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b8cc0c21f46d55b0aaa419cacce1eadcf28eaebd0e1488d6a6313ee71a586" -dependencies = [ - "anyhow", - "indexmap 2.2.6", - "serde", - "serde_derive", - "serde_json", - "spdx", - "wasm-encoder 0.200.0", - "wasmparser 0.200.0", -] - -[[package]] -name = "wasm-test" -version = "0.1.0" -dependencies = [ - "bitflags 2.5.0", - "wit-bindgen-rt 0.24.0", -] - -[[package]] -name = "wasmparser" -version = "0.200.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a03f65ac876612140c57ff6c3b8fe4990067cce97c2cfdb07368a3cc3354b062" -dependencies = [ - "bitflags 2.5.0", - "indexmap 2.2.6", - "semver", -] - -[[package]] -name = "wasmparser" -version = "0.201.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84e5df6dba6c0d7fafc63a450f1738451ed7a0b52295d83e868218fa286bf708" -dependencies = [ - "bitflags 2.5.0", - "indexmap 2.2.6", - "semver", -] - -[[package]] -name = "wasmparser" -version = "0.202.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6998515d3cf3f8b980ef7c11b29a9b1017d4cf86b99ae93b546992df9931413" -dependencies = [ - "bitflags 2.5.0", - "indexmap 2.2.6", - "semver", -] - -[[package]] -name = "wasmprinter" -version = "0.201.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a67e66da702706ba08729a78e3c0079085f6bfcb1a62e4799e97bbf728c2c265" -dependencies = [ - "anyhow", - "wasmparser 0.201.0", -] - -[[package]] -name = "wasmtime" -version = "19.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "516be5b58a8f75d39b01378516dcb0ff7b9bc39c7f1f10eec5b338d4916cf988" -dependencies = [ - "addr2line", - "anyhow", - "async-trait", - "bincode", - "bumpalo", - "cfg-if", - "encoding_rs", - "fxprof-processed-profile", - "gimli", - "indexmap 2.2.6", - "ittapi", - "libc", - "log", - "object", - "once_cell", - "paste", - "rayon", - "rustix", - "semver", - "serde", - "serde_derive", - "serde_json", - "target-lexicon", - "wasm-encoder 0.201.0", - "wasmparser 0.201.0", - "wasmtime-cache", - "wasmtime-component-macro", - "wasmtime-component-util", - "wasmtime-cranelift", - "wasmtime-environ", - "wasmtime-fiber", - "wasmtime-jit-debug", - "wasmtime-jit-icache-coherence", - "wasmtime-runtime", - "wasmtime-slab", - "wasmtime-winch", - "wat", - "windows-sys 0.52.0", -] - -[[package]] -name = "wasmtime-asm-macros" -version = "19.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8d22d88a92d69385f18143c946884bf6aaa9ec206ce54c85a2d320c1362b009" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "wasmtime-cache" -version = "19.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "068728a840223b56c964507550da671372e7e5c2f3a7856012b57482e3e979a7" -dependencies = [ - "anyhow", - "base64", - "bincode", - "directories-next", - "log", - "rustix", - "serde", - "serde_derive", - "sha2", - "toml", - "windows-sys 0.52.0", - "zstd", -] - -[[package]] -name = "wasmtime-component-macro" -version = "19.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631244bac89c57ebe7283209d86fe175ad5929328e75f61bf9141895cafbf52d" -dependencies = [ - "anyhow", - "proc-macro2", - "quote", - "syn", - "wasmtime-component-util", - "wasmtime-wit-bindgen", - "wit-parser 0.201.0", -] - -[[package]] -name = "wasmtime-component-util" -version = "19.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82ad496ba0558f7602da5e9d4c201f35f7aefcca70f973ec916f3f0d0787ef74" - -[[package]] -name = "wasmtime-cranelift" -version = "19.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "961ab5ee4b17e627001b18069ee89ef906edbbd3f84955515f6aad5ab6d82299" -dependencies = [ - "anyhow", - "cfg-if", - "cranelift-codegen", - "cranelift-control", - "cranelift-entity", - "cranelift-frontend", - "cranelift-native", - "cranelift-wasm", - "gimli", - "log", - "object", - "target-lexicon", - "thiserror", - "wasmparser 0.201.0", - "wasmtime-cranelift-shared", - "wasmtime-environ", - "wasmtime-versioned-export-macros", -] - -[[package]] -name = "wasmtime-cranelift-shared" -version = "19.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc4db94596be14cd1f85844ce85470bf68acf235143098b9d9bf72b49e47b917" -dependencies = [ - "anyhow", - "cranelift-codegen", - "cranelift-control", - "cranelift-native", - "gimli", - "object", - "target-lexicon", - "wasmtime-environ", -] - -[[package]] -name = "wasmtime-environ" -version = "19.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "420b13858ef27dfd116f1fdb0513e9593a307a632ade2ea58334b639a3d8d24e" -dependencies = [ - "anyhow", - "bincode", - "cpp_demangle", - "cranelift-entity", - "gimli", - "indexmap 2.2.6", - "log", - "object", - "rustc-demangle", - "serde", - "serde_derive", - "target-lexicon", - "thiserror", - "wasm-encoder 0.201.0", - "wasmparser 0.201.0", - "wasmprinter", - "wasmtime-component-util", - "wasmtime-types", -] - -[[package]] -name = "wasmtime-fiber" -version = "19.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d37ff0e11a023019e34fe839c74a1c00880b989f4446176b6cc6da3b58e3ef2" -dependencies = [ - "anyhow", - "cc", - "cfg-if", - "rustix", - "wasmtime-asm-macros", - "wasmtime-versioned-export-macros", - "windows-sys 0.52.0", -] - -[[package]] -name = "wasmtime-jit-debug" -version = "19.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b849f19ad1d4a8133ff05b82c438144f17fb49b08e5f7995f8c1e25cf35f390" -dependencies = [ - "object", - "once_cell", - "rustix", - "wasmtime-versioned-export-macros", -] - -[[package]] -name = "wasmtime-jit-icache-coherence" -version = "19.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59c48eb4223d6556ffbf3decb146d0da124f1fd043f41c98b705252cb6a5c186" -dependencies = [ - "cfg-if", - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "wasmtime-runtime" -version = "19.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fefac2cb5f5a6f365234a3584bf40bd2e45e7f6cd90a689d9b2afbb9881978f" -dependencies = [ - "anyhow", - "cc", - "cfg-if", - "encoding_rs", - "indexmap 2.2.6", - "libc", - "log", - "mach", - "memfd", - "memoffset", - "paste", - "psm", - "rustix", - "sptr", - "wasm-encoder 0.201.0", - "wasmtime-asm-macros", - "wasmtime-environ", - "wasmtime-fiber", - "wasmtime-jit-debug", - "wasmtime-versioned-export-macros", - "wasmtime-wmemcheck", - "windows-sys 0.52.0", -] - -[[package]] -name = "wasmtime-slab" -version = "19.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52d7b97b92df126fdbe994a53d2215828ec5ed5087535e6d4703b1fbd299f0e3" - -[[package]] -name = "wasmtime-types" -version = "19.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "509c88abb830819b259c49e2d4e4f22b555db066ba08ded0b76b071a2aa53ddf" -dependencies = [ - "cranelift-entity", - "serde", - "serde_derive", - "thiserror", - "wasmparser 0.201.0", -] - -[[package]] -name = "wasmtime-versioned-export-macros" -version = "19.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1d81c092a61ca1667013e2eb08fed7c6c53e496dbbaa32d5685dc5152b0a772" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "wasmtime-wasi" -version = "19.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af3ebe8aeb34f49342db2e8fbb1992796e6c7d9f7005b7298ca0dceede532e9d" -dependencies = [ - "anyhow", - "async-trait", - "bitflags 2.5.0", - "bytes", - "cap-fs-ext", - "cap-net-ext", - "cap-rand", - "cap-std", - "cap-time-ext", - "fs-set-times", - "futures", - "io-extras", - "io-lifetimes", - "once_cell", - "rustix", - "system-interface", - "thiserror", - "tokio", - "tracing", - "url", - "wasmtime", - "wiggle", - "windows-sys 0.52.0", -] - -[[package]] -name = "wasmtime-wasi-http" -version = "19.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1d47c5f5d6f6f04f481b2d19f77cc03b6a16899061bc10a86c46213cdaa3ba4" -dependencies = [ - "anyhow", - "async-trait", - "bytes", - "futures", - "http", - "http-body", - "http-body-util", - "hyper", - "rustls", - "tokio", - "tokio-rustls", - "tracing", - "wasmtime", - "wasmtime-wasi", - "webpki-roots", -] - -[[package]] -name = "wasmtime-winch" -version = "19.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0958907880e37a2d3974f5b3574c23bf70aaf1fc6c1f716625bb50dac776f1a" -dependencies = [ - "anyhow", - "cranelift-codegen", - "gimli", - "object", - "target-lexicon", - "wasmparser 0.201.0", - "wasmtime-cranelift-shared", - "wasmtime-environ", - "winch-codegen", -] - -[[package]] -name = "wasmtime-wit-bindgen" -version = "19.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a593ddefd2f80617df6bea084b2e422d8969e924bc209642a794d57518f59587" -dependencies = [ - "anyhow", - "heck", - "indexmap 2.2.6", - "wit-parser 0.201.0", -] - -[[package]] -name = "wasmtime-wmemcheck" -version = "19.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b77212b6874bbc86d220bb1d28632d0c11c6afe996c3e1ddcf746b1a6b4919b9" - -[[package]] -name = "wast" -version = "35.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ef140f1b49946586078353a453a1d28ba90adfc54dde75710bc1931de204d68" -dependencies = [ - "leb128", -] - -[[package]] -name = "wast" -version = "202.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fbcb11204515c953c9b42ede0a46a1c5e17f82af05c4fae201a8efff1b0f4fe" -dependencies = [ - "bumpalo", - "leb128", - "memchr", - "unicode-width", - "wasm-encoder 0.202.0", -] - -[[package]] -name = "wat" -version = "1.202.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4de4b15a47135c56a3573406e9977b9518787a6154459b4842a9b9d3d1684848" -dependencies = [ - "wast 202.0.0", -] - -[[package]] -name = "webpki-roots" -version = "0.25.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" - -[[package]] -name = "wiggle" -version = "19.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f093d8afdb09efaf2ed1037468bd4614308a762d215b6cafd60a7712993a8ffa" -dependencies = [ - "anyhow", - "async-trait", - "bitflags 2.5.0", - "thiserror", - "tracing", - "wasmtime", - "wiggle-macro", -] - -[[package]] -name = "wiggle-generate" -version = "19.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47c7bccd5172ce8d853242f723e42c84b8c131b24fb07a1570f9045d99258616" -dependencies = [ - "anyhow", - "heck", - "proc-macro2", - "quote", - "shellexpand", - "syn", - "witx", -] - -[[package]] -name = "wiggle-macro" -version = "19.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a69d087dee85991096fc0c6eaf4dcf4e17cd16a0594c33b8ab9e2d345234ef75" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wiggle-generate", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" -dependencies = [ - "winapi", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "winch-codegen" -version = "0.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e72a6a7034793b874b85e428fd6d7b3ccccb98c326e33af3aa40cdf50d0c33da" -dependencies = [ - "anyhow", - "cranelift-codegen", - "gimli", - "regalloc2", - "smallvec", - "target-lexicon", - "wasmparser 0.201.0", - "wasmtime-environ", -] - -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.4", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.4", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" -dependencies = [ - "windows_aarch64_gnullvm 0.52.4", - "windows_aarch64_msvc 0.52.4", - "windows_i686_gnu 0.52.4", - "windows_i686_msvc 0.52.4", - "windows_x86_64_gnu 0.52.4", - "windows_x86_64_gnullvm 0.52.4", - "windows_x86_64_msvc 0.52.4", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" - -[[package]] -name = "winnow" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dffa400e67ed5a4dd237983829e66475f0a4a26938c4b04c21baede6262215b8" -dependencies = [ - "memchr", -] - -[[package]] -name = "winx" -version = "0.36.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9643b83820c0cd246ecabe5fa454dd04ba4fa67996369466d0747472d337346" -dependencies = [ - "bitflags 2.5.0", - "windows-sys 0.52.0", -] - -[[package]] -name = "wit-bindgen-rt" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb8738270f32a2d6739973cbbb7c1b6dd8959ce515578a6e19165853272ee64" - -[[package]] -name = "wit-bindgen-rt" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b0780cf7046630ed70f689a098cd8d56c5c3b22f2a7379bbdb088879963ff96" - -[[package]] -name = "wit-component" -version = "0.200.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39979723340baea490b87b11b2abae05f149d86f2b55c18d41d78a2a2b284c16" -dependencies = [ - "anyhow", - "bitflags 2.5.0", - "indexmap 2.2.6", - "log", - "serde", - "serde_derive", - "serde_json", - "wasm-encoder 0.200.0", - "wasm-metadata", - "wasmparser 0.200.0", - "wit-parser 0.200.0", -] - -[[package]] -name = "wit-parser" -version = "0.200.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f717576b37f01c15696bda7f6f13868367b9c5913485f9f0ec8e59fd28c8e13" -dependencies = [ - "anyhow", - "id-arena", - "indexmap 2.2.6", - "log", - "semver", - "serde", - "serde_derive", - "serde_json", - "unicode-xid", - "wasmparser 0.200.0", -] - -[[package]] -name = "wit-parser" -version = "0.201.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "196d3ecfc4b759a8573bf86a9b3f8996b304b3732e4c7de81655f875f6efdca6" -dependencies = [ - "anyhow", - "id-arena", - "indexmap 2.2.6", - "log", - "semver", - "serde", - "serde_derive", - "serde_json", - "unicode-xid", - "wasmparser 0.201.0", -] - -[[package]] -name = "witx" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e366f27a5cabcddb2706a78296a40b8fcc451e1a6aba2fc1d94b4a01bdaaef4b" -dependencies = [ - "anyhow", - "log", - "thiserror", - "wast 35.0.2", -] - -[[package]] -name = "yansi" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" - -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "zstd" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bffb3309596d527cfcba7dfc6ed6052f1d39dfbd7c867aa2e865e4a449c10110" -dependencies = [ - "zstd-safe", -] - -[[package]] -name = "zstd-safe" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43747c7422e2924c11144d5229878b98180ef8b06cca4ab5af37afc8a8d8ea3e" -dependencies = [ - "zstd-sys", -] - -[[package]] -name = "zstd-sys" -version = "2.0.9+zstd.1.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" -dependencies = [ - "cc", - "pkg-config", -] diff --git a/crates/spin-test-virt/Cargo.toml b/crates/spin-test-virt/Cargo.toml index cd875ec..dad10d2 100644 --- a/crates/spin-test-virt/Cargo.toml +++ b/crates/spin-test-virt/Cargo.toml @@ -4,19 +4,18 @@ version = "0.1.0" edition = "2021" [dependencies] -anyhow = "1.0" +anyhow = { workspace = true } async-trait = "0.1" futures = "0.3" -ipnet = "2.9" +ipnet = "2.11" spin-expressions = { workspace = true } spin-manifest = { workspace = true } -spin-outbound-networking = { workspace = true } spin-serde = { workspace = true } -spin-locked-app = { git = "https://github.com/fermyon/spin" } +spin-locked-app = { git = "https://github.com/spinframework/spin", rev = "1d48156da083843453ecaf627c7f976306a8210d" } +spin-outbound-networking-config = { git = "https://github.com/spinframework/spin", rev = "1d48156da083843453ecaf627c7f976306a8210d" } toml = { workspace = true } wit-bindgen-rt = { workspace = true } -# rusqlite > 0.25 fails to build with various linker errors -rusqlite = { version = "0.25", features = ["bundled", "wasm32-wasi-vfs"] } +rusqlite = { version = "0.36", features = ["bundled", "wasm32-wasi-vfs"] } [lib] diff --git a/crates/spin-test-virt/src/bindings.rs b/crates/spin-test-virt/src/bindings.rs index 8048b52..38b31a6 100644 --- a/crates/spin-test-virt/src/bindings.rs +++ b/crates/spin-test-virt/src/bindings.rs @@ -1,262 +1,254 @@ -// Generated by `wit-bindgen` 0.25.0. DO NOT EDIT! +// Generated by `wit-bindgen` 0.41.0. DO NOT EDIT! // Options used: +// * runtime_path: "wit_bindgen_rt" #[allow(unused_unsafe, clippy::all)] pub fn get_manifest() -> _rt::String { unsafe { - #[repr(align(4))] - struct RetArea([::core::mem::MaybeUninit; 8]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct RetArea( + [::core::mem::MaybeUninit; 2 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 2 * ::core::mem::size_of::<*const u8>()], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "$root")] - extern "C" { + unsafe extern "C" { #[link_name = "get-manifest"] - fn wit_import(_: *mut u8); + fn wit_import1(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: *mut u8) { + unsafe extern "C" fn wit_import1(_: *mut u8) { unreachable!() } - wit_import(ptr0); - let l1 = *ptr0.add(0).cast::<*mut u8>(); - let l2 = *ptr0.add(4).cast::(); - let len3 = l2; - let bytes3 = _rt::Vec::from_raw_parts(l1.cast(), len3, len3); - _rt::string_lift(bytes3) + unsafe { wit_import1(ptr0) }; + let l2 = *ptr0.add(0).cast::<*mut u8>(); + let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::(); + let len4 = l3; + let bytes4 = _rt::Vec::from_raw_parts(l2.cast(), len4, len4); + let result5 = _rt::string_lift(bytes4); + result5 } } #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_set_component_id_cabi(arg0: *mut u8, arg1: usize) { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg1; let bytes0 = _rt::Vec::from_raw_parts(arg0.cast(), len0, len0); T::set_component_id(_rt::string_lift(bytes0)); } pub trait Guest { /// Helper functions - fn set_component_id(component_id: _rt::String); + fn set_component_id(component_id: _rt::String) -> (); } #[doc(hidden)] - -macro_rules! __export_world_env_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "set-component-id"] - unsafe extern "C" fn export_set_component_id(arg0: *mut u8,arg1: usize,) { - $($path_to_types)*::_export_set_component_id_cabi::<$ty>(arg0, arg1) - } - };); +macro_rules! __export_world_env_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = "set-component-id")] unsafe extern "C" + fn export_set_component_id(arg0 : * mut u8, arg1 : usize,) { unsafe { + $($path_to_types)*:: _export_set_component_id_cabi::<$ty > (arg0, arg1) } } }; + }; } #[doc(hidden)] pub(crate) use __export_world_env_cabi; -#[allow(dead_code)] +#[rustfmt::skip] +#[allow(dead_code, clippy::all)] pub mod wasi { - #[allow(dead_code)] pub mod cli { - #[allow(dead_code, clippy::all)] + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod stdout { #[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; pub type OutputStream = super::super::super::wasi::io::streams::OutputStream; #[allow(unused_unsafe, clippy::all)] pub fn get_stdout() -> OutputStream { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:cli/stdout@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "get-stdout"] - fn wit_import() -> i32; + fn wit_import0() -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import() -> i32 { + unsafe extern "C" fn wit_import0() -> i32 { unreachable!() } - let ret = wit_import(); - super::super::super::wasi::io::streams::OutputStream::from_handle(ret as u32) + let ret = unsafe { wit_import0() }; + unsafe { + super::super::super::wasi::io::streams::OutputStream::from_handle( + ret as u32, + ) + } } } } - - #[allow(dead_code, clippy::all)] + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod stdin { #[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; pub type InputStream = super::super::super::wasi::io::streams::InputStream; #[allow(unused_unsafe, clippy::all)] pub fn get_stdin() -> InputStream { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:cli/stdin@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "get-stdin"] - fn wit_import() -> i32; + fn wit_import0() -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import() -> i32 { + unsafe extern "C" fn wit_import0() -> i32 { unreachable!() } - let ret = wit_import(); - super::super::super::wasi::io::streams::InputStream::from_handle(ret as u32) + let ret = unsafe { wit_import0() }; + unsafe { + super::super::super::wasi::io::streams::InputStream::from_handle( + ret as u32, + ) + } } } } - - #[allow(dead_code, clippy::all)] + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod stderr { #[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; pub type OutputStream = super::super::super::wasi::io::streams::OutputStream; #[allow(unused_unsafe, clippy::all)] pub fn get_stderr() -> OutputStream { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:cli/stderr@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "get-stderr"] - fn wit_import() -> i32; + fn wit_import0() -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import() -> i32 { + unsafe extern "C" fn wit_import0() -> i32 { unreachable!() } - let ret = wit_import(); - super::super::super::wasi::io::streams::OutputStream::from_handle(ret as u32) + let ret = unsafe { wit_import0() }; + unsafe { + super::super::super::wasi::io::streams::OutputStream::from_handle( + ret as u32, + ) + } } } } - - #[allow(dead_code, clippy::all)] + /// Terminal input. + /// + /// In the future, this may include functions for disabling echoing, + /// disabling input buffering so that keyboard events are sent through + /// immediately, querying supported features, and so on. + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod terminal_input { #[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; /// The input side of a terminal. - #[derive(Debug)] #[repr(transparent)] pub struct TerminalInput { handle: _rt::Resource, } - impl TerminalInput { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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 TerminalInput { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:cli/terminal-input@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]terminal-input"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } } - - #[allow(dead_code, clippy::all)] + /// Terminal output. + /// + /// In the future, this may include functions for querying the terminal + /// size, being notified of terminal size changes, querying supported + /// features, and so on. + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod terminal_output { #[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; /// The output side of a terminal. - #[derive(Debug)] #[repr(transparent)] pub struct TerminalOutput { handle: _rt::Resource, } - impl TerminalOutput { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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 TerminalOutput { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:cli/terminal-output@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]terminal-output"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } } - - #[allow(dead_code, clippy::all)] + /// An interface providing an optional `terminal-input` for stdin as a + /// link-time authority. + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod terminal_stdin { #[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 TerminalInput = super::super::super::wasi::cli::terminal_input::TerminalInput; #[allow(unused_unsafe, clippy::all)] @@ -270,43 +262,44 @@ pub mod wasi { let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:cli/terminal-stdin@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "get-terminal-stdin"] - fn wit_import(_: *mut u8); + fn wit_import1(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: *mut u8) { + unsafe extern "C" fn wit_import1(_: *mut u8) { unreachable!() } - wit_import(ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1(ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result4 = match l2 { 0 => None, 1 => { let e = { - let l2 = *ptr0.add(4).cast::(); - - super::super::super::wasi::cli::terminal_input::TerminalInput::from_handle(l2 as u32) + let l3 = *ptr0.add(4).cast::(); + unsafe { + super::super::super::wasi::cli::terminal_input::TerminalInput::from_handle( + l3 as u32, + ) + } }; Some(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result4 } } } - - #[allow(dead_code, clippy::all)] + /// An interface providing an optional `terminal-output` for stdout as a + /// link-time authority. + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod terminal_stdout { #[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 TerminalOutput = - super::super::super::wasi::cli::terminal_output::TerminalOutput; + pub type TerminalOutput = super::super::super::wasi::cli::terminal_output::TerminalOutput; #[allow(unused_unsafe, clippy::all)] /// If stdout is connected to a terminal, return a `terminal-output` handle /// allowing further interaction with it. @@ -318,43 +311,44 @@ pub mod wasi { let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:cli/terminal-stdout@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "get-terminal-stdout"] - fn wit_import(_: *mut u8); + fn wit_import1(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: *mut u8) { + unsafe extern "C" fn wit_import1(_: *mut u8) { unreachable!() } - wit_import(ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1(ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result4 = match l2 { 0 => None, 1 => { let e = { - let l2 = *ptr0.add(4).cast::(); - - super::super::super::wasi::cli::terminal_output::TerminalOutput::from_handle(l2 as u32) + let l3 = *ptr0.add(4).cast::(); + unsafe { + super::super::super::wasi::cli::terminal_output::TerminalOutput::from_handle( + l3 as u32, + ) + } }; Some(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result4 } } } - - #[allow(dead_code, clippy::all)] + /// An interface providing an optional `terminal-output` for stderr as a + /// link-time authority. + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod terminal_stderr { #[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 TerminalOutput = - super::super::super::wasi::cli::terminal_output::TerminalOutput; + pub type TerminalOutput = super::super::super::wasi::cli::terminal_output::TerminalOutput; #[allow(unused_unsafe, clippy::all)] /// If stderr is connected to a terminal, return a `terminal-output` handle /// allowing further interaction with it. @@ -366,40 +360,40 @@ pub mod wasi { let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:cli/terminal-stderr@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "get-terminal-stderr"] - fn wit_import(_: *mut u8); + fn wit_import1(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: *mut u8) { + unsafe extern "C" fn wit_import1(_: *mut u8) { unreachable!() } - wit_import(ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1(ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result4 = match l2 { 0 => None, 1 => { let e = { - let l2 = *ptr0.add(4).cast::(); - - super::super::super::wasi::cli::terminal_output::TerminalOutput::from_handle(l2 as u32) + let l3 = *ptr0.add(4).cast::(); + unsafe { + super::super::super::wasi::cli::terminal_output::TerminalOutput::from_handle( + l3 as u32, + ) + } }; Some(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result4 } } } - - #[allow(dead_code, clippy::all)] + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod environment { #[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; #[allow(unused_unsafe, clippy::all)] /// Get the POSIX-style environment variables. @@ -412,86 +406,122 @@ pub mod wasi { /// values each time it is called. pub fn get_environment() -> _rt::Vec<(_rt::String, _rt::String)> { unsafe { - #[repr(align(4))] - struct RetArea([::core::mem::MaybeUninit; 8]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 2 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 2 + * ::core::mem::size_of::<*const u8>()], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:cli/environment@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "get-environment"] - fn wit_import(_: *mut u8); + fn wit_import1(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: *mut u8) { + unsafe extern "C" fn wit_import1(_: *mut u8) { unreachable!() } - wit_import(ptr0); - let l1 = *ptr0.add(0).cast::<*mut u8>(); - let l2 = *ptr0.add(4).cast::(); - let base9 = l1; - let len9 = l2; - let mut result9 = _rt::Vec::with_capacity(len9); - for i in 0..len9 { - let base = base9.add(i * 16); - let e9 = { - let l3 = *base.add(0).cast::<*mut u8>(); - let l4 = *base.add(4).cast::(); - let len5 = l4; - let bytes5 = _rt::Vec::from_raw_parts(l3.cast(), len5, len5); - let l6 = *base.add(8).cast::<*mut u8>(); - let l7 = *base.add(12).cast::(); - let len8 = l7; - let bytes8 = _rt::Vec::from_raw_parts(l6.cast(), len8, len8); - - (_rt::string_lift(bytes5), _rt::string_lift(bytes8)) + unsafe { wit_import1(ptr0) }; + let l2 = *ptr0.add(0).cast::<*mut u8>(); + let l3 = *ptr0 + .add(::core::mem::size_of::<*const u8>()) + .cast::(); + let base10 = l2; + let len10 = l3; + let mut result10 = _rt::Vec::with_capacity(len10); + for i in 0..len10 { + let base = base10 + .add(i * (4 * ::core::mem::size_of::<*const u8>())); + let e10 = { + let l4 = *base.add(0).cast::<*mut u8>(); + let l5 = *base + .add(::core::mem::size_of::<*const u8>()) + .cast::(); + let len6 = l5; + let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6); + let l7 = *base + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l8 = *base + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len9 = l8; + let bytes9 = _rt::Vec::from_raw_parts(l7.cast(), len9, len9); + (_rt::string_lift(bytes6), _rt::string_lift(bytes9)) }; - result9.push(e9); + result10.push(e10); } - _rt::cabi_dealloc(base9, len9 * 16, 4); - result9 + _rt::cabi_dealloc( + base10, + len10 * (4 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); + let result11 = result10; + result11 } } #[allow(unused_unsafe, clippy::all)] /// Get the POSIX-style arguments to the program. pub fn get_arguments() -> _rt::Vec<_rt::String> { unsafe { - #[repr(align(4))] - struct RetArea([::core::mem::MaybeUninit; 8]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 2 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 2 + * ::core::mem::size_of::<*const u8>()], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:cli/environment@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "get-arguments"] - fn wit_import(_: *mut u8); + fn wit_import1(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: *mut u8) { + unsafe extern "C" fn wit_import1(_: *mut u8) { unreachable!() } - wit_import(ptr0); - let l1 = *ptr0.add(0).cast::<*mut u8>(); - let l2 = *ptr0.add(4).cast::(); - let base6 = l1; - let len6 = l2; - let mut result6 = _rt::Vec::with_capacity(len6); - for i in 0..len6 { - let base = base6.add(i * 8); - let e6 = { - let l3 = *base.add(0).cast::<*mut u8>(); - let l4 = *base.add(4).cast::(); - let len5 = l4; - let bytes5 = _rt::Vec::from_raw_parts(l3.cast(), len5, len5); - - _rt::string_lift(bytes5) + unsafe { wit_import1(ptr0) }; + let l2 = *ptr0.add(0).cast::<*mut u8>(); + let l3 = *ptr0 + .add(::core::mem::size_of::<*const u8>()) + .cast::(); + let base7 = l2; + let len7 = l3; + let mut result7 = _rt::Vec::with_capacity(len7); + for i in 0..len7 { + let base = base7 + .add(i * (2 * ::core::mem::size_of::<*const u8>())); + let e7 = { + let l4 = *base.add(0).cast::<*mut u8>(); + let l5 = *base + .add(::core::mem::size_of::<*const u8>()) + .cast::(); + let len6 = l5; + let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6); + _rt::string_lift(bytes6) }; - result6.push(e6); + result7.push(e7); } - _rt::cabi_dealloc(base6, len6 * 8, 4); - result6 + _rt::cabi_dealloc( + base7, + len7 * (2 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); + let result8 = result7; + result8 } } #[allow(unused_unsafe, clippy::all)] @@ -499,52 +529,64 @@ pub mod wasi { /// directory, interpreting `.` as shorthand for this. pub fn initial_cwd() -> Option<_rt::String> { unsafe { - #[repr(align(4))] - struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 3 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 3 + * ::core::mem::size_of::<*const u8>()], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:cli/environment@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "initial-cwd"] - fn wit_import(_: *mut u8); + fn wit_import1(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: *mut u8) { + unsafe extern "C" fn wit_import1(_: *mut u8) { unreachable!() } - wit_import(ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1(ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result6 = match l2 { 0 => None, 1 => { let e = { - let l2 = *ptr0.add(4).cast::<*mut u8>(); - let l3 = *ptr0.add(8).cast::(); - let len4 = l3; - let bytes4 = _rt::Vec::from_raw_parts(l2.cast(), len4, len4); - - _rt::string_lift(bytes4) + let l3 = *ptr0 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l4 = *ptr0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len5 = l4; + let bytes5 = _rt::Vec::from_raw_parts( + l3.cast(), + len5, + len5, + ); + _rt::string_lift(bytes5) }; Some(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result6 } } } - - #[allow(dead_code, clippy::all)] + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod exit { #[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; #[allow(unused_unsafe, clippy::all)] /// Exit the current instance and any linked instances. - pub fn exit(status: Result<(), ()>) { + pub fn exit(status: Result<(), ()>) -> () { unsafe { let result0 = match status { Ok(_) => 0i32, @@ -552,29 +594,35 @@ pub mod wasi { }; #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:cli/exit@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "exit"] - fn wit_import(_: i32); + fn wit_import1(_: i32); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32) { + unsafe extern "C" fn wit_import1(_: i32) { unreachable!() } - wit_import(result0); + unsafe { wit_import1(result0) }; } } } } - #[allow(dead_code)] pub mod clocks { - #[allow(dead_code, clippy::all)] + /// WASI Monotonic Clock is a clock API intended to let users measure elapsed + /// time. + /// + /// It is intended to be portable at least between Unix-family platforms and + /// Windows. + /// + /// A monotonic clock is a clock which has an unspecified initial value, and + /// successive reads of the clock will produce non-decreasing values. + /// + /// It is intended for measuring elapsed time. + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod monotonic_clock { #[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; /// An instant in time, in nanoseconds. An instant is relative to an @@ -592,16 +640,15 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:clocks/monotonic-clock@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "now"] - fn wit_import() -> i64; + fn wit_import0() -> i64; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import() -> i64 { + unsafe extern "C" fn wit_import0() -> i64 { unreachable!() } - let ret = wit_import(); + let ret = unsafe { wit_import0() }; ret as u64 } } @@ -612,16 +659,15 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:clocks/monotonic-clock@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "resolution"] - fn wit_import() -> i64; + fn wit_import0() -> i64; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import() -> i64 { + unsafe extern "C" fn wit_import0() -> i64 { unreachable!() } - let ret = wit_import(); + let ret = unsafe { wit_import0() }; ret as u64 } } @@ -632,17 +678,20 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:clocks/monotonic-clock@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "subscribe-instant"] - fn wit_import(_: i64) -> i32; + fn wit_import0(_: i64) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i64) -> i32 { + unsafe extern "C" fn wit_import0(_: i64) -> i32 { unreachable!() } - let ret = wit_import(_rt::as_i64(when)); - super::super::super::wasi::io::poll::Pollable::from_handle(ret as u32) + let ret = unsafe { wit_import0(_rt::as_i64(when)) }; + unsafe { + super::super::super::wasi::io::poll::Pollable::from_handle( + ret as u32, + ) + } } } #[allow(unused_unsafe, clippy::all)] @@ -653,28 +702,42 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:clocks/monotonic-clock@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "subscribe-duration"] - fn wit_import(_: i64) -> i32; + fn wit_import0(_: i64) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i64) -> i32 { + unsafe extern "C" fn wit_import0(_: i64) -> i32 { unreachable!() } - let ret = wit_import(_rt::as_i64(when)); - super::super::super::wasi::io::poll::Pollable::from_handle(ret as u32) + let ret = unsafe { wit_import0(_rt::as_i64(when)) }; + unsafe { + super::super::super::wasi::io::poll::Pollable::from_handle( + ret as u32, + ) + } } } } - - #[allow(dead_code, clippy::all)] + /// WASI Wall Clock is a clock API intended to let users query the current + /// time. The name "wall" makes an analogy to a "clock on the wall", which + /// is not necessarily monotonic as it may be reset. + /// + /// It is intended to be portable at least between Unix-family platforms and + /// Windows. + /// + /// A wall clock is a clock which measures the date and time according to + /// some external reference. + /// + /// External references may be reset, so this clock is not necessarily + /// monotonic, making it unsuitable for measuring elapsed time. + /// + /// It is intended for reporting the current date and time for humans. + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod wall_clock { #[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; /// A time and date in seconds plus nanoseconds. #[repr(C)] #[derive(Clone, Copy)] @@ -683,7 +746,10 @@ pub mod wasi { pub nanoseconds: u32, } impl ::core::fmt::Debug for Datetime { - 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("Datetime") .field("seconds", &self.seconds) .field("nanoseconds", &self.nanoseconds) @@ -712,22 +778,22 @@ pub mod wasi { let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:clocks/wall-clock@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "now"] - fn wit_import(_: *mut u8); + fn wit_import1(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: *mut u8) { + unsafe extern "C" fn wit_import1(_: *mut u8) { unreachable!() } - wit_import(ptr0); - let l1 = *ptr0.add(0).cast::(); - let l2 = *ptr0.add(8).cast::(); - Datetime { - seconds: l1 as u64, - nanoseconds: l2 as u32, - } + unsafe { wit_import1(ptr0) }; + let l2 = *ptr0.add(0).cast::(); + let l3 = *ptr0.add(8).cast::(); + let result4 = Datetime { + seconds: l2 as u64, + nanoseconds: l3 as u32, + }; + result4 } } #[allow(unused_unsafe, clippy::all)] @@ -742,35 +808,35 @@ pub mod wasi { let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:clocks/wall-clock@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "resolution"] - fn wit_import(_: *mut u8); + fn wit_import1(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: *mut u8) { + unsafe extern "C" fn wit_import1(_: *mut u8) { unreachable!() } - wit_import(ptr0); - let l1 = *ptr0.add(0).cast::(); - let l2 = *ptr0.add(8).cast::(); - Datetime { - seconds: l1 as u64, - nanoseconds: l2 as u32, - } + unsafe { wit_import1(ptr0) }; + let l2 = *ptr0.add(0).cast::(); + let l3 = *ptr0.add(8).cast::(); + let result4 = Datetime { + seconds: l2 as u64, + nanoseconds: l3 as u32, + }; + result4 } } } } - #[allow(dead_code)] pub mod http { - #[allow(dead_code, clippy::all)] + /// This interface defines all of the types and methods for implementing + /// HTTP Requests and Responses, both incoming and outgoing, as well as + /// their headers, trailers, and bodies. + #[allow(dead_code, async_fn_in_trait, unused_imports, 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 Duration = super::super::super::wasi::clocks::monotonic_clock::Duration; pub type InputStream = super::super::super::wasi::io::streams::InputStream; @@ -792,7 +858,10 @@ pub mod wasi { Other(_rt::String), } impl ::core::fmt::Debug for Method { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { Method::Get => f.debug_tuple("Method::Get").finish(), Method::Head => f.debug_tuple("Method::Head").finish(), @@ -803,7 +872,9 @@ pub mod wasi { Method::Options => f.debug_tuple("Method::Options").finish(), Method::Trace => f.debug_tuple("Method::Trace").finish(), Method::Patch => f.debug_tuple("Method::Patch").finish(), - Method::Other(e) => f.debug_tuple("Method::Other").field(e).finish(), + Method::Other(e) => { + f.debug_tuple("Method::Other").field(e).finish() + } } } } @@ -815,11 +886,16 @@ pub mod wasi { Other(_rt::String), } impl ::core::fmt::Debug for Scheme { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { Scheme::Http => f.debug_tuple("Scheme::Http").finish(), Scheme::Https => f.debug_tuple("Scheme::Https").finish(), - Scheme::Other(e) => f.debug_tuple("Scheme::Other").field(e).finish(), + Scheme::Other(e) => { + f.debug_tuple("Scheme::Other").field(e).finish() + } } } } @@ -830,7 +906,10 @@ pub mod wasi { pub info_code: Option, } impl ::core::fmt::Debug for DnsErrorPayload { - 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("DnsErrorPayload") .field("rcode", &self.rcode) .field("info-code", &self.info_code) @@ -844,7 +923,10 @@ pub mod wasi { pub alert_message: Option<_rt::String>, } impl ::core::fmt::Debug for TlsAlertReceivedPayload { - 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("TlsAlertReceivedPayload") .field("alert-id", &self.alert_id) .field("alert-message", &self.alert_message) @@ -858,7 +940,10 @@ pub mod wasi { pub field_size: Option, } impl ::core::fmt::Debug for FieldSizePayload { - 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("FieldSizePayload") .field("field-name", &self.field_name) .field("field-size", &self.field_size) @@ -866,7 +951,7 @@ pub mod wasi { } } /// These cases are inspired by the IANA HTTP Proxy Error Types: - /// https://www.iana.org/assignments/http-proxy-status/http-proxy-status.xhtml#table-http-proxy-error-types + /// https://www.iana.org/assignments/http-proxy-status/http-proxy-status.xhtml#table-http-proxy-error-types #[derive(Clone)] pub enum ErrorCode { DnsTimeout, @@ -915,9 +1000,14 @@ pub mod wasi { InternalError(Option<_rt::String>), } impl ::core::fmt::Debug for ErrorCode { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { - ErrorCode::DnsTimeout => f.debug_tuple("ErrorCode::DnsTimeout").finish(), + ErrorCode::DnsTimeout => { + f.debug_tuple("ErrorCode::DnsTimeout").finish() + } ErrorCode::DnsError(e) => { f.debug_tuple("ErrorCode::DnsError").field(e).finish() } @@ -957,76 +1047,90 @@ pub mod wasi { ErrorCode::TlsCertificateError => { f.debug_tuple("ErrorCode::TlsCertificateError").finish() } - ErrorCode::TlsAlertReceived(e) => f - .debug_tuple("ErrorCode::TlsAlertReceived") - .field(e) - .finish(), + ErrorCode::TlsAlertReceived(e) => { + f.debug_tuple("ErrorCode::TlsAlertReceived") + .field(e) + .finish() + } ErrorCode::HttpRequestDenied => { f.debug_tuple("ErrorCode::HttpRequestDenied").finish() } - ErrorCode::HttpRequestLengthRequired => f - .debug_tuple("ErrorCode::HttpRequestLengthRequired") - .finish(), - ErrorCode::HttpRequestBodySize(e) => f - .debug_tuple("ErrorCode::HttpRequestBodySize") - .field(e) - .finish(), - ErrorCode::HttpRequestMethodInvalid => f - .debug_tuple("ErrorCode::HttpRequestMethodInvalid") - .finish(), + ErrorCode::HttpRequestLengthRequired => { + f.debug_tuple("ErrorCode::HttpRequestLengthRequired") + .finish() + } + ErrorCode::HttpRequestBodySize(e) => { + f.debug_tuple("ErrorCode::HttpRequestBodySize") + .field(e) + .finish() + } + ErrorCode::HttpRequestMethodInvalid => { + f.debug_tuple("ErrorCode::HttpRequestMethodInvalid").finish() + } ErrorCode::HttpRequestUriInvalid => { f.debug_tuple("ErrorCode::HttpRequestUriInvalid").finish() } ErrorCode::HttpRequestUriTooLong => { f.debug_tuple("ErrorCode::HttpRequestUriTooLong").finish() } - ErrorCode::HttpRequestHeaderSectionSize(e) => f - .debug_tuple("ErrorCode::HttpRequestHeaderSectionSize") - .field(e) - .finish(), - ErrorCode::HttpRequestHeaderSize(e) => f - .debug_tuple("ErrorCode::HttpRequestHeaderSize") - .field(e) - .finish(), - ErrorCode::HttpRequestTrailerSectionSize(e) => f - .debug_tuple("ErrorCode::HttpRequestTrailerSectionSize") - .field(e) - .finish(), - ErrorCode::HttpRequestTrailerSize(e) => f - .debug_tuple("ErrorCode::HttpRequestTrailerSize") - .field(e) - .finish(), + ErrorCode::HttpRequestHeaderSectionSize(e) => { + f.debug_tuple("ErrorCode::HttpRequestHeaderSectionSize") + .field(e) + .finish() + } + ErrorCode::HttpRequestHeaderSize(e) => { + f.debug_tuple("ErrorCode::HttpRequestHeaderSize") + .field(e) + .finish() + } + ErrorCode::HttpRequestTrailerSectionSize(e) => { + f.debug_tuple("ErrorCode::HttpRequestTrailerSectionSize") + .field(e) + .finish() + } + ErrorCode::HttpRequestTrailerSize(e) => { + f.debug_tuple("ErrorCode::HttpRequestTrailerSize") + .field(e) + .finish() + } ErrorCode::HttpResponseIncomplete => { f.debug_tuple("ErrorCode::HttpResponseIncomplete").finish() } - ErrorCode::HttpResponseHeaderSectionSize(e) => f - .debug_tuple("ErrorCode::HttpResponseHeaderSectionSize") - .field(e) - .finish(), - ErrorCode::HttpResponseHeaderSize(e) => f - .debug_tuple("ErrorCode::HttpResponseHeaderSize") - .field(e) - .finish(), - ErrorCode::HttpResponseBodySize(e) => f - .debug_tuple("ErrorCode::HttpResponseBodySize") - .field(e) - .finish(), - ErrorCode::HttpResponseTrailerSectionSize(e) => f - .debug_tuple("ErrorCode::HttpResponseTrailerSectionSize") - .field(e) - .finish(), - ErrorCode::HttpResponseTrailerSize(e) => f - .debug_tuple("ErrorCode::HttpResponseTrailerSize") - .field(e) - .finish(), - ErrorCode::HttpResponseTransferCoding(e) => f - .debug_tuple("ErrorCode::HttpResponseTransferCoding") - .field(e) - .finish(), - ErrorCode::HttpResponseContentCoding(e) => f - .debug_tuple("ErrorCode::HttpResponseContentCoding") - .field(e) - .finish(), + ErrorCode::HttpResponseHeaderSectionSize(e) => { + f.debug_tuple("ErrorCode::HttpResponseHeaderSectionSize") + .field(e) + .finish() + } + ErrorCode::HttpResponseHeaderSize(e) => { + f.debug_tuple("ErrorCode::HttpResponseHeaderSize") + .field(e) + .finish() + } + ErrorCode::HttpResponseBodySize(e) => { + f.debug_tuple("ErrorCode::HttpResponseBodySize") + .field(e) + .finish() + } + ErrorCode::HttpResponseTrailerSectionSize(e) => { + f.debug_tuple("ErrorCode::HttpResponseTrailerSectionSize") + .field(e) + .finish() + } + ErrorCode::HttpResponseTrailerSize(e) => { + f.debug_tuple("ErrorCode::HttpResponseTrailerSize") + .field(e) + .finish() + } + ErrorCode::HttpResponseTransferCoding(e) => { + f.debug_tuple("ErrorCode::HttpResponseTransferCoding") + .field(e) + .finish() + } + ErrorCode::HttpResponseContentCoding(e) => { + f.debug_tuple("ErrorCode::HttpResponseContentCoding") + .field(e) + .finish() + } ErrorCode::HttpResponseTimeout => { f.debug_tuple("ErrorCode::HttpResponseTimeout").finish() } @@ -1049,11 +1153,13 @@ pub mod wasi { } } impl ::core::fmt::Display for ErrorCode { - 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 ErrorCode {} /// This type enumerates the different kinds of errors that may occur when /// setting or appending to a `fields` resource. @@ -1071,22 +1177,31 @@ pub mod wasi { Immutable, } impl ::core::fmt::Debug for HeaderError { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { HeaderError::InvalidSyntax => { f.debug_tuple("HeaderError::InvalidSyntax").finish() } - HeaderError::Forbidden => f.debug_tuple("HeaderError::Forbidden").finish(), - HeaderError::Immutable => f.debug_tuple("HeaderError::Immutable").finish(), + HeaderError::Forbidden => { + f.debug_tuple("HeaderError::Forbidden").finish() + } + HeaderError::Immutable => { + f.debug_tuple("HeaderError::Immutable").finish() + } } } } impl ::core::fmt::Display for HeaderError { - 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 HeaderError {} /// Field keys are always strings. pub type FieldKey = _rt::String; @@ -1104,296 +1219,248 @@ pub mod wasi { /// `incoming-request.headers`, `outgoing-request.headers`) might be be /// immutable. In an immutable fields, the `set`, `append`, and `delete` /// operations will fail with `header-error.immutable`. - #[derive(Debug)] #[repr(transparent)] pub struct Fields { handle: _rt::Resource, } - impl Fields { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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 Fields { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]fields"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - /// Headers is an alias for Fields. pub type Headers = Fields; /// Trailers is an alias for Fields. pub type Trailers = Fields; /// Represents an incoming HTTP Request. - #[derive(Debug)] #[repr(transparent)] pub struct IncomingRequest { handle: _rt::Resource, } - impl IncomingRequest { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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 IncomingRequest { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]incoming-request"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - /// Represents an outgoing HTTP Request. - #[derive(Debug)] #[repr(transparent)] pub struct OutgoingRequest { handle: _rt::Resource, } - impl OutgoingRequest { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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 OutgoingRequest { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]outgoing-request"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - /// Parameters for making an HTTP Request. Each of these parameters is /// currently an optional timeout applicable to the transport layer of the /// HTTP protocol. /// /// These timeouts are separate from any the user may use to bound a /// blocking call to `wasi:io/poll.poll`. - #[derive(Debug)] #[repr(transparent)] pub struct RequestOptions { handle: _rt::Resource, } - impl RequestOptions { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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 RequestOptions { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]request-options"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - /// Represents the ability to send an HTTP Response. /// /// This resource is used by the `wasi:http/incoming-handler` interface to /// allow a Response to be sent corresponding to the Request provided as the /// other argument to `incoming-handler.handle`. - #[derive(Debug)] #[repr(transparent)] pub struct ResponseOutparam { handle: _rt::Resource, } - impl ResponseOutparam { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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 ResponseOutparam { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]response-outparam"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - /// This type corresponds to the HTTP standard Status Code. pub type StatusCode = u16; /// Represents an incoming HTTP Response. - #[derive(Debug)] #[repr(transparent)] pub struct IncomingResponse { handle: _rt::Resource, } - impl IncomingResponse { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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 IncomingResponse { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]incoming-response"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - /// Represents an incoming HTTP Request or Response's Body. /// /// A body has both its contents - a stream of bytes - and a (possibly @@ -1402,147 +1469,123 @@ pub mod wasi { /// an `input-stream` and the delivery of trailers as a `future-trailers`, /// and ensures that the user of this interface may only be consuming either /// the body contents or waiting on trailers at any given time. - #[derive(Debug)] #[repr(transparent)] pub struct IncomingBody { handle: _rt::Resource, } - impl IncomingBody { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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 IncomingBody { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]incoming-body"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - /// Represents a future which may eventaully return trailers, or an error. /// /// In the case that the incoming HTTP Request or Response did not have any /// trailers, this future will resolve to the empty set of trailers once the /// complete Request or Response body has been received. - #[derive(Debug)] #[repr(transparent)] pub struct FutureTrailers { handle: _rt::Resource, } - impl FutureTrailers { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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 FutureTrailers { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]future-trailers"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - /// Represents an outgoing HTTP Response. - #[derive(Debug)] #[repr(transparent)] pub struct OutgoingResponse { handle: _rt::Resource, } - impl OutgoingResponse { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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 OutgoingResponse { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]outgoing-response"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - /// Represents an outgoing HTTP Request or Response's Body. /// /// A body has both its contents - a stream of bytes - and a (possibly @@ -1559,101 +1602,85 @@ pub mod wasi { /// error to the HTTP protocol by whatever means it has available, /// including: corrupting the body on the wire, aborting the associated /// Request, or sending a late status code for the Response. - #[derive(Debug)] #[repr(transparent)] pub struct OutgoingBody { handle: _rt::Resource, } - impl OutgoingBody { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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 OutgoingBody { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]outgoing-body"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - /// Represents a future which may eventaully return an incoming HTTP /// Response, or an error. /// /// This resource is returned by the `wasi:http/outgoing-handler` interface to /// provide the HTTP Response corresponding to the sent Request. - #[derive(Debug)] #[repr(transparent)] pub struct FutureIncomingResponse { handle: _rt::Resource, } - impl FutureIncomingResponse { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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 FutureIncomingResponse { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]future-incoming-response"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - #[allow(unused_unsafe, clippy::all)] /// Attempts to extract a http-related `error` from the wasi:io `error` /// provided. @@ -1669,64 +1696,76 @@ pub mod wasi { pub fn http_error_code(err: &IoError) -> Option { unsafe { #[repr(align(8))] - struct RetArea([::core::mem::MaybeUninit; 40]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 40]); + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 24 + 4 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 24 + + 4 * ::core::mem::size_of::<*const u8>()], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "http-error-code"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((err).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((err).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result66 = match l2 { 0 => None, 1 => { let e = { - let l2 = i32::from(*ptr0.add(8).cast::()); - let v64 = match l2 { + let l3 = i32::from(*ptr0.add(8).cast::()); + let v65 = match l3 { 0 => ErrorCode::DnsTimeout, 1 => { - let e64 = { - let l3 = i32::from(*ptr0.add(16).cast::()); - let l7 = i32::from(*ptr0.add(28).cast::()); - + let e65 = { + let l4 = i32::from(*ptr0.add(16).cast::()); + let l8 = i32::from( + *ptr0 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); DnsErrorPayload { - rcode: match l3 { + rcode: match l4 { 0 => None, 1 => { let e = { - let l4 = - *ptr0.add(20).cast::<*mut u8>(); - let l5 = *ptr0.add(24).cast::(); - let len6 = l5; - let bytes6 = _rt::Vec::from_raw_parts( - l4.cast(), - len6, - len6, + let l5 = *ptr0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l6 = *ptr0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len7 = l6; + let bytes7 = _rt::Vec::from_raw_parts( + l5.cast(), + len7, + len7, ); - - _rt::string_lift(bytes6) + _rt::string_lift(bytes7) }; Some(e) } _ => _rt::invalid_enum_discriminant(), }, - info_code: match l7 { + info_code: match l8 { 0 => None, 1 => { let e = { - let l8 = i32::from( - *ptr0.add(30).cast::(), + let l9 = i32::from( + *ptr0 + .add(18 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(), ); - - l8 as u16 + l9 as u16 }; Some(e) } @@ -1734,7 +1773,7 @@ pub mod wasi { }, } }; - ErrorCode::DnsError(e64) + ErrorCode::DnsError(e65) } 2 => ErrorCode::DestinationNotFound, 3 => ErrorCode::DestinationUnavailable, @@ -1749,40 +1788,42 @@ pub mod wasi { 12 => ErrorCode::TlsProtocolError, 13 => ErrorCode::TlsCertificateError, 14 => { - let e64 = { - let l9 = i32::from(*ptr0.add(16).cast::()); - let l11 = i32::from(*ptr0.add(20).cast::()); - + let e65 = { + let l10 = i32::from(*ptr0.add(16).cast::()); + let l12 = i32::from( + *ptr0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); TlsAlertReceivedPayload { - alert_id: match l9 { + alert_id: match l10 { 0 => None, 1 => { let e = { - let l10 = i32::from( - *ptr0.add(17).cast::(), - ); - - l10 as u8 + let l11 = i32::from(*ptr0.add(17).cast::()); + l11 as u8 }; Some(e) } _ => _rt::invalid_enum_discriminant(), }, - alert_message: match l11 { + alert_message: match l12 { 0 => None, 1 => { let e = { - let l12 = - *ptr0.add(24).cast::<*mut u8>(); - let l13 = *ptr0.add(28).cast::(); - let len14 = l13; - let bytes14 = _rt::Vec::from_raw_parts( - l12.cast(), - len14, - len14, + let l13 = *ptr0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l14 = *ptr0 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len15 = l14; + let bytes15 = _rt::Vec::from_raw_parts( + l13.cast(), + len15, + len15, ); - - _rt::string_lift(bytes14) + _rt::string_lift(bytes15) }; Some(e) } @@ -1790,102 +1831,99 @@ pub mod wasi { }, } }; - ErrorCode::TlsAlertReceived(e64) + ErrorCode::TlsAlertReceived(e65) } 15 => ErrorCode::HttpRequestDenied, 16 => ErrorCode::HttpRequestLengthRequired, 17 => { - let e64 = { - let l15 = i32::from(*ptr0.add(16).cast::()); - - match l15 { + let e65 = { + let l16 = i32::from(*ptr0.add(16).cast::()); + match l16 { 0 => None, 1 => { let e = { - let l16 = *ptr0.add(24).cast::(); - - l16 as u64 + let l17 = *ptr0.add(24).cast::(); + l17 as u64 }; Some(e) } _ => _rt::invalid_enum_discriminant(), } }; - ErrorCode::HttpRequestBodySize(e64) + ErrorCode::HttpRequestBodySize(e65) } 18 => ErrorCode::HttpRequestMethodInvalid, 19 => ErrorCode::HttpRequestUriInvalid, 20 => ErrorCode::HttpRequestUriTooLong, 21 => { - let e64 = { - let l17 = i32::from(*ptr0.add(16).cast::()); - - match l17 { + let e65 = { + let l18 = i32::from(*ptr0.add(16).cast::()); + match l18 { 0 => None, 1 => { let e = { - let l18 = *ptr0.add(20).cast::(); - - l18 as u32 + let l19 = *ptr0.add(20).cast::(); + l19 as u32 }; Some(e) } _ => _rt::invalid_enum_discriminant(), } }; - ErrorCode::HttpRequestHeaderSectionSize(e64) + ErrorCode::HttpRequestHeaderSectionSize(e65) } 22 => { - let e64 = { - let l19 = i32::from(*ptr0.add(16).cast::()); - - match l19 { + let e65 = { + let l20 = i32::from(*ptr0.add(16).cast::()); + match l20 { 0 => None, 1 => { let e = { - let l20 = - i32::from(*ptr0.add(20).cast::()); - let l24 = - i32::from(*ptr0.add(32).cast::()); - + let l21 = i32::from( + *ptr0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + let l25 = i32::from( + *ptr0 + .add(16 + 4 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); FieldSizePayload { - field_name: match l20 { + field_name: match l21 { 0 => None, 1 => { let e = { - let l21 = *ptr0 - .add(24) - .cast::<*mut u8>( - ); let l22 = *ptr0 - .add(28) + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l23 = *ptr0 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) .cast::(); - let len23 = l22; - let bytes23 = _rt::Vec::from_raw_parts(l21.cast(), len23, len23); - - _rt::string_lift(bytes23) + let len24 = l23; + let bytes24 = _rt::Vec::from_raw_parts( + l22.cast(), + len24, + len24, + ); + _rt::string_lift(bytes24) }; Some(e) } - _ => { - _rt::invalid_enum_discriminant() - } + _ => _rt::invalid_enum_discriminant(), }, - field_size: match l24 { + field_size: match l25 { 0 => None, 1 => { let e = { - let l25 = *ptr0 - .add(36) + let l26 = *ptr0 + .add(20 + 4 * ::core::mem::size_of::<*const u8>()) .cast::(); - - l25 as u32 + l26 as u32 }; Some(e) } - _ => { - _rt::invalid_enum_discriminant() - } + _ => _rt::invalid_enum_discriminant(), }, } }; @@ -1894,60 +1932,64 @@ pub mod wasi { _ => _rt::invalid_enum_discriminant(), } }; - ErrorCode::HttpRequestHeaderSize(e64) + ErrorCode::HttpRequestHeaderSize(e65) } 23 => { - let e64 = { - let l26 = i32::from(*ptr0.add(16).cast::()); - - match l26 { + let e65 = { + let l27 = i32::from(*ptr0.add(16).cast::()); + match l27 { 0 => None, 1 => { let e = { - let l27 = *ptr0.add(20).cast::(); - - l27 as u32 + let l28 = *ptr0.add(20).cast::(); + l28 as u32 }; Some(e) } _ => _rt::invalid_enum_discriminant(), } }; - ErrorCode::HttpRequestTrailerSectionSize(e64) + ErrorCode::HttpRequestTrailerSectionSize(e65) } 24 => { - let e64 = { - let l28 = i32::from(*ptr0.add(16).cast::()); - let l32 = i32::from(*ptr0.add(28).cast::()); - + let e65 = { + let l29 = i32::from(*ptr0.add(16).cast::()); + let l33 = i32::from( + *ptr0 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); FieldSizePayload { - field_name: match l28 { + field_name: match l29 { 0 => None, 1 => { let e = { - let l29 = - *ptr0.add(20).cast::<*mut u8>(); - let l30 = *ptr0.add(24).cast::(); - let len31 = l30; - let bytes31 = _rt::Vec::from_raw_parts( - l29.cast(), - len31, - len31, + let l30 = *ptr0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l31 = *ptr0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len32 = l31; + let bytes32 = _rt::Vec::from_raw_parts( + l30.cast(), + len32, + len32, ); - - _rt::string_lift(bytes31) + _rt::string_lift(bytes32) }; Some(e) } _ => _rt::invalid_enum_discriminant(), }, - field_size: match l32 { + field_size: match l33 { 0 => None, 1 => { let e = { - let l33 = *ptr0.add(32).cast::(); - - l33 as u32 + let l34 = *ptr0 + .add(20 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + l34 as u32 }; Some(e) } @@ -1955,61 +1997,65 @@ pub mod wasi { }, } }; - ErrorCode::HttpRequestTrailerSize(e64) + ErrorCode::HttpRequestTrailerSize(e65) } 25 => ErrorCode::HttpResponseIncomplete, 26 => { - let e64 = { - let l34 = i32::from(*ptr0.add(16).cast::()); - - match l34 { + let e65 = { + let l35 = i32::from(*ptr0.add(16).cast::()); + match l35 { 0 => None, 1 => { let e = { - let l35 = *ptr0.add(20).cast::(); - - l35 as u32 + let l36 = *ptr0.add(20).cast::(); + l36 as u32 }; Some(e) } _ => _rt::invalid_enum_discriminant(), } }; - ErrorCode::HttpResponseHeaderSectionSize(e64) + ErrorCode::HttpResponseHeaderSectionSize(e65) } 27 => { - let e64 = { - let l36 = i32::from(*ptr0.add(16).cast::()); - let l40 = i32::from(*ptr0.add(28).cast::()); - + let e65 = { + let l37 = i32::from(*ptr0.add(16).cast::()); + let l41 = i32::from( + *ptr0 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); FieldSizePayload { - field_name: match l36 { + field_name: match l37 { 0 => None, 1 => { let e = { - let l37 = - *ptr0.add(20).cast::<*mut u8>(); - let l38 = *ptr0.add(24).cast::(); - let len39 = l38; - let bytes39 = _rt::Vec::from_raw_parts( - l37.cast(), - len39, - len39, + let l38 = *ptr0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l39 = *ptr0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len40 = l39; + let bytes40 = _rt::Vec::from_raw_parts( + l38.cast(), + len40, + len40, ); - - _rt::string_lift(bytes39) + _rt::string_lift(bytes40) }; Some(e) } _ => _rt::invalid_enum_discriminant(), }, - field_size: match l40 { + field_size: match l41 { 0 => None, 1 => { let e = { - let l41 = *ptr0.add(32).cast::(); - - l41 as u32 + let l42 = *ptr0 + .add(20 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + l42 as u32 }; Some(e) } @@ -2017,79 +2063,81 @@ pub mod wasi { }, } }; - ErrorCode::HttpResponseHeaderSize(e64) + ErrorCode::HttpResponseHeaderSize(e65) } 28 => { - let e64 = { - let l42 = i32::from(*ptr0.add(16).cast::()); - - match l42 { + let e65 = { + let l43 = i32::from(*ptr0.add(16).cast::()); + match l43 { 0 => None, 1 => { let e = { - let l43 = *ptr0.add(24).cast::(); - - l43 as u64 + let l44 = *ptr0.add(24).cast::(); + l44 as u64 }; Some(e) } _ => _rt::invalid_enum_discriminant(), } }; - ErrorCode::HttpResponseBodySize(e64) + ErrorCode::HttpResponseBodySize(e65) } 29 => { - let e64 = { - let l44 = i32::from(*ptr0.add(16).cast::()); - - match l44 { + let e65 = { + let l45 = i32::from(*ptr0.add(16).cast::()); + match l45 { 0 => None, 1 => { let e = { - let l45 = *ptr0.add(20).cast::(); - - l45 as u32 + let l46 = *ptr0.add(20).cast::(); + l46 as u32 }; Some(e) } _ => _rt::invalid_enum_discriminant(), } }; - ErrorCode::HttpResponseTrailerSectionSize(e64) + ErrorCode::HttpResponseTrailerSectionSize(e65) } 30 => { - let e64 = { - let l46 = i32::from(*ptr0.add(16).cast::()); - let l50 = i32::from(*ptr0.add(28).cast::()); - + let e65 = { + let l47 = i32::from(*ptr0.add(16).cast::()); + let l51 = i32::from( + *ptr0 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); FieldSizePayload { - field_name: match l46 { + field_name: match l47 { 0 => None, 1 => { let e = { - let l47 = - *ptr0.add(20).cast::<*mut u8>(); - let l48 = *ptr0.add(24).cast::(); - let len49 = l48; - let bytes49 = _rt::Vec::from_raw_parts( - l47.cast(), - len49, - len49, + let l48 = *ptr0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l49 = *ptr0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len50 = l49; + let bytes50 = _rt::Vec::from_raw_parts( + l48.cast(), + len50, + len50, ); - - _rt::string_lift(bytes49) + _rt::string_lift(bytes50) }; Some(e) } _ => _rt::invalid_enum_discriminant(), }, - field_size: match l50 { + field_size: match l51 { 0 => None, 1 => { let e = { - let l51 = *ptr0.add(32).cast::(); - - l51 as u32 + let l52 = *ptr0 + .add(20 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + l52 as u32 }; Some(e) } @@ -2097,59 +2145,63 @@ pub mod wasi { }, } }; - ErrorCode::HttpResponseTrailerSize(e64) + ErrorCode::HttpResponseTrailerSize(e65) } 31 => { - let e64 = { - let l52 = i32::from(*ptr0.add(16).cast::()); - - match l52 { + let e65 = { + let l53 = i32::from(*ptr0.add(16).cast::()); + match l53 { 0 => None, 1 => { let e = { - let l53 = *ptr0.add(20).cast::<*mut u8>(); - let l54 = *ptr0.add(24).cast::(); - let len55 = l54; - let bytes55 = _rt::Vec::from_raw_parts( - l53.cast(), - len55, - len55, + let l54 = *ptr0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l55 = *ptr0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len56 = l55; + let bytes56 = _rt::Vec::from_raw_parts( + l54.cast(), + len56, + len56, ); - - _rt::string_lift(bytes55) + _rt::string_lift(bytes56) }; Some(e) } _ => _rt::invalid_enum_discriminant(), } }; - ErrorCode::HttpResponseTransferCoding(e64) + ErrorCode::HttpResponseTransferCoding(e65) } 32 => { - let e64 = { - let l56 = i32::from(*ptr0.add(16).cast::()); - - match l56 { + let e65 = { + let l57 = i32::from(*ptr0.add(16).cast::()); + match l57 { 0 => None, 1 => { let e = { - let l57 = *ptr0.add(20).cast::<*mut u8>(); - let l58 = *ptr0.add(24).cast::(); - let len59 = l58; - let bytes59 = _rt::Vec::from_raw_parts( - l57.cast(), - len59, - len59, + let l58 = *ptr0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l59 = *ptr0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len60 = l59; + let bytes60 = _rt::Vec::from_raw_parts( + l58.cast(), + len60, + len60, ); - - _rt::string_lift(bytes59) + _rt::string_lift(bytes60) }; Some(e) } _ => _rt::invalid_enum_discriminant(), } }; - ErrorCode::HttpResponseContentCoding(e64) + ErrorCode::HttpResponseContentCoding(e65) } 33 => ErrorCode::HttpResponseTimeout, 34 => ErrorCode::HttpUpgradeFailed, @@ -2158,39 +2210,41 @@ pub mod wasi { 37 => ErrorCode::ConfigurationError, n => { debug_assert_eq!(n, 38, "invalid enum discriminant"); - let e64 = { - let l60 = i32::from(*ptr0.add(16).cast::()); - - match l60 { + let e65 = { + let l61 = i32::from(*ptr0.add(16).cast::()); + match l61 { 0 => None, 1 => { let e = { - let l61 = *ptr0.add(20).cast::<*mut u8>(); - let l62 = *ptr0.add(24).cast::(); - let len63 = l62; - let bytes63 = _rt::Vec::from_raw_parts( - l61.cast(), - len63, - len63, + let l62 = *ptr0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l63 = *ptr0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len64 = l63; + let bytes64 = _rt::Vec::from_raw_parts( + l62.cast(), + len64, + len64, ); - - _rt::string_lift(bytes63) + _rt::string_lift(bytes64) }; Some(e) } _ => _rt::invalid_enum_discriminant(), } }; - ErrorCode::InternalError(e64) + ErrorCode::InternalError(e65) } }; - - v64 + v65 }; Some(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result66 } } impl Fields { @@ -2202,17 +2256,16 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[constructor]fields"] - fn wit_import() -> i32; + fn wit_import0() -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import() -> i32 { + unsafe extern "C" fn wit_import0() -> i32 { unreachable!() } - let ret = wit_import(); - Fields::from_handle(ret as u32) + let ret = unsafe { wit_import0() }; + unsafe { Fields::from_handle(ret as u32) } } } } @@ -2239,11 +2292,15 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 8], + ); let vec3 = entries; let len3 = vec3.len(); - let layout3 = - _rt::alloc::Layout::from_size_align_unchecked(vec3.len() * 16, 4); + let layout3 = _rt::alloc::Layout::from_size_align_unchecked( + vec3.len() * (4 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); let result3 = if layout3.size() != 0 { let ptr = _rt::alloc::alloc(layout3).cast::(); if ptr.is_null() { @@ -2251,56 +2308,60 @@ pub mod wasi { } ptr } else { - { - ::core::ptr::null_mut() - } + ::core::ptr::null_mut() }; for (i, e) in vec3.into_iter().enumerate() { - let base = result3.add(i * 16); + let base = result3 + .add(i * (4 * ::core::mem::size_of::<*const u8>())); { let (t0_0, t0_1) = e; let vec1 = t0_0; let ptr1 = vec1.as_ptr().cast::(); let len1 = vec1.len(); - *base.add(4).cast::() = len1; + *base + .add(::core::mem::size_of::<*const u8>()) + .cast::() = len1; *base.add(0).cast::<*mut u8>() = ptr1.cast_mut(); let vec2 = t0_1; let ptr2 = vec2.as_ptr().cast::(); let len2 = vec2.len(); - *base.add(12).cast::() = len2; - *base.add(8).cast::<*mut u8>() = ptr2.cast_mut(); + *base + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len2; + *base + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr2.cast_mut(); } } let ptr4 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[static]fields.from-list"] - fn wit_import(_: *mut u8, _: usize, _: *mut u8); + fn wit_import5(_: *mut u8, _: usize, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: *mut u8, _: usize, _: *mut u8) { + unsafe extern "C" fn wit_import5( + _: *mut u8, + _: usize, + _: *mut u8, + ) { unreachable!() } - wit_import(result3, len3, ptr4); - let l5 = i32::from(*ptr4.add(0).cast::()); - if layout3.size() != 0 { - _rt::alloc::dealloc(result3.cast(), layout3); - } - match l5 { + unsafe { wit_import5(result3, len3, ptr4) }; + let l6 = i32::from(*ptr4.add(0).cast::()); + let result10 = match l6 { 0 => { let e = { - let l6 = *ptr4.add(4).cast::(); - - Fields::from_handle(l6 as u32) + let l7 = *ptr4.add(4).cast::(); + unsafe { Fields::from_handle(l7 as u32) } }; Ok(e) } 1 => { let e = { - let l7 = i32::from(*ptr4.add(4).cast::()); - let v8 = match l7 { + let l8 = i32::from(*ptr4.add(4).cast::()); + let v9 = match l8 { 0 => HeaderError::InvalidSyntax, 1 => HeaderError::Forbidden, n => { @@ -2308,13 +2369,16 @@ pub mod wasi { HeaderError::Immutable } }; - - v8 + v9 }; Err(e) } _ => _rt::invalid_enum_discriminant(), + }; + if layout3.size() != 0 { + _rt::alloc::dealloc(result3.cast(), layout3); } + result10 } } } @@ -2324,45 +2388,73 @@ pub mod wasi { /// in this `fields`, an empty list is returned. However, if the key is /// present but empty, this is represented by a list with one or more /// empty field-values present. - pub fn get(&self, name: &FieldKey) -> _rt::Vec { + pub fn get(&self, name: &str) -> _rt::Vec { unsafe { - #[repr(align(4))] - struct RetArea([::core::mem::MaybeUninit; 8]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 2 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 2 + * ::core::mem::size_of::<*const u8>()], + ); let vec0 = name; let ptr0 = vec0.as_ptr().cast::(); let len0 = vec0.len(); let ptr1 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]fields.get"] - fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8); + fn wit_import2(_: i32, _: *mut u8, _: usize, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8) { + unsafe extern "C" fn wit_import2( + _: i32, + _: *mut u8, + _: usize, + _: *mut u8, + ) { unreachable!() } - wit_import((self).handle() as i32, ptr0.cast_mut(), len0, ptr1); - let l2 = *ptr1.add(0).cast::<*mut u8>(); - let l3 = *ptr1.add(4).cast::(); - let base7 = l2; - let len7 = l3; - let mut result7 = _rt::Vec::with_capacity(len7); - for i in 0..len7 { - let base = base7.add(i * 8); - let e7 = { - let l4 = *base.add(0).cast::<*mut u8>(); - let l5 = *base.add(4).cast::(); - let len6 = l5; - - _rt::Vec::from_raw_parts(l4.cast(), len6, len6) + unsafe { + wit_import2( + (self).handle() as i32, + ptr0.cast_mut(), + len0, + ptr1, + ) + }; + let l3 = *ptr1.add(0).cast::<*mut u8>(); + let l4 = *ptr1 + .add(::core::mem::size_of::<*const u8>()) + .cast::(); + let base8 = l3; + let len8 = l4; + let mut result8 = _rt::Vec::with_capacity(len8); + for i in 0..len8 { + let base = base8 + .add(i * (2 * ::core::mem::size_of::<*const u8>())); + let e8 = { + let l5 = *base.add(0).cast::<*mut u8>(); + let l6 = *base + .add(::core::mem::size_of::<*const u8>()) + .cast::(); + let len7 = l6; + _rt::Vec::from_raw_parts(l5.cast(), len7, len7) }; - result7.push(e7); + result8.push(e8); } - _rt::cabi_dealloc(base7, len7 * 8, 4); - result7 + _rt::cabi_dealloc( + base8, + len8 * (2 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); + let result9 = result8; + result9 } } } @@ -2370,24 +2462,28 @@ pub mod wasi { #[allow(unused_unsafe, clippy::all)] /// Returns `true` when the key is present in this `fields`. If the key is /// syntactically invalid, `false` is returned. - pub fn has(&self, name: &FieldKey) -> bool { + pub fn has(&self, name: &str) -> bool { unsafe { let vec0 = name; let ptr0 = vec0.as_ptr().cast::(); let len0 = vec0.len(); - #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]fields.has"] - fn wit_import(_: i32, _: *mut u8, _: usize) -> i32; + fn wit_import1(_: i32, _: *mut u8, _: usize) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8, _: usize) -> i32 { + unsafe extern "C" fn wit_import1( + _: i32, + _: *mut u8, + _: usize, + ) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32, ptr0.cast_mut(), len0); + let ret = unsafe { + wit_import1((self).handle() as i32, ptr0.cast_mut(), len0) + }; _rt::bool_lift(ret as u8) } } @@ -2400,20 +2496,24 @@ pub mod wasi { /// Fails with `header-error.immutable` if the `fields` are immutable. pub fn set( &self, - name: &FieldKey, + name: &str, value: &[FieldValue], ) -> Result<(), HeaderError> { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 2]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 2], + ); let vec0 = name; let ptr0 = vec0.as_ptr().cast::(); let len0 = vec0.len(); let vec2 = value; let len2 = vec2.len(); - let layout2 = - _rt::alloc::Layout::from_size_align_unchecked(vec2.len() * 8, 4); + let layout2 = _rt::alloc::Layout::from_size_align_unchecked( + vec2.len() * (2 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); let result2 = if layout2.size() != 0 { let ptr = _rt::alloc::alloc(layout2).cast::(); if ptr.is_null() { @@ -2421,26 +2521,27 @@ pub mod wasi { } ptr } else { - { - ::core::ptr::null_mut() - } + ::core::ptr::null_mut() }; for (i, e) in vec2.into_iter().enumerate() { - let base = result2.add(i * 8); + let base = result2 + .add(i * (2 * ::core::mem::size_of::<*const u8>())); { let vec1 = e; let ptr1 = vec1.as_ptr().cast::(); let len1 = vec1.len(); - *base.add(4).cast::() = len1; + *base + .add(::core::mem::size_of::<*const u8>()) + .cast::() = len1; *base.add(0).cast::<*mut u8>() = ptr1.cast_mut(); } } let ptr3 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]fields.set"] - fn wit_import( + fn wit_import4( _: i32, _: *mut u8, _: usize, @@ -2449,9 +2550,8 @@ pub mod wasi { _: *mut u8, ); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import( + unsafe extern "C" fn wit_import4( _: i32, _: *mut u8, _: usize, @@ -2461,27 +2561,26 @@ pub mod wasi { ) { unreachable!() } - wit_import( - (self).handle() as i32, - ptr0.cast_mut(), - len0, - result2, - len2, - ptr3, - ); - let l4 = i32::from(*ptr3.add(0).cast::()); - if layout2.size() != 0 { - _rt::alloc::dealloc(result2.cast(), layout2); - } - match l4 { + unsafe { + wit_import4( + (self).handle() as i32, + ptr0.cast_mut(), + len0, + result2, + len2, + ptr3, + ) + }; + let l5 = i32::from(*ptr3.add(0).cast::()); + let result8 = match l5 { 0 => { let e = (); Ok(e) } 1 => { let e = { - let l5 = i32::from(*ptr3.add(1).cast::()); - let v6 = match l5 { + let l6 = i32::from(*ptr3.add(1).cast::()); + let v7 = match l6 { 0 => HeaderError::InvalidSyntax, 1 => HeaderError::Forbidden, n => { @@ -2489,13 +2588,16 @@ pub mod wasi { HeaderError::Immutable } }; - - v6 + v7 }; Err(e) } _ => _rt::invalid_enum_discriminant(), + }; + if layout2.size() != 0 { + _rt::alloc::dealloc(result2.cast(), layout2); } + result8 } } } @@ -2505,37 +2607,50 @@ pub mod wasi { /// exist. /// /// Fails with `header-error.immutable` if the `fields` are immutable. - pub fn delete(&self, name: &FieldKey) -> Result<(), HeaderError> { + pub fn delete(&self, name: &str) -> Result<(), HeaderError> { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 2]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 2], + ); let vec0 = name; let ptr0 = vec0.as_ptr().cast::(); let len0 = vec0.len(); let ptr1 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]fields.delete"] - fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8); + fn wit_import2(_: i32, _: *mut u8, _: usize, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8) { + unsafe extern "C" fn wit_import2( + _: i32, + _: *mut u8, + _: usize, + _: *mut u8, + ) { unreachable!() } - wit_import((self).handle() as i32, ptr0.cast_mut(), len0, ptr1); - let l2 = i32::from(*ptr1.add(0).cast::()); - match l2 { + unsafe { + wit_import2( + (self).handle() as i32, + ptr0.cast_mut(), + len0, + ptr1, + ) + }; + let l3 = i32::from(*ptr1.add(0).cast::()); + let result6 = match l3 { 0 => { let e = (); Ok(e) } 1 => { let e = { - let l3 = i32::from(*ptr1.add(1).cast::()); - let v4 = match l3 { + let l4 = i32::from(*ptr1.add(1).cast::()); + let v5 = match l4 { 0 => HeaderError::InvalidSyntax, 1 => HeaderError::Forbidden, n => { @@ -2543,13 +2658,13 @@ pub mod wasi { HeaderError::Immutable } }; - - v4 + v5 }; Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result6 } } } @@ -2561,13 +2676,15 @@ pub mod wasi { /// Fails with `header-error.immutable` if the `fields` are immutable. pub fn append( &self, - name: &FieldKey, - value: &FieldValue, + name: &str, + value: &[u8], ) -> Result<(), HeaderError> { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 2]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 2], + ); let vec0 = name; let ptr0 = vec0.as_ptr().cast::(); let len0 = vec0.len(); @@ -2577,9 +2694,9 @@ pub mod wasi { let ptr2 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]fields.append"] - fn wit_import( + fn wit_import3( _: i32, _: *mut u8, _: usize, @@ -2588,9 +2705,8 @@ pub mod wasi { _: *mut u8, ); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import( + unsafe extern "C" fn wit_import3( _: i32, _: *mut u8, _: usize, @@ -2600,24 +2716,26 @@ pub mod wasi { ) { unreachable!() } - wit_import( - (self).handle() as i32, - ptr0.cast_mut(), - len0, - ptr1.cast_mut(), - len1, - ptr2, - ); - let l3 = i32::from(*ptr2.add(0).cast::()); - match l3 { + unsafe { + wit_import3( + (self).handle() as i32, + ptr0.cast_mut(), + len0, + ptr1.cast_mut(), + len1, + ptr2, + ) + }; + let l4 = i32::from(*ptr2.add(0).cast::()); + let result7 = match l4 { 0 => { let e = (); Ok(e) } 1 => { let e = { - let l4 = i32::from(*ptr2.add(1).cast::()); - let v5 = match l4 { + let l5 = i32::from(*ptr2.add(1).cast::()); + let v6 = match l5 { 0 => HeaderError::InvalidSyntax, 1 => HeaderError::Forbidden, n => { @@ -2625,13 +2743,13 @@ pub mod wasi { HeaderError::Immutable } }; - - v5 + v6 }; Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result7 } } } @@ -2645,47 +2763,71 @@ pub mod wasi { /// list with the same key. pub fn entries(&self) -> _rt::Vec<(FieldKey, FieldValue)> { unsafe { - #[repr(align(4))] - struct RetArea([::core::mem::MaybeUninit; 8]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 2 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 2 + * ::core::mem::size_of::<*const u8>()], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]fields.entries"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = *ptr0.add(0).cast::<*mut u8>(); - let l2 = *ptr0.add(4).cast::(); - let base9 = l1; - let len9 = l2; - let mut result9 = _rt::Vec::with_capacity(len9); - for i in 0..len9 { - let base = base9.add(i * 16); - let e9 = { - let l3 = *base.add(0).cast::<*mut u8>(); - let l4 = *base.add(4).cast::(); - let len5 = l4; - let bytes5 = _rt::Vec::from_raw_parts(l3.cast(), len5, len5); - let l6 = *base.add(8).cast::<*mut u8>(); - let l7 = *base.add(12).cast::(); - let len8 = l7; - + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = *ptr0.add(0).cast::<*mut u8>(); + let l3 = *ptr0 + .add(::core::mem::size_of::<*const u8>()) + .cast::(); + let base10 = l2; + let len10 = l3; + let mut result10 = _rt::Vec::with_capacity(len10); + for i in 0..len10 { + let base = base10 + .add(i * (4 * ::core::mem::size_of::<*const u8>())); + let e10 = { + let l4 = *base.add(0).cast::<*mut u8>(); + let l5 = *base + .add(::core::mem::size_of::<*const u8>()) + .cast::(); + let len6 = l5; + let bytes6 = _rt::Vec::from_raw_parts( + l4.cast(), + len6, + len6, + ); + let l7 = *base + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l8 = *base + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len9 = l8; ( - _rt::string_lift(bytes5), - _rt::Vec::from_raw_parts(l6.cast(), len8, len8), + _rt::string_lift(bytes6), + _rt::Vec::from_raw_parts(l7.cast(), len9, len9), ) }; - result9.push(e9); + result10.push(e10); } - _rt::cabi_dealloc(base9, len9 * 16, 4); - result9 + _rt::cabi_dealloc( + base10, + len10 * (4 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); + let result11 = result10; + result11 } } } @@ -2698,17 +2840,16 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]fields.clone"] - fn wit_import(_: i32) -> i32; + fn wit_import0(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32) -> i32 { + unsafe extern "C" fn wit_import0(_: i32) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32); - Fields::from_handle(ret as u32) + let ret = unsafe { wit_import0((self).handle() as i32) }; + unsafe { Fields::from_handle(ret as u32) } } } } @@ -2717,24 +2858,31 @@ pub mod wasi { /// Returns the method of the incoming request. pub fn method(&self) -> Method { unsafe { - #[repr(align(4))] - struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 3 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 3 + * ::core::mem::size_of::<*const u8>()], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]incoming-request.method"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - let v5 = match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let v6 = match l2 { 0 => Method::Get, 1 => Method::Head, 2 => Method::Post, @@ -2746,18 +2894,26 @@ pub mod wasi { 8 => Method::Patch, n => { debug_assert_eq!(n, 9, "invalid enum discriminant"); - let e5 = { - let l2 = *ptr0.add(4).cast::<*mut u8>(); - let l3 = *ptr0.add(8).cast::(); - let len4 = l3; - let bytes4 = _rt::Vec::from_raw_parts(l2.cast(), len4, len4); - - _rt::string_lift(bytes4) + let e6 = { + let l3 = *ptr0 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l4 = *ptr0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len5 = l4; + let bytes5 = _rt::Vec::from_raw_parts( + l3.cast(), + len5, + len5, + ); + _rt::string_lift(bytes5) }; - Method::Other(e5) + Method::Other(e6) } }; - v5 + let result7 = v6; + result7 } } } @@ -2766,38 +2922,53 @@ pub mod wasi { /// Returns the path with query parameters from the request, as a string. pub fn path_with_query(&self) -> Option<_rt::String> { unsafe { - #[repr(align(4))] - struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 3 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 3 + * ::core::mem::size_of::<*const u8>()], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]incoming-request.path-with-query"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result6 = match l2 { 0 => None, 1 => { let e = { - let l2 = *ptr0.add(4).cast::<*mut u8>(); - let l3 = *ptr0.add(8).cast::(); - let len4 = l3; - let bytes4 = _rt::Vec::from_raw_parts(l2.cast(), len4, len4); - - _rt::string_lift(bytes4) + let l3 = *ptr0 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l4 = *ptr0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len5 = l4; + let bytes5 = _rt::Vec::from_raw_parts( + l3.cast(), + len5, + len5, + ); + _rt::string_lift(bytes5) }; Some(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result6 } } } @@ -2806,52 +2977,67 @@ pub mod wasi { /// Returns the protocol scheme from the request. pub fn scheme(&self) -> Option { unsafe { - #[repr(align(4))] - struct RetArea([::core::mem::MaybeUninit; 16]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 16]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 4 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 4 + * ::core::mem::size_of::<*const u8>()], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]incoming-request.scheme"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result8 = match l2 { 0 => None, 1 => { let e = { - let l2 = i32::from(*ptr0.add(4).cast::()); - let v6 = match l2 { + let l3 = i32::from( + *ptr0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); + let v7 = match l3 { 0 => Scheme::Http, 1 => Scheme::Https, n => { debug_assert_eq!(n, 2, "invalid enum discriminant"); - let e6 = { - let l3 = *ptr0.add(8).cast::<*mut u8>(); - let l4 = *ptr0.add(12).cast::(); - let len5 = l4; - let bytes5 = - _rt::Vec::from_raw_parts(l3.cast(), len5, len5); - - _rt::string_lift(bytes5) + let e7 = { + let l4 = *ptr0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l5 = *ptr0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len6 = l5; + let bytes6 = _rt::Vec::from_raw_parts( + l4.cast(), + len6, + len6, + ); + _rt::string_lift(bytes6) }; - Scheme::Other(e6) + Scheme::Other(e7) } }; - - v6 + v7 }; Some(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result8 } } } @@ -2860,38 +3046,53 @@ pub mod wasi { /// Returns the authority from the request, if it was present. pub fn authority(&self) -> Option<_rt::String> { unsafe { - #[repr(align(4))] - struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 3 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 3 + * ::core::mem::size_of::<*const u8>()], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]incoming-request.authority"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result6 = match l2 { 0 => None, 1 => { let e = { - let l2 = *ptr0.add(4).cast::<*mut u8>(); - let l3 = *ptr0.add(8).cast::(); - let len4 = l3; - let bytes4 = _rt::Vec::from_raw_parts(l2.cast(), len4, len4); - - _rt::string_lift(bytes4) + let l3 = *ptr0 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l4 = *ptr0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len5 = l4; + let bytes5 = _rt::Vec::from_raw_parts( + l3.cast(), + len5, + len5, + ); + _rt::string_lift(bytes5) }; Some(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result6 } } } @@ -2909,17 +3110,16 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]incoming-request.headers"] - fn wit_import(_: i32) -> i32; + fn wit_import0(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32) -> i32 { + unsafe extern "C" fn wit_import0(_: i32) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32); - Fields::from_handle(ret as u32) + let ret = unsafe { wit_import0((self).handle() as i32) }; + unsafe { Fields::from_handle(ret as u32) } } } } @@ -2931,27 +3131,27 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 8], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]incoming-request.consume"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result4 = match l2 { 0 => { let e = { - let l2 = *ptr0.add(4).cast::(); - - IncomingBody::from_handle(l2 as u32) + let l3 = *ptr0.add(4).cast::(); + unsafe { IncomingBody::from_handle(l3 as u32) } }; Ok(e) } @@ -2960,7 +3160,8 @@ pub mod wasi { Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result4 } } } @@ -2980,17 +3181,18 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[constructor]outgoing-request"] - fn wit_import(_: i32) -> i32; + fn wit_import0(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32) -> i32 { + unsafe extern "C" fn wit_import0(_: i32) -> i32 { unreachable!() } - let ret = wit_import((&headers).take_handle() as i32); - OutgoingRequest::from_handle(ret as u32) + let ret = unsafe { + wit_import0((&headers).take_handle() as i32) + }; + unsafe { OutgoingRequest::from_handle(ret as u32) } } } } @@ -3006,27 +3208,27 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 8], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]outgoing-request.body"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result4 = match l2 { 0 => { let e = { - let l2 = *ptr0.add(4).cast::(); - - OutgoingBody::from_handle(l2 as u32) + let l3 = *ptr0.add(4).cast::(); + unsafe { OutgoingBody::from_handle(l3 as u32) } }; Ok(e) } @@ -3035,7 +3237,8 @@ pub mod wasi { Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result4 } } } @@ -3044,24 +3247,31 @@ pub mod wasi { /// Get the Method for the Request. pub fn method(&self) -> Method { unsafe { - #[repr(align(4))] - struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 3 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 3 + * ::core::mem::size_of::<*const u8>()], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]outgoing-request.method"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - let v5 = match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let v6 = match l2 { 0 => Method::Get, 1 => Method::Head, 2 => Method::Post, @@ -3073,18 +3283,26 @@ pub mod wasi { 8 => Method::Patch, n => { debug_assert_eq!(n, 9, "invalid enum discriminant"); - let e5 = { - let l2 = *ptr0.add(4).cast::<*mut u8>(); - let l3 = *ptr0.add(8).cast::(); - let len4 = l3; - let bytes4 = _rt::Vec::from_raw_parts(l2.cast(), len4, len4); - - _rt::string_lift(bytes4) + let e6 = { + let l3 = *ptr0 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l4 = *ptr0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len5 = l4; + let bytes5 = _rt::Vec::from_raw_parts( + l3.cast(), + len5, + len5, + ); + _rt::string_lift(bytes5) }; - Method::Other(e5) + Method::Other(e6) } }; - v5 + let result7 = v6; + result7 } } } @@ -3108,24 +3326,32 @@ pub mod wasi { let vec0 = e; let ptr0 = vec0.as_ptr().cast::(); let len0 = vec0.len(); - (9i32, ptr0.cast_mut(), len0) } }; - #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]outgoing-request.set-method"] - fn wit_import(_: i32, _: i32, _: *mut u8, _: usize) -> i32; + fn wit_import2(_: i32, _: i32, _: *mut u8, _: usize) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: i32, _: *mut u8, _: usize) -> i32 { + unsafe extern "C" fn wit_import2( + _: i32, + _: i32, + _: *mut u8, + _: usize, + ) -> i32 { unreachable!() } - let ret = - wit_import((self).handle() as i32, result1_0, result1_1, result1_2); + let ret = unsafe { + wit_import2( + (self).handle() as i32, + result1_0, + result1_1, + result1_2, + ) + }; match ret { 0 => { let e = (); @@ -3146,38 +3372,53 @@ pub mod wasi { /// When `none`, this represents an empty Path and empty Query. pub fn path_with_query(&self) -> Option<_rt::String> { unsafe { - #[repr(align(4))] - struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 3 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 3 + * ::core::mem::size_of::<*const u8>()], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]outgoing-request.path-with-query"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result6 = match l2 { 0 => None, 1 => { let e = { - let l2 = *ptr0.add(4).cast::<*mut u8>(); - let l3 = *ptr0.add(8).cast::(); - let len4 = l3; - let bytes4 = _rt::Vec::from_raw_parts(l2.cast(), len4, len4); - - _rt::string_lift(bytes4) + let l3 = *ptr0 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l4 = *ptr0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len5 = l4; + let bytes5 = _rt::Vec::from_raw_parts( + l3.cast(), + len5, + len5, + ); + _rt::string_lift(bytes5) }; Some(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result6 } } } @@ -3186,31 +3427,43 @@ pub mod wasi { /// Set the combination of the HTTP Path and Query for the Request. /// When `none`, this represents an empty Path and empty Query. Fails is the /// string given is not a syntactically valid path and query uri component. - pub fn set_path_with_query(&self, path_with_query: Option<&str>) -> Result<(), ()> { + pub fn set_path_with_query( + &self, + path_with_query: Option<&str>, + ) -> Result<(), ()> { unsafe { let (result1_0, result1_1, result1_2) = match path_with_query { Some(e) => { let vec0 = e; let ptr0 = vec0.as_ptr().cast::(); let len0 = vec0.len(); - (1i32, ptr0.cast_mut(), len0) } None => (0i32, ::core::ptr::null_mut(), 0usize), }; #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]outgoing-request.set-path-with-query"] - fn wit_import(_: i32, _: i32, _: *mut u8, _: usize) -> i32; + fn wit_import2(_: i32, _: i32, _: *mut u8, _: usize) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: i32, _: *mut u8, _: usize) -> i32 { + unsafe extern "C" fn wit_import2( + _: i32, + _: i32, + _: *mut u8, + _: usize, + ) -> i32 { unreachable!() } - let ret = - wit_import((self).handle() as i32, result1_0, result1_1, result1_2); + let ret = unsafe { + wit_import2( + (self).handle() as i32, + result1_0, + result1_1, + result1_2, + ) + }; match ret { 0 => { let e = (); @@ -3231,52 +3484,67 @@ pub mod wasi { /// implementation may choose an appropriate default scheme. pub fn scheme(&self) -> Option { unsafe { - #[repr(align(4))] - struct RetArea([::core::mem::MaybeUninit; 16]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 16]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 4 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 4 + * ::core::mem::size_of::<*const u8>()], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]outgoing-request.scheme"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result8 = match l2 { 0 => None, 1 => { let e = { - let l2 = i32::from(*ptr0.add(4).cast::()); - let v6 = match l2 { + let l3 = i32::from( + *ptr0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); + let v7 = match l3 { 0 => Scheme::Http, 1 => Scheme::Https, n => { debug_assert_eq!(n, 2, "invalid enum discriminant"); - let e6 = { - let l3 = *ptr0.add(8).cast::<*mut u8>(); - let l4 = *ptr0.add(12).cast::(); - let len5 = l4; - let bytes5 = - _rt::Vec::from_raw_parts(l3.cast(), len5, len5); - - _rt::string_lift(bytes5) + let e7 = { + let l4 = *ptr0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l5 = *ptr0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len6 = l5; + let bytes6 = _rt::Vec::from_raw_parts( + l4.cast(), + len6, + len6, + ); + _rt::string_lift(bytes6) }; - Scheme::Other(e6) + Scheme::Other(e7) } }; - - v6 + v7 }; Some(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result8 } } } @@ -3296,33 +3564,44 @@ pub mod wasi { let vec0 = e; let ptr0 = vec0.as_ptr().cast::(); let len0 = vec0.len(); - (2i32, ptr0.cast_mut(), len0) } }; - (1i32, result1_0, result1_1, result1_2) } None => (0i32, 0i32, ::core::ptr::null_mut(), 0usize), }; #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]outgoing-request.set-scheme"] - fn wit_import(_: i32, _: i32, _: i32, _: *mut u8, _: usize) -> i32; + fn wit_import3( + _: i32, + _: i32, + _: i32, + _: *mut u8, + _: usize, + ) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: i32, _: i32, _: *mut u8, _: usize) -> i32 { + unsafe extern "C" fn wit_import3( + _: i32, + _: i32, + _: i32, + _: *mut u8, + _: usize, + ) -> i32 { unreachable!() } - let ret = wit_import( - (self).handle() as i32, - result2_0, - result2_1, - result2_2, - result2_3, - ); + let ret = unsafe { + wit_import3( + (self).handle() as i32, + result2_0, + result2_1, + result2_2, + result2_3, + ) + }; match ret { 0 => { let e = (); @@ -3344,38 +3623,53 @@ pub mod wasi { /// HTTPS schemes always require an authority. pub fn authority(&self) -> Option<_rt::String> { unsafe { - #[repr(align(4))] - struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 3 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 3 + * ::core::mem::size_of::<*const u8>()], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]outgoing-request.authority"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result6 = match l2 { 0 => None, 1 => { let e = { - let l2 = *ptr0.add(4).cast::<*mut u8>(); - let l3 = *ptr0.add(8).cast::(); - let len4 = l3; - let bytes4 = _rt::Vec::from_raw_parts(l2.cast(), len4, len4); - - _rt::string_lift(bytes4) + let l3 = *ptr0 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l4 = *ptr0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len5 = l4; + let bytes5 = _rt::Vec::from_raw_parts( + l3.cast(), + len5, + len5, + ); + _rt::string_lift(bytes5) }; Some(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result6 } } } @@ -3392,24 +3686,33 @@ pub mod wasi { let vec0 = e; let ptr0 = vec0.as_ptr().cast::(); let len0 = vec0.len(); - (1i32, ptr0.cast_mut(), len0) } None => (0i32, ::core::ptr::null_mut(), 0usize), }; #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]outgoing-request.set-authority"] - fn wit_import(_: i32, _: i32, _: *mut u8, _: usize) -> i32; + fn wit_import2(_: i32, _: i32, _: *mut u8, _: usize) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: i32, _: *mut u8, _: usize) -> i32 { + unsafe extern "C" fn wit_import2( + _: i32, + _: i32, + _: *mut u8, + _: usize, + ) -> i32 { unreachable!() } - let ret = - wit_import((self).handle() as i32, result1_0, result1_1, result1_2); + let ret = unsafe { + wit_import2( + (self).handle() as i32, + result1_0, + result1_1, + result1_2, + ) + }; match ret { 0 => { let e = (); @@ -3438,17 +3741,16 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]outgoing-request.headers"] - fn wit_import(_: i32) -> i32; + fn wit_import0(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32) -> i32 { + unsafe extern "C" fn wit_import0(_: i32) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32); - Fields::from_handle(ret as u32) + let ret = unsafe { wit_import0((self).handle() as i32) }; + unsafe { Fields::from_handle(ret as u32) } } } } @@ -3459,17 +3761,16 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[constructor]request-options"] - fn wit_import() -> i32; + fn wit_import0() -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import() -> i32 { + unsafe extern "C" fn wit_import0() -> i32 { unreachable!() } - let ret = wit_import(); - RequestOptions::from_handle(ret as u32) + let ret = unsafe { wit_import0() }; + unsafe { RequestOptions::from_handle(ret as u32) } } } } @@ -3480,33 +3781,34 @@ pub mod wasi { unsafe { #[repr(align(8))] 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]request-options.connect-timeout"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result4 = match l2 { 0 => None, 1 => { let e = { - let l2 = *ptr0.add(8).cast::(); - - l2 as u64 + let l3 = *ptr0.add(8).cast::(); + l3 as u64 }; Some(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result4 } } } @@ -3514,7 +3816,10 @@ pub mod wasi { #[allow(unused_unsafe, clippy::all)] /// Set the timeout for the initial connect to the HTTP Server. An error /// return value indicates that this timeout is not supported. - pub fn set_connect_timeout(&self, duration: Option) -> Result<(), ()> { + pub fn set_connect_timeout( + &self, + duration: Option, + ) -> Result<(), ()> { unsafe { let (result0_0, result0_1) = match duration { Some(e) => (1i32, _rt::as_i64(e)), @@ -3522,16 +3827,17 @@ pub mod wasi { }; #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]request-options.set-connect-timeout"] - fn wit_import(_: i32, _: i32, _: i64) -> i32; + fn wit_import1(_: i32, _: i32, _: i64) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: i32, _: i64) -> i32 { + unsafe extern "C" fn wit_import1(_: i32, _: i32, _: i64) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32, result0_0, result0_1); + let ret = unsafe { + wit_import1((self).handle() as i32, result0_0, result0_1) + }; match ret { 0 => { let e = (); @@ -3553,33 +3859,34 @@ pub mod wasi { unsafe { #[repr(align(8))] 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]request-options.first-byte-timeout"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result4 = match l2 { 0 => None, 1 => { let e = { - let l2 = *ptr0.add(8).cast::(); - - l2 as u64 + let l3 = *ptr0.add(8).cast::(); + l3 as u64 }; Some(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result4 } } } @@ -3587,7 +3894,10 @@ pub mod wasi { #[allow(unused_unsafe, clippy::all)] /// Set the timeout for receiving the first byte of the Response body. An /// error return value indicates that this timeout is not supported. - pub fn set_first_byte_timeout(&self, duration: Option) -> Result<(), ()> { + pub fn set_first_byte_timeout( + &self, + duration: Option, + ) -> Result<(), ()> { unsafe { let (result0_0, result0_1) = match duration { Some(e) => (1i32, _rt::as_i64(e)), @@ -3595,16 +3905,17 @@ pub mod wasi { }; #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]request-options.set-first-byte-timeout"] - fn wit_import(_: i32, _: i32, _: i64) -> i32; + fn wit_import1(_: i32, _: i32, _: i64) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: i32, _: i64) -> i32 { + unsafe extern "C" fn wit_import1(_: i32, _: i32, _: i64) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32, result0_0, result0_1); + let ret = unsafe { + wit_import1((self).handle() as i32, result0_0, result0_1) + }; match ret { 0 => { let e = (); @@ -3627,33 +3938,34 @@ pub mod wasi { unsafe { #[repr(align(8))] 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]request-options.between-bytes-timeout"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result4 = match l2 { 0 => None, 1 => { let e = { - let l2 = *ptr0.add(8).cast::(); - - l2 as u64 + let l3 = *ptr0.add(8).cast::(); + l3 as u64 }; Some(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result4 } } } @@ -3673,16 +3985,17 @@ pub mod wasi { }; #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]request-options.set-between-bytes-timeout"] - fn wit_import(_: i32, _: i32, _: i64) -> i32; + fn wit_import1(_: i32, _: i32, _: i64) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: i32, _: i64) -> i32 { + unsafe extern "C" fn wit_import1(_: i32, _: i32, _: i64) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32, result0_0, result0_1); + let ret = unsafe { + wit_import1((self).handle() as i32, result0_0, result0_1) + }; match ret { 0 => { let e = (); @@ -3708,7 +4021,10 @@ pub mod wasi { /// /// The user may provide an `error` to `response` to allow the /// implementation determine how to respond with an HTTP error response. - pub fn set(param: ResponseOutparam, response: Result) { + pub fn set( + param: ResponseOutparam, + response: Result, + ) -> () { unsafe { let ( result38_0, @@ -3720,16 +4036,18 @@ pub mod wasi { result38_6, result38_7, ) = match &response { - Ok(e) => ( - 0i32, - (e).take_handle() as i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), + Ok(e) => { + ( + 0i32, + (e).take_handle() as i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } Err(e) => { let ( result37_0, @@ -3740,15 +4058,17 @@ pub mod wasi { result37_5, result37_6, ) = match e { - ErrorCode::DnsTimeout => ( - 0i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), + ErrorCode::DnsTimeout => { + ( + 0i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } ErrorCode::DnsError(e) => { let DnsErrorPayload { rcode: rcode0, @@ -3759,7 +4079,6 @@ pub mod wasi { let vec1 = e; let ptr1 = vec1.as_ptr().cast::(); let len1 = vec1.len(); - (1i32, ptr1.cast_mut(), len1) } None => (0i32, ::core::ptr::null_mut(), 0usize), @@ -3772,8 +4091,7 @@ pub mod wasi { 1i32, result2_0, { - let mut t = - ::core::mem::MaybeUninit::::uninit(); + let mut t = ::core::mem::MaybeUninit::::uninit(); t.as_mut_ptr().cast::<*mut u8>().write(result2_1); t }, @@ -3783,114 +4101,138 @@ pub mod wasi { 0i32, ) } - ErrorCode::DestinationNotFound => ( - 2i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::DestinationUnavailable => ( - 3i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::DestinationIpProhibited => ( - 4i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::DestinationIpUnroutable => ( - 5i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::ConnectionRefused => ( - 6i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::ConnectionTerminated => ( - 7i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::ConnectionTimeout => ( - 8i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::ConnectionReadTimeout => ( - 9i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::ConnectionWriteTimeout => ( - 10i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::ConnectionLimitReached => ( - 11i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::TlsProtocolError => ( - 12i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::TlsCertificateError => ( - 13i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), + ErrorCode::DestinationNotFound => { + ( + 2i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::DestinationUnavailable => { + ( + 3i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::DestinationIpProhibited => { + ( + 4i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::DestinationIpUnroutable => { + ( + 5i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::ConnectionRefused => { + ( + 6i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::ConnectionTerminated => { + ( + 7i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::ConnectionTimeout => { + ( + 8i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::ConnectionReadTimeout => { + ( + 9i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::ConnectionWriteTimeout => { + ( + 10i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::ConnectionLimitReached => { + ( + 11i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::TlsProtocolError => { + ( + 12i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::TlsCertificateError => { + ( + 13i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } ErrorCode::TlsAlertReceived(e) => { let TlsAlertReceivedPayload { alert_id: alert_id4, @@ -3900,13 +4242,11 @@ pub mod wasi { Some(e) => (1i32, _rt::as_i32(e)), None => (0i32, 0i32), }; - let (result7_0, result7_1, result7_2) = match alert_message4 - { + let (result7_0, result7_1, result7_2) = match alert_message4 { Some(e) => { let vec6 = e; let ptr6 = vec6.as_ptr().cast::(); let len6 = vec6.len(); - (1i32, ptr6.cast_mut(), len6) } None => (0i32, ::core::ptr::null_mut(), 0usize), @@ -3914,33 +4254,35 @@ pub mod wasi { ( 14i32, result5_0, - ::core::mem::MaybeUninit::new( - i64::from(result5_1) as u64 - ), + ::core::mem::MaybeUninit::new(i64::from(result5_1) as u64), result7_0 as *mut u8, result7_1, result7_2, 0i32, ) } - ErrorCode::HttpRequestDenied => ( - 15i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::HttpRequestLengthRequired => ( - 16i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), + ErrorCode::HttpRequestDenied => { + ( + 15i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::HttpRequestLengthRequired => { + ( + 16i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } ErrorCode::HttpRequestBodySize(e) => { let (result8_0, result8_1) = match e { Some(e) => (1i32, _rt::as_i64(e)), @@ -3956,33 +4298,39 @@ pub mod wasi { 0i32, ) } - ErrorCode::HttpRequestMethodInvalid => ( - 18i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::HttpRequestUriInvalid => ( - 19i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::HttpRequestUriTooLong => ( - 20i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), + ErrorCode::HttpRequestMethodInvalid => { + ( + 18i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::HttpRequestUriInvalid => { + ( + 19i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::HttpRequestUriTooLong => { + ( + 20i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } ErrorCode::HttpRequestHeaderSectionSize(e) => { let (result9_0, result9_1) = match e { Some(e) => (1i32, _rt::as_i32(e)), @@ -3991,9 +4339,7 @@ pub mod wasi { ( 21i32, result9_0, - ::core::mem::MaybeUninit::new( - i64::from(result9_1) as u64 - ), + ::core::mem::MaybeUninit::new(i64::from(result9_1) as u64), ::core::ptr::null_mut(), ::core::ptr::null_mut(), 0usize, @@ -4014,43 +4360,36 @@ pub mod wasi { field_name: field_name10, field_size: field_size10, } = e; - let (result12_0, result12_1, result12_2) = - match field_name10 { - Some(e) => { - let vec11 = e; - let ptr11 = vec11.as_ptr().cast::(); - let len11 = vec11.len(); - - (1i32, ptr11.cast_mut(), len11) - } - None => { - (0i32, ::core::ptr::null_mut(), 0usize) - } - }; + let (result12_0, result12_1, result12_2) = match field_name10 { + Some(e) => { + let vec11 = e; + let ptr11 = vec11.as_ptr().cast::(); + let len11 = vec11.len(); + (1i32, ptr11.cast_mut(), len11) + } + None => (0i32, ::core::ptr::null_mut(), 0usize), + }; let (result13_0, result13_1) = match field_size10 { Some(e) => (1i32, _rt::as_i32(e)), None => (0i32, 0i32), }; ( - 1i32, result12_0, result12_1, result12_2, - result13_0, result13_1, + 1i32, + result12_0, + result12_1, + result12_2, + result13_0, + result13_1, ) } - None => ( - 0i32, - 0i32, - ::core::ptr::null_mut(), - 0usize, - 0i32, - 0i32, - ), + None => { + (0i32, 0i32, ::core::ptr::null_mut(), 0usize, 0i32, 0i32) + } }; ( 22i32, result14_0, - ::core::mem::MaybeUninit::new( - i64::from(result14_1) as u64 - ), + ::core::mem::MaybeUninit::new(i64::from(result14_1) as u64), result14_2, result14_3 as *mut u8, result14_4 as usize, @@ -4065,9 +4404,7 @@ pub mod wasi { ( 23i32, result15_0, - ::core::mem::MaybeUninit::new( - i64::from(result15_1) as u64 - ), + ::core::mem::MaybeUninit::new(i64::from(result15_1) as u64), ::core::ptr::null_mut(), ::core::ptr::null_mut(), 0usize, @@ -4079,17 +4416,15 @@ pub mod wasi { field_name: field_name16, field_size: field_size16, } = e; - let (result18_0, result18_1, result18_2) = - match field_name16 { - Some(e) => { - let vec17 = e; - let ptr17 = vec17.as_ptr().cast::(); - let len17 = vec17.len(); - - (1i32, ptr17.cast_mut(), len17) - } - None => (0i32, ::core::ptr::null_mut(), 0usize), - }; + let (result18_0, result18_1, result18_2) = match field_name16 { + Some(e) => { + let vec17 = e; + let ptr17 = vec17.as_ptr().cast::(); + let len17 = vec17.len(); + (1i32, ptr17.cast_mut(), len17) + } + None => (0i32, ::core::ptr::null_mut(), 0usize), + }; let (result19_0, result19_1) = match field_size16 { Some(e) => (1i32, _rt::as_i32(e)), None => (0i32, 0i32), @@ -4098,8 +4433,7 @@ pub mod wasi { 24i32, result18_0, { - let mut t = - ::core::mem::MaybeUninit::::uninit(); + let mut t = ::core::mem::MaybeUninit::::uninit(); t.as_mut_ptr().cast::<*mut u8>().write(result18_1); t }, @@ -4109,15 +4443,17 @@ pub mod wasi { 0i32, ) } - ErrorCode::HttpResponseIncomplete => ( - 25i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), + ErrorCode::HttpResponseIncomplete => { + ( + 25i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } ErrorCode::HttpResponseHeaderSectionSize(e) => { let (result20_0, result20_1) = match e { Some(e) => (1i32, _rt::as_i32(e)), @@ -4126,9 +4462,7 @@ pub mod wasi { ( 26i32, result20_0, - ::core::mem::MaybeUninit::new( - i64::from(result20_1) as u64 - ), + ::core::mem::MaybeUninit::new(i64::from(result20_1) as u64), ::core::ptr::null_mut(), ::core::ptr::null_mut(), 0usize, @@ -4140,17 +4474,15 @@ pub mod wasi { field_name: field_name21, field_size: field_size21, } = e; - let (result23_0, result23_1, result23_2) = - match field_name21 { - Some(e) => { - let vec22 = e; - let ptr22 = vec22.as_ptr().cast::(); - let len22 = vec22.len(); - - (1i32, ptr22.cast_mut(), len22) - } - None => (0i32, ::core::ptr::null_mut(), 0usize), - }; + let (result23_0, result23_1, result23_2) = match field_name21 { + Some(e) => { + let vec22 = e; + let ptr22 = vec22.as_ptr().cast::(); + let len22 = vec22.len(); + (1i32, ptr22.cast_mut(), len22) + } + None => (0i32, ::core::ptr::null_mut(), 0usize), + }; let (result24_0, result24_1) = match field_size21 { Some(e) => (1i32, _rt::as_i32(e)), None => (0i32, 0i32), @@ -4159,8 +4491,7 @@ pub mod wasi { 27i32, result23_0, { - let mut t = - ::core::mem::MaybeUninit::::uninit(); + let mut t = ::core::mem::MaybeUninit::::uninit(); t.as_mut_ptr().cast::<*mut u8>().write(result23_1); t }, @@ -4193,9 +4524,7 @@ pub mod wasi { ( 29i32, result26_0, - ::core::mem::MaybeUninit::new( - i64::from(result26_1) as u64 - ), + ::core::mem::MaybeUninit::new(i64::from(result26_1) as u64), ::core::ptr::null_mut(), ::core::ptr::null_mut(), 0usize, @@ -4207,17 +4536,15 @@ pub mod wasi { field_name: field_name27, field_size: field_size27, } = e; - let (result29_0, result29_1, result29_2) = - match field_name27 { - Some(e) => { - let vec28 = e; - let ptr28 = vec28.as_ptr().cast::(); - let len28 = vec28.len(); - - (1i32, ptr28.cast_mut(), len28) - } - None => (0i32, ::core::ptr::null_mut(), 0usize), - }; + let (result29_0, result29_1, result29_2) = match field_name27 { + Some(e) => { + let vec28 = e; + let ptr28 = vec28.as_ptr().cast::(); + let len28 = vec28.len(); + (1i32, ptr28.cast_mut(), len28) + } + None => (0i32, ::core::ptr::null_mut(), 0usize), + }; let (result30_0, result30_1) = match field_size27 { Some(e) => (1i32, _rt::as_i32(e)), None => (0i32, 0i32), @@ -4226,8 +4553,7 @@ pub mod wasi { 30i32, result29_0, { - let mut t = - ::core::mem::MaybeUninit::::uninit(); + let mut t = ::core::mem::MaybeUninit::::uninit(); t.as_mut_ptr().cast::<*mut u8>().write(result29_1); t }, @@ -4243,7 +4569,6 @@ pub mod wasi { let vec31 = e; let ptr31 = vec31.as_ptr().cast::(); let len31 = vec31.len(); - (1i32, ptr31.cast_mut(), len31) } None => (0i32, ::core::ptr::null_mut(), 0usize), @@ -4252,8 +4577,7 @@ pub mod wasi { 31i32, result32_0, { - let mut t = - ::core::mem::MaybeUninit::::uninit(); + let mut t = ::core::mem::MaybeUninit::::uninit(); t.as_mut_ptr().cast::<*mut u8>().write(result32_1); t }, @@ -4269,7 +4593,6 @@ pub mod wasi { let vec33 = e; let ptr33 = vec33.as_ptr().cast::(); let len33 = vec33.len(); - (1i32, ptr33.cast_mut(), len33) } None => (0i32, ::core::ptr::null_mut(), 0usize), @@ -4278,8 +4601,7 @@ pub mod wasi { 32i32, result34_0, { - let mut t = - ::core::mem::MaybeUninit::::uninit(); + let mut t = ::core::mem::MaybeUninit::::uninit(); t.as_mut_ptr().cast::<*mut u8>().write(result34_1); t }, @@ -4289,58 +4611,67 @@ pub mod wasi { 0i32, ) } - ErrorCode::HttpResponseTimeout => ( - 33i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::HttpUpgradeFailed => ( - 34i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::HttpProtocolError => ( - 35i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::LoopDetected => ( - 36i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::ConfigurationError => ( - 37i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), + ErrorCode::HttpResponseTimeout => { + ( + 33i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::HttpUpgradeFailed => { + ( + 34i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::HttpProtocolError => { + ( + 35i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::LoopDetected => { + ( + 36i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::ConfigurationError => { + ( + 37i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } ErrorCode::InternalError(e) => { let (result36_0, result36_1, result36_2) = match e { Some(e) => { let vec35 = e; let ptr35 = vec35.as_ptr().cast::(); let len35 = vec35.len(); - (1i32, ptr35.cast_mut(), len35) } None => (0i32, ::core::ptr::null_mut(), 0usize), @@ -4349,8 +4680,7 @@ pub mod wasi { 38i32, result36_0, { - let mut t = - ::core::mem::MaybeUninit::::uninit(); + let mut t = ::core::mem::MaybeUninit::::uninit(); t.as_mut_ptr().cast::<*mut u8>().write(result36_1); t }, @@ -4361,18 +4691,23 @@ pub mod wasi { ) } }; - ( - 1i32, result37_0, result37_1, result37_2, result37_3, - result37_4, result37_5, result37_6, + 1i32, + result37_0, + result37_1, + result37_2, + result37_3, + result37_4, + result37_5, + result37_6, ) } }; #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[static]response-outparam.set"] - fn wit_import( + fn wit_import39( _: i32, _: i32, _: i32, @@ -4384,9 +4719,8 @@ pub mod wasi { _: i32, ); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import( + unsafe extern "C" fn wit_import39( _: i32, _: i32, _: i32, @@ -4399,17 +4733,19 @@ pub mod wasi { ) { unreachable!() } - wit_import( - (¶m).take_handle() as i32, - result38_0, - result38_1, - result38_2, - result38_3, - result38_4, - result38_5, - result38_6, - result38_7, - ); + unsafe { + wit_import39( + (¶m).take_handle() as i32, + result38_0, + result38_1, + result38_2, + result38_3, + result38_4, + result38_5, + result38_6, + result38_7, + ) + }; } } } @@ -4420,16 +4756,15 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]incoming-response.status"] - fn wit_import(_: i32) -> i32; + fn wit_import0(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32) -> i32 { + unsafe extern "C" fn wit_import0(_: i32) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32); + let ret = unsafe { wit_import0((self).handle() as i32) }; ret as u16 } } @@ -4447,17 +4782,16 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]incoming-response.headers"] - fn wit_import(_: i32) -> i32; + fn wit_import0(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32) -> i32 { + unsafe extern "C" fn wit_import0(_: i32) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32); - Fields::from_handle(ret as u32) + let ret = unsafe { wit_import0((self).handle() as i32) }; + unsafe { Fields::from_handle(ret as u32) } } } } @@ -4469,27 +4803,27 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 8], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]incoming-response.consume"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result4 = match l2 { 0 => { let e = { - let l2 = *ptr0.add(4).cast::(); - - IncomingBody::from_handle(l2 as u32) + let l3 = *ptr0.add(4).cast::(); + unsafe { IncomingBody::from_handle(l3 as u32) } }; Ok(e) } @@ -4498,7 +4832,8 @@ pub mod wasi { Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result4 } } } @@ -4523,29 +4858,31 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 8], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]incoming-body.stream"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result4 = match l2 { 0 => { let e = { - let l2 = *ptr0.add(4).cast::(); - - super::super::super::wasi::io::streams::InputStream::from_handle( - l2 as u32, - ) + let l3 = *ptr0.add(4).cast::(); + unsafe { + super::super::super::wasi::io::streams::InputStream::from_handle( + l3 as u32, + ) + } }; Ok(e) } @@ -4554,7 +4891,8 @@ pub mod wasi { Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result4 } } } @@ -4566,17 +4904,16 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[static]incoming-body.finish"] - fn wit_import(_: i32) -> i32; + fn wit_import0(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32) -> i32 { + unsafe extern "C" fn wit_import0(_: i32) -> i32 { unreachable!() } - let ret = wit_import((&this).take_handle() as i32); - FutureTrailers::from_handle(ret as u32) + let ret = unsafe { wit_import0((&this).take_handle() as i32) }; + unsafe { FutureTrailers::from_handle(ret as u32) } } } } @@ -4589,17 +4926,20 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]future-trailers.subscribe"] - fn wit_import(_: i32) -> i32; + fn wit_import0(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32) -> i32 { + unsafe extern "C" fn wit_import0(_: i32) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32); - super::super::super::wasi::io::poll::Pollable::from_handle(ret as u32) + let ret = unsafe { wit_import0((self).handle() as i32) }; + unsafe { + super::super::super::wasi::io::poll::Pollable::from_handle( + ret as u32, + ) + } } } } @@ -4624,565 +4964,590 @@ pub mod wasi { /// resource is immutable, and a child. Use of the `set`, `append`, or /// `delete` methods will return an error, and the resource must be /// dropped before the parent `future-trailers` is dropped. - pub fn get(&self) -> Option, ErrorCode>, ()>> { + pub fn get( + &self, + ) -> Option, ErrorCode>, ()>> { unsafe { #[repr(align(8))] - struct RetArea([::core::mem::MaybeUninit; 56]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 56]); + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 40 + 4 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 40 + + 4 * ::core::mem::size_of::<*const u8>()], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]future-trailers.get"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result70 = match l2 { 0 => None, 1 => { let e = { - let l2 = i32::from(*ptr0.add(8).cast::()); - - match l2 { + let l3 = i32::from(*ptr0.add(8).cast::()); + match l3 { 0 => { let e = { - let l3 = i32::from(*ptr0.add(16).cast::()); - - match l3 { + let l4 = i32::from(*ptr0.add(16).cast::()); + match l4 { 0 => { - let e = - { - let l4 = i32::from( - *ptr0.add(24).cast::(), - ); - - match l4 { - 0 => None, - 1 => { - let e = { - let l5 = *ptr0.add(28).cast::(); - - Fields::from_handle(l5 as u32) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; + let e = { + let l5 = i32::from(*ptr0.add(24).cast::()); + match l5 { + 0 => None, + 1 => { + let e = { + let l6 = *ptr0.add(28).cast::(); + unsafe { Fields::from_handle(l6 as u32) } + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; Ok(e) } 1 => { let e = { - let l6 = i32::from( - *ptr0.add(24).cast::(), - ); - let v68 = match l6 { - 0 => { - ErrorCode::DnsTimeout - } - 1 => { - let e68 = { - let l7 = i32::from(*ptr0.add(32).cast::()); - let l11 = i32::from(*ptr0.add(44).cast::()); - - DnsErrorPayload{ - rcode: match l7 { - 0 => None, - 1 => { - let e = { - let l8 = *ptr0.add(36).cast::<*mut u8>(); - let l9 = *ptr0.add(40).cast::(); - let len10 = l9; - let bytes10 = _rt::Vec::from_raw_parts(l8.cast(), len10, len10); - - _rt::string_lift(bytes10) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - info_code: match l11 { - 0 => None, - 1 => { - let e = { - let l12 = i32::from(*ptr0.add(46).cast::()); - - l12 as u16 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } - }; - ErrorCode::DnsError(e68) - } - 2 => { - ErrorCode::DestinationNotFound - } - 3 => { - ErrorCode::DestinationUnavailable - } - 4 => { - ErrorCode::DestinationIpProhibited - } - 5 => { - ErrorCode::DestinationIpUnroutable - } - 6 => { - ErrorCode::ConnectionRefused - } - 7 => { - ErrorCode::ConnectionTerminated - } - 8 => { - ErrorCode::ConnectionTimeout - } - 9 => { - ErrorCode::ConnectionReadTimeout - } - 10 => { - ErrorCode::ConnectionWriteTimeout - } - 11 => { - ErrorCode::ConnectionLimitReached - } - 12 => { - ErrorCode::TlsProtocolError - } - 13 => { - ErrorCode::TlsCertificateError - } - 14 => { - let e68 = { - let l13 = i32::from(*ptr0.add(32).cast::()); - let l15 = i32::from(*ptr0.add(36).cast::()); - - TlsAlertReceivedPayload{ - alert_id: match l13 { - 0 => None, - 1 => { - let e = { - let l14 = i32::from(*ptr0.add(33).cast::()); - - l14 as u8 - }; - Some(e) + let l7 = i32::from(*ptr0.add(24).cast::()); + let v69 = match l7 { + 0 => ErrorCode::DnsTimeout, + 1 => { + let e69 = { + let l8 = i32::from(*ptr0.add(32).cast::()); + let l12 = i32::from( + *ptr0 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + DnsErrorPayload { + rcode: match l8 { + 0 => None, + 1 => { + let e = { + let l9 = *ptr0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l10 = *ptr0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len11 = l10; + let bytes11 = _rt::Vec::from_raw_parts( + l9.cast(), + len11, + len11, + ); + _rt::string_lift(bytes11) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + info_code: match l12 { + 0 => None, + 1 => { + let e = { + let l13 = i32::from( + *ptr0 + .add(34 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + l13 as u16 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } + }; + ErrorCode::DnsError(e69) + } + 2 => ErrorCode::DestinationNotFound, + 3 => ErrorCode::DestinationUnavailable, + 4 => ErrorCode::DestinationIpProhibited, + 5 => ErrorCode::DestinationIpUnroutable, + 6 => ErrorCode::ConnectionRefused, + 7 => ErrorCode::ConnectionTerminated, + 8 => ErrorCode::ConnectionTimeout, + 9 => ErrorCode::ConnectionReadTimeout, + 10 => ErrorCode::ConnectionWriteTimeout, + 11 => ErrorCode::ConnectionLimitReached, + 12 => ErrorCode::TlsProtocolError, + 13 => ErrorCode::TlsCertificateError, + 14 => { + let e69 = { + let l14 = i32::from(*ptr0.add(32).cast::()); + let l16 = i32::from( + *ptr0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + TlsAlertReceivedPayload { + alert_id: match l14 { + 0 => None, + 1 => { + let e = { + let l15 = i32::from(*ptr0.add(33).cast::()); + l15 as u8 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + alert_message: match l16 { + 0 => None, + 1 => { + let e = { + let l17 = *ptr0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l18 = *ptr0 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len19 = l18; + let bytes19 = _rt::Vec::from_raw_parts( + l17.cast(), + len19, + len19, + ); + _rt::string_lift(bytes19) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } + }; + ErrorCode::TlsAlertReceived(e69) + } + 15 => ErrorCode::HttpRequestDenied, + 16 => ErrorCode::HttpRequestLengthRequired, + 17 => { + let e69 = { + let l20 = i32::from(*ptr0.add(32).cast::()); + match l20 { + 0 => None, + 1 => { + let e = { + let l21 = *ptr0.add(40).cast::(); + l21 as u64 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpRequestBodySize(e69) + } + 18 => ErrorCode::HttpRequestMethodInvalid, + 19 => ErrorCode::HttpRequestUriInvalid, + 20 => ErrorCode::HttpRequestUriTooLong, + 21 => { + let e69 = { + let l22 = i32::from(*ptr0.add(32).cast::()); + match l22 { + 0 => None, + 1 => { + let e = { + let l23 = *ptr0.add(36).cast::(); + l23 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpRequestHeaderSectionSize(e69) + } + 22 => { + let e69 = { + let l24 = i32::from(*ptr0.add(32).cast::()); + match l24 { + 0 => None, + 1 => { + let e = { + let l25 = i32::from( + *ptr0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + let l29 = i32::from( + *ptr0 + .add(32 + 4 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + FieldSizePayload { + field_name: match l25 { + 0 => None, + 1 => { + let e = { + let l26 = *ptr0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l27 = *ptr0 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len28 = l27; + let bytes28 = _rt::Vec::from_raw_parts( + l26.cast(), + len28, + len28, + ); + _rt::string_lift(bytes28) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + field_size: match l29 { + 0 => None, + 1 => { + let e = { + let l30 = *ptr0 + .add(36 + 4 * ::core::mem::size_of::<*const u8>()) + .cast::(); + l30 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpRequestHeaderSize(e69) + } + 23 => { + let e69 = { + let l31 = i32::from(*ptr0.add(32).cast::()); + match l31 { + 0 => None, + 1 => { + let e = { + let l32 = *ptr0.add(36).cast::(); + l32 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpRequestTrailerSectionSize(e69) + } + 24 => { + let e69 = { + let l33 = i32::from(*ptr0.add(32).cast::()); + let l37 = i32::from( + *ptr0 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + FieldSizePayload { + field_name: match l33 { + 0 => None, + 1 => { + let e = { + let l34 = *ptr0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l35 = *ptr0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len36 = l35; + let bytes36 = _rt::Vec::from_raw_parts( + l34.cast(), + len36, + len36, + ); + _rt::string_lift(bytes36) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + field_size: match l37 { + 0 => None, + 1 => { + let e = { + let l38 = *ptr0 + .add(36 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + l38 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } + }; + ErrorCode::HttpRequestTrailerSize(e69) + } + 25 => ErrorCode::HttpResponseIncomplete, + 26 => { + let e69 = { + let l39 = i32::from(*ptr0.add(32).cast::()); + match l39 { + 0 => None, + 1 => { + let e = { + let l40 = *ptr0.add(36).cast::(); + l40 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpResponseHeaderSectionSize(e69) + } + 27 => { + let e69 = { + let l41 = i32::from(*ptr0.add(32).cast::()); + let l45 = i32::from( + *ptr0 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + FieldSizePayload { + field_name: match l41 { + 0 => None, + 1 => { + let e = { + let l42 = *ptr0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l43 = *ptr0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len44 = l43; + let bytes44 = _rt::Vec::from_raw_parts( + l42.cast(), + len44, + len44, + ); + _rt::string_lift(bytes44) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + field_size: match l45 { + 0 => None, + 1 => { + let e = { + let l46 = *ptr0 + .add(36 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + l46 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } + }; + ErrorCode::HttpResponseHeaderSize(e69) + } + 28 => { + let e69 = { + let l47 = i32::from(*ptr0.add(32).cast::()); + match l47 { + 0 => None, + 1 => { + let e = { + let l48 = *ptr0.add(40).cast::(); + l48 as u64 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpResponseBodySize(e69) + } + 29 => { + let e69 = { + let l49 = i32::from(*ptr0.add(32).cast::()); + match l49 { + 0 => None, + 1 => { + let e = { + let l50 = *ptr0.add(36).cast::(); + l50 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpResponseTrailerSectionSize(e69) + } + 30 => { + let e69 = { + let l51 = i32::from(*ptr0.add(32).cast::()); + let l55 = i32::from( + *ptr0 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + FieldSizePayload { + field_name: match l51 { + 0 => None, + 1 => { + let e = { + let l52 = *ptr0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l53 = *ptr0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len54 = l53; + let bytes54 = _rt::Vec::from_raw_parts( + l52.cast(), + len54, + len54, + ); + _rt::string_lift(bytes54) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + field_size: match l55 { + 0 => None, + 1 => { + let e = { + let l56 = *ptr0 + .add(36 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + l56 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } + }; + ErrorCode::HttpResponseTrailerSize(e69) + } + 31 => { + let e69 = { + let l57 = i32::from(*ptr0.add(32).cast::()); + match l57 { + 0 => None, + 1 => { + let e = { + let l58 = *ptr0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l59 = *ptr0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len60 = l59; + let bytes60 = _rt::Vec::from_raw_parts( + l58.cast(), + len60, + len60, + ); + _rt::string_lift(bytes60) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpResponseTransferCoding(e69) + } + 32 => { + let e69 = { + let l61 = i32::from(*ptr0.add(32).cast::()); + match l61 { + 0 => None, + 1 => { + let e = { + let l62 = *ptr0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l63 = *ptr0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len64 = l63; + let bytes64 = _rt::Vec::from_raw_parts( + l62.cast(), + len64, + len64, + ); + _rt::string_lift(bytes64) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpResponseContentCoding(e69) + } + 33 => ErrorCode::HttpResponseTimeout, + 34 => ErrorCode::HttpUpgradeFailed, + 35 => ErrorCode::HttpProtocolError, + 36 => ErrorCode::LoopDetected, + 37 => ErrorCode::ConfigurationError, + n => { + debug_assert_eq!(n, 38, "invalid enum discriminant"); + let e69 = { + let l65 = i32::from(*ptr0.add(32).cast::()); + match l65 { + 0 => None, + 1 => { + let e = { + let l66 = *ptr0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l67 = *ptr0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len68 = l67; + let bytes68 = _rt::Vec::from_raw_parts( + l66.cast(), + len68, + len68, + ); + _rt::string_lift(bytes68) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::InternalError(e69) + } + }; + v69 + }; + Err(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + Ok(e) } - _ => _rt::invalid_enum_discriminant(), - }, - alert_message: match l15 { - 0 => None, 1 => { - let e = { - let l16 = *ptr0.add(40).cast::<*mut u8>(); - let l17 = *ptr0.add(44).cast::(); - let len18 = l17; - let bytes18 = _rt::Vec::from_raw_parts(l16.cast(), len18, len18); - - _rt::string_lift(bytes18) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } - }; - ErrorCode::TlsAlertReceived(e68) - } - 15 => { - ErrorCode::HttpRequestDenied - } - 16 => { - ErrorCode::HttpRequestLengthRequired - } - 17 => { - let e68 = { - let l19 = i32::from(*ptr0.add(32).cast::()); - - match l19 { - 0 => None, - 1 => { - let e = { - let l20 = *ptr0.add(40).cast::(); - - l20 as u64 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpRequestBodySize(e68) - } - 18 => { - ErrorCode::HttpRequestMethodInvalid - } - 19 => { - ErrorCode::HttpRequestUriInvalid - } - 20 => { - ErrorCode::HttpRequestUriTooLong - } - 21 => { - let e68 = { - let l21 = i32::from(*ptr0.add(32).cast::()); - - match l21 { - 0 => None, - 1 => { - let e = { - let l22 = *ptr0.add(36).cast::(); - - l22 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpRequestHeaderSectionSize(e68) - } - 22 => { - let e68 = { - let l23 = i32::from(*ptr0.add(32).cast::()); - - match l23 { - 0 => None, - 1 => { - let e = { - let l24 = i32::from(*ptr0.add(36).cast::()); - let l28 = i32::from(*ptr0.add(48).cast::()); - - FieldSizePayload{ - field_name: match l24 { - 0 => None, - 1 => { - let e = { - let l25 = *ptr0.add(40).cast::<*mut u8>(); - let l26 = *ptr0.add(44).cast::(); - let len27 = l26; - let bytes27 = _rt::Vec::from_raw_parts(l25.cast(), len27, len27); - - _rt::string_lift(bytes27) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - field_size: match l28 { - 0 => None, - 1 => { - let e = { - let l29 = *ptr0.add(52).cast::(); - - l29 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpRequestHeaderSize(e68) - } - 23 => { - let e68 = { - let l30 = i32::from(*ptr0.add(32).cast::()); - - match l30 { - 0 => None, - 1 => { - let e = { - let l31 = *ptr0.add(36).cast::(); - - l31 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpRequestTrailerSectionSize(e68) - } - 24 => { - let e68 = { - let l32 = i32::from(*ptr0.add(32).cast::()); - let l36 = i32::from(*ptr0.add(44).cast::()); - - FieldSizePayload{ - field_name: match l32 { - 0 => None, - 1 => { - let e = { - let l33 = *ptr0.add(36).cast::<*mut u8>(); - let l34 = *ptr0.add(40).cast::(); - let len35 = l34; - let bytes35 = _rt::Vec::from_raw_parts(l33.cast(), len35, len35); - - _rt::string_lift(bytes35) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - field_size: match l36 { - 0 => None, - 1 => { - let e = { - let l37 = *ptr0.add(48).cast::(); - - l37 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } - }; - ErrorCode::HttpRequestTrailerSize(e68) - } - 25 => { - ErrorCode::HttpResponseIncomplete - } - 26 => { - let e68 = { - let l38 = i32::from(*ptr0.add(32).cast::()); - - match l38 { - 0 => None, - 1 => { - let e = { - let l39 = *ptr0.add(36).cast::(); - - l39 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpResponseHeaderSectionSize(e68) - } - 27 => { - let e68 = { - let l40 = i32::from(*ptr0.add(32).cast::()); - let l44 = i32::from(*ptr0.add(44).cast::()); - - FieldSizePayload{ - field_name: match l40 { - 0 => None, - 1 => { - let e = { - let l41 = *ptr0.add(36).cast::<*mut u8>(); - let l42 = *ptr0.add(40).cast::(); - let len43 = l42; - let bytes43 = _rt::Vec::from_raw_parts(l41.cast(), len43, len43); - - _rt::string_lift(bytes43) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - field_size: match l44 { - 0 => None, - 1 => { - let e = { - let l45 = *ptr0.add(48).cast::(); - - l45 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } - }; - ErrorCode::HttpResponseHeaderSize(e68) - } - 28 => { - let e68 = { - let l46 = i32::from(*ptr0.add(32).cast::()); - - match l46 { - 0 => None, - 1 => { - let e = { - let l47 = *ptr0.add(40).cast::(); - - l47 as u64 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpResponseBodySize(e68) - } - 29 => { - let e68 = { - let l48 = i32::from(*ptr0.add(32).cast::()); - - match l48 { - 0 => None, - 1 => { - let e = { - let l49 = *ptr0.add(36).cast::(); - - l49 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpResponseTrailerSectionSize(e68) - } - 30 => { - let e68 = { - let l50 = i32::from(*ptr0.add(32).cast::()); - let l54 = i32::from(*ptr0.add(44).cast::()); - - FieldSizePayload{ - field_name: match l50 { - 0 => None, - 1 => { - let e = { - let l51 = *ptr0.add(36).cast::<*mut u8>(); - let l52 = *ptr0.add(40).cast::(); - let len53 = l52; - let bytes53 = _rt::Vec::from_raw_parts(l51.cast(), len53, len53); - - _rt::string_lift(bytes53) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - field_size: match l54 { - 0 => None, - 1 => { - let e = { - let l55 = *ptr0.add(48).cast::(); - - l55 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } - }; - ErrorCode::HttpResponseTrailerSize(e68) - } - 31 => { - let e68 = { - let l56 = i32::from(*ptr0.add(32).cast::()); - - match l56 { - 0 => None, - 1 => { - let e = { - let l57 = *ptr0.add(36).cast::<*mut u8>(); - let l58 = *ptr0.add(40).cast::(); - let len59 = l58; - let bytes59 = _rt::Vec::from_raw_parts(l57.cast(), len59, len59); - - _rt::string_lift(bytes59) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpResponseTransferCoding(e68) - } - 32 => { - let e68 = { - let l60 = i32::from(*ptr0.add(32).cast::()); - - match l60 { - 0 => None, - 1 => { - let e = { - let l61 = *ptr0.add(36).cast::<*mut u8>(); - let l62 = *ptr0.add(40).cast::(); - let len63 = l62; - let bytes63 = _rt::Vec::from_raw_parts(l61.cast(), len63, len63); - - _rt::string_lift(bytes63) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpResponseContentCoding(e68) - } - 33 => { - ErrorCode::HttpResponseTimeout - } - 34 => { - ErrorCode::HttpUpgradeFailed - } - 35 => { - ErrorCode::HttpProtocolError - } - 36 => { - ErrorCode::LoopDetected - } - 37 => { - ErrorCode::ConfigurationError - } - n => { - debug_assert_eq!(n, 38, "invalid enum discriminant"); - let e68 = { - let l64 = i32::from(*ptr0.add(32).cast::()); - - match l64 { - 0 => None, - 1 => { - let e = { - let l65 = *ptr0.add(36).cast::<*mut u8>(); - let l66 = *ptr0.add(40).cast::(); - let len67 = l66; - let bytes67 = _rt::Vec::from_raw_parts(l65.cast(), len67, len67); - - _rt::string_lift(bytes67) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::InternalError(e68) - } - }; - - v68 - }; - Err(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - Ok(e) - } - 1 => { - let e = (); - Err(e) + let e = (); + Err(e) } _ => _rt::invalid_enum_discriminant(), } @@ -5190,7 +5555,8 @@ pub mod wasi { Some(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result70 } } } @@ -5205,17 +5571,18 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[constructor]outgoing-response"] - fn wit_import(_: i32) -> i32; + fn wit_import0(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32) -> i32 { + unsafe extern "C" fn wit_import0(_: i32) -> i32 { unreachable!() } - let ret = wit_import((&headers).take_handle() as i32); - OutgoingResponse::from_handle(ret as u32) + let ret = unsafe { + wit_import0((&headers).take_handle() as i32) + }; + unsafe { OutgoingResponse::from_handle(ret as u32) } } } } @@ -5226,16 +5593,15 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]outgoing-response.status-code"] - fn wit_import(_: i32) -> i32; + fn wit_import0(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32) -> i32 { + unsafe extern "C" fn wit_import0(_: i32) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32); + let ret = unsafe { wit_import0((self).handle() as i32) }; ret as u16 } } @@ -5244,20 +5610,24 @@ pub mod wasi { #[allow(unused_unsafe, clippy::all)] /// Set the HTTP Status Code for the Response. Fails if the status-code /// given is not a valid http status code. - pub fn set_status_code(&self, status_code: StatusCode) -> Result<(), ()> { + pub fn set_status_code( + &self, + status_code: StatusCode, + ) -> Result<(), ()> { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]outgoing-response.set-status-code"] - fn wit_import(_: i32, _: i32) -> i32; + fn wit_import0(_: i32, _: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: i32) -> i32 { + unsafe extern "C" fn wit_import0(_: i32, _: i32) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32, _rt::as_i32(status_code)); + let ret = unsafe { + wit_import0((self).handle() as i32, _rt::as_i32(status_code)) + }; match ret { 0 => { let e = (); @@ -5286,17 +5656,16 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]outgoing-response.headers"] - fn wit_import(_: i32) -> i32; + fn wit_import0(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32) -> i32 { + unsafe extern "C" fn wit_import0(_: i32) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32); - Fields::from_handle(ret as u32) + let ret = unsafe { wit_import0((self).handle() as i32) }; + unsafe { Fields::from_handle(ret as u32) } } } } @@ -5311,27 +5680,27 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 8], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]outgoing-response.body"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result4 = match l2 { 0 => { let e = { - let l2 = *ptr0.add(4).cast::(); - - OutgoingBody::from_handle(l2 as u32) + let l3 = *ptr0.add(4).cast::(); + unsafe { OutgoingBody::from_handle(l3 as u32) } }; Ok(e) } @@ -5340,7 +5709,8 @@ pub mod wasi { Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result4 } } } @@ -5359,27 +5729,31 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 8], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]outgoing-body.write"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result4 = match l2 { 0 => { let e = { - let l2 = *ptr0.add(4).cast::(); - - super::super::super::wasi::io::streams::OutputStream::from_handle(l2 as u32) + let l3 = *ptr0.add(4).cast::(); + unsafe { + super::super::super::wasi::io::streams::OutputStream::from_handle( + l3 as u32, + ) + } }; Ok(e) } @@ -5388,7 +5762,8 @@ pub mod wasi { Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result4 } } } @@ -5409,8 +5784,15 @@ pub mod wasi { ) -> Result<(), ErrorCode> { unsafe { #[repr(align(8))] - struct RetArea([::core::mem::MaybeUninit; 40]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 40]); + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 24 + 4 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 24 + + 4 * ::core::mem::size_of::<*const u8>()], + ); let (result0_0, result0_1) = match &trailers { Some(e) => (1i32, (e).take_handle() as i32), None => (0i32, 0i32), @@ -5418,64 +5800,79 @@ pub mod wasi { let ptr1 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[static]outgoing-body.finish"] - fn wit_import(_: i32, _: i32, _: i32, _: *mut u8); + fn wit_import2(_: i32, _: i32, _: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: i32, _: i32, _: *mut u8) { + unsafe extern "C" fn wit_import2( + _: i32, + _: i32, + _: i32, + _: *mut u8, + ) { unreachable!() } - wit_import((&this).take_handle() as i32, result0_0, result0_1, ptr1); - let l2 = i32::from(*ptr1.add(0).cast::()); - match l2 { + unsafe { + wit_import2( + (&this).take_handle() as i32, + result0_0, + result0_1, + ptr1, + ) + }; + let l3 = i32::from(*ptr1.add(0).cast::()); + let result67 = match l3 { 0 => { let e = (); Ok(e) } 1 => { let e = { - let l3 = i32::from(*ptr1.add(8).cast::()); - let v65 = match l3 { + let l4 = i32::from(*ptr1.add(8).cast::()); + let v66 = match l4 { 0 => ErrorCode::DnsTimeout, 1 => { - let e65 = { - let l4 = i32::from(*ptr1.add(16).cast::()); - let l8 = i32::from(*ptr1.add(28).cast::()); - + let e66 = { + let l5 = i32::from(*ptr1.add(16).cast::()); + let l9 = i32::from( + *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); DnsErrorPayload { - rcode: match l4 { + rcode: match l5 { 0 => None, 1 => { let e = { - let l5 = - *ptr1.add(20).cast::<*mut u8>(); - let l6 = - *ptr1.add(24).cast::(); - let len7 = l6; - let bytes7 = - _rt::Vec::from_raw_parts( - l5.cast(), - len7, - len7, - ); - - _rt::string_lift(bytes7) + let l6 = *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l7 = *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len8 = l7; + let bytes8 = _rt::Vec::from_raw_parts( + l6.cast(), + len8, + len8, + ); + _rt::string_lift(bytes8) }; Some(e) } _ => _rt::invalid_enum_discriminant(), }, - info_code: match l8 { + info_code: match l9 { 0 => None, 1 => { let e = { - let l9 = i32::from( - *ptr1.add(30).cast::(), + let l10 = i32::from( + *ptr1 + .add(18 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(), ); - - l9 as u16 + l10 as u16 }; Some(e) } @@ -5483,7 +5880,7 @@ pub mod wasi { }, } }; - ErrorCode::DnsError(e65) + ErrorCode::DnsError(e66) } 2 => ErrorCode::DestinationNotFound, 3 => ErrorCode::DestinationUnavailable, @@ -5498,42 +5895,42 @@ pub mod wasi { 12 => ErrorCode::TlsProtocolError, 13 => ErrorCode::TlsCertificateError, 14 => { - let e65 = { - let l10 = i32::from(*ptr1.add(16).cast::()); - let l12 = i32::from(*ptr1.add(20).cast::()); - + let e66 = { + let l11 = i32::from(*ptr1.add(16).cast::()); + let l13 = i32::from( + *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); TlsAlertReceivedPayload { - alert_id: match l10 { + alert_id: match l11 { 0 => None, 1 => { let e = { - let l11 = i32::from( - *ptr1.add(17).cast::(), - ); - - l11 as u8 + let l12 = i32::from(*ptr1.add(17).cast::()); + l12 as u8 }; Some(e) } _ => _rt::invalid_enum_discriminant(), }, - alert_message: match l12 { + alert_message: match l13 { 0 => None, 1 => { let e = { - let l13 = - *ptr1.add(24).cast::<*mut u8>(); - let l14 = - *ptr1.add(28).cast::(); - let len15 = l14; - let bytes15 = - _rt::Vec::from_raw_parts( - l13.cast(), - len15, - len15, - ); - - _rt::string_lift(bytes15) + let l14 = *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l15 = *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len16 = l15; + let bytes16 = _rt::Vec::from_raw_parts( + l14.cast(), + len16, + len16, + ); + _rt::string_lift(bytes16) }; Some(e) } @@ -5541,158 +5938,165 @@ pub mod wasi { }, } }; - ErrorCode::TlsAlertReceived(e65) + ErrorCode::TlsAlertReceived(e66) } 15 => ErrorCode::HttpRequestDenied, 16 => ErrorCode::HttpRequestLengthRequired, 17 => { - let e65 = { - let l16 = i32::from(*ptr1.add(16).cast::()); - - match l16 { + let e66 = { + let l17 = i32::from(*ptr1.add(16).cast::()); + match l17 { 0 => None, 1 => { let e = { - let l17 = *ptr1.add(24).cast::(); - - l17 as u64 + let l18 = *ptr1.add(24).cast::(); + l18 as u64 }; Some(e) } _ => _rt::invalid_enum_discriminant(), } }; - ErrorCode::HttpRequestBodySize(e65) + ErrorCode::HttpRequestBodySize(e66) } 18 => ErrorCode::HttpRequestMethodInvalid, 19 => ErrorCode::HttpRequestUriInvalid, 20 => ErrorCode::HttpRequestUriTooLong, 21 => { - let e65 = { - let l18 = i32::from(*ptr1.add(16).cast::()); - - match l18 { + let e66 = { + let l19 = i32::from(*ptr1.add(16).cast::()); + match l19 { 0 => None, 1 => { let e = { - let l19 = *ptr1.add(20).cast::(); - - l19 as u32 + let l20 = *ptr1.add(20).cast::(); + l20 as u32 }; Some(e) } _ => _rt::invalid_enum_discriminant(), } }; - ErrorCode::HttpRequestHeaderSectionSize(e65) + ErrorCode::HttpRequestHeaderSectionSize(e66) } 22 => { - let e65 = { - let l20 = i32::from(*ptr1.add(16).cast::()); - - match l20 { + let e66 = { + let l21 = i32::from(*ptr1.add(16).cast::()); + match l21 { 0 => None, 1 => { let e = { - let l21 = i32::from( - *ptr1.add(20).cast::(), + let l22 = i32::from( + *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(), ); - let l25 = i32::from( - *ptr1.add(32).cast::(), + let l26 = i32::from( + *ptr1 + .add(16 + 4 * ::core::mem::size_of::<*const u8>()) + .cast::(), ); - - FieldSizePayload{ - field_name: match l21 { - 0 => None, - 1 => { - let e = { - let l22 = *ptr1.add(24).cast::<*mut u8>(); - let l23 = *ptr1.add(28).cast::(); - let len24 = l23; - let bytes24 = _rt::Vec::from_raw_parts(l22.cast(), len24, len24); - - _rt::string_lift(bytes24) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - field_size: match l25 { - 0 => None, - 1 => { - let e = { - let l26 = *ptr1.add(36).cast::(); - - l26 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } + FieldSizePayload { + field_name: match l22 { + 0 => None, + 1 => { + let e = { + let l23 = *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l24 = *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len25 = l24; + let bytes25 = _rt::Vec::from_raw_parts( + l23.cast(), + len25, + len25, + ); + _rt::string_lift(bytes25) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + field_size: match l26 { + 0 => None, + 1 => { + let e = { + let l27 = *ptr1 + .add(20 + 4 * ::core::mem::size_of::<*const u8>()) + .cast::(); + l27 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } }; Some(e) } _ => _rt::invalid_enum_discriminant(), } }; - ErrorCode::HttpRequestHeaderSize(e65) + ErrorCode::HttpRequestHeaderSize(e66) } 23 => { - let e65 = { - let l27 = i32::from(*ptr1.add(16).cast::()); - - match l27 { + let e66 = { + let l28 = i32::from(*ptr1.add(16).cast::()); + match l28 { 0 => None, 1 => { let e = { - let l28 = *ptr1.add(20).cast::(); - - l28 as u32 + let l29 = *ptr1.add(20).cast::(); + l29 as u32 }; Some(e) } _ => _rt::invalid_enum_discriminant(), } }; - ErrorCode::HttpRequestTrailerSectionSize(e65) + ErrorCode::HttpRequestTrailerSectionSize(e66) } 24 => { - let e65 = { - let l29 = i32::from(*ptr1.add(16).cast::()); - let l33 = i32::from(*ptr1.add(28).cast::()); - + let e66 = { + let l30 = i32::from(*ptr1.add(16).cast::()); + let l34 = i32::from( + *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); FieldSizePayload { - field_name: match l29 { + field_name: match l30 { 0 => None, 1 => { let e = { - let l30 = - *ptr1.add(20).cast::<*mut u8>(); - let l31 = - *ptr1.add(24).cast::(); - let len32 = l31; - let bytes32 = - _rt::Vec::from_raw_parts( - l30.cast(), - len32, - len32, - ); - - _rt::string_lift(bytes32) + let l31 = *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l32 = *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len33 = l32; + let bytes33 = _rt::Vec::from_raw_parts( + l31.cast(), + len33, + len33, + ); + _rt::string_lift(bytes33) }; Some(e) } _ => _rt::invalid_enum_discriminant(), }, - field_size: match l33 { + field_size: match l34 { 0 => None, 1 => { let e = { - let l34 = - *ptr1.add(32).cast::(); - - l34 as u32 + let l35 = *ptr1 + .add(20 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + l35 as u32 }; Some(e) } @@ -5700,64 +6104,65 @@ pub mod wasi { }, } }; - ErrorCode::HttpRequestTrailerSize(e65) + ErrorCode::HttpRequestTrailerSize(e66) } 25 => ErrorCode::HttpResponseIncomplete, 26 => { - let e65 = { - let l35 = i32::from(*ptr1.add(16).cast::()); - - match l35 { + let e66 = { + let l36 = i32::from(*ptr1.add(16).cast::()); + match l36 { 0 => None, 1 => { let e = { - let l36 = *ptr1.add(20).cast::(); - - l36 as u32 + let l37 = *ptr1.add(20).cast::(); + l37 as u32 }; Some(e) } _ => _rt::invalid_enum_discriminant(), } }; - ErrorCode::HttpResponseHeaderSectionSize(e65) + ErrorCode::HttpResponseHeaderSectionSize(e66) } 27 => { - let e65 = { - let l37 = i32::from(*ptr1.add(16).cast::()); - let l41 = i32::from(*ptr1.add(28).cast::()); - + let e66 = { + let l38 = i32::from(*ptr1.add(16).cast::()); + let l42 = i32::from( + *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); FieldSizePayload { - field_name: match l37 { + field_name: match l38 { 0 => None, 1 => { let e = { - let l38 = - *ptr1.add(20).cast::<*mut u8>(); - let l39 = - *ptr1.add(24).cast::(); - let len40 = l39; - let bytes40 = - _rt::Vec::from_raw_parts( - l38.cast(), - len40, - len40, - ); - - _rt::string_lift(bytes40) + let l39 = *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l40 = *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len41 = l40; + let bytes41 = _rt::Vec::from_raw_parts( + l39.cast(), + len41, + len41, + ); + _rt::string_lift(bytes41) }; Some(e) } _ => _rt::invalid_enum_discriminant(), }, - field_size: match l41 { + field_size: match l42 { 0 => None, 1 => { let e = { - let l42 = - *ptr1.add(32).cast::(); - - l42 as u32 + let l43 = *ptr1 + .add(20 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + l43 as u32 }; Some(e) } @@ -5765,82 +6170,81 @@ pub mod wasi { }, } }; - ErrorCode::HttpResponseHeaderSize(e65) + ErrorCode::HttpResponseHeaderSize(e66) } 28 => { - let e65 = { - let l43 = i32::from(*ptr1.add(16).cast::()); - - match l43 { + let e66 = { + let l44 = i32::from(*ptr1.add(16).cast::()); + match l44 { 0 => None, 1 => { let e = { - let l44 = *ptr1.add(24).cast::(); - - l44 as u64 + let l45 = *ptr1.add(24).cast::(); + l45 as u64 }; Some(e) } _ => _rt::invalid_enum_discriminant(), } }; - ErrorCode::HttpResponseBodySize(e65) + ErrorCode::HttpResponseBodySize(e66) } 29 => { - let e65 = { - let l45 = i32::from(*ptr1.add(16).cast::()); - - match l45 { + let e66 = { + let l46 = i32::from(*ptr1.add(16).cast::()); + match l46 { 0 => None, 1 => { let e = { - let l46 = *ptr1.add(20).cast::(); - - l46 as u32 + let l47 = *ptr1.add(20).cast::(); + l47 as u32 }; Some(e) } _ => _rt::invalid_enum_discriminant(), } }; - ErrorCode::HttpResponseTrailerSectionSize(e65) + ErrorCode::HttpResponseTrailerSectionSize(e66) } 30 => { - let e65 = { - let l47 = i32::from(*ptr1.add(16).cast::()); - let l51 = i32::from(*ptr1.add(28).cast::()); - + let e66 = { + let l48 = i32::from(*ptr1.add(16).cast::()); + let l52 = i32::from( + *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); FieldSizePayload { - field_name: match l47 { + field_name: match l48 { 0 => None, 1 => { let e = { - let l48 = - *ptr1.add(20).cast::<*mut u8>(); - let l49 = - *ptr1.add(24).cast::(); - let len50 = l49; - let bytes50 = - _rt::Vec::from_raw_parts( - l48.cast(), - len50, - len50, - ); - - _rt::string_lift(bytes50) + let l49 = *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l50 = *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len51 = l50; + let bytes51 = _rt::Vec::from_raw_parts( + l49.cast(), + len51, + len51, + ); + _rt::string_lift(bytes51) }; Some(e) } _ => _rt::invalid_enum_discriminant(), }, - field_size: match l51 { + field_size: match l52 { 0 => None, 1 => { let e = { - let l52 = - *ptr1.add(32).cast::(); - - l52 as u32 + let l53 = *ptr1 + .add(20 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + l53 as u32 }; Some(e) } @@ -5848,61 +6252,63 @@ pub mod wasi { }, } }; - ErrorCode::HttpResponseTrailerSize(e65) + ErrorCode::HttpResponseTrailerSize(e66) } 31 => { - let e65 = { - let l53 = i32::from(*ptr1.add(16).cast::()); - - match l53 { + let e66 = { + let l54 = i32::from(*ptr1.add(16).cast::()); + match l54 { 0 => None, 1 => { let e = { - let l54 = - *ptr1.add(20).cast::<*mut u8>(); - let l55 = *ptr1.add(24).cast::(); - let len56 = l55; - let bytes56 = _rt::Vec::from_raw_parts( - l54.cast(), - len56, - len56, + let l55 = *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l56 = *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len57 = l56; + let bytes57 = _rt::Vec::from_raw_parts( + l55.cast(), + len57, + len57, ); - - _rt::string_lift(bytes56) + _rt::string_lift(bytes57) }; Some(e) } _ => _rt::invalid_enum_discriminant(), } }; - ErrorCode::HttpResponseTransferCoding(e65) + ErrorCode::HttpResponseTransferCoding(e66) } 32 => { - let e65 = { - let l57 = i32::from(*ptr1.add(16).cast::()); - - match l57 { + let e66 = { + let l58 = i32::from(*ptr1.add(16).cast::()); + match l58 { 0 => None, 1 => { let e = { - let l58 = - *ptr1.add(20).cast::<*mut u8>(); - let l59 = *ptr1.add(24).cast::(); - let len60 = l59; - let bytes60 = _rt::Vec::from_raw_parts( - l58.cast(), - len60, - len60, + let l59 = *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l60 = *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len61 = l60; + let bytes61 = _rt::Vec::from_raw_parts( + l59.cast(), + len61, + len61, ); - - _rt::string_lift(bytes60) + _rt::string_lift(bytes61) }; Some(e) } _ => _rt::invalid_enum_discriminant(), } }; - ErrorCode::HttpResponseContentCoding(e65) + ErrorCode::HttpResponseContentCoding(e66) } 33 => ErrorCode::HttpResponseTimeout, 34 => ErrorCode::HttpUpgradeFailed, @@ -5911,40 +6317,41 @@ pub mod wasi { 37 => ErrorCode::ConfigurationError, n => { debug_assert_eq!(n, 38, "invalid enum discriminant"); - let e65 = { - let l61 = i32::from(*ptr1.add(16).cast::()); - - match l61 { + let e66 = { + let l62 = i32::from(*ptr1.add(16).cast::()); + match l62 { 0 => None, 1 => { let e = { - let l62 = - *ptr1.add(20).cast::<*mut u8>(); - let l63 = *ptr1.add(24).cast::(); - let len64 = l63; - let bytes64 = _rt::Vec::from_raw_parts( - l62.cast(), - len64, - len64, + let l63 = *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l64 = *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len65 = l64; + let bytes65 = _rt::Vec::from_raw_parts( + l63.cast(), + len65, + len65, ); - - _rt::string_lift(bytes64) + _rt::string_lift(bytes65) }; Some(e) } _ => _rt::invalid_enum_discriminant(), } }; - ErrorCode::InternalError(e65) + ErrorCode::InternalError(e66) } }; - - v65 + v66 }; Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result67 } } } @@ -5957,17 +6364,20 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]future-incoming-response.subscribe"] - fn wit_import(_: i32) -> i32; + fn wit_import0(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32) -> i32 { + unsafe extern "C" fn wit_import0(_: i32) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32); - super::super::super::wasi::io::poll::Pollable::from_handle(ret as u32) + let ret = unsafe { wit_import0((self).handle() as i32) }; + unsafe { + super::super::super::wasi::io::poll::Pollable::from_handle( + ret as u32, + ) + } } } } @@ -5987,540 +6397,569 @@ pub mod wasi { /// occured. Errors may also occur while consuming the response body, /// but those will be reported by the `incoming-body` and its /// `output-stream` child. - pub fn get(&self) -> Option, ()>> { + pub fn get( + &self, + ) -> Option, ()>> { unsafe { #[repr(align(8))] - struct RetArea([::core::mem::MaybeUninit; 56]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 56]); + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 40 + 4 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 40 + + 4 * ::core::mem::size_of::<*const u8>()], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]future-incoming-response.get"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result69 = match l2 { 0 => None, 1 => { let e = { - let l2 = i32::from(*ptr0.add(8).cast::()); - - match l2 { + let l3 = i32::from(*ptr0.add(8).cast::()); + match l3 { 0 => { let e = { - let l3 = i32::from(*ptr0.add(16).cast::()); - - match l3 { + let l4 = i32::from(*ptr0.add(16).cast::()); + match l4 { 0 => { let e = { - let l4 = *ptr0.add(24).cast::(); - - IncomingResponse::from_handle(l4 as u32) + let l5 = *ptr0.add(24).cast::(); + unsafe { IncomingResponse::from_handle(l5 as u32) } }; Ok(e) } 1 => { let e = { - let l5 = i32::from( - *ptr0.add(24).cast::(), - ); - let v67 = match l5 { - 0 => { - ErrorCode::DnsTimeout - } - 1 => { - let e67 = { - let l6 = i32::from(*ptr0.add(32).cast::()); - let l10 = i32::from(*ptr0.add(44).cast::()); - - DnsErrorPayload{ - rcode: match l6 { - 0 => None, - 1 => { - let e = { - let l7 = *ptr0.add(36).cast::<*mut u8>(); - let l8 = *ptr0.add(40).cast::(); - let len9 = l8; - let bytes9 = _rt::Vec::from_raw_parts(l7.cast(), len9, len9); - - _rt::string_lift(bytes9) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - info_code: match l10 { - 0 => None, - 1 => { - let e = { - let l11 = i32::from(*ptr0.add(46).cast::()); - - l11 as u16 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } - }; - ErrorCode::DnsError(e67) - } - 2 => { - ErrorCode::DestinationNotFound - } - 3 => { - ErrorCode::DestinationUnavailable - } - 4 => { - ErrorCode::DestinationIpProhibited - } - 5 => { - ErrorCode::DestinationIpUnroutable - } - 6 => { - ErrorCode::ConnectionRefused - } - 7 => { - ErrorCode::ConnectionTerminated - } - 8 => { - ErrorCode::ConnectionTimeout - } - 9 => { - ErrorCode::ConnectionReadTimeout - } - 10 => { - ErrorCode::ConnectionWriteTimeout - } - 11 => { - ErrorCode::ConnectionLimitReached - } - 12 => { - ErrorCode::TlsProtocolError - } - 13 => { - ErrorCode::TlsCertificateError - } - 14 => { - let e67 = { - let l12 = i32::from(*ptr0.add(32).cast::()); - let l14 = i32::from(*ptr0.add(36).cast::()); - - TlsAlertReceivedPayload{ - alert_id: match l12 { - 0 => None, - 1 => { - let e = { - let l13 = i32::from(*ptr0.add(33).cast::()); - - l13 as u8 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - alert_message: match l14 { - 0 => None, - 1 => { - let e = { - let l15 = *ptr0.add(40).cast::<*mut u8>(); - let l16 = *ptr0.add(44).cast::(); - let len17 = l16; - let bytes17 = _rt::Vec::from_raw_parts(l15.cast(), len17, len17); - - _rt::string_lift(bytes17) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } - }; - ErrorCode::TlsAlertReceived(e67) - } - 15 => { - ErrorCode::HttpRequestDenied - } - 16 => { - ErrorCode::HttpRequestLengthRequired - } - 17 => { - let e67 = { - let l18 = i32::from(*ptr0.add(32).cast::()); - - match l18 { - 0 => None, - 1 => { - let e = { - let l19 = *ptr0.add(40).cast::(); - - l19 as u64 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpRequestBodySize(e67) - } - 18 => { - ErrorCode::HttpRequestMethodInvalid - } - 19 => { - ErrorCode::HttpRequestUriInvalid - } - 20 => { - ErrorCode::HttpRequestUriTooLong - } - 21 => { - let e67 = { - let l20 = i32::from(*ptr0.add(32).cast::()); - - match l20 { - 0 => None, - 1 => { - let e = { - let l21 = *ptr0.add(36).cast::(); - - l21 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpRequestHeaderSectionSize(e67) - } - 22 => { - let e67 = { - let l22 = i32::from(*ptr0.add(32).cast::()); - - match l22 { - 0 => None, - 1 => { - let e = { - let l23 = i32::from(*ptr0.add(36).cast::()); - let l27 = i32::from(*ptr0.add(48).cast::()); - - FieldSizePayload{ - field_name: match l23 { - 0 => None, - 1 => { - let e = { - let l24 = *ptr0.add(40).cast::<*mut u8>(); - let l25 = *ptr0.add(44).cast::(); - let len26 = l25; - let bytes26 = _rt::Vec::from_raw_parts(l24.cast(), len26, len26); - - _rt::string_lift(bytes26) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - field_size: match l27 { - 0 => None, - 1 => { - let e = { - let l28 = *ptr0.add(52).cast::(); - - l28 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpRequestHeaderSize(e67) - } - 23 => { - let e67 = { - let l29 = i32::from(*ptr0.add(32).cast::()); - - match l29 { - 0 => None, - 1 => { - let e = { - let l30 = *ptr0.add(36).cast::(); - - l30 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpRequestTrailerSectionSize(e67) - } - 24 => { - let e67 = { - let l31 = i32::from(*ptr0.add(32).cast::()); - let l35 = i32::from(*ptr0.add(44).cast::()); - - FieldSizePayload{ - field_name: match l31 { - 0 => None, - 1 => { - let e = { - let l32 = *ptr0.add(36).cast::<*mut u8>(); - let l33 = *ptr0.add(40).cast::(); - let len34 = l33; - let bytes34 = _rt::Vec::from_raw_parts(l32.cast(), len34, len34); - - _rt::string_lift(bytes34) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - field_size: match l35 { - 0 => None, - 1 => { - let e = { - let l36 = *ptr0.add(48).cast::(); - - l36 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } - }; - ErrorCode::HttpRequestTrailerSize(e67) - } - 25 => { - ErrorCode::HttpResponseIncomplete - } - 26 => { - let e67 = { - let l37 = i32::from(*ptr0.add(32).cast::()); - - match l37 { - 0 => None, - 1 => { - let e = { - let l38 = *ptr0.add(36).cast::(); - - l38 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpResponseHeaderSectionSize(e67) - } - 27 => { - let e67 = { - let l39 = i32::from(*ptr0.add(32).cast::()); - let l43 = i32::from(*ptr0.add(44).cast::()); - - FieldSizePayload{ - field_name: match l39 { - 0 => None, - 1 => { - let e = { - let l40 = *ptr0.add(36).cast::<*mut u8>(); - let l41 = *ptr0.add(40).cast::(); - let len42 = l41; - let bytes42 = _rt::Vec::from_raw_parts(l40.cast(), len42, len42); - - _rt::string_lift(bytes42) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - field_size: match l43 { - 0 => None, - 1 => { - let e = { - let l44 = *ptr0.add(48).cast::(); - - l44 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } - }; - ErrorCode::HttpResponseHeaderSize(e67) - } - 28 => { - let e67 = { - let l45 = i32::from(*ptr0.add(32).cast::()); - - match l45 { - 0 => None, - 1 => { - let e = { - let l46 = *ptr0.add(40).cast::(); - - l46 as u64 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpResponseBodySize(e67) - } - 29 => { - let e67 = { - let l47 = i32::from(*ptr0.add(32).cast::()); - - match l47 { - 0 => None, - 1 => { - let e = { - let l48 = *ptr0.add(36).cast::(); - - l48 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpResponseTrailerSectionSize(e67) - } - 30 => { - let e67 = { - let l49 = i32::from(*ptr0.add(32).cast::()); - let l53 = i32::from(*ptr0.add(44).cast::()); - - FieldSizePayload{ - field_name: match l49 { - 0 => None, - 1 => { - let e = { - let l50 = *ptr0.add(36).cast::<*mut u8>(); - let l51 = *ptr0.add(40).cast::(); - let len52 = l51; - let bytes52 = _rt::Vec::from_raw_parts(l50.cast(), len52, len52); - - _rt::string_lift(bytes52) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - field_size: match l53 { - 0 => None, - 1 => { - let e = { - let l54 = *ptr0.add(48).cast::(); - - l54 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } - }; - ErrorCode::HttpResponseTrailerSize(e67) - } - 31 => { - let e67 = { - let l55 = i32::from(*ptr0.add(32).cast::()); - - match l55 { - 0 => None, - 1 => { - let e = { - let l56 = *ptr0.add(36).cast::<*mut u8>(); - let l57 = *ptr0.add(40).cast::(); - let len58 = l57; - let bytes58 = _rt::Vec::from_raw_parts(l56.cast(), len58, len58); - - _rt::string_lift(bytes58) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpResponseTransferCoding(e67) - } - 32 => { - let e67 = { - let l59 = i32::from(*ptr0.add(32).cast::()); - - match l59 { - 0 => None, - 1 => { - let e = { - let l60 = *ptr0.add(36).cast::<*mut u8>(); - let l61 = *ptr0.add(40).cast::(); - let len62 = l61; - let bytes62 = _rt::Vec::from_raw_parts(l60.cast(), len62, len62); - - _rt::string_lift(bytes62) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpResponseContentCoding(e67) - } - 33 => { - ErrorCode::HttpResponseTimeout - } - 34 => { - ErrorCode::HttpUpgradeFailed - } - 35 => { - ErrorCode::HttpProtocolError - } - 36 => { - ErrorCode::LoopDetected - } - 37 => { - ErrorCode::ConfigurationError - } - n => { - debug_assert_eq!(n, 38, "invalid enum discriminant"); - let e67 = { - let l63 = i32::from(*ptr0.add(32).cast::()); - - match l63 { - 0 => None, - 1 => { - let e = { - let l64 = *ptr0.add(36).cast::<*mut u8>(); - let l65 = *ptr0.add(40).cast::(); - let len66 = l65; - let bytes66 = _rt::Vec::from_raw_parts(l64.cast(), len66, len66); - - _rt::string_lift(bytes66) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::InternalError(e67) - } - }; - - v67 + let l6 = i32::from(*ptr0.add(24).cast::()); + let v68 = match l6 { + 0 => ErrorCode::DnsTimeout, + 1 => { + let e68 = { + let l7 = i32::from(*ptr0.add(32).cast::()); + let l11 = i32::from( + *ptr0 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + DnsErrorPayload { + rcode: match l7 { + 0 => None, + 1 => { + let e = { + let l8 = *ptr0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l9 = *ptr0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len10 = l9; + let bytes10 = _rt::Vec::from_raw_parts( + l8.cast(), + len10, + len10, + ); + _rt::string_lift(bytes10) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + info_code: match l11 { + 0 => None, + 1 => { + let e = { + let l12 = i32::from( + *ptr0 + .add(34 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + l12 as u16 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } + }; + ErrorCode::DnsError(e68) + } + 2 => ErrorCode::DestinationNotFound, + 3 => ErrorCode::DestinationUnavailable, + 4 => ErrorCode::DestinationIpProhibited, + 5 => ErrorCode::DestinationIpUnroutable, + 6 => ErrorCode::ConnectionRefused, + 7 => ErrorCode::ConnectionTerminated, + 8 => ErrorCode::ConnectionTimeout, + 9 => ErrorCode::ConnectionReadTimeout, + 10 => ErrorCode::ConnectionWriteTimeout, + 11 => ErrorCode::ConnectionLimitReached, + 12 => ErrorCode::TlsProtocolError, + 13 => ErrorCode::TlsCertificateError, + 14 => { + let e68 = { + let l13 = i32::from(*ptr0.add(32).cast::()); + let l15 = i32::from( + *ptr0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + TlsAlertReceivedPayload { + alert_id: match l13 { + 0 => None, + 1 => { + let e = { + let l14 = i32::from(*ptr0.add(33).cast::()); + l14 as u8 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + alert_message: match l15 { + 0 => None, + 1 => { + let e = { + let l16 = *ptr0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l17 = *ptr0 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len18 = l17; + let bytes18 = _rt::Vec::from_raw_parts( + l16.cast(), + len18, + len18, + ); + _rt::string_lift(bytes18) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } + }; + ErrorCode::TlsAlertReceived(e68) + } + 15 => ErrorCode::HttpRequestDenied, + 16 => ErrorCode::HttpRequestLengthRequired, + 17 => { + let e68 = { + let l19 = i32::from(*ptr0.add(32).cast::()); + match l19 { + 0 => None, + 1 => { + let e = { + let l20 = *ptr0.add(40).cast::(); + l20 as u64 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpRequestBodySize(e68) + } + 18 => ErrorCode::HttpRequestMethodInvalid, + 19 => ErrorCode::HttpRequestUriInvalid, + 20 => ErrorCode::HttpRequestUriTooLong, + 21 => { + let e68 = { + let l21 = i32::from(*ptr0.add(32).cast::()); + match l21 { + 0 => None, + 1 => { + let e = { + let l22 = *ptr0.add(36).cast::(); + l22 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpRequestHeaderSectionSize(e68) + } + 22 => { + let e68 = { + let l23 = i32::from(*ptr0.add(32).cast::()); + match l23 { + 0 => None, + 1 => { + let e = { + let l24 = i32::from( + *ptr0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + let l28 = i32::from( + *ptr0 + .add(32 + 4 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + FieldSizePayload { + field_name: match l24 { + 0 => None, + 1 => { + let e = { + let l25 = *ptr0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l26 = *ptr0 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len27 = l26; + let bytes27 = _rt::Vec::from_raw_parts( + l25.cast(), + len27, + len27, + ); + _rt::string_lift(bytes27) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + field_size: match l28 { + 0 => None, + 1 => { + let e = { + let l29 = *ptr0 + .add(36 + 4 * ::core::mem::size_of::<*const u8>()) + .cast::(); + l29 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpRequestHeaderSize(e68) + } + 23 => { + let e68 = { + let l30 = i32::from(*ptr0.add(32).cast::()); + match l30 { + 0 => None, + 1 => { + let e = { + let l31 = *ptr0.add(36).cast::(); + l31 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpRequestTrailerSectionSize(e68) + } + 24 => { + let e68 = { + let l32 = i32::from(*ptr0.add(32).cast::()); + let l36 = i32::from( + *ptr0 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + FieldSizePayload { + field_name: match l32 { + 0 => None, + 1 => { + let e = { + let l33 = *ptr0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l34 = *ptr0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len35 = l34; + let bytes35 = _rt::Vec::from_raw_parts( + l33.cast(), + len35, + len35, + ); + _rt::string_lift(bytes35) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + field_size: match l36 { + 0 => None, + 1 => { + let e = { + let l37 = *ptr0 + .add(36 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + l37 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } + }; + ErrorCode::HttpRequestTrailerSize(e68) + } + 25 => ErrorCode::HttpResponseIncomplete, + 26 => { + let e68 = { + let l38 = i32::from(*ptr0.add(32).cast::()); + match l38 { + 0 => None, + 1 => { + let e = { + let l39 = *ptr0.add(36).cast::(); + l39 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpResponseHeaderSectionSize(e68) + } + 27 => { + let e68 = { + let l40 = i32::from(*ptr0.add(32).cast::()); + let l44 = i32::from( + *ptr0 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + FieldSizePayload { + field_name: match l40 { + 0 => None, + 1 => { + let e = { + let l41 = *ptr0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l42 = *ptr0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len43 = l42; + let bytes43 = _rt::Vec::from_raw_parts( + l41.cast(), + len43, + len43, + ); + _rt::string_lift(bytes43) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + field_size: match l44 { + 0 => None, + 1 => { + let e = { + let l45 = *ptr0 + .add(36 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + l45 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } + }; + ErrorCode::HttpResponseHeaderSize(e68) + } + 28 => { + let e68 = { + let l46 = i32::from(*ptr0.add(32).cast::()); + match l46 { + 0 => None, + 1 => { + let e = { + let l47 = *ptr0.add(40).cast::(); + l47 as u64 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpResponseBodySize(e68) + } + 29 => { + let e68 = { + let l48 = i32::from(*ptr0.add(32).cast::()); + match l48 { + 0 => None, + 1 => { + let e = { + let l49 = *ptr0.add(36).cast::(); + l49 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpResponseTrailerSectionSize(e68) + } + 30 => { + let e68 = { + let l50 = i32::from(*ptr0.add(32).cast::()); + let l54 = i32::from( + *ptr0 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + FieldSizePayload { + field_name: match l50 { + 0 => None, + 1 => { + let e = { + let l51 = *ptr0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l52 = *ptr0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len53 = l52; + let bytes53 = _rt::Vec::from_raw_parts( + l51.cast(), + len53, + len53, + ); + _rt::string_lift(bytes53) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + field_size: match l54 { + 0 => None, + 1 => { + let e = { + let l55 = *ptr0 + .add(36 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + l55 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } + }; + ErrorCode::HttpResponseTrailerSize(e68) + } + 31 => { + let e68 = { + let l56 = i32::from(*ptr0.add(32).cast::()); + match l56 { + 0 => None, + 1 => { + let e = { + let l57 = *ptr0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l58 = *ptr0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len59 = l58; + let bytes59 = _rt::Vec::from_raw_parts( + l57.cast(), + len59, + len59, + ); + _rt::string_lift(bytes59) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpResponseTransferCoding(e68) + } + 32 => { + let e68 = { + let l60 = i32::from(*ptr0.add(32).cast::()); + match l60 { + 0 => None, + 1 => { + let e = { + let l61 = *ptr0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l62 = *ptr0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len63 = l62; + let bytes63 = _rt::Vec::from_raw_parts( + l61.cast(), + len63, + len63, + ); + _rt::string_lift(bytes63) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpResponseContentCoding(e68) + } + 33 => ErrorCode::HttpResponseTimeout, + 34 => ErrorCode::HttpUpgradeFailed, + 35 => ErrorCode::HttpProtocolError, + 36 => ErrorCode::LoopDetected, + 37 => ErrorCode::ConfigurationError, + n => { + debug_assert_eq!(n, 38, "invalid enum discriminant"); + let e68 = { + let l64 = i32::from(*ptr0.add(32).cast::()); + match l64 { + 0 => None, + 1 => { + let e = { + let l65 = *ptr0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l66 = *ptr0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len67 = l66; + let bytes67 = _rt::Vec::from_raw_parts( + l65.cast(), + len67, + len67, + ); + _rt::string_lift(bytes67) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::InternalError(e68) + } + }; + v68 }; Err(e) } @@ -6539,68 +6978,60 @@ pub mod wasi { Some(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result69 } } } } } - #[allow(dead_code)] pub mod io { - #[allow(dead_code, clippy::all)] + /// A poll API intended to let users wait for I/O events on multiple handles + /// at once. + #[allow(dead_code, async_fn_in_trait, unused_imports, 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` represents 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 { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]pollable"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - impl Pollable { #[allow(unused_unsafe, clippy::all)] /// Return the readiness of a pollable. This function never blocks. @@ -6610,16 +7041,15 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/poll@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]pollable.ready"] - fn wit_import(_: i32) -> i32; + fn wit_import0(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32) -> i32 { + unsafe extern "C" fn wit_import0(_: i32) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32); + let ret = unsafe { wit_import0((self).handle() as i32) }; _rt::bool_lift(ret as u8) } } @@ -6631,20 +7061,19 @@ pub mod wasi { /// /// This function is equivalent to calling `poll.poll` on a list /// containing only this pollable. - pub fn block(&self) { + pub fn block(&self) -> () { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/poll@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]pollable.block"] - fn wit_import(_: i32); + fn wit_import0(_: i32); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32) { + unsafe extern "C" fn wit_import0(_: i32) { unreachable!() } - wit_import((self).handle() as i32); + unsafe { wit_import0((self).handle() as i32) }; } } } @@ -6669,12 +7098,23 @@ pub mod wasi { /// being reaedy for I/O. pub fn poll(in_: &[&Pollable]) -> _rt::Vec { unsafe { - #[repr(align(4))] - struct RetArea([::core::mem::MaybeUninit; 8]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 2 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 2 + * ::core::mem::size_of::<*const u8>()], + ); 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() { @@ -6682,9 +7122,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); @@ -6695,34 +7133,33 @@ pub mod wasi { let ptr1 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/poll@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "poll"] - fn wit_import(_: *mut u8, _: usize, _: *mut u8); + fn wit_import2(_: *mut u8, _: usize, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: *mut u8, _: usize, _: *mut u8) { + unsafe extern "C" fn wit_import2(_: *mut u8, _: usize, _: *mut u8) { unreachable!() } - wit_import(result0, len0, ptr1); - let l2 = *ptr1.add(0).cast::<*mut u8>(); - let l3 = *ptr1.add(4).cast::(); - let len4 = l3; + unsafe { wit_import2(result0, len0, ptr1) }; + let l3 = *ptr1.add(0).cast::<*mut u8>(); + let l4 = *ptr1 + .add(::core::mem::size_of::<*const u8>()) + .cast::(); + let len5 = l4; + let result6 = _rt::Vec::from_raw_parts(l3.cast(), len5, len5); if layout0.size() != 0 { _rt::alloc::dealloc(result0.cast(), layout0); } - _rt::Vec::from_raw_parts(l2.cast(), len4, len4) + result6 } } } - - #[allow(dead_code, clippy::all)] + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod error { #[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; /// A resource which represents some error information. /// @@ -6743,51 +7180,43 @@ pub mod wasi { /// /// The set of functions which can "downcast" an `error` into a more /// concrete type is open. - #[derive(Debug)] #[repr(transparent)] pub struct Error { handle: _rt::Resource, } - impl Error { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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 Error { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:io/error@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]error"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - impl Error { #[allow(unused_unsafe, clippy::all)] /// Returns a string that is suitable to assist humans in debugging @@ -6799,39 +7228,51 @@ pub mod wasi { /// hazard. pub fn to_debug_string(&self) -> _rt::String { unsafe { - #[repr(align(4))] - struct RetArea([::core::mem::MaybeUninit; 8]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 2 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 2 + * ::core::mem::size_of::<*const u8>()], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/error@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]error.to-debug-string"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = *ptr0.add(0).cast::<*mut u8>(); - let l2 = *ptr0.add(4).cast::(); - let len3 = l2; - let bytes3 = _rt::Vec::from_raw_parts(l1.cast(), len3, len3); - _rt::string_lift(bytes3) + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = *ptr0.add(0).cast::<*mut u8>(); + let l3 = *ptr0 + .add(::core::mem::size_of::<*const u8>()) + .cast::(); + let len4 = l3; + let bytes4 = _rt::Vec::from_raw_parts(l2.cast(), len4, len4); + let result5 = _rt::string_lift(bytes4); + result5 } } } } - - #[allow(dead_code, clippy::all)] + /// WASI I/O is an I/O abstraction API which is currently focused on providing + /// stream types. + /// + /// In the future, the component model is expected to add built-in stream types; + /// when it does, they are expected to subsume this API. + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod streams { #[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 Error = super::super::super::wasi::io::error::Error; pub type Pollable = super::super::super::wasi::io::poll::Pollable; @@ -6847,22 +7288,30 @@ pub mod wasi { Closed, } impl ::core::fmt::Debug for StreamError { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { - StreamError::LastOperationFailed(e) => f - .debug_tuple("StreamError::LastOperationFailed") - .field(e) - .finish(), - StreamError::Closed => f.debug_tuple("StreamError::Closed").finish(), + StreamError::LastOperationFailed(e) => { + f.debug_tuple("StreamError::LastOperationFailed") + .field(e) + .finish() + } + StreamError::Closed => { + f.debug_tuple("StreamError::Closed").finish() + } } } } impl ::core::fmt::Display for StreamError { - 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 StreamError {} /// An input bytestream. /// @@ -6872,51 +7321,43 @@ pub mod wasi { /// available, which could even be zero. To wait for data to be available, /// use the `subscribe` function to obtain a `pollable` which can be polled /// for using `wasi:io/poll`. - #[derive(Debug)] #[repr(transparent)] pub struct InputStream { handle: _rt::Resource, } - impl InputStream { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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 InputStream { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:io/streams@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]input-stream"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - /// An output bytestream. /// /// `output-stream`s are *non-blocking* to the extent practical on @@ -6925,51 +7366,43 @@ pub mod wasi { /// promptly, which could even be zero. To wait for the stream to be ready to /// accept data, the `subscribe` function to obtain a `pollable` which can be /// polled for using `wasi:io/poll`. - #[derive(Debug)] #[repr(transparent)] pub struct OutputStream { handle: _rt::Resource, } - impl OutputStream { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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 OutputStream { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:io/streams@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]output-stream"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - impl InputStream { #[allow(unused_unsafe, clippy::all)] /// Perform a non-blocking read from the stream. @@ -7000,58 +7433,77 @@ pub mod wasi { /// less than `len` in size while more bytes are available for reading. pub fn read(&self, len: u64) -> Result<_rt::Vec, StreamError> { unsafe { - #[repr(align(4))] - struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 3 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 3 + * ::core::mem::size_of::<*const u8>()], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]input-stream.read"] - fn wit_import(_: i32, _: i64, _: *mut u8); + fn wit_import1(_: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: i64, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: i64, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, _rt::as_i64(&len), ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { + wit_import1((self).handle() as i32, _rt::as_i64(&len), ptr0) + }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result9 = match l2 { 0 => { let e = { - let l2 = *ptr0.add(4).cast::<*mut u8>(); - let l3 = *ptr0.add(8).cast::(); - let len4 = l3; - - _rt::Vec::from_raw_parts(l2.cast(), len4, len4) + let l3 = *ptr0 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l4 = *ptr0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len5 = l4; + _rt::Vec::from_raw_parts(l3.cast(), len5, len5) }; Ok(e) } 1 => { let e = { - let l5 = i32::from(*ptr0.add(4).cast::()); - let v7 = match l5 { + let l6 = i32::from( + *ptr0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); + let v8 = match l6 { 0 => { - let e7 = { - let l6 = *ptr0.add(8).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l6 as u32) + let e8 = { + let l7 = *ptr0 + .add(4 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(); + unsafe { + super::super::super::wasi::io::error::Error::from_handle( + l7 as u32, + ) + } }; - StreamError::LastOperationFailed(e7) + StreamError::LastOperationFailed(e8) } n => { debug_assert_eq!(n, 1, "invalid enum discriminant"); StreamError::Closed } }; - - v7 + v8 }; Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result9 } } } @@ -7059,60 +7511,82 @@ pub mod wasi { #[allow(unused_unsafe, clippy::all)] /// Read bytes from a stream, after blocking until at least one byte can /// be read. Except for blocking, behavior is identical to `read`. - pub fn blocking_read(&self, len: u64) -> Result<_rt::Vec, StreamError> { + pub fn blocking_read( + &self, + len: u64, + ) -> Result<_rt::Vec, StreamError> { unsafe { - #[repr(align(4))] - struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 3 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 3 + * ::core::mem::size_of::<*const u8>()], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]input-stream.blocking-read"] - fn wit_import(_: i32, _: i64, _: *mut u8); + fn wit_import1(_: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: i64, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: i64, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, _rt::as_i64(&len), ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { + wit_import1((self).handle() as i32, _rt::as_i64(&len), ptr0) + }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result9 = match l2 { 0 => { let e = { - let l2 = *ptr0.add(4).cast::<*mut u8>(); - let l3 = *ptr0.add(8).cast::(); - let len4 = l3; - - _rt::Vec::from_raw_parts(l2.cast(), len4, len4) + let l3 = *ptr0 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l4 = *ptr0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let len5 = l4; + _rt::Vec::from_raw_parts(l3.cast(), len5, len5) }; Ok(e) } 1 => { let e = { - let l5 = i32::from(*ptr0.add(4).cast::()); - let v7 = match l5 { + let l6 = i32::from( + *ptr0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); + let v8 = match l6 { 0 => { - let e7 = { - let l6 = *ptr0.add(8).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l6 as u32) + let e8 = { + let l7 = *ptr0 + .add(4 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(); + unsafe { + super::super::super::wasi::io::error::Error::from_handle( + l7 as u32, + ) + } }; - StreamError::LastOperationFailed(e7) + StreamError::LastOperationFailed(e8) } n => { debug_assert_eq!(n, 1, "invalid enum discriminant"); StreamError::Closed } }; - - v7 + v8 }; Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result9 } } } @@ -7126,54 +7600,59 @@ pub mod wasi { unsafe { #[repr(align(8))] 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]input-stream.skip"] - fn wit_import(_: i32, _: i64, _: *mut u8); + fn wit_import1(_: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: i64, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: i64, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, _rt::as_i64(&len), ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { + wit_import1((self).handle() as i32, _rt::as_i64(&len), ptr0) + }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result7 = match l2 { 0 => { let e = { - let l2 = *ptr0.add(8).cast::(); - - l2 as u64 + let l3 = *ptr0.add(8).cast::(); + l3 as u64 }; Ok(e) } 1 => { let e = { - let l3 = i32::from(*ptr0.add(8).cast::()); - let v5 = match l3 { + let l4 = i32::from(*ptr0.add(8).cast::()); + let v6 = match l4 { 0 => { - let e5 = { - let l4 = *ptr0.add(12).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l4 as u32) + let e6 = { + let l5 = *ptr0.add(12).cast::(); + unsafe { + super::super::super::wasi::io::error::Error::from_handle( + l5 as u32, + ) + } }; - StreamError::LastOperationFailed(e5) + StreamError::LastOperationFailed(e6) } n => { debug_assert_eq!(n, 1, "invalid enum discriminant"); StreamError::Closed } }; - - v5 + v6 }; Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result7 } } } @@ -7185,54 +7664,59 @@ pub mod wasi { unsafe { #[repr(align(8))] 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]input-stream.blocking-skip"] - fn wit_import(_: i32, _: i64, _: *mut u8); + fn wit_import1(_: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: i64, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: i64, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, _rt::as_i64(&len), ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { + wit_import1((self).handle() as i32, _rt::as_i64(&len), ptr0) + }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result7 = match l2 { 0 => { let e = { - let l2 = *ptr0.add(8).cast::(); - - l2 as u64 + let l3 = *ptr0.add(8).cast::(); + l3 as u64 }; Ok(e) } 1 => { let e = { - let l3 = i32::from(*ptr0.add(8).cast::()); - let v5 = match l3 { + let l4 = i32::from(*ptr0.add(8).cast::()); + let v6 = match l4 { 0 => { - let e5 = { - let l4 = *ptr0.add(12).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l4 as u32) + let e6 = { + let l5 = *ptr0.add(12).cast::(); + unsafe { + super::super::super::wasi::io::error::Error::from_handle( + l5 as u32, + ) + } }; - StreamError::LastOperationFailed(e5) + StreamError::LastOperationFailed(e6) } n => { debug_assert_eq!(n, 1, "invalid enum discriminant"); StreamError::Closed } }; - - v5 + v6 }; Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result7 } } } @@ -7248,17 +7732,20 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]input-stream.subscribe"] - fn wit_import(_: i32) -> i32; + fn wit_import0(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32) -> i32 { + unsafe extern "C" fn wit_import0(_: i32) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32); - super::super::super::wasi::io::poll::Pollable::from_handle(ret as u32) + let ret = unsafe { wit_import0((self).handle() as i32) }; + unsafe { + super::super::super::wasi::io::poll::Pollable::from_handle( + ret as u32, + ) + } } } } @@ -7277,54 +7764,57 @@ pub mod wasi { unsafe { #[repr(align(8))] 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]output-stream.check-write"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result7 = match l2 { 0 => { let e = { - let l2 = *ptr0.add(8).cast::(); - - l2 as u64 + let l3 = *ptr0.add(8).cast::(); + l3 as u64 }; Ok(e) } 1 => { let e = { - let l3 = i32::from(*ptr0.add(8).cast::()); - let v5 = match l3 { + let l4 = i32::from(*ptr0.add(8).cast::()); + let v6 = match l4 { 0 => { - let e5 = { - let l4 = *ptr0.add(12).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l4 as u32) + let e6 = { + let l5 = *ptr0.add(12).cast::(); + unsafe { + super::super::super::wasi::io::error::Error::from_handle( + l5 as u32, + ) + } }; - StreamError::LastOperationFailed(e5) + StreamError::LastOperationFailed(e6) } n => { debug_assert_eq!(n, 1, "invalid enum discriminant"); StreamError::Closed } }; - - v5 + v6 }; Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result7 } } } @@ -7347,53 +7837,69 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 12], + ); let vec0 = contents; let ptr0 = vec0.as_ptr().cast::(); let len0 = vec0.len(); let ptr1 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]output-stream.write"] - fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8); + fn wit_import2(_: i32, _: *mut u8, _: usize, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8) { + unsafe extern "C" fn wit_import2( + _: i32, + _: *mut u8, + _: usize, + _: *mut u8, + ) { unreachable!() } - wit_import((self).handle() as i32, ptr0.cast_mut(), len0, ptr1); - let l2 = i32::from(*ptr1.add(0).cast::()); - match l2 { + unsafe { + wit_import2( + (self).handle() as i32, + ptr0.cast_mut(), + len0, + ptr1, + ) + }; + let l3 = i32::from(*ptr1.add(0).cast::()); + let result7 = match l3 { 0 => { let e = (); Ok(e) } 1 => { let e = { - let l3 = i32::from(*ptr1.add(4).cast::()); - let v5 = match l3 { + let l4 = i32::from(*ptr1.add(4).cast::()); + let v6 = match l4 { 0 => { - let e5 = { - let l4 = *ptr1.add(8).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l4 as u32) + let e6 = { + let l5 = *ptr1.add(8).cast::(); + unsafe { + super::super::super::wasi::io::error::Error::from_handle( + l5 as u32, + ) + } }; - StreamError::LastOperationFailed(e5) + StreamError::LastOperationFailed(e6) } n => { debug_assert_eq!(n, 1, "invalid enum discriminant"); StreamError::Closed } }; - - v5 + v6 }; Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result7 } } } @@ -7409,13 +7915,13 @@ pub mod wasi { /// ```text /// let pollable = this.subscribe(); /// while !contents.is_empty() { - /// // Wait for the stream to become writable - /// pollable.block(); - /// let Ok(n) = this.check-write(); // eliding error handling - /// let len = min(n, contents.len()); - /// let (chunk, rest) = contents.split_at(len); - /// this.write(chunk ); // eliding error handling - /// contents = rest; + /// // Wait for the stream to become writable + /// pollable.block(); + /// let Ok(n) = this.check-write(); // eliding error handling + /// let len = min(n, contents.len()); + /// let (chunk, rest) = contents.split_at(len); + /// this.write(chunk ); // eliding error handling + /// contents = rest; /// } /// this.flush(); /// // Wait for completion of `flush` @@ -7423,57 +7929,76 @@ pub mod wasi { /// // Check for any errors that arose during `flush` /// let _ = this.check-write(); // eliding error handling /// ``` - pub fn blocking_write_and_flush(&self, contents: &[u8]) -> Result<(), StreamError> { + pub fn blocking_write_and_flush( + &self, + contents: &[u8], + ) -> Result<(), StreamError> { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 12], + ); let vec0 = contents; let ptr0 = vec0.as_ptr().cast::(); let len0 = vec0.len(); let ptr1 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]output-stream.blocking-write-and-flush"] - fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8); + fn wit_import2(_: i32, _: *mut u8, _: usize, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8) { + unsafe extern "C" fn wit_import2( + _: i32, + _: *mut u8, + _: usize, + _: *mut u8, + ) { unreachable!() } - wit_import((self).handle() as i32, ptr0.cast_mut(), len0, ptr1); - let l2 = i32::from(*ptr1.add(0).cast::()); - match l2 { + unsafe { + wit_import2( + (self).handle() as i32, + ptr0.cast_mut(), + len0, + ptr1, + ) + }; + let l3 = i32::from(*ptr1.add(0).cast::()); + let result7 = match l3 { 0 => { let e = (); Ok(e) } 1 => { let e = { - let l3 = i32::from(*ptr1.add(4).cast::()); - let v5 = match l3 { + let l4 = i32::from(*ptr1.add(4).cast::()); + let v6 = match l4 { 0 => { - let e5 = { - let l4 = *ptr1.add(8).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l4 as u32) + let e6 = { + let l5 = *ptr1.add(8).cast::(); + unsafe { + super::super::super::wasi::io::error::Error::from_handle( + l5 as u32, + ) + } }; - StreamError::LastOperationFailed(e5) + StreamError::LastOperationFailed(e6) } n => { debug_assert_eq!(n, 1, "invalid enum discriminant"); StreamError::Closed } }; - - v5 + v6 }; Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result7 } } } @@ -7493,50 +8018,54 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 12], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]output-stream.flush"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result6 = match l2 { 0 => { let e = (); Ok(e) } 1 => { let e = { - let l2 = i32::from(*ptr0.add(4).cast::()); - let v4 = match l2 { + let l3 = i32::from(*ptr0.add(4).cast::()); + let v5 = match l3 { 0 => { - let e4 = { - let l3 = *ptr0.add(8).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l3 as u32) + let e5 = { + let l4 = *ptr0.add(8).cast::(); + unsafe { + super::super::super::wasi::io::error::Error::from_handle( + l4 as u32, + ) + } }; - StreamError::LastOperationFailed(e4) + StreamError::LastOperationFailed(e5) } n => { debug_assert_eq!(n, 1, "invalid enum discriminant"); StreamError::Closed } }; - - v4 + v5 }; Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result6 } } } @@ -7548,50 +8077,54 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 12], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]output-stream.blocking-flush"] - fn wit_import(_: i32, _: *mut u8); + fn wit_import1(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { wit_import1((self).handle() as i32, ptr0) }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result6 = match l2 { 0 => { let e = (); Ok(e) } 1 => { let e = { - let l2 = i32::from(*ptr0.add(4).cast::()); - let v4 = match l2 { + let l3 = i32::from(*ptr0.add(4).cast::()); + let v5 = match l3 { 0 => { - let e4 = { - let l3 = *ptr0.add(8).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l3 as u32) + let e5 = { + let l4 = *ptr0.add(8).cast::(); + unsafe { + super::super::super::wasi::io::error::Error::from_handle( + l4 as u32, + ) + } }; - StreamError::LastOperationFailed(e4) + StreamError::LastOperationFailed(e5) } n => { debug_assert_eq!(n, 1, "invalid enum discriminant"); StreamError::Closed } }; - - v4 + v5 }; Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result6 } } } @@ -7611,17 +8144,20 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]output-stream.subscribe"] - fn wit_import(_: i32) -> i32; + fn wit_import0(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32) -> i32 { + unsafe extern "C" fn wit_import0(_: i32) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32); - super::super::super::wasi::io::poll::Pollable::from_handle(ret as u32) + let ret = unsafe { wit_import0((self).handle() as i32) }; + unsafe { + super::super::super::wasi::io::poll::Pollable::from_handle( + ret as u32, + ) + } } } } @@ -7637,50 +8173,56 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 12], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]output-stream.write-zeroes"] - fn wit_import(_: i32, _: i64, _: *mut u8); + fn wit_import1(_: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: i64, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: i64, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, _rt::as_i64(&len), ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { + wit_import1((self).handle() as i32, _rt::as_i64(&len), ptr0) + }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result6 = match l2 { 0 => { let e = (); Ok(e) } 1 => { let e = { - let l2 = i32::from(*ptr0.add(4).cast::()); - let v4 = match l2 { + let l3 = i32::from(*ptr0.add(4).cast::()); + let v5 = match l3 { 0 => { - let e4 = { - let l3 = *ptr0.add(8).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l3 as u32) + let e5 = { + let l4 = *ptr0.add(8).cast::(); + unsafe { + super::super::super::wasi::io::error::Error::from_handle( + l4 as u32, + ) + } }; - StreamError::LastOperationFailed(e4) + StreamError::LastOperationFailed(e5) } n => { debug_assert_eq!(n, 1, "invalid enum discriminant"); StreamError::Closed } }; - - v4 + v5 }; Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result6 } } } @@ -7697,12 +8239,12 @@ pub mod wasi { /// ```text /// let pollable = this.subscribe(); /// while num_zeroes != 0 { - /// // Wait for the stream to become writable - /// pollable.block(); - /// let Ok(n) = this.check-write(); // eliding error handling - /// let len = min(n, num_zeroes); - /// this.write-zeroes(len); // eliding error handling - /// num_zeroes -= len; + /// // Wait for the stream to become writable + /// pollable.block(); + /// let Ok(n) = this.check-write(); // eliding error handling + /// let len = min(n, num_zeroes); + /// this.write-zeroes(len); // eliding error handling + /// num_zeroes -= len; /// } /// this.flush(); /// // Wait for completion of `flush` @@ -7710,54 +8252,63 @@ pub mod wasi { /// // Check for any errors that arose during `flush` /// let _ = this.check-write(); // eliding error handling /// ``` - pub fn blocking_write_zeroes_and_flush(&self, len: u64) -> Result<(), StreamError> { + pub fn blocking_write_zeroes_and_flush( + &self, + len: u64, + ) -> Result<(), StreamError> { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 12], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]output-stream.blocking-write-zeroes-and-flush"] - fn wit_import(_: i32, _: i64, _: *mut u8); + fn wit_import1(_: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: i64, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i32, _: i64, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, _rt::as_i64(&len), ptr0); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { + wit_import1((self).handle() as i32, _rt::as_i64(&len), ptr0) + }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result6 = match l2 { 0 => { let e = (); Ok(e) } 1 => { let e = { - let l2 = i32::from(*ptr0.add(4).cast::()); - let v4 = match l2 { + let l3 = i32::from(*ptr0.add(4).cast::()); + let v5 = match l3 { 0 => { - let e4 = { - let l3 = *ptr0.add(8).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l3 as u32) + let e5 = { + let l4 = *ptr0.add(8).cast::(); + unsafe { + super::super::super::wasi::io::error::Error::from_handle( + l4 as u32, + ) + } }; - StreamError::LastOperationFailed(e4) + StreamError::LastOperationFailed(e5) } n => { debug_assert_eq!(n, 1, "invalid enum discriminant"); StreamError::Closed } }; - - v4 + v5 }; Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result6 } } } @@ -7776,63 +8327,77 @@ pub mod wasi { /// /// This function returns the number of bytes transferred; it may be less /// than `len`. - pub fn splice(&self, src: &InputStream, len: u64) -> Result { + pub fn splice( + &self, + src: &InputStream, + len: u64, + ) -> Result { unsafe { #[repr(align(8))] 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]output-stream.splice"] - fn wit_import(_: i32, _: i32, _: i64, _: *mut u8); + fn wit_import1(_: i32, _: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: i32, _: i64, _: *mut u8) { + unsafe extern "C" fn wit_import1( + _: i32, + _: i32, + _: i64, + _: *mut u8, + ) { unreachable!() } - wit_import( - (self).handle() as i32, - (src).handle() as i32, - _rt::as_i64(&len), - ptr0, - ); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { + wit_import1( + (self).handle() as i32, + (src).handle() as i32, + _rt::as_i64(&len), + ptr0, + ) + }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result7 = match l2 { 0 => { let e = { - let l2 = *ptr0.add(8).cast::(); - - l2 as u64 + let l3 = *ptr0.add(8).cast::(); + l3 as u64 }; Ok(e) } 1 => { let e = { - let l3 = i32::from(*ptr0.add(8).cast::()); - let v5 = match l3 { + let l4 = i32::from(*ptr0.add(8).cast::()); + let v6 = match l4 { 0 => { - let e5 = { - let l4 = *ptr0.add(12).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l4 as u32) + let e6 = { + let l5 = *ptr0.add(12).cast::(); + unsafe { + super::super::super::wasi::io::error::Error::from_handle( + l5 as u32, + ) + } }; - StreamError::LastOperationFailed(e5) + StreamError::LastOperationFailed(e6) } n => { debug_assert_eq!(n, 1, "invalid enum discriminant"); StreamError::Closed } }; - - v5 + v6 }; Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result7 } } } @@ -7851,73 +8416,84 @@ pub mod wasi { unsafe { #[repr(align(8))] 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[method]output-stream.blocking-splice"] - fn wit_import(_: i32, _: i32, _: i64, _: *mut u8); + fn wit_import1(_: i32, _: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: i32, _: i64, _: *mut u8) { + unsafe extern "C" fn wit_import1( + _: i32, + _: i32, + _: i64, + _: *mut u8, + ) { unreachable!() } - wit_import( - (self).handle() as i32, - (src).handle() as i32, - _rt::as_i64(&len), - ptr0, - ); - let l1 = i32::from(*ptr0.add(0).cast::()); - match l1 { + unsafe { + wit_import1( + (self).handle() as i32, + (src).handle() as i32, + _rt::as_i64(&len), + ptr0, + ) + }; + let l2 = i32::from(*ptr0.add(0).cast::()); + let result7 = match l2 { 0 => { let e = { - let l2 = *ptr0.add(8).cast::(); - - l2 as u64 + let l3 = *ptr0.add(8).cast::(); + l3 as u64 }; Ok(e) } 1 => { let e = { - let l3 = i32::from(*ptr0.add(8).cast::()); - let v5 = match l3 { + let l4 = i32::from(*ptr0.add(8).cast::()); + let v6 = match l4 { 0 => { - let e5 = { - let l4 = *ptr0.add(12).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l4 as u32) + let e6 = { + let l5 = *ptr0.add(12).cast::(); + unsafe { + super::super::super::wasi::io::error::Error::from_handle( + l5 as u32, + ) + } }; - StreamError::LastOperationFailed(e5) + StreamError::LastOperationFailed(e6) } n => { debug_assert_eq!(n, 1, "invalid enum discriminant"); StreamError::Closed } }; - - v5 + v6 }; Err(e) } _ => _rt::invalid_enum_discriminant(), - } + }; + result7 } } } } } - #[allow(dead_code)] pub mod random { - #[allow(dead_code, clippy::all)] + /// WASI Random is a random data API. + /// + /// It is intended to be portable at least between Unix-family platforms and + /// Windows. + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod random { #[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; #[allow(unused_unsafe, clippy::all)] /// Return `len` cryptographically-secure random or pseudo-random bytes. @@ -7934,26 +8510,36 @@ pub mod wasi { /// data. pub fn get_random_bytes(len: u64) -> _rt::Vec { unsafe { - #[repr(align(4))] - struct RetArea([::core::mem::MaybeUninit; 8]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 2 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 2 + * ::core::mem::size_of::<*const u8>()], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:random/random@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "get-random-bytes"] - fn wit_import(_: i64, _: *mut u8); + fn wit_import1(_: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i64, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i64, _: *mut u8) { unreachable!() } - wit_import(_rt::as_i64(&len), ptr0); - let l1 = *ptr0.add(0).cast::<*mut u8>(); - let l2 = *ptr0.add(4).cast::(); - let len3 = l2; - _rt::Vec::from_raw_parts(l1.cast(), len3, len3) + unsafe { wit_import1(_rt::as_i64(&len), ptr0) }; + let l2 = *ptr0.add(0).cast::<*mut u8>(); + let l3 = *ptr0 + .add(::core::mem::size_of::<*const u8>()) + .cast::(); + let len4 = l3; + let result5 = _rt::Vec::from_raw_parts(l2.cast(), len4, len4); + result5 } } #[allow(unused_unsafe, clippy::all)] @@ -7965,28 +8551,28 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:random/random@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "get-random-u64"] - fn wit_import() -> i64; + fn wit_import0() -> i64; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import() -> i64 { + unsafe extern "C" fn wit_import0() -> i64 { unreachable!() } - let ret = wit_import(); + let ret = unsafe { wit_import0() }; ret as u64 } } } - - #[allow(dead_code, clippy::all)] + /// The insecure interface for insecure pseudo-random numbers. + /// + /// It is intended to be portable at least between Unix-family platforms and + /// Windows. + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod insecure { #[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; #[allow(unused_unsafe, clippy::all)] /// Return `len` insecure pseudo-random bytes. @@ -7999,26 +8585,36 @@ pub mod wasi { /// a long period. pub fn get_insecure_random_bytes(len: u64) -> _rt::Vec { unsafe { - #[repr(align(4))] - struct RetArea([::core::mem::MaybeUninit; 8]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct RetArea( + [::core::mem::MaybeUninit< + u8, + >; 2 * ::core::mem::size_of::<*const u8>()], + ); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 2 + * ::core::mem::size_of::<*const u8>()], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:random/insecure@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "get-insecure-random-bytes"] - fn wit_import(_: i64, _: *mut u8); + fn wit_import1(_: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i64, _: *mut u8) { + unsafe extern "C" fn wit_import1(_: i64, _: *mut u8) { unreachable!() } - wit_import(_rt::as_i64(&len), ptr0); - let l1 = *ptr0.add(0).cast::<*mut u8>(); - let l2 = *ptr0.add(4).cast::(); - let len3 = l2; - _rt::Vec::from_raw_parts(l1.cast(), len3, len3) + unsafe { wit_import1(_rt::as_i64(&len), ptr0) }; + let l2 = *ptr0.add(0).cast::<*mut u8>(); + let l3 = *ptr0 + .add(::core::mem::size_of::<*const u8>()) + .cast::(); + let len4 = l3; + let result5 = _rt::Vec::from_raw_parts(l2.cast(), len4, len4); + result5 } } #[allow(unused_unsafe, clippy::all)] @@ -8030,28 +8626,28 @@ pub mod wasi { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:random/insecure@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "get-insecure-random-u64"] - fn wit_import() -> i64; + fn wit_import0() -> i64; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import() -> i64 { + unsafe extern "C" fn wit_import0() -> i64 { unreachable!() } - let ret = wit_import(); + let ret = unsafe { wit_import0() }; ret as u64 } } } - - #[allow(dead_code, clippy::all)] + /// The insecure-seed interface for seeding hash-map DoS resistance. + /// + /// It is intended to be portable at least between Unix-family platforms and + /// Windows. + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod insecure_seed { #[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; #[allow(unused_unsafe, clippy::all)] /// Return a 128-bit value that may contain a pseudo-random value. /// @@ -8078,48 +8674,42 @@ pub mod wasi { let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:random/insecure-seed@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "insecure-seed"] - fn wit_import(_: *mut u8); + fn wit_import1(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: *mut u8) { + unsafe extern "C" fn wit_import1(_: *mut u8) { unreachable!() } - wit_import(ptr0); - let l1 = *ptr0.add(0).cast::(); - let l2 = *ptr0.add(8).cast::(); - (l1 as u64, l2 as u64) + unsafe { wit_import1(ptr0) }; + let l2 = *ptr0.add(0).cast::(); + let l3 = *ptr0.add(8).cast::(); + let result4 = (l2 as u64, l3 as u64); + result4 } } } } } -#[allow(dead_code)] +#[rustfmt::skip] +#[allow(dead_code, clippy::all)] pub mod exports { - #[allow(dead_code)] pub mod fermyon { - #[allow(dead_code)] pub mod spin { - #[allow(dead_code, clippy::all)] + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod key_value { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; /// An open key-value store - #[derive(Debug)] #[repr(transparent)] pub struct Store { handle: _rt::Resource, } - type _StoreRep = Option; - impl Store { /// Creates a new resource from the specified representation. /// @@ -8129,77 +8719,70 @@ pub mod exports { pub fn new(val: T) -> Self { Self::type_guard::(); let val: _StoreRep = Some(val); - let ptr: *mut _StoreRep = _rt::Box::into_raw(_rt::Box::new(val)); + let ptr: *mut _StoreRep = _rt::Box::into_raw( + _rt::Box::new(val), + ); unsafe { Self::from_handle(T::_resource_new(ptr.cast())) } } - /// Gets access to the underlying `T` which represents this resource. pub fn get(&self) -> &T { let ptr = unsafe { &*self.as_ptr::() }; ptr.as_ref().unwrap() } - /// Gets mutable access to the underlying `T` which represents this /// resource. pub fn get_mut(&mut self) -> &mut T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_mut().unwrap() } - /// Consumes this resource and returns the underlying `T`. pub fn into_inner(self) -> T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.take().unwrap() } - #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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) } - - // It's theoretically possible to implement the `GuestStore` trait twice - // so guard against using it with two different types here. #[doc(hidden)] fn type_guard() { use core::any::TypeId; static mut LAST_TYPE: Option = None; unsafe { - assert!(!cfg!(target_feature = "threads")); + assert!(! cfg!(target_feature = "atomics")); let id = TypeId::of::(); match LAST_TYPE { - Some(ty) => assert!( - ty == id, - "cannot use two types with this resource type" - ), + Some(ty) => { + assert!( + ty == id, "cannot use two types with this resource type" + ) + } None => LAST_TYPE = Some(id), } } } - #[doc(hidden)] pub unsafe fn dtor(handle: *mut u8) { Self::type_guard::(); - let _ = _rt::Box::from_raw(handle as *mut _StoreRep); + let _ = unsafe { + _rt::Box::from_raw(handle as *mut _StoreRep) + }; } - fn as_ptr(&self) -> *mut _StoreRep { Store::type_guard::(); T::_resource_rep(self.handle()).cast() } } - /// A borrowed version of [`Store`] which represents a borrowed value /// with the lifetime `'a`. #[derive(Debug)] @@ -8208,7 +8791,6 @@ pub mod exports { rep: *mut u8, _marker: core::marker::PhantomData<&'a Store>, } - impl<'a> StoreBorrow<'a> { #[doc(hidden)] pub unsafe fn lift(rep: usize) -> Self { @@ -8217,41 +8799,34 @@ pub mod exports { _marker: core::marker::PhantomData, } } - /// Gets access to the underlying `T` in this resource. pub fn get(&self) -> &T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_ref().unwrap() } - - // NB: mutable access is not allowed due to the component model allowing - // multiple borrows of the same resource. - fn as_ptr(&self) -> *mut _StoreRep { Store::type_guard::(); self.rep.cast() } } - unsafe impl _rt::WasmResource for Store { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]fermyon:spin/key-value@2.0.0")] - extern "C" { + #[link( + wasm_import_module = "[export]fermyon:spin/key-value@2.0.0" + )] + unsafe extern "C" { #[link_name = "[resource-drop]store"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - /// The set of errors which may be raised by functions in this interface #[derive(Clone)] pub enum Error { @@ -8267,23 +8842,34 @@ pub mod exports { Other(_rt::String), } impl ::core::fmt::Debug for Error { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { Error::StoreTableFull => { f.debug_tuple("Error::StoreTableFull").finish() } - Error::NoSuchStore => f.debug_tuple("Error::NoSuchStore").finish(), - Error::AccessDenied => f.debug_tuple("Error::AccessDenied").finish(), - Error::Other(e) => f.debug_tuple("Error::Other").field(e).finish(), + Error::NoSuchStore => { + f.debug_tuple("Error::NoSuchStore").finish() + } + Error::AccessDenied => { + f.debug_tuple("Error::AccessDenied").finish() + } + Error::Other(e) => { + f.debug_tuple("Error::Other").field(e).finish() + } } } } impl ::core::fmt::Display for Error { - 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 Error {} #[doc(hidden)] #[allow(non_snake_case)] @@ -8291,37 +8877,50 @@ pub mod exports { arg0: *mut u8, arg1: usize, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg1; let bytes0 = _rt::Vec::from_raw_parts(arg0.cast(), len0, len0); let result1 = T::open(_rt::string_lift(bytes0)); - let ptr2 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr2 = (&raw mut _RET_AREA.0).cast::(); match result1 { Ok(e) => { *ptr2.add(0).cast::() = (0i32) as u8; - *ptr2.add(4).cast::() = (e).take_handle() as i32; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (e).take_handle() as i32; } Err(e) => { *ptr2.add(0).cast::() = (1i32) as u8; match e { Error::StoreTableFull => { - *ptr2.add(4).cast::() = (0i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } Error::NoSuchStore => { - *ptr2.add(4).cast::() = (1i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; } Error::AccessDenied => { - *ptr2.add(4).cast::() = (2i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (2i32) as u8; } Error::Other(e) => { - *ptr2.add(4).cast::() = (3i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (3i32) as u8; let vec3 = (e.into_bytes()).into_boxed_slice(); let ptr3 = vec3.as_ptr().cast::(); let len3 = vec3.len(); ::core::mem::forget(vec3); - *ptr2.add(12).cast::() = len3; - *ptr2.add(8).cast::<*mut u8>() = ptr3.cast_mut(); + *ptr2 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len3; + *ptr2 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr3.cast_mut(); } } } @@ -8330,19 +8929,27 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn __post_return_static_store_open(arg0: *mut u8) { + pub unsafe fn __post_return_static_store_open( + arg0: *mut u8, + ) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { - 0 => (), + 0 => {} _ => { - let l1 = i32::from(*arg0.add(4).cast::()); + let l1 = i32::from( + *arg0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); match l1 { - 0 => (), - 1 => (), - 2 => (), + 0 => {} + 1 => {} + 2 => {} _ => { - let l2 = *arg0.add(8).cast::<*mut u8>(); - let l3 = *arg0.add(12).cast::(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l3 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l2, l3, 1); } } @@ -8356,30 +8963,37 @@ pub mod exports { arg1: *mut u8, arg2: usize, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg2; let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0); let result1 = T::get( - StoreBorrow::lift(arg0 as u32 as usize).get(), + unsafe { StoreBorrow::lift(arg0 as u32 as usize) }.get(), _rt::string_lift(bytes0), ); - let ptr2 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr2 = (&raw mut _RET_AREA.0).cast::(); match result1 { Ok(e) => { *ptr2.add(0).cast::() = (0i32) as u8; match e { Some(e) => { - *ptr2.add(4).cast::() = (1i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; let vec3 = (e).into_boxed_slice(); let ptr3 = vec3.as_ptr().cast::(); let len3 = vec3.len(); ::core::mem::forget(vec3); - *ptr2.add(12).cast::() = len3; - *ptr2.add(8).cast::<*mut u8>() = ptr3.cast_mut(); + *ptr2 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len3; + *ptr2 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr3.cast_mut(); } None => { - *ptr2.add(4).cast::() = (0i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } }; } @@ -8387,22 +9001,34 @@ pub mod exports { *ptr2.add(0).cast::() = (1i32) as u8; match e { Error::StoreTableFull => { - *ptr2.add(4).cast::() = (0i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } Error::NoSuchStore => { - *ptr2.add(4).cast::() = (1i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; } Error::AccessDenied => { - *ptr2.add(4).cast::() = (2i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (2i32) as u8; } Error::Other(e) => { - *ptr2.add(4).cast::() = (3i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (3i32) as u8; let vec4 = (e.into_bytes()).into_boxed_slice(); let ptr4 = vec4.as_ptr().cast::(); let len4 = vec4.len(); ::core::mem::forget(vec4); - *ptr2.add(12).cast::() = len4; - *ptr2.add(8).cast::<*mut u8>() = ptr4.cast_mut(); + *ptr2 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len4; + *ptr2 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr4.cast_mut(); } } } @@ -8411,16 +9037,24 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn __post_return_method_store_get(arg0: *mut u8) { + pub unsafe fn __post_return_method_store_get( + arg0: *mut u8, + ) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { 0 => { - let l1 = i32::from(*arg0.add(4).cast::()); + let l1 = i32::from( + *arg0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); match l1 { - 0 => (), + 0 => {} _ => { - let l2 = *arg0.add(8).cast::<*mut u8>(); - let l3 = *arg0.add(12).cast::(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l3 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); let base4 = l2; let len4 = l3; _rt::cabi_dealloc(base4, len4 * 1, 1); @@ -8428,14 +9062,20 @@ pub mod exports { } } _ => { - let l5 = i32::from(*arg0.add(4).cast::()); + let l5 = i32::from( + *arg0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); match l5 { - 0 => (), - 1 => (), - 2 => (), + 0 => {} + 1 => {} + 2 => {} _ => { - let l6 = *arg0.add(8).cast::<*mut u8>(); - let l7 = *arg0.add(12).cast::(); + let l6 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l7 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l6, l7, 1); } } @@ -8451,17 +9091,16 @@ pub mod exports { arg3: *mut u8, arg4: usize, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg2; let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0); let len1 = arg4; let result2 = T::set( - StoreBorrow::lift(arg0 as u32 as usize).get(), + unsafe { StoreBorrow::lift(arg0 as u32 as usize) }.get(), _rt::string_lift(bytes0), _rt::Vec::from_raw_parts(arg3.cast(), len1, len1), ); - let ptr3 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr3 = (&raw mut _RET_AREA.0).cast::(); match result2 { Ok(_) => { *ptr3.add(0).cast::() = (0i32) as u8; @@ -8470,22 +9109,34 @@ pub mod exports { *ptr3.add(0).cast::() = (1i32) as u8; match e { Error::StoreTableFull => { - *ptr3.add(4).cast::() = (0i32) as u8; + *ptr3 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } Error::NoSuchStore => { - *ptr3.add(4).cast::() = (1i32) as u8; + *ptr3 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; } Error::AccessDenied => { - *ptr3.add(4).cast::() = (2i32) as u8; + *ptr3 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (2i32) as u8; } Error::Other(e) => { - *ptr3.add(4).cast::() = (3i32) as u8; + *ptr3 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (3i32) as u8; let vec4 = (e.into_bytes()).into_boxed_slice(); let ptr4 = vec4.as_ptr().cast::(); let len4 = vec4.len(); ::core::mem::forget(vec4); - *ptr3.add(12).cast::() = len4; - *ptr3.add(8).cast::<*mut u8>() = ptr4.cast_mut(); + *ptr3 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len4; + *ptr3 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr4.cast_mut(); } } } @@ -8494,19 +9145,27 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn __post_return_method_store_set(arg0: *mut u8) { + pub unsafe fn __post_return_method_store_set( + arg0: *mut u8, + ) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { - 0 => (), + 0 => {} _ => { - let l1 = i32::from(*arg0.add(4).cast::()); + let l1 = i32::from( + *arg0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); match l1 { - 0 => (), - 1 => (), - 2 => (), + 0 => {} + 1 => {} + 2 => {} _ => { - let l2 = *arg0.add(8).cast::<*mut u8>(); - let l3 = *arg0.add(12).cast::(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l3 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l2, l3, 1); } } @@ -8520,15 +9179,14 @@ pub mod exports { arg1: *mut u8, arg2: usize, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg2; let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0); let result1 = T::delete( - StoreBorrow::lift(arg0 as u32 as usize).get(), + unsafe { StoreBorrow::lift(arg0 as u32 as usize) }.get(), _rt::string_lift(bytes0), ); - let ptr2 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr2 = (&raw mut _RET_AREA.0).cast::(); match result1 { Ok(_) => { *ptr2.add(0).cast::() = (0i32) as u8; @@ -8537,22 +9195,34 @@ pub mod exports { *ptr2.add(0).cast::() = (1i32) as u8; match e { Error::StoreTableFull => { - *ptr2.add(4).cast::() = (0i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } Error::NoSuchStore => { - *ptr2.add(4).cast::() = (1i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; } Error::AccessDenied => { - *ptr2.add(4).cast::() = (2i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (2i32) as u8; } Error::Other(e) => { - *ptr2.add(4).cast::() = (3i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (3i32) as u8; let vec3 = (e.into_bytes()).into_boxed_slice(); let ptr3 = vec3.as_ptr().cast::(); let len3 = vec3.len(); ::core::mem::forget(vec3); - *ptr2.add(12).cast::() = len3; - *ptr2.add(8).cast::<*mut u8>() = ptr3.cast_mut(); + *ptr2 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len3; + *ptr2 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr3.cast_mut(); } } } @@ -8561,19 +9231,27 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn __post_return_method_store_delete(arg0: *mut u8) { + pub unsafe fn __post_return_method_store_delete( + arg0: *mut u8, + ) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { - 0 => (), + 0 => {} _ => { - let l1 = i32::from(*arg0.add(4).cast::()); + let l1 = i32::from( + *arg0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); match l1 { - 0 => (), - 1 => (), - 2 => (), + 0 => {} + 1 => {} + 2 => {} _ => { - let l2 = *arg0.add(8).cast::<*mut u8>(); - let l3 = *arg0.add(12).cast::(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l3 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l2, l3, 1); } } @@ -8587,19 +9265,20 @@ pub mod exports { arg1: *mut u8, arg2: usize, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg2; let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0); let result1 = T::exists( - StoreBorrow::lift(arg0 as u32 as usize).get(), + unsafe { StoreBorrow::lift(arg0 as u32 as usize) }.get(), _rt::string_lift(bytes0), ); - let ptr2 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr2 = (&raw mut _RET_AREA.0).cast::(); match result1 { Ok(e) => { *ptr2.add(0).cast::() = (0i32) as u8; - *ptr2.add(4).cast::() = (match e { + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (match e { true => 1, false => 0, }) as u8; @@ -8608,22 +9287,34 @@ pub mod exports { *ptr2.add(0).cast::() = (1i32) as u8; match e { Error::StoreTableFull => { - *ptr2.add(4).cast::() = (0i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } Error::NoSuchStore => { - *ptr2.add(4).cast::() = (1i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; } Error::AccessDenied => { - *ptr2.add(4).cast::() = (2i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (2i32) as u8; } Error::Other(e) => { - *ptr2.add(4).cast::() = (3i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (3i32) as u8; let vec3 = (e.into_bytes()).into_boxed_slice(); let ptr3 = vec3.as_ptr().cast::(); let len3 = vec3.len(); ::core::mem::forget(vec3); - *ptr2.add(12).cast::() = len3; - *ptr2.add(8).cast::<*mut u8>() = ptr3.cast_mut(); + *ptr2 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len3; + *ptr2 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr3.cast_mut(); } } } @@ -8632,19 +9323,27 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn __post_return_method_store_exists(arg0: *mut u8) { + pub unsafe fn __post_return_method_store_exists( + arg0: *mut u8, + ) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { - 0 => (), + 0 => {} _ => { - let l1 = i32::from(*arg0.add(4).cast::()); + let l1 = i32::from( + *arg0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); match l1 { - 0 => (), - 1 => (), - 2 => (), + 0 => {} + 1 => {} + 2 => {} _ => { - let l2 = *arg0.add(8).cast::<*mut u8>(); - let l3 = *arg0.add(12).cast::(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l3 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l2, l3, 1); } } @@ -8656,17 +9355,20 @@ pub mod exports { pub unsafe fn _export_method_store_get_keys_cabi( arg0: *mut u8, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = T::get_keys(StoreBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::get_keys( + unsafe { StoreBorrow::lift(arg0 as u32 as usize) }.get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; let vec3 = e; let len3 = vec3.len(); - let layout3 = - _rt::alloc::Layout::from_size_align_unchecked(vec3.len() * 8, 4); + let layout3 = _rt::alloc::Layout::from_size_align_unchecked( + vec3.len() * (2 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); let result3 = if layout3.size() != 0 { let ptr = _rt::alloc::alloc(layout3).cast::(); if ptr.is_null() { @@ -8674,44 +9376,61 @@ pub mod exports { } ptr } else { - { - ::core::ptr::null_mut() - } + ::core::ptr::null_mut() }; for (i, e) in vec3.into_iter().enumerate() { - let base = result3.add(i * 8); + let base = result3 + .add(i * (2 * ::core::mem::size_of::<*const u8>())); { let vec2 = (e.into_bytes()).into_boxed_slice(); let ptr2 = vec2.as_ptr().cast::(); let len2 = vec2.len(); ::core::mem::forget(vec2); - *base.add(4).cast::() = len2; + *base + .add(::core::mem::size_of::<*const u8>()) + .cast::() = len2; *base.add(0).cast::<*mut u8>() = ptr2.cast_mut(); } } - *ptr1.add(8).cast::() = len3; - *ptr1.add(4).cast::<*mut u8>() = result3; + *ptr1 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len3; + *ptr1 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = result3; } Err(e) => { *ptr1.add(0).cast::() = (1i32) as u8; match e { Error::StoreTableFull => { - *ptr1.add(4).cast::() = (0i32) as u8; + *ptr1 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } Error::NoSuchStore => { - *ptr1.add(4).cast::() = (1i32) as u8; + *ptr1 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; } Error::AccessDenied => { - *ptr1.add(4).cast::() = (2i32) as u8; + *ptr1 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (2i32) as u8; } Error::Other(e) => { - *ptr1.add(4).cast::() = (3i32) as u8; + *ptr1 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (3i32) as u8; let vec4 = (e.into_bytes()).into_boxed_slice(); let ptr4 = vec4.as_ptr().cast::(); let len4 = vec4.len(); ::core::mem::forget(vec4); - *ptr1.add(12).cast::() = len4; - *ptr1.add(8).cast::<*mut u8>() = ptr4.cast_mut(); + *ptr1 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len4; + *ptr1 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr4.cast_mut(); } } } @@ -8720,33 +9439,52 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn __post_return_method_store_get_keys(arg0: *mut u8) { + pub unsafe fn __post_return_method_store_get_keys( + arg0: *mut u8, + ) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { 0 => { - let l3 = *arg0.add(4).cast::<*mut u8>(); - let l4 = *arg0.add(8).cast::(); - let base5 = l3; - let len5 = l4; + let l1 = *arg0 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let base5 = l1; + let len5 = l2; for i in 0..len5 { - let base = base5.add(i * 8); + let base = base5 + .add(i * (2 * ::core::mem::size_of::<*const u8>())); { - let l1 = *base.add(0).cast::<*mut u8>(); - let l2 = *base.add(4).cast::(); - _rt::cabi_dealloc(l1, l2, 1); + let l3 = *base.add(0).cast::<*mut u8>(); + let l4 = *base + .add(::core::mem::size_of::<*const u8>()) + .cast::(); + _rt::cabi_dealloc(l3, l4, 1); } } - _rt::cabi_dealloc(base5, len5 * 8, 4); + _rt::cabi_dealloc( + base5, + len5 * (2 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); } _ => { - let l6 = i32::from(*arg0.add(4).cast::()); + let l6 = i32::from( + *arg0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); match l6 { - 0 => (), - 1 => (), - 2 => (), + 0 => {} + 1 => {} + 2 => {} _ => { - let l7 = *arg0.add(8).cast::<*mut u8>(); - let l8 = *arg0.add(12).cast::(); + let l7 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l8 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l7, l8, 1); } } @@ -8767,18 +9505,18 @@ pub mod exports { let _ = val; unreachable!(); } - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]fermyon:spin/key-value@2.0.0")] - extern "C" { + #[link( + wasm_import_module = "[export]fermyon:spin/key-value@2.0.0" + )] + unsafe extern "C" { #[link_name = "[resource-new]store"] fn new(_: *mut u8) -> u32; } - new(val) + unsafe { new(val) } } } - #[doc(hidden)] fn _resource_rep(handle: u32) -> *mut u8 where @@ -8789,18 +9527,18 @@ pub mod exports { let _ = handle; unreachable!(); } - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]fermyon:spin/key-value@2.0.0")] - extern "C" { + #[link( + wasm_import_module = "[export]fermyon:spin/key-value@2.0.0" + )] + unsafe extern "C" { #[link_name = "[resource-rep]store"] fn rep(_: u32) -> *mut u8; } unsafe { rep(handle) } } } - /// Open the store with the specified label. /// /// `label` must refer to a store allowed in the spin.toml manifest. @@ -8810,9 +9548,16 @@ pub mod exports { /// Get the value associated with the specified `key` /// /// Returns `ok(none)` if the key does not exist. - fn get(&self, key: _rt::String) -> Result>, Error>; + fn get( + &self, + key: _rt::String, + ) -> Result>, Error>; /// Set the `value` associated with the specified `key` overwriting any existing value. - fn set(&self, key: _rt::String, value: _rt::Vec) -> Result<(), Error>; + fn set( + &self, + key: _rt::String, + value: _rt::Vec, + ) -> Result<(), Error>; /// Delete the tuple with the specified `key` /// /// No error is raised if a tuple did not previously exist for `key`. @@ -8823,86 +9568,100 @@ pub mod exports { fn get_keys(&self) -> Result<_rt::Vec<_rt::String>, Error>; } #[doc(hidden)] - - macro_rules! __export_fermyon_spin_key_value_2_0_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "fermyon:spin/key-value@2.0.0#[static]store.open"] - unsafe extern "C" fn export_static_store_open(arg0: *mut u8,arg1: usize,) -> *mut u8 { - $($path_to_types)*::_export_static_store_open_cabi::<<$ty as $($path_to_types)*::Guest>::Store>(arg0, arg1) - } - #[export_name = "cabi_post_fermyon:spin/key-value@2.0.0#[static]store.open"] - unsafe extern "C" fn _post_return_static_store_open(arg0: *mut u8,) { - $($path_to_types)*::__post_return_static_store_open::<<$ty as $($path_to_types)*::Guest>::Store>(arg0) - } - #[export_name = "fermyon:spin/key-value@2.0.0#[method]store.get"] - unsafe extern "C" fn export_method_store_get(arg0: *mut u8,arg1: *mut u8,arg2: usize,) -> *mut u8 { - $($path_to_types)*::_export_method_store_get_cabi::<<$ty as $($path_to_types)*::Guest>::Store>(arg0, arg1, arg2) - } - #[export_name = "cabi_post_fermyon:spin/key-value@2.0.0#[method]store.get"] - unsafe extern "C" fn _post_return_method_store_get(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_store_get::<<$ty as $($path_to_types)*::Guest>::Store>(arg0) - } - #[export_name = "fermyon:spin/key-value@2.0.0#[method]store.set"] - unsafe extern "C" fn export_method_store_set(arg0: *mut u8,arg1: *mut u8,arg2: usize,arg3: *mut u8,arg4: usize,) -> *mut u8 { - $($path_to_types)*::_export_method_store_set_cabi::<<$ty as $($path_to_types)*::Guest>::Store>(arg0, arg1, arg2, arg3, arg4) - } - #[export_name = "cabi_post_fermyon:spin/key-value@2.0.0#[method]store.set"] - unsafe extern "C" fn _post_return_method_store_set(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_store_set::<<$ty as $($path_to_types)*::Guest>::Store>(arg0) - } - #[export_name = "fermyon:spin/key-value@2.0.0#[method]store.delete"] - unsafe extern "C" fn export_method_store_delete(arg0: *mut u8,arg1: *mut u8,arg2: usize,) -> *mut u8 { - $($path_to_types)*::_export_method_store_delete_cabi::<<$ty as $($path_to_types)*::Guest>::Store>(arg0, arg1, arg2) - } - #[export_name = "cabi_post_fermyon:spin/key-value@2.0.0#[method]store.delete"] - unsafe extern "C" fn _post_return_method_store_delete(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_store_delete::<<$ty as $($path_to_types)*::Guest>::Store>(arg0) - } - #[export_name = "fermyon:spin/key-value@2.0.0#[method]store.exists"] - unsafe extern "C" fn export_method_store_exists(arg0: *mut u8,arg1: *mut u8,arg2: usize,) -> *mut u8 { - $($path_to_types)*::_export_method_store_exists_cabi::<<$ty as $($path_to_types)*::Guest>::Store>(arg0, arg1, arg2) - } - #[export_name = "cabi_post_fermyon:spin/key-value@2.0.0#[method]store.exists"] - unsafe extern "C" fn _post_return_method_store_exists(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_store_exists::<<$ty as $($path_to_types)*::Guest>::Store>(arg0) - } - #[export_name = "fermyon:spin/key-value@2.0.0#[method]store.get-keys"] - unsafe extern "C" fn export_method_store_get_keys(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_store_get_keys_cabi::<<$ty as $($path_to_types)*::Guest>::Store>(arg0) - } - #[export_name = "cabi_post_fermyon:spin/key-value@2.0.0#[method]store.get-keys"] - unsafe extern "C" fn _post_return_method_store_get_keys(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_store_get_keys::<<$ty as $($path_to_types)*::Guest>::Store>(arg0) - } - - const _: () = { - #[doc(hidden)] - #[export_name = "fermyon:spin/key-value@2.0.0#[dtor]store"] - #[allow(non_snake_case)] - unsafe extern "C" fn dtor(rep: *mut u8) { - $($path_to_types)*::Store::dtor::< - <$ty as $($path_to_types)*::Guest>::Store - >(rep) - } - }; - - };); -} + macro_rules! __export_fermyon_spin_key_value_2_0_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "fermyon:spin/key-value@2.0.0#[static]store.open")] unsafe extern + "C" fn export_static_store_open(arg0 : * mut u8, arg1 : usize,) + -> * mut u8 { unsafe { $($path_to_types)*:: + _export_static_store_open_cabi::<<$ty as $($path_to_types)*:: + Guest >::Store > (arg0, arg1) } } #[unsafe (export_name = + "cabi_post_fermyon:spin/key-value@2.0.0#[static]store.open")] + unsafe extern "C" fn _post_return_static_store_open(arg0 : * mut + u8,) { unsafe { $($path_to_types)*:: + __post_return_static_store_open::<<$ty as $($path_to_types)*:: + Guest >::Store > (arg0) } } #[unsafe (export_name = + "fermyon:spin/key-value@2.0.0#[method]store.get")] unsafe extern + "C" fn export_method_store_get(arg0 : * mut u8, arg1 : * mut u8, + arg2 : usize,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_store_get_cabi::<<$ty as $($path_to_types)*:: + Guest >::Store > (arg0, arg1, arg2) } } #[unsafe (export_name = + "cabi_post_fermyon:spin/key-value@2.0.0#[method]store.get")] + unsafe extern "C" fn _post_return_method_store_get(arg0 : * mut + u8,) { unsafe { $($path_to_types)*:: + __post_return_method_store_get::<<$ty as $($path_to_types)*:: + Guest >::Store > (arg0) } } #[unsafe (export_name = + "fermyon:spin/key-value@2.0.0#[method]store.set")] unsafe extern + "C" fn export_method_store_set(arg0 : * mut u8, arg1 : * mut u8, + arg2 : usize, arg3 : * mut u8, arg4 : usize,) -> * mut u8 { + unsafe { $($path_to_types)*:: + _export_method_store_set_cabi::<<$ty as $($path_to_types)*:: + Guest >::Store > (arg0, arg1, arg2, arg3, arg4) } } #[unsafe + (export_name = + "cabi_post_fermyon:spin/key-value@2.0.0#[method]store.set")] + unsafe extern "C" fn _post_return_method_store_set(arg0 : * mut + u8,) { unsafe { $($path_to_types)*:: + __post_return_method_store_set::<<$ty as $($path_to_types)*:: + Guest >::Store > (arg0) } } #[unsafe (export_name = + "fermyon:spin/key-value@2.0.0#[method]store.delete")] unsafe + extern "C" fn export_method_store_delete(arg0 : * mut u8, arg1 : + * mut u8, arg2 : usize,) -> * mut u8 { unsafe { + $($path_to_types)*:: _export_method_store_delete_cabi::<<$ty as + $($path_to_types)*:: Guest >::Store > (arg0, arg1, arg2) } } + #[unsafe (export_name = + "cabi_post_fermyon:spin/key-value@2.0.0#[method]store.delete")] + unsafe extern "C" fn _post_return_method_store_delete(arg0 : * + mut u8,) { unsafe { $($path_to_types)*:: + __post_return_method_store_delete::<<$ty as $($path_to_types)*:: + Guest >::Store > (arg0) } } #[unsafe (export_name = + "fermyon:spin/key-value@2.0.0#[method]store.exists")] unsafe + extern "C" fn export_method_store_exists(arg0 : * mut u8, arg1 : + * mut u8, arg2 : usize,) -> * mut u8 { unsafe { + $($path_to_types)*:: _export_method_store_exists_cabi::<<$ty as + $($path_to_types)*:: Guest >::Store > (arg0, arg1, arg2) } } + #[unsafe (export_name = + "cabi_post_fermyon:spin/key-value@2.0.0#[method]store.exists")] + unsafe extern "C" fn _post_return_method_store_exists(arg0 : * + mut u8,) { unsafe { $($path_to_types)*:: + __post_return_method_store_exists::<<$ty as $($path_to_types)*:: + Guest >::Store > (arg0) } } #[unsafe (export_name = + "fermyon:spin/key-value@2.0.0#[method]store.get-keys")] unsafe + extern "C" fn export_method_store_get_keys(arg0 : * mut u8,) -> * + mut u8 { unsafe { $($path_to_types)*:: + _export_method_store_get_keys_cabi::<<$ty as $($path_to_types)*:: + Guest >::Store > (arg0) } } #[unsafe (export_name = + "cabi_post_fermyon:spin/key-value@2.0.0#[method]store.get-keys")] + unsafe extern "C" fn _post_return_method_store_get_keys(arg0 : * + mut u8,) { unsafe { $($path_to_types)*:: + __post_return_method_store_get_keys::<<$ty as + $($path_to_types)*:: Guest >::Store > (arg0) } } const _ : () = { + #[doc(hidden)] #[unsafe (export_name = + "fermyon:spin/key-value@2.0.0#[dtor]store")] + #[allow(non_snake_case)] unsafe extern "C" fn dtor(rep : * mut + u8) { unsafe { $($path_to_types)*:: Store::dtor::< <$ty as + $($path_to_types)*:: Guest >::Store > (rep) } } }; }; + }; + } #[doc(hidden)] pub(crate) use __export_fermyon_spin_key_value_2_0_0_cabi; - #[repr(align(4))] - struct _RetArea([::core::mem::MaybeUninit; 16]); - static mut _RET_AREA: _RetArea = _RetArea([::core::mem::MaybeUninit::uninit(); 16]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct _RetArea( + [::core::mem::MaybeUninit< + u8, + >; 4 * ::core::mem::size_of::<*const u8>()], + ); + static mut _RET_AREA: _RetArea = _RetArea( + [::core::mem::MaybeUninit::uninit(); 4 + * ::core::mem::size_of::<*const u8>()], + ); } - - #[allow(dead_code, clippy::all)] + /// A WASI interface dedicated to performing inferencing for Large Language Models. + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod llm { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; /// A Large Language Model. pub type InferencingModel = _rt::String; @@ -8926,7 +9685,10 @@ pub mod exports { pub top_p: f32, } impl ::core::fmt::Debug for InferencingParams { - 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("InferencingParams") .field("max-tokens", &self.max_tokens) .field("repeat-penalty", &self.repeat_penalty) @@ -8948,7 +9710,10 @@ pub mod exports { InvalidInput(_rt::String), } impl ::core::fmt::Debug for Error { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { Error::ModelNotSupported => { f.debug_tuple("Error::ModelNotSupported").finish() @@ -8963,11 +9728,13 @@ pub mod exports { } } impl ::core::fmt::Display for Error { - 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 Error {} /// Usage information related to the inferencing result #[repr(C)] @@ -8979,7 +9746,10 @@ pub mod exports { pub generated_token_count: u32, } impl ::core::fmt::Debug for InferencingUsage { - 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("InferencingUsage") .field("prompt-token-count", &self.prompt_token_count) .field("generated-token-count", &self.generated_token_count) @@ -8996,7 +9766,10 @@ pub mod exports { pub usage: InferencingUsage, } impl ::core::fmt::Debug for InferencingResult { - 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("InferencingResult") .field("text", &self.text) .field("usage", &self.usage) @@ -9013,7 +9786,10 @@ pub mod exports { pub prompt_token_count: u32, } impl ::core::fmt::Debug for EmbeddingsUsage { - 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("EmbeddingsUsage") .field("prompt-token-count", &self.prompt_token_count) .finish() @@ -9028,7 +9804,10 @@ pub mod exports { pub usage: EmbeddingsUsage, } impl ::core::fmt::Debug for EmbeddingsResult { - 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("EmbeddingsResult") .field("embeddings", &self.embeddings) .field("usage", &self.usage) @@ -9050,8 +9829,7 @@ pub mod exports { arg9: i32, arg10: f32, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg1; let bytes0 = _rt::Vec::from_raw_parts(arg0.cast(), len0, len0); let len1 = arg3; @@ -9075,50 +9853,69 @@ pub mod exports { _ => _rt::invalid_enum_discriminant(), }, ); - let ptr3 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr3 = (&raw mut _RET_AREA.0).cast::(); match result2 { Ok(e) => { *ptr3.add(0).cast::() = (0i32) as u8; - let InferencingResult { - text: text4, - usage: usage4, - } = e; + let InferencingResult { text: text4, usage: usage4 } = e; let vec5 = (text4.into_bytes()).into_boxed_slice(); let ptr5 = vec5.as_ptr().cast::(); let len5 = vec5.len(); ::core::mem::forget(vec5); - *ptr3.add(8).cast::() = len5; - *ptr3.add(4).cast::<*mut u8>() = ptr5.cast_mut(); + *ptr3 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len5; + *ptr3 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr5.cast_mut(); let InferencingUsage { prompt_token_count: prompt_token_count6, generated_token_count: generated_token_count6, } = usage4; - *ptr3.add(12).cast::() = _rt::as_i32(prompt_token_count6); - *ptr3.add(16).cast::() = _rt::as_i32(generated_token_count6); + *ptr3 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = _rt::as_i32(prompt_token_count6); + *ptr3 + .add(4 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = _rt::as_i32(generated_token_count6); } Err(e) => { *ptr3.add(0).cast::() = (1i32) as u8; match e { Error::ModelNotSupported => { - *ptr3.add(4).cast::() = (0i32) as u8; + *ptr3 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } Error::RuntimeError(e) => { - *ptr3.add(4).cast::() = (1i32) as u8; + *ptr3 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; let vec7 = (e.into_bytes()).into_boxed_slice(); let ptr7 = vec7.as_ptr().cast::(); let len7 = vec7.len(); ::core::mem::forget(vec7); - *ptr3.add(12).cast::() = len7; - *ptr3.add(8).cast::<*mut u8>() = ptr7.cast_mut(); + *ptr3 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len7; + *ptr3 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr7.cast_mut(); } Error::InvalidInput(e) => { - *ptr3.add(4).cast::() = (2i32) as u8; + *ptr3 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (2i32) as u8; let vec8 = (e.into_bytes()).into_boxed_slice(); let ptr8 = vec8.as_ptr().cast::(); let len8 = vec8.len(); ::core::mem::forget(vec8); - *ptr3.add(12).cast::() = len8; - *ptr3.add(8).cast::<*mut u8>() = ptr8.cast_mut(); + *ptr3 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len8; + *ptr3 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr8.cast_mut(); } } } @@ -9131,22 +9928,36 @@ pub mod exports { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { 0 => { - let l1 = *arg0.add(4).cast::<*mut u8>(); - let l2 = *arg0.add(8).cast::(); + let l1 = *arg0 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l1, l2, 1); } _ => { - let l3 = i32::from(*arg0.add(4).cast::()); + let l3 = i32::from( + *arg0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); match l3 { - 0 => (), + 0 => {} 1 => { - let l4 = *arg0.add(8).cast::<*mut u8>(); - let l5 = *arg0.add(12).cast::(); + let l4 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l5 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l4, l5, 1); } _ => { - let l6 = *arg0.add(8).cast::<*mut u8>(); - let l7 = *arg0.add(12).cast::(); + let l6 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l7 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l6, l7, 1); } } @@ -9161,28 +9972,36 @@ pub mod exports { arg2: *mut u8, arg3: usize, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg1; let bytes0 = _rt::Vec::from_raw_parts(arg0.cast(), len0, len0); let base4 = arg2; let len4 = arg3; let mut result4 = _rt::Vec::with_capacity(len4); for i in 0..len4 { - let base = base4.add(i * 8); + let base = base4 + .add(i * (2 * ::core::mem::size_of::<*const u8>())); let e4 = { let l1 = *base.add(0).cast::<*mut u8>(); - let l2 = *base.add(4).cast::(); + let l2 = *base + .add(::core::mem::size_of::<*const u8>()) + .cast::(); let len3 = l2; let bytes3 = _rt::Vec::from_raw_parts(l1.cast(), len3, len3); - _rt::string_lift(bytes3) }; result4.push(e4); } - _rt::cabi_dealloc(base4, len4 * 8, 4); - let result5 = T::generate_embeddings(_rt::string_lift(bytes0), result4); - let ptr6 = _RET_AREA.0.as_mut_ptr().cast::(); + _rt::cabi_dealloc( + base4, + len4 * (2 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); + let result5 = T::generate_embeddings( + _rt::string_lift(bytes0), + result4, + ); + let ptr6 = (&raw mut _RET_AREA.0).cast::(); match result5 { Ok(e) => { *ptr6.add(0).cast::() = (0i32) as u8; @@ -9192,8 +10011,10 @@ pub mod exports { } = e; let vec9 = embeddings7; let len9 = vec9.len(); - let layout9 = - _rt::alloc::Layout::from_size_align_unchecked(vec9.len() * 8, 4); + let layout9 = _rt::alloc::Layout::from_size_align_unchecked( + vec9.len() * (2 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); let result9 = if layout9.size() != 0 { let ptr = _rt::alloc::alloc(layout9).cast::(); if ptr.is_null() { @@ -9201,51 +10022,72 @@ pub mod exports { } ptr } else { - { - ::core::ptr::null_mut() - } + ::core::ptr::null_mut() }; for (i, e) in vec9.into_iter().enumerate() { - let base = result9.add(i * 8); + let base = result9 + .add(i * (2 * ::core::mem::size_of::<*const u8>())); { let vec8 = (e).into_boxed_slice(); let ptr8 = vec8.as_ptr().cast::(); let len8 = vec8.len(); ::core::mem::forget(vec8); - *base.add(4).cast::() = len8; + *base + .add(::core::mem::size_of::<*const u8>()) + .cast::() = len8; *base.add(0).cast::<*mut u8>() = ptr8.cast_mut(); } } - *ptr6.add(8).cast::() = len9; - *ptr6.add(4).cast::<*mut u8>() = result9; + *ptr6 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len9; + *ptr6 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = result9; let EmbeddingsUsage { prompt_token_count: prompt_token_count10, } = usage7; - *ptr6.add(12).cast::() = _rt::as_i32(prompt_token_count10); + *ptr6 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = _rt::as_i32(prompt_token_count10); } Err(e) => { *ptr6.add(0).cast::() = (1i32) as u8; match e { Error::ModelNotSupported => { - *ptr6.add(4).cast::() = (0i32) as u8; + *ptr6 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } Error::RuntimeError(e) => { - *ptr6.add(4).cast::() = (1i32) as u8; + *ptr6 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; let vec11 = (e.into_bytes()).into_boxed_slice(); let ptr11 = vec11.as_ptr().cast::(); let len11 = vec11.len(); ::core::mem::forget(vec11); - *ptr6.add(12).cast::() = len11; - *ptr6.add(8).cast::<*mut u8>() = ptr11.cast_mut(); + *ptr6 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len11; + *ptr6 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr11.cast_mut(); } Error::InvalidInput(e) => { - *ptr6.add(4).cast::() = (2i32) as u8; + *ptr6 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (2i32) as u8; let vec12 = (e.into_bytes()).into_boxed_slice(); let ptr12 = vec12.as_ptr().cast::(); let len12 = vec12.len(); ::core::mem::forget(vec12); - *ptr6.add(12).cast::() = len12; - *ptr6.add(8).cast::<*mut u8>() = ptr12.cast_mut(); + *ptr6 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len12; + *ptr6 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr12.cast_mut(); } } } @@ -9254,38 +10096,61 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn __post_return_generate_embeddings(arg0: *mut u8) { + pub unsafe fn __post_return_generate_embeddings( + arg0: *mut u8, + ) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { 0 => { - let l4 = *arg0.add(4).cast::<*mut u8>(); - let l5 = *arg0.add(8).cast::(); - let base6 = l4; - let len6 = l5; + let l1 = *arg0 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let base6 = l1; + let len6 = l2; for i in 0..len6 { - let base = base6.add(i * 8); + let base = base6 + .add(i * (2 * ::core::mem::size_of::<*const u8>())); { - let l1 = *base.add(0).cast::<*mut u8>(); - let l2 = *base.add(4).cast::(); - let base3 = l1; - let len3 = l2; - _rt::cabi_dealloc(base3, len3 * 4, 4); - } - } - _rt::cabi_dealloc(base6, len6 * 8, 4); + let l3 = *base.add(0).cast::<*mut u8>(); + let l4 = *base + .add(::core::mem::size_of::<*const u8>()) + .cast::(); + let base5 = l3; + let len5 = l4; + _rt::cabi_dealloc(base5, len5 * 4, 4); + } + } + _rt::cabi_dealloc( + base6, + len6 * (2 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); } _ => { - let l7 = i32::from(*arg0.add(4).cast::()); + let l7 = i32::from( + *arg0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); match l7 { - 0 => (), + 0 => {} 1 => { - let l8 = *arg0.add(8).cast::<*mut u8>(); - let l9 = *arg0.add(12).cast::(); + let l8 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l9 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l8, l9, 1); } _ => { - let l10 = *arg0.add(8).cast::<*mut u8>(); - let l11 = *arg0.add(12).cast::(); + let l10 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l11 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l10, l11, 1); } } @@ -9306,42 +10171,50 @@ pub mod exports { ) -> Result; } #[doc(hidden)] - - macro_rules! __export_fermyon_spin_llm_2_0_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "fermyon:spin/llm@2.0.0#infer"] - unsafe extern "C" fn export_infer(arg0: *mut u8,arg1: usize,arg2: *mut u8,arg3: usize,arg4: i32,arg5: i32,arg6: f32,arg7: i32,arg8: f32,arg9: i32,arg10: f32,) -> *mut u8 { - $($path_to_types)*::_export_infer_cabi::<$ty>(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10) - } - #[export_name = "cabi_post_fermyon:spin/llm@2.0.0#infer"] - unsafe extern "C" fn _post_return_infer(arg0: *mut u8,) { - $($path_to_types)*::__post_return_infer::<$ty>(arg0) - } - #[export_name = "fermyon:spin/llm@2.0.0#generate-embeddings"] - unsafe extern "C" fn export_generate_embeddings(arg0: *mut u8,arg1: usize,arg2: *mut u8,arg3: usize,) -> *mut u8 { - $($path_to_types)*::_export_generate_embeddings_cabi::<$ty>(arg0, arg1, arg2, arg3) - } - #[export_name = "cabi_post_fermyon:spin/llm@2.0.0#generate-embeddings"] - unsafe extern "C" fn _post_return_generate_embeddings(arg0: *mut u8,) { - $($path_to_types)*::__post_return_generate_embeddings::<$ty>(arg0) - } - };); -} + macro_rules! __export_fermyon_spin_llm_2_0_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "fermyon:spin/llm@2.0.0#infer")] unsafe extern "C" fn + export_infer(arg0 : * mut u8, arg1 : usize, arg2 : * mut u8, arg3 + : usize, arg4 : i32, arg5 : i32, arg6 : f32, arg7 : i32, arg8 : + f32, arg9 : i32, arg10 : f32,) -> * mut u8 { unsafe { + $($path_to_types)*:: _export_infer_cabi::<$ty > (arg0, arg1, + arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10) } } + #[unsafe (export_name = + "cabi_post_fermyon:spin/llm@2.0.0#infer")] unsafe extern "C" fn + _post_return_infer(arg0 : * mut u8,) { unsafe { + $($path_to_types)*:: __post_return_infer::<$ty > (arg0) } } + #[unsafe (export_name = + "fermyon:spin/llm@2.0.0#generate-embeddings")] unsafe extern "C" + fn export_generate_embeddings(arg0 : * mut u8, arg1 : usize, arg2 + : * mut u8, arg3 : usize,) -> * mut u8 { unsafe { + $($path_to_types)*:: _export_generate_embeddings_cabi::<$ty > + (arg0, arg1, arg2, arg3) } } #[unsafe (export_name = + "cabi_post_fermyon:spin/llm@2.0.0#generate-embeddings")] unsafe + extern "C" fn _post_return_generate_embeddings(arg0 : * mut u8,) + { unsafe { $($path_to_types)*:: + __post_return_generate_embeddings::<$ty > (arg0) } } }; + }; + } #[doc(hidden)] pub(crate) use __export_fermyon_spin_llm_2_0_0_cabi; - #[repr(align(4))] - struct _RetArea([::core::mem::MaybeUninit; 20]); - static mut _RET_AREA: _RetArea = _RetArea([::core::mem::MaybeUninit::uninit(); 20]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct _RetArea( + [::core::mem::MaybeUninit< + u8, + >; 8 + 3 * ::core::mem::size_of::<*const u8>()], + ); + static mut _RET_AREA: _RetArea = _RetArea( + [::core::mem::MaybeUninit::uninit(); 8 + + 3 * ::core::mem::size_of::<*const u8>()], + ); } - - #[allow(dead_code, clippy::all)] + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod redis { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; /// Errors related to interacting with Redis #[derive(Clone)] @@ -9356,7 +10229,10 @@ pub mod exports { Other(_rt::String), } impl ::core::fmt::Debug for Error { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { Error::InvalidAddress => { f.debug_tuple("Error::InvalidAddress").finish() @@ -9364,27 +10240,30 @@ pub mod exports { Error::TooManyConnections => { f.debug_tuple("Error::TooManyConnections").finish() } - Error::TypeError => f.debug_tuple("Error::TypeError").finish(), - Error::Other(e) => f.debug_tuple("Error::Other").field(e).finish(), + Error::TypeError => { + f.debug_tuple("Error::TypeError").finish() + } + Error::Other(e) => { + f.debug_tuple("Error::Other").field(e).finish() + } } } } impl ::core::fmt::Display for Error { - 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 Error {} - #[derive(Debug)] #[repr(transparent)] pub struct Connection { handle: _rt::Resource, } - type _ConnectionRep = Option; - impl Connection { /// Creates a new resource from the specified representation. /// @@ -9394,77 +10273,70 @@ pub mod exports { pub fn new(val: T) -> Self { Self::type_guard::(); let val: _ConnectionRep = Some(val); - let ptr: *mut _ConnectionRep = _rt::Box::into_raw(_rt::Box::new(val)); + let ptr: *mut _ConnectionRep = _rt::Box::into_raw( + _rt::Box::new(val), + ); unsafe { Self::from_handle(T::_resource_new(ptr.cast())) } } - /// Gets access to the underlying `T` which represents this resource. pub fn get(&self) -> &T { let ptr = unsafe { &*self.as_ptr::() }; ptr.as_ref().unwrap() } - /// Gets mutable access to the underlying `T` which represents this /// resource. pub fn get_mut(&mut self) -> &mut T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_mut().unwrap() } - /// Consumes this resource and returns the underlying `T`. pub fn into_inner(self) -> T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.take().unwrap() } - #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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) } - - // It's theoretically possible to implement the `GuestConnection` trait twice - // so guard against using it with two different types here. #[doc(hidden)] fn type_guard() { use core::any::TypeId; static mut LAST_TYPE: Option = None; unsafe { - assert!(!cfg!(target_feature = "threads")); + assert!(! cfg!(target_feature = "atomics")); let id = TypeId::of::(); match LAST_TYPE { - Some(ty) => assert!( - ty == id, - "cannot use two types with this resource type" - ), + Some(ty) => { + assert!( + ty == id, "cannot use two types with this resource type" + ) + } None => LAST_TYPE = Some(id), } } } - #[doc(hidden)] pub unsafe fn dtor(handle: *mut u8) { Self::type_guard::(); - let _ = _rt::Box::from_raw(handle as *mut _ConnectionRep); + let _ = unsafe { + _rt::Box::from_raw(handle as *mut _ConnectionRep) + }; } - fn as_ptr(&self) -> *mut _ConnectionRep { Connection::type_guard::(); T::_resource_rep(self.handle()).cast() } } - /// A borrowed version of [`Connection`] which represents a borrowed value /// with the lifetime `'a`. #[derive(Debug)] @@ -9473,7 +10345,6 @@ pub mod exports { rep: *mut u8, _marker: core::marker::PhantomData<&'a Connection>, } - impl<'a> ConnectionBorrow<'a> { #[doc(hidden)] pub unsafe fn lift(rep: usize) -> Self { @@ -9482,41 +10353,34 @@ pub mod exports { _marker: core::marker::PhantomData, } } - /// Gets access to the underlying `T` in this resource. pub fn get(&self) -> &T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_ref().unwrap() } - - // NB: mutable access is not allowed due to the component model allowing - // multiple borrows of the same resource. - fn as_ptr(&self) -> *mut _ConnectionRep { Connection::type_guard::(); self.rep.cast() } } - unsafe impl _rt::WasmResource for Connection { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]fermyon:spin/redis@2.0.0")] - extern "C" { + #[link( + wasm_import_module = "[export]fermyon:spin/redis@2.0.0" + )] + unsafe extern "C" { #[link_name = "[resource-drop]connection"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - /// The message payload. pub type Payload = _rt::Vec; /// A parameter type for the general-purpose `execute` function. @@ -9526,7 +10390,10 @@ pub mod exports { Binary(Payload), } impl ::core::fmt::Debug for RedisParameter { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { RedisParameter::Int64(e) => { f.debug_tuple("RedisParameter::Int64").field(e).finish() @@ -9546,9 +10413,14 @@ pub mod exports { Binary(Payload), } impl ::core::fmt::Debug for RedisResult { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { - RedisResult::Nil => f.debug_tuple("RedisResult::Nil").finish(), + RedisResult::Nil => { + f.debug_tuple("RedisResult::Nil").finish() + } RedisResult::Status(e) => { f.debug_tuple("RedisResult::Status").field(e).finish() } @@ -9567,37 +10439,50 @@ pub mod exports { arg0: *mut u8, arg1: usize, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg1; let bytes0 = _rt::Vec::from_raw_parts(arg0.cast(), len0, len0); let result1 = T::open(_rt::string_lift(bytes0)); - let ptr2 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr2 = (&raw mut _RET_AREA.0).cast::(); match result1 { Ok(e) => { *ptr2.add(0).cast::() = (0i32) as u8; - *ptr2.add(4).cast::() = (e).take_handle() as i32; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (e).take_handle() as i32; } Err(e) => { *ptr2.add(0).cast::() = (1i32) as u8; match e { Error::InvalidAddress => { - *ptr2.add(4).cast::() = (0i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } Error::TooManyConnections => { - *ptr2.add(4).cast::() = (1i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; } Error::TypeError => { - *ptr2.add(4).cast::() = (2i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (2i32) as u8; } Error::Other(e) => { - *ptr2.add(4).cast::() = (3i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (3i32) as u8; let vec3 = (e.into_bytes()).into_boxed_slice(); let ptr3 = vec3.as_ptr().cast::(); let len3 = vec3.len(); ::core::mem::forget(vec3); - *ptr2.add(12).cast::() = len3; - *ptr2.add(8).cast::<*mut u8>() = ptr3.cast_mut(); + *ptr2 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len3; + *ptr2 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr3.cast_mut(); } } } @@ -9611,16 +10496,22 @@ pub mod exports { ) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { - 0 => (), + 0 => {} _ => { - let l1 = i32::from(*arg0.add(4).cast::()); + let l1 = i32::from( + *arg0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); match l1 { - 0 => (), - 1 => (), - 2 => (), + 0 => {} + 1 => {} + 2 => {} _ => { - let l2 = *arg0.add(8).cast::<*mut u8>(); - let l3 = *arg0.add(12).cast::(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l3 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l2, l3, 1); } } @@ -9636,17 +10527,16 @@ pub mod exports { arg3: *mut u8, arg4: usize, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg2; let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0); let len1 = arg4; let result2 = T::publish( - ConnectionBorrow::lift(arg0 as u32 as usize).get(), + unsafe { ConnectionBorrow::lift(arg0 as u32 as usize) }.get(), _rt::string_lift(bytes0), _rt::Vec::from_raw_parts(arg3.cast(), len1, len1), ); - let ptr3 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr3 = (&raw mut _RET_AREA.0).cast::(); match result2 { Ok(_) => { *ptr3.add(0).cast::() = (0i32) as u8; @@ -9655,22 +10545,34 @@ pub mod exports { *ptr3.add(0).cast::() = (1i32) as u8; match e { Error::InvalidAddress => { - *ptr3.add(4).cast::() = (0i32) as u8; + *ptr3 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } Error::TooManyConnections => { - *ptr3.add(4).cast::() = (1i32) as u8; + *ptr3 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; } Error::TypeError => { - *ptr3.add(4).cast::() = (2i32) as u8; + *ptr3 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (2i32) as u8; } Error::Other(e) => { - *ptr3.add(4).cast::() = (3i32) as u8; + *ptr3 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (3i32) as u8; let vec4 = (e.into_bytes()).into_boxed_slice(); let ptr4 = vec4.as_ptr().cast::(); let len4 = vec4.len(); ::core::mem::forget(vec4); - *ptr3.add(12).cast::() = len4; - *ptr3.add(8).cast::<*mut u8>() = ptr4.cast_mut(); + *ptr3 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len4; + *ptr3 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr4.cast_mut(); } } } @@ -9679,21 +10581,27 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn __post_return_method_connection_publish( - arg0: *mut u8, - ) { + pub unsafe fn __post_return_method_connection_publish< + T: GuestConnection, + >(arg0: *mut u8) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { - 0 => (), + 0 => {} _ => { - let l1 = i32::from(*arg0.add(4).cast::()); + let l1 = i32::from( + *arg0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); match l1 { - 0 => (), - 1 => (), - 2 => (), + 0 => {} + 1 => {} + 2 => {} _ => { - let l2 = *arg0.add(8).cast::<*mut u8>(); - let l3 = *arg0.add(12).cast::(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l3 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l2, l3, 1); } } @@ -9707,30 +10615,37 @@ pub mod exports { arg1: *mut u8, arg2: usize, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg2; let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0); let result1 = T::get( - ConnectionBorrow::lift(arg0 as u32 as usize).get(), + unsafe { ConnectionBorrow::lift(arg0 as u32 as usize) }.get(), _rt::string_lift(bytes0), ); - let ptr2 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr2 = (&raw mut _RET_AREA.0).cast::(); match result1 { Ok(e) => { *ptr2.add(0).cast::() = (0i32) as u8; match e { Some(e) => { - *ptr2.add(4).cast::() = (1i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; let vec3 = (e).into_boxed_slice(); let ptr3 = vec3.as_ptr().cast::(); let len3 = vec3.len(); ::core::mem::forget(vec3); - *ptr2.add(12).cast::() = len3; - *ptr2.add(8).cast::<*mut u8>() = ptr3.cast_mut(); + *ptr2 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len3; + *ptr2 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr3.cast_mut(); } None => { - *ptr2.add(4).cast::() = (0i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } }; } @@ -9738,22 +10653,34 @@ pub mod exports { *ptr2.add(0).cast::() = (1i32) as u8; match e { Error::InvalidAddress => { - *ptr2.add(4).cast::() = (0i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } Error::TooManyConnections => { - *ptr2.add(4).cast::() = (1i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; } Error::TypeError => { - *ptr2.add(4).cast::() = (2i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (2i32) as u8; } Error::Other(e) => { - *ptr2.add(4).cast::() = (3i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (3i32) as u8; let vec4 = (e.into_bytes()).into_boxed_slice(); let ptr4 = vec4.as_ptr().cast::(); let len4 = vec4.len(); ::core::mem::forget(vec4); - *ptr2.add(12).cast::() = len4; - *ptr2.add(8).cast::<*mut u8>() = ptr4.cast_mut(); + *ptr2 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len4; + *ptr2 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr4.cast_mut(); } } } @@ -9768,12 +10695,18 @@ pub mod exports { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { 0 => { - let l1 = i32::from(*arg0.add(4).cast::()); + let l1 = i32::from( + *arg0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); match l1 { - 0 => (), + 0 => {} _ => { - let l2 = *arg0.add(8).cast::<*mut u8>(); - let l3 = *arg0.add(12).cast::(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l3 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); let base4 = l2; let len4 = l3; _rt::cabi_dealloc(base4, len4 * 1, 1); @@ -9781,14 +10714,20 @@ pub mod exports { } } _ => { - let l5 = i32::from(*arg0.add(4).cast::()); + let l5 = i32::from( + *arg0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); match l5 { - 0 => (), - 1 => (), - 2 => (), + 0 => {} + 1 => {} + 2 => {} _ => { - let l6 = *arg0.add(8).cast::<*mut u8>(); - let l7 = *arg0.add(12).cast::(); + let l6 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l7 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l6, l7, 1); } } @@ -9804,17 +10743,16 @@ pub mod exports { arg3: *mut u8, arg4: usize, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg2; let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0); let len1 = arg4; let result2 = T::set( - ConnectionBorrow::lift(arg0 as u32 as usize).get(), + unsafe { ConnectionBorrow::lift(arg0 as u32 as usize) }.get(), _rt::string_lift(bytes0), _rt::Vec::from_raw_parts(arg3.cast(), len1, len1), ); - let ptr3 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr3 = (&raw mut _RET_AREA.0).cast::(); match result2 { Ok(_) => { *ptr3.add(0).cast::() = (0i32) as u8; @@ -9823,22 +10761,34 @@ pub mod exports { *ptr3.add(0).cast::() = (1i32) as u8; match e { Error::InvalidAddress => { - *ptr3.add(4).cast::() = (0i32) as u8; + *ptr3 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } Error::TooManyConnections => { - *ptr3.add(4).cast::() = (1i32) as u8; + *ptr3 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; } Error::TypeError => { - *ptr3.add(4).cast::() = (2i32) as u8; + *ptr3 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (2i32) as u8; } Error::Other(e) => { - *ptr3.add(4).cast::() = (3i32) as u8; + *ptr3 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (3i32) as u8; let vec4 = (e.into_bytes()).into_boxed_slice(); let ptr4 = vec4.as_ptr().cast::(); let len4 = vec4.len(); ::core::mem::forget(vec4); - *ptr3.add(12).cast::() = len4; - *ptr3.add(8).cast::<*mut u8>() = ptr4.cast_mut(); + *ptr3 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len4; + *ptr3 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr4.cast_mut(); } } } @@ -9852,16 +10802,22 @@ pub mod exports { ) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { - 0 => (), + 0 => {} _ => { - let l1 = i32::from(*arg0.add(4).cast::()); + let l1 = i32::from( + *arg0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); match l1 { - 0 => (), - 1 => (), - 2 => (), + 0 => {} + 1 => {} + 2 => {} _ => { - let l2 = *arg0.add(8).cast::<*mut u8>(); - let l3 = *arg0.add(12).cast::(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l3 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l2, l3, 1); } } @@ -9875,15 +10831,14 @@ pub mod exports { arg1: *mut u8, arg2: usize, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg2; let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0); let result1 = T::incr( - ConnectionBorrow::lift(arg0 as u32 as usize).get(), + unsafe { ConnectionBorrow::lift(arg0 as u32 as usize) }.get(), _rt::string_lift(bytes0), ); - let ptr2 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr2 = (&raw mut _RET_AREA.0).cast::(); match result1 { Ok(e) => { *ptr2.add(0).cast::() = (0i32) as u8; @@ -9907,8 +10862,12 @@ pub mod exports { let ptr3 = vec3.as_ptr().cast::(); let len3 = vec3.len(); ::core::mem::forget(vec3); - *ptr2.add(16).cast::() = len3; - *ptr2.add(12).cast::<*mut u8>() = ptr3.cast_mut(); + *ptr2 + .add(8 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len3; + *ptr2 + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr3.cast_mut(); } } } @@ -9922,16 +10881,20 @@ pub mod exports { ) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { - 0 => (), + 0 => {} _ => { let l1 = i32::from(*arg0.add(8).cast::()); match l1 { - 0 => (), - 1 => (), - 2 => (), + 0 => {} + 1 => {} + 2 => {} _ => { - let l2 = *arg0.add(12).cast::<*mut u8>(); - let l3 = *arg0.add(16).cast::(); + let l2 = *arg0 + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l3 = *arg0 + .add(8 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l2, l3, 1); } } @@ -9945,52 +10908,73 @@ pub mod exports { arg1: *mut u8, arg2: usize, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let base3 = arg1; let len3 = arg2; let mut result3 = _rt::Vec::with_capacity(len3); for i in 0..len3 { - let base = base3.add(i * 8); + let base = base3 + .add(i * (2 * ::core::mem::size_of::<*const u8>())); let e3 = { let l0 = *base.add(0).cast::<*mut u8>(); - let l1 = *base.add(4).cast::(); + let l1 = *base + .add(::core::mem::size_of::<*const u8>()) + .cast::(); let len2 = l1; let bytes2 = _rt::Vec::from_raw_parts(l0.cast(), len2, len2); - _rt::string_lift(bytes2) }; result3.push(e3); } - _rt::cabi_dealloc(base3, len3 * 8, 4); - let result4 = - T::del(ConnectionBorrow::lift(arg0 as u32 as usize).get(), result3); - let ptr5 = _RET_AREA.0.as_mut_ptr().cast::(); + _rt::cabi_dealloc( + base3, + len3 * (2 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); + let result4 = T::del( + unsafe { ConnectionBorrow::lift(arg0 as u32 as usize) }.get(), + result3, + ); + let ptr5 = (&raw mut _RET_AREA.0).cast::(); match result4 { Ok(e) => { *ptr5.add(0).cast::() = (0i32) as u8; - *ptr5.add(4).cast::() = _rt::as_i32(e); + *ptr5 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = _rt::as_i32(e); } Err(e) => { *ptr5.add(0).cast::() = (1i32) as u8; match e { Error::InvalidAddress => { - *ptr5.add(4).cast::() = (0i32) as u8; + *ptr5 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } Error::TooManyConnections => { - *ptr5.add(4).cast::() = (1i32) as u8; + *ptr5 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; } Error::TypeError => { - *ptr5.add(4).cast::() = (2i32) as u8; + *ptr5 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (2i32) as u8; } Error::Other(e) => { - *ptr5.add(4).cast::() = (3i32) as u8; + *ptr5 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (3i32) as u8; let vec6 = (e.into_bytes()).into_boxed_slice(); let ptr6 = vec6.as_ptr().cast::(); let len6 = vec6.len(); ::core::mem::forget(vec6); - *ptr5.add(12).cast::() = len6; - *ptr5.add(8).cast::<*mut u8>() = ptr6.cast_mut(); + *ptr5 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len6; + *ptr5 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr6.cast_mut(); } } } @@ -10004,16 +10988,22 @@ pub mod exports { ) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { - 0 => (), + 0 => {} _ => { - let l1 = i32::from(*arg0.add(4).cast::()); + let l1 = i32::from( + *arg0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); match l1 { - 0 => (), - 1 => (), - 2 => (), + 0 => {} + 1 => {} + 2 => {} _ => { - let l2 = *arg0.add(8).cast::<*mut u8>(); - let l3 = *arg0.add(12).cast::(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l3 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l2, l3, 1); } } @@ -10029,57 +11019,76 @@ pub mod exports { arg3: *mut u8, arg4: usize, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg2; let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0); let base4 = arg3; let len4 = arg4; let mut result4 = _rt::Vec::with_capacity(len4); for i in 0..len4 { - let base = base4.add(i * 8); + let base = base4 + .add(i * (2 * ::core::mem::size_of::<*const u8>())); let e4 = { let l1 = *base.add(0).cast::<*mut u8>(); - let l2 = *base.add(4).cast::(); + let l2 = *base + .add(::core::mem::size_of::<*const u8>()) + .cast::(); let len3 = l2; let bytes3 = _rt::Vec::from_raw_parts(l1.cast(), len3, len3); - _rt::string_lift(bytes3) }; result4.push(e4); } - _rt::cabi_dealloc(base4, len4 * 8, 4); + _rt::cabi_dealloc( + base4, + len4 * (2 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); let result5 = T::sadd( - ConnectionBorrow::lift(arg0 as u32 as usize).get(), + unsafe { ConnectionBorrow::lift(arg0 as u32 as usize) }.get(), _rt::string_lift(bytes0), result4, ); - let ptr6 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr6 = (&raw mut _RET_AREA.0).cast::(); match result5 { Ok(e) => { *ptr6.add(0).cast::() = (0i32) as u8; - *ptr6.add(4).cast::() = _rt::as_i32(e); + *ptr6 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = _rt::as_i32(e); } Err(e) => { *ptr6.add(0).cast::() = (1i32) as u8; match e { Error::InvalidAddress => { - *ptr6.add(4).cast::() = (0i32) as u8; + *ptr6 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } Error::TooManyConnections => { - *ptr6.add(4).cast::() = (1i32) as u8; + *ptr6 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; } Error::TypeError => { - *ptr6.add(4).cast::() = (2i32) as u8; + *ptr6 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (2i32) as u8; } Error::Other(e) => { - *ptr6.add(4).cast::() = (3i32) as u8; + *ptr6 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (3i32) as u8; let vec7 = (e.into_bytes()).into_boxed_slice(); let ptr7 = vec7.as_ptr().cast::(); let len7 = vec7.len(); ::core::mem::forget(vec7); - *ptr6.add(12).cast::() = len7; - *ptr6.add(8).cast::<*mut u8>() = ptr7.cast_mut(); + *ptr6 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len7; + *ptr6 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr7.cast_mut(); } } } @@ -10093,16 +11102,22 @@ pub mod exports { ) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { - 0 => (), + 0 => {} _ => { - let l1 = i32::from(*arg0.add(4).cast::()); + let l1 = i32::from( + *arg0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); match l1 { - 0 => (), - 1 => (), - 2 => (), + 0 => {} + 1 => {} + 2 => {} _ => { - let l2 = *arg0.add(8).cast::<*mut u8>(); - let l3 = *arg0.add(12).cast::(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l3 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l2, l3, 1); } } @@ -10111,27 +11126,26 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_connection_smembers_cabi( - arg0: *mut u8, - arg1: *mut u8, - arg2: usize, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + pub unsafe fn _export_method_connection_smembers_cabi< + T: GuestConnection, + >(arg0: *mut u8, arg1: *mut u8, arg2: usize) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg2; let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0); let result1 = T::smembers( - ConnectionBorrow::lift(arg0 as u32 as usize).get(), + unsafe { ConnectionBorrow::lift(arg0 as u32 as usize) }.get(), _rt::string_lift(bytes0), ); - let ptr2 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr2 = (&raw mut _RET_AREA.0).cast::(); match result1 { Ok(e) => { *ptr2.add(0).cast::() = (0i32) as u8; let vec4 = e; let len4 = vec4.len(); - let layout4 = - _rt::alloc::Layout::from_size_align_unchecked(vec4.len() * 8, 4); + let layout4 = _rt::alloc::Layout::from_size_align_unchecked( + vec4.len() * (2 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); let result4 = if layout4.size() != 0 { let ptr = _rt::alloc::alloc(layout4).cast::(); if ptr.is_null() { @@ -10139,44 +11153,61 @@ pub mod exports { } ptr } else { - { - ::core::ptr::null_mut() - } + ::core::ptr::null_mut() }; for (i, e) in vec4.into_iter().enumerate() { - let base = result4.add(i * 8); + let base = result4 + .add(i * (2 * ::core::mem::size_of::<*const u8>())); { let vec3 = (e.into_bytes()).into_boxed_slice(); let ptr3 = vec3.as_ptr().cast::(); let len3 = vec3.len(); ::core::mem::forget(vec3); - *base.add(4).cast::() = len3; + *base + .add(::core::mem::size_of::<*const u8>()) + .cast::() = len3; *base.add(0).cast::<*mut u8>() = ptr3.cast_mut(); } } - *ptr2.add(8).cast::() = len4; - *ptr2.add(4).cast::<*mut u8>() = result4; + *ptr2 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len4; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = result4; } Err(e) => { *ptr2.add(0).cast::() = (1i32) as u8; match e { Error::InvalidAddress => { - *ptr2.add(4).cast::() = (0i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } Error::TooManyConnections => { - *ptr2.add(4).cast::() = (1i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; } Error::TypeError => { - *ptr2.add(4).cast::() = (2i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (2i32) as u8; } Error::Other(e) => { - *ptr2.add(4).cast::() = (3i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (3i32) as u8; let vec5 = (e.into_bytes()).into_boxed_slice(); let ptr5 = vec5.as_ptr().cast::(); let len5 = vec5.len(); ::core::mem::forget(vec5); - *ptr2.add(12).cast::() = len5; - *ptr2.add(8).cast::<*mut u8>() = ptr5.cast_mut(); + *ptr2 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len5; + *ptr2 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr5.cast_mut(); } } } @@ -10185,35 +11216,52 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn __post_return_method_connection_smembers( - arg0: *mut u8, - ) { + pub unsafe fn __post_return_method_connection_smembers< + T: GuestConnection, + >(arg0: *mut u8) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { 0 => { - let l3 = *arg0.add(4).cast::<*mut u8>(); - let l4 = *arg0.add(8).cast::(); - let base5 = l3; - let len5 = l4; + let l1 = *arg0 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let base5 = l1; + let len5 = l2; for i in 0..len5 { - let base = base5.add(i * 8); + let base = base5 + .add(i * (2 * ::core::mem::size_of::<*const u8>())); { - let l1 = *base.add(0).cast::<*mut u8>(); - let l2 = *base.add(4).cast::(); - _rt::cabi_dealloc(l1, l2, 1); + let l3 = *base.add(0).cast::<*mut u8>(); + let l4 = *base + .add(::core::mem::size_of::<*const u8>()) + .cast::(); + _rt::cabi_dealloc(l3, l4, 1); } } - _rt::cabi_dealloc(base5, len5 * 8, 4); + _rt::cabi_dealloc( + base5, + len5 * (2 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); } _ => { - let l6 = i32::from(*arg0.add(4).cast::()); + let l6 = i32::from( + *arg0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); match l6 { - 0 => (), - 1 => (), - 2 => (), + 0 => {} + 1 => {} + 2 => {} _ => { - let l7 = *arg0.add(8).cast::<*mut u8>(); - let l8 = *arg0.add(12).cast::(); + let l7 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l8 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l7, l8, 1); } } @@ -10229,57 +11277,76 @@ pub mod exports { arg3: *mut u8, arg4: usize, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg2; let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0); let base4 = arg3; let len4 = arg4; let mut result4 = _rt::Vec::with_capacity(len4); for i in 0..len4 { - let base = base4.add(i * 8); + let base = base4 + .add(i * (2 * ::core::mem::size_of::<*const u8>())); let e4 = { let l1 = *base.add(0).cast::<*mut u8>(); - let l2 = *base.add(4).cast::(); + let l2 = *base + .add(::core::mem::size_of::<*const u8>()) + .cast::(); let len3 = l2; let bytes3 = _rt::Vec::from_raw_parts(l1.cast(), len3, len3); - _rt::string_lift(bytes3) }; result4.push(e4); } - _rt::cabi_dealloc(base4, len4 * 8, 4); + _rt::cabi_dealloc( + base4, + len4 * (2 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); let result5 = T::srem( - ConnectionBorrow::lift(arg0 as u32 as usize).get(), + unsafe { ConnectionBorrow::lift(arg0 as u32 as usize) }.get(), _rt::string_lift(bytes0), result4, ); - let ptr6 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr6 = (&raw mut _RET_AREA.0).cast::(); match result5 { Ok(e) => { *ptr6.add(0).cast::() = (0i32) as u8; - *ptr6.add(4).cast::() = _rt::as_i32(e); + *ptr6 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = _rt::as_i32(e); } Err(e) => { *ptr6.add(0).cast::() = (1i32) as u8; match e { Error::InvalidAddress => { - *ptr6.add(4).cast::() = (0i32) as u8; + *ptr6 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } Error::TooManyConnections => { - *ptr6.add(4).cast::() = (1i32) as u8; + *ptr6 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; } Error::TypeError => { - *ptr6.add(4).cast::() = (2i32) as u8; + *ptr6 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (2i32) as u8; } Error::Other(e) => { - *ptr6.add(4).cast::() = (3i32) as u8; + *ptr6 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (3i32) as u8; let vec7 = (e.into_bytes()).into_boxed_slice(); let ptr7 = vec7.as_ptr().cast::(); let len7 = vec7.len(); ::core::mem::forget(vec7); - *ptr6.add(12).cast::() = len7; - *ptr6.add(8).cast::<*mut u8>() = ptr7.cast_mut(); + *ptr6 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len7; + *ptr6 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr7.cast_mut(); } } } @@ -10293,16 +11360,22 @@ pub mod exports { ) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { - 0 => (), + 0 => {} _ => { - let l1 = i32::from(*arg0.add(4).cast::()); + let l1 = i32::from( + *arg0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); match l1 { - 0 => (), - 1 => (), - 2 => (), + 0 => {} + 1 => {} + 2 => {} _ => { - let l2 = *arg0.add(8).cast::<*mut u8>(); - let l3 = *arg0.add(12).cast::(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l3 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l2, l3, 1); } } @@ -10318,22 +11391,21 @@ pub mod exports { arg3: *mut u8, arg4: usize, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg2; let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0); let base7 = arg3; let len7 = arg4; let mut result7 = _rt::Vec::with_capacity(len7); for i in 0..len7 { - let base = base7.add(i * 16); + let base = base7 + .add(i * (8 + 2 * ::core::mem::size_of::<*const u8>())); let e7 = { let l1 = i32::from(*base.add(0).cast::()); let v6 = match l1 { 0 => { let e6 = { let l2 = *base.add(8).cast::(); - l2 }; RedisParameter::Int64(e6) @@ -10342,33 +11414,39 @@ pub mod exports { debug_assert_eq!(n, 1, "invalid enum discriminant"); let e6 = { let l3 = *base.add(8).cast::<*mut u8>(); - let l4 = *base.add(12).cast::(); + let l4 = *base + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(); let len5 = l4; - _rt::Vec::from_raw_parts(l3.cast(), len5, len5) }; RedisParameter::Binary(e6) } }; - v6 }; result7.push(e7); } - _rt::cabi_dealloc(base7, len7 * 16, 8); + _rt::cabi_dealloc( + base7, + len7 * (8 + 2 * ::core::mem::size_of::<*const u8>()), + 8, + ); let result8 = T::execute( - ConnectionBorrow::lift(arg0 as u32 as usize).get(), + unsafe { ConnectionBorrow::lift(arg0 as u32 as usize) }.get(), _rt::string_lift(bytes0), result7, ); - let ptr9 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr9 = (&raw mut _RET_AREA.0).cast::(); match result8 { Ok(e) => { *ptr9.add(0).cast::() = (0i32) as u8; let vec12 = e; let len12 = vec12.len(); - let layout12 = - _rt::alloc::Layout::from_size_align_unchecked(vec12.len() * 16, 8); + let layout12 = _rt::alloc::Layout::from_size_align_unchecked( + vec12.len() * (8 + 2 * ::core::mem::size_of::<*const u8>()), + 8, + ); let result12 = if layout12.size() != 0 { let ptr = _rt::alloc::alloc(layout12).cast::(); if ptr.is_null() { @@ -10376,12 +11454,11 @@ pub mod exports { } ptr } else { - { - ::core::ptr::null_mut() - } + ::core::ptr::null_mut() }; for (i, e) in vec12.into_iter().enumerate() { - let base = result12.add(i * 16); + let base = result12 + .add(i * (8 + 2 * ::core::mem::size_of::<*const u8>())); { match e { RedisResult::Nil => { @@ -10393,7 +11470,9 @@ pub mod exports { let ptr10 = vec10.as_ptr().cast::(); let len10 = vec10.len(); ::core::mem::forget(vec10); - *base.add(12).cast::() = len10; + *base + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::() = len10; *base.add(8).cast::<*mut u8>() = ptr10.cast_mut(); } RedisResult::Int64(e) => { @@ -10406,35 +11485,53 @@ pub mod exports { let ptr11 = vec11.as_ptr().cast::(); let len11 = vec11.len(); ::core::mem::forget(vec11); - *base.add(12).cast::() = len11; + *base + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::() = len11; *base.add(8).cast::<*mut u8>() = ptr11.cast_mut(); } } } } - *ptr9.add(8).cast::() = len12; - *ptr9.add(4).cast::<*mut u8>() = result12; + *ptr9 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len12; + *ptr9 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = result12; } Err(e) => { *ptr9.add(0).cast::() = (1i32) as u8; match e { Error::InvalidAddress => { - *ptr9.add(4).cast::() = (0i32) as u8; + *ptr9 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } Error::TooManyConnections => { - *ptr9.add(4).cast::() = (1i32) as u8; + *ptr9 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; } Error::TypeError => { - *ptr9.add(4).cast::() = (2i32) as u8; + *ptr9 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (2i32) as u8; } Error::Other(e) => { - *ptr9.add(4).cast::() = (3i32) as u8; + *ptr9 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (3i32) as u8; let vec13 = (e.into_bytes()).into_boxed_slice(); let ptr13 = vec13.as_ptr().cast::(); let len13 = vec13.len(); ::core::mem::forget(vec13); - *ptr9.add(12).cast::() = len13; - *ptr9.add(8).cast::<*mut u8>() = ptr13.cast_mut(); + *ptr9 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len13; + *ptr9 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr13.cast_mut(); } } } @@ -10443,49 +11540,68 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn __post_return_method_connection_execute( - arg0: *mut u8, - ) { + pub unsafe fn __post_return_method_connection_execute< + T: GuestConnection, + >(arg0: *mut u8) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { 0 => { - let l7 = *arg0.add(4).cast::<*mut u8>(); - let l8 = *arg0.add(8).cast::(); - let base9 = l7; - let len9 = l8; + let l1 = *arg0 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let base9 = l1; + let len9 = l2; for i in 0..len9 { - let base = base9.add(i * 16); + let base = base9 + .add(i * (8 + 2 * ::core::mem::size_of::<*const u8>())); { - let l1 = i32::from(*base.add(0).cast::()); - match l1 { - 0 => (), + let l3 = i32::from(*base.add(0).cast::()); + match l3 { + 0 => {} 1 => { - let l2 = *base.add(8).cast::<*mut u8>(); - let l3 = *base.add(12).cast::(); - _rt::cabi_dealloc(l2, l3, 1); + let l4 = *base.add(8).cast::<*mut u8>(); + let l5 = *base + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(); + _rt::cabi_dealloc(l4, l5, 1); } - 2 => (), + 2 => {} _ => { - let l4 = *base.add(8).cast::<*mut u8>(); - let l5 = *base.add(12).cast::(); - let base6 = l4; - let len6 = l5; - _rt::cabi_dealloc(base6, len6 * 1, 1); + let l6 = *base.add(8).cast::<*mut u8>(); + let l7 = *base + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let base8 = l6; + let len8 = l7; + _rt::cabi_dealloc(base8, len8 * 1, 1); } } } } - _rt::cabi_dealloc(base9, len9 * 16, 8); + _rt::cabi_dealloc( + base9, + len9 * (8 + 2 * ::core::mem::size_of::<*const u8>()), + 8, + ); } _ => { - let l10 = i32::from(*arg0.add(4).cast::()); + let l10 = i32::from( + *arg0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); match l10 { - 0 => (), - 1 => (), - 2 => (), + 0 => {} + 1 => {} + 2 => {} _ => { - let l11 = *arg0.add(8).cast::<*mut u8>(); - let l12 = *arg0.add(12).cast::(); + let l11 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l12 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l11, l12, 1); } } @@ -10506,18 +11622,18 @@ pub mod exports { let _ = val; unreachable!(); } - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]fermyon:spin/redis@2.0.0")] - extern "C" { + #[link( + wasm_import_module = "[export]fermyon:spin/redis@2.0.0" + )] + unsafe extern "C" { #[link_name = "[resource-new]connection"] fn new(_: *mut u8) -> u32; } - new(val) + unsafe { new(val) } } } - #[doc(hidden)] fn _resource_rep(handle: u32) -> *mut u8 where @@ -10528,22 +11644,26 @@ pub mod exports { let _ = handle; unreachable!(); } - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]fermyon:spin/redis@2.0.0")] - extern "C" { + #[link( + wasm_import_module = "[export]fermyon:spin/redis@2.0.0" + )] + unsafe extern "C" { #[link_name = "[resource-rep]connection"] fn rep(_: u32) -> *mut u8; } unsafe { rep(handle) } } } - /// Open a connection to the Redis instance at `address`. fn open(address: _rt::String) -> Result; /// Publish a Redis message to the specified channel. - fn publish(&self, channel: _rt::String, payload: Payload) -> Result<(), Error>; + fn publish( + &self, + channel: _rt::String, + payload: Payload, + ) -> Result<(), Error>; /// Get the value of a key. fn get(&self, key: _rt::String) -> Result, Error>; /// Set key to value. @@ -10567,7 +11687,10 @@ pub mod exports { values: _rt::Vec<_rt::String>, ) -> Result; /// Retrieve the contents of the set named `key`. - fn smembers(&self, key: _rt::String) -> Result<_rt::Vec<_rt::String>, Error>; + fn smembers( + &self, + key: _rt::String, + ) -> Result<_rt::Vec<_rt::String>, Error>; /// Remove the specified `values` from the set named `key`, returning the number of newly-removed values. fn srem( &self, @@ -10582,118 +11705,159 @@ pub mod exports { ) -> Result<_rt::Vec, Error>; } #[doc(hidden)] - - macro_rules! __export_fermyon_spin_redis_2_0_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "fermyon:spin/redis@2.0.0#[static]connection.open"] - unsafe extern "C" fn export_static_connection_open(arg0: *mut u8,arg1: usize,) -> *mut u8 { - $($path_to_types)*::_export_static_connection_open_cabi::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0, arg1) - } - #[export_name = "cabi_post_fermyon:spin/redis@2.0.0#[static]connection.open"] - unsafe extern "C" fn _post_return_static_connection_open(arg0: *mut u8,) { - $($path_to_types)*::__post_return_static_connection_open::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0) - } - #[export_name = "fermyon:spin/redis@2.0.0#[method]connection.publish"] - unsafe extern "C" fn export_method_connection_publish(arg0: *mut u8,arg1: *mut u8,arg2: usize,arg3: *mut u8,arg4: usize,) -> *mut u8 { - $($path_to_types)*::_export_method_connection_publish_cabi::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0, arg1, arg2, arg3, arg4) - } - #[export_name = "cabi_post_fermyon:spin/redis@2.0.0#[method]connection.publish"] - unsafe extern "C" fn _post_return_method_connection_publish(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_connection_publish::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0) - } - #[export_name = "fermyon:spin/redis@2.0.0#[method]connection.get"] - unsafe extern "C" fn export_method_connection_get(arg0: *mut u8,arg1: *mut u8,arg2: usize,) -> *mut u8 { - $($path_to_types)*::_export_method_connection_get_cabi::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0, arg1, arg2) - } - #[export_name = "cabi_post_fermyon:spin/redis@2.0.0#[method]connection.get"] - unsafe extern "C" fn _post_return_method_connection_get(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_connection_get::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0) - } - #[export_name = "fermyon:spin/redis@2.0.0#[method]connection.set"] - unsafe extern "C" fn export_method_connection_set(arg0: *mut u8,arg1: *mut u8,arg2: usize,arg3: *mut u8,arg4: usize,) -> *mut u8 { - $($path_to_types)*::_export_method_connection_set_cabi::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0, arg1, arg2, arg3, arg4) - } - #[export_name = "cabi_post_fermyon:spin/redis@2.0.0#[method]connection.set"] - unsafe extern "C" fn _post_return_method_connection_set(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_connection_set::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0) - } - #[export_name = "fermyon:spin/redis@2.0.0#[method]connection.incr"] - unsafe extern "C" fn export_method_connection_incr(arg0: *mut u8,arg1: *mut u8,arg2: usize,) -> *mut u8 { - $($path_to_types)*::_export_method_connection_incr_cabi::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0, arg1, arg2) - } - #[export_name = "cabi_post_fermyon:spin/redis@2.0.0#[method]connection.incr"] - unsafe extern "C" fn _post_return_method_connection_incr(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_connection_incr::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0) - } - #[export_name = "fermyon:spin/redis@2.0.0#[method]connection.del"] - unsafe extern "C" fn export_method_connection_del(arg0: *mut u8,arg1: *mut u8,arg2: usize,) -> *mut u8 { - $($path_to_types)*::_export_method_connection_del_cabi::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0, arg1, arg2) - } - #[export_name = "cabi_post_fermyon:spin/redis@2.0.0#[method]connection.del"] - unsafe extern "C" fn _post_return_method_connection_del(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_connection_del::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0) - } - #[export_name = "fermyon:spin/redis@2.0.0#[method]connection.sadd"] - unsafe extern "C" fn export_method_connection_sadd(arg0: *mut u8,arg1: *mut u8,arg2: usize,arg3: *mut u8,arg4: usize,) -> *mut u8 { - $($path_to_types)*::_export_method_connection_sadd_cabi::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0, arg1, arg2, arg3, arg4) - } - #[export_name = "cabi_post_fermyon:spin/redis@2.0.0#[method]connection.sadd"] - unsafe extern "C" fn _post_return_method_connection_sadd(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_connection_sadd::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0) - } - #[export_name = "fermyon:spin/redis@2.0.0#[method]connection.smembers"] - unsafe extern "C" fn export_method_connection_smembers(arg0: *mut u8,arg1: *mut u8,arg2: usize,) -> *mut u8 { - $($path_to_types)*::_export_method_connection_smembers_cabi::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0, arg1, arg2) - } - #[export_name = "cabi_post_fermyon:spin/redis@2.0.0#[method]connection.smembers"] - unsafe extern "C" fn _post_return_method_connection_smembers(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_connection_smembers::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0) - } - #[export_name = "fermyon:spin/redis@2.0.0#[method]connection.srem"] - unsafe extern "C" fn export_method_connection_srem(arg0: *mut u8,arg1: *mut u8,arg2: usize,arg3: *mut u8,arg4: usize,) -> *mut u8 { - $($path_to_types)*::_export_method_connection_srem_cabi::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0, arg1, arg2, arg3, arg4) - } - #[export_name = "cabi_post_fermyon:spin/redis@2.0.0#[method]connection.srem"] - unsafe extern "C" fn _post_return_method_connection_srem(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_connection_srem::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0) - } - #[export_name = "fermyon:spin/redis@2.0.0#[method]connection.execute"] - unsafe extern "C" fn export_method_connection_execute(arg0: *mut u8,arg1: *mut u8,arg2: usize,arg3: *mut u8,arg4: usize,) -> *mut u8 { - $($path_to_types)*::_export_method_connection_execute_cabi::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0, arg1, arg2, arg3, arg4) - } - #[export_name = "cabi_post_fermyon:spin/redis@2.0.0#[method]connection.execute"] - unsafe extern "C" fn _post_return_method_connection_execute(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_connection_execute::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0) - } - - const _: () = { - #[doc(hidden)] - #[export_name = "fermyon:spin/redis@2.0.0#[dtor]connection"] - #[allow(non_snake_case)] - unsafe extern "C" fn dtor(rep: *mut u8) { - $($path_to_types)*::Connection::dtor::< - <$ty as $($path_to_types)*::Guest>::Connection - >(rep) - } - }; - - };); -} + macro_rules! __export_fermyon_spin_redis_2_0_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "fermyon:spin/redis@2.0.0#[static]connection.open")] unsafe + extern "C" fn export_static_connection_open(arg0 : * mut u8, arg1 + : usize,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_static_connection_open_cabi::<<$ty as + $($path_to_types)*:: Guest >::Connection > (arg0, arg1) } } + #[unsafe (export_name = + "cabi_post_fermyon:spin/redis@2.0.0#[static]connection.open")] + unsafe extern "C" fn _post_return_static_connection_open(arg0 : * + mut u8,) { unsafe { $($path_to_types)*:: + __post_return_static_connection_open::<<$ty as + $($path_to_types)*:: Guest >::Connection > (arg0) } } #[unsafe + (export_name = + "fermyon:spin/redis@2.0.0#[method]connection.publish")] unsafe + extern "C" fn export_method_connection_publish(arg0 : * mut u8, + arg1 : * mut u8, arg2 : usize, arg3 : * mut u8, arg4 : usize,) -> + * mut u8 { unsafe { $($path_to_types)*:: + _export_method_connection_publish_cabi::<<$ty as + $($path_to_types)*:: Guest >::Connection > (arg0, arg1, arg2, + arg3, arg4) } } #[unsafe (export_name = + "cabi_post_fermyon:spin/redis@2.0.0#[method]connection.publish")] + unsafe extern "C" fn _post_return_method_connection_publish(arg0 + : * mut u8,) { unsafe { $($path_to_types)*:: + __post_return_method_connection_publish::<<$ty as + $($path_to_types)*:: Guest >::Connection > (arg0) } } #[unsafe + (export_name = + "fermyon:spin/redis@2.0.0#[method]connection.get")] unsafe extern + "C" fn export_method_connection_get(arg0 : * mut u8, arg1 : * mut + u8, arg2 : usize,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_connection_get_cabi::<<$ty as $($path_to_types)*:: + Guest >::Connection > (arg0, arg1, arg2) } } #[unsafe + (export_name = + "cabi_post_fermyon:spin/redis@2.0.0#[method]connection.get")] + unsafe extern "C" fn _post_return_method_connection_get(arg0 : * + mut u8,) { unsafe { $($path_to_types)*:: + __post_return_method_connection_get::<<$ty as + $($path_to_types)*:: Guest >::Connection > (arg0) } } #[unsafe + (export_name = + "fermyon:spin/redis@2.0.0#[method]connection.set")] unsafe extern + "C" fn export_method_connection_set(arg0 : * mut u8, arg1 : * mut + u8, arg2 : usize, arg3 : * mut u8, arg4 : usize,) -> * mut u8 { + unsafe { $($path_to_types)*:: + _export_method_connection_set_cabi::<<$ty as $($path_to_types)*:: + Guest >::Connection > (arg0, arg1, arg2, arg3, arg4) } } #[unsafe + (export_name = + "cabi_post_fermyon:spin/redis@2.0.0#[method]connection.set")] + unsafe extern "C" fn _post_return_method_connection_set(arg0 : * + mut u8,) { unsafe { $($path_to_types)*:: + __post_return_method_connection_set::<<$ty as + $($path_to_types)*:: Guest >::Connection > (arg0) } } #[unsafe + (export_name = + "fermyon:spin/redis@2.0.0#[method]connection.incr")] unsafe + extern "C" fn export_method_connection_incr(arg0 : * mut u8, arg1 + : * mut u8, arg2 : usize,) -> * mut u8 { unsafe { + $($path_to_types)*:: _export_method_connection_incr_cabi::<<$ty + as $($path_to_types)*:: Guest >::Connection > (arg0, arg1, arg2) + } } #[unsafe (export_name = + "cabi_post_fermyon:spin/redis@2.0.0#[method]connection.incr")] + unsafe extern "C" fn _post_return_method_connection_incr(arg0 : * + mut u8,) { unsafe { $($path_to_types)*:: + __post_return_method_connection_incr::<<$ty as + $($path_to_types)*:: Guest >::Connection > (arg0) } } #[unsafe + (export_name = + "fermyon:spin/redis@2.0.0#[method]connection.del")] unsafe extern + "C" fn export_method_connection_del(arg0 : * mut u8, arg1 : * mut + u8, arg2 : usize,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_connection_del_cabi::<<$ty as $($path_to_types)*:: + Guest >::Connection > (arg0, arg1, arg2) } } #[unsafe + (export_name = + "cabi_post_fermyon:spin/redis@2.0.0#[method]connection.del")] + unsafe extern "C" fn _post_return_method_connection_del(arg0 : * + mut u8,) { unsafe { $($path_to_types)*:: + __post_return_method_connection_del::<<$ty as + $($path_to_types)*:: Guest >::Connection > (arg0) } } #[unsafe + (export_name = + "fermyon:spin/redis@2.0.0#[method]connection.sadd")] unsafe + extern "C" fn export_method_connection_sadd(arg0 : * mut u8, arg1 + : * mut u8, arg2 : usize, arg3 : * mut u8, arg4 : usize,) -> * + mut u8 { unsafe { $($path_to_types)*:: + _export_method_connection_sadd_cabi::<<$ty as + $($path_to_types)*:: Guest >::Connection > (arg0, arg1, arg2, + arg3, arg4) } } #[unsafe (export_name = + "cabi_post_fermyon:spin/redis@2.0.0#[method]connection.sadd")] + unsafe extern "C" fn _post_return_method_connection_sadd(arg0 : * + mut u8,) { unsafe { $($path_to_types)*:: + __post_return_method_connection_sadd::<<$ty as + $($path_to_types)*:: Guest >::Connection > (arg0) } } #[unsafe + (export_name = + "fermyon:spin/redis@2.0.0#[method]connection.smembers")] unsafe + extern "C" fn export_method_connection_smembers(arg0 : * mut u8, + arg1 : * mut u8, arg2 : usize,) -> * mut u8 { unsafe { + $($path_to_types)*:: + _export_method_connection_smembers_cabi::<<$ty as + $($path_to_types)*:: Guest >::Connection > (arg0, arg1, arg2) } } + #[unsafe (export_name = + "cabi_post_fermyon:spin/redis@2.0.0#[method]connection.smembers")] + unsafe extern "C" fn _post_return_method_connection_smembers(arg0 + : * mut u8,) { unsafe { $($path_to_types)*:: + __post_return_method_connection_smembers::<<$ty as + $($path_to_types)*:: Guest >::Connection > (arg0) } } #[unsafe + (export_name = + "fermyon:spin/redis@2.0.0#[method]connection.srem")] unsafe + extern "C" fn export_method_connection_srem(arg0 : * mut u8, arg1 + : * mut u8, arg2 : usize, arg3 : * mut u8, arg4 : usize,) -> * + mut u8 { unsafe { $($path_to_types)*:: + _export_method_connection_srem_cabi::<<$ty as + $($path_to_types)*:: Guest >::Connection > (arg0, arg1, arg2, + arg3, arg4) } } #[unsafe (export_name = + "cabi_post_fermyon:spin/redis@2.0.0#[method]connection.srem")] + unsafe extern "C" fn _post_return_method_connection_srem(arg0 : * + mut u8,) { unsafe { $($path_to_types)*:: + __post_return_method_connection_srem::<<$ty as + $($path_to_types)*:: Guest >::Connection > (arg0) } } #[unsafe + (export_name = + "fermyon:spin/redis@2.0.0#[method]connection.execute")] unsafe + extern "C" fn export_method_connection_execute(arg0 : * mut u8, + arg1 : * mut u8, arg2 : usize, arg3 : * mut u8, arg4 : usize,) -> + * mut u8 { unsafe { $($path_to_types)*:: + _export_method_connection_execute_cabi::<<$ty as + $($path_to_types)*:: Guest >::Connection > (arg0, arg1, arg2, + arg3, arg4) } } #[unsafe (export_name = + "cabi_post_fermyon:spin/redis@2.0.0#[method]connection.execute")] + unsafe extern "C" fn _post_return_method_connection_execute(arg0 + : * mut u8,) { unsafe { $($path_to_types)*:: + __post_return_method_connection_execute::<<$ty as + $($path_to_types)*:: Guest >::Connection > (arg0) } } const _ : + () = { #[doc(hidden)] #[unsafe (export_name = + "fermyon:spin/redis@2.0.0#[dtor]connection")] + #[allow(non_snake_case)] unsafe extern "C" fn dtor(rep : * mut + u8) { unsafe { $($path_to_types)*:: Connection::dtor::< <$ty as + $($path_to_types)*:: Guest >::Connection > (rep) } } }; }; + }; + } #[doc(hidden)] pub(crate) use __export_fermyon_spin_redis_2_0_0_cabi; #[repr(align(8))] - struct _RetArea([::core::mem::MaybeUninit; 24]); - static mut _RET_AREA: _RetArea = _RetArea([::core::mem::MaybeUninit::uninit(); 24]); + struct _RetArea( + [::core::mem::MaybeUninit< + u8, + >; 16 + 2 * ::core::mem::size_of::<*const u8>()], + ); + static mut _RET_AREA: _RetArea = _RetArea( + [::core::mem::MaybeUninit::uninit(); 16 + + 2 * ::core::mem::size_of::<*const u8>()], + ); } - - #[allow(dead_code, clippy::all)] + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod rdbms_types { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; /// Errors related to interacting with a database. #[derive(Clone)] @@ -10705,7 +11869,10 @@ pub mod exports { Other(_rt::String), } impl ::core::fmt::Debug for Error { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { Error::ConnectionFailed(e) => { f.debug_tuple("Error::ConnectionFailed").field(e).finish() @@ -10716,24 +11883,29 @@ pub mod exports { Error::QueryFailed(e) => { f.debug_tuple("Error::QueryFailed").field(e).finish() } - Error::ValueConversionFailed(e) => f - .debug_tuple("Error::ValueConversionFailed") - .field(e) - .finish(), - Error::Other(e) => f.debug_tuple("Error::Other").field(e).finish(), + Error::ValueConversionFailed(e) => { + f.debug_tuple("Error::ValueConversionFailed") + .field(e) + .finish() + } + Error::Other(e) => { + f.debug_tuple("Error::Other").field(e).finish() + } } } } impl ::core::fmt::Display for Error { - 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 Error {} /// Data types for a database column #[repr(u8)] - #[derive(Clone, Copy, Eq, PartialEq)] + #[derive(Clone, Copy, Eq, Ord, PartialEq, PartialOrd)] pub enum DbDataType { Boolean, Int8, @@ -10751,17 +11923,38 @@ pub mod exports { Other, } impl ::core::fmt::Debug for DbDataType { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { - DbDataType::Boolean => f.debug_tuple("DbDataType::Boolean").finish(), - DbDataType::Int8 => f.debug_tuple("DbDataType::Int8").finish(), - DbDataType::Int16 => f.debug_tuple("DbDataType::Int16").finish(), - DbDataType::Int32 => f.debug_tuple("DbDataType::Int32").finish(), - DbDataType::Int64 => f.debug_tuple("DbDataType::Int64").finish(), - DbDataType::Uint8 => f.debug_tuple("DbDataType::Uint8").finish(), - DbDataType::Uint16 => f.debug_tuple("DbDataType::Uint16").finish(), - DbDataType::Uint32 => f.debug_tuple("DbDataType::Uint32").finish(), - DbDataType::Uint64 => f.debug_tuple("DbDataType::Uint64").finish(), + DbDataType::Boolean => { + f.debug_tuple("DbDataType::Boolean").finish() + } + DbDataType::Int8 => { + f.debug_tuple("DbDataType::Int8").finish() + } + DbDataType::Int16 => { + f.debug_tuple("DbDataType::Int16").finish() + } + DbDataType::Int32 => { + f.debug_tuple("DbDataType::Int32").finish() + } + DbDataType::Int64 => { + f.debug_tuple("DbDataType::Int64").finish() + } + DbDataType::Uint8 => { + f.debug_tuple("DbDataType::Uint8").finish() + } + DbDataType::Uint16 => { + f.debug_tuple("DbDataType::Uint16").finish() + } + DbDataType::Uint32 => { + f.debug_tuple("DbDataType::Uint32").finish() + } + DbDataType::Uint64 => { + f.debug_tuple("DbDataType::Uint64").finish() + } DbDataType::Floating32 => { f.debug_tuple("DbDataType::Floating32").finish() } @@ -10769,19 +11962,21 @@ pub mod exports { f.debug_tuple("DbDataType::Floating64").finish() } DbDataType::Str => f.debug_tuple("DbDataType::Str").finish(), - DbDataType::Binary => f.debug_tuple("DbDataType::Binary").finish(), - DbDataType::Other => f.debug_tuple("DbDataType::Other").finish(), + DbDataType::Binary => { + f.debug_tuple("DbDataType::Binary").finish() + } + DbDataType::Other => { + f.debug_tuple("DbDataType::Other").finish() + } } } } - impl DbDataType { #[doc(hidden)] pub unsafe fn _lift(val: u8) -> DbDataType { if !cfg!(debug_assertions) { return ::core::mem::transmute(val); } - match val { 0 => DbDataType::Boolean, 1 => DbDataType::Int8, @@ -10797,12 +11992,10 @@ pub mod exports { 11 => DbDataType::Str, 12 => DbDataType::Binary, 13 => DbDataType::Other, - _ => panic!("invalid enum discriminant"), } } } - /// Database values #[derive(Clone)] pub enum DbValue { @@ -10823,16 +12016,29 @@ pub mod exports { Unsupported, } impl ::core::fmt::Debug for DbValue { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { DbValue::Boolean(e) => { f.debug_tuple("DbValue::Boolean").field(e).finish() } - DbValue::Int8(e) => f.debug_tuple("DbValue::Int8").field(e).finish(), - DbValue::Int16(e) => f.debug_tuple("DbValue::Int16").field(e).finish(), - DbValue::Int32(e) => f.debug_tuple("DbValue::Int32").field(e).finish(), - DbValue::Int64(e) => f.debug_tuple("DbValue::Int64").field(e).finish(), - DbValue::Uint8(e) => f.debug_tuple("DbValue::Uint8").field(e).finish(), + DbValue::Int8(e) => { + f.debug_tuple("DbValue::Int8").field(e).finish() + } + DbValue::Int16(e) => { + f.debug_tuple("DbValue::Int16").field(e).finish() + } + DbValue::Int32(e) => { + f.debug_tuple("DbValue::Int32").field(e).finish() + } + DbValue::Int64(e) => { + f.debug_tuple("DbValue::Int64").field(e).finish() + } + DbValue::Uint8(e) => { + f.debug_tuple("DbValue::Uint8").field(e).finish() + } DbValue::Uint16(e) => { f.debug_tuple("DbValue::Uint16").field(e).finish() } @@ -10848,12 +12054,16 @@ pub mod exports { DbValue::Floating64(e) => { f.debug_tuple("DbValue::Floating64").field(e).finish() } - DbValue::Str(e) => f.debug_tuple("DbValue::Str").field(e).finish(), + DbValue::Str(e) => { + f.debug_tuple("DbValue::Str").field(e).finish() + } DbValue::Binary(e) => { f.debug_tuple("DbValue::Binary").field(e).finish() } DbValue::DbNull => f.debug_tuple("DbValue::DbNull").finish(), - DbValue::Unsupported => f.debug_tuple("DbValue::Unsupported").finish(), + DbValue::Unsupported => { + f.debug_tuple("DbValue::Unsupported").finish() + } } } } @@ -10876,7 +12086,10 @@ pub mod exports { DbNull, } impl ::core::fmt::Debug for ParameterValue { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { ParameterValue::Boolean(e) => { f.debug_tuple("ParameterValue::Boolean").field(e).finish() @@ -10905,14 +12118,16 @@ pub mod exports { ParameterValue::Uint64(e) => { f.debug_tuple("ParameterValue::Uint64").field(e).finish() } - ParameterValue::Floating32(e) => f - .debug_tuple("ParameterValue::Floating32") - .field(e) - .finish(), - ParameterValue::Floating64(e) => f - .debug_tuple("ParameterValue::Floating64") - .field(e) - .finish(), + ParameterValue::Floating32(e) => { + f.debug_tuple("ParameterValue::Floating32") + .field(e) + .finish() + } + ParameterValue::Floating64(e) => { + f.debug_tuple("ParameterValue::Floating64") + .field(e) + .finish() + } ParameterValue::Str(e) => { f.debug_tuple("ParameterValue::Str").field(e).finish() } @@ -10932,7 +12147,10 @@ pub mod exports { pub data_type: DbDataType, } impl ::core::fmt::Debug for Column { - 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("Column") .field("name", &self.name) .field("data-type", &self.data_type) @@ -10948,7 +12166,10 @@ pub mod exports { pub rows: _rt::Vec, } impl ::core::fmt::Debug for RowSet { - 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("RowSet") .field("columns", &self.columns) .field("rows", &self.rows) @@ -10956,40 +12177,30 @@ pub mod exports { } } #[doc(hidden)] - macro_rules! __export_fermyon_spin_rdbms_types_2_0_0_cabi { ($ty:ident with_types_in $($path_to_types:tt)*) => { - const _: () = {}; + const _ : () = {}; }; } #[doc(hidden)] pub(crate) use __export_fermyon_spin_rdbms_types_2_0_0_cabi; } - - #[allow(dead_code, clippy::all)] + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod postgres { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; - pub type ParameterValue = - super::super::super::super::exports::fermyon::spin::rdbms_types::ParameterValue; - pub type RowSet = - super::super::super::super::exports::fermyon::spin::rdbms_types::RowSet; - pub type Error = - super::super::super::super::exports::fermyon::spin::rdbms_types::Error; + pub type ParameterValue = super::super::super::super::exports::fermyon::spin::rdbms_types::ParameterValue; + pub type RowSet = super::super::super::super::exports::fermyon::spin::rdbms_types::RowSet; + pub type Error = super::super::super::super::exports::fermyon::spin::rdbms_types::Error; /// A connection to a postgres database. - #[derive(Debug)] #[repr(transparent)] pub struct Connection { handle: _rt::Resource, } - type _ConnectionRep = Option; - impl Connection { /// Creates a new resource from the specified representation. /// @@ -10999,77 +12210,70 @@ pub mod exports { pub fn new(val: T) -> Self { Self::type_guard::(); let val: _ConnectionRep = Some(val); - let ptr: *mut _ConnectionRep = _rt::Box::into_raw(_rt::Box::new(val)); + let ptr: *mut _ConnectionRep = _rt::Box::into_raw( + _rt::Box::new(val), + ); unsafe { Self::from_handle(T::_resource_new(ptr.cast())) } } - /// Gets access to the underlying `T` which represents this resource. pub fn get(&self) -> &T { let ptr = unsafe { &*self.as_ptr::() }; ptr.as_ref().unwrap() } - /// Gets mutable access to the underlying `T` which represents this /// resource. pub fn get_mut(&mut self) -> &mut T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_mut().unwrap() } - /// Consumes this resource and returns the underlying `T`. pub fn into_inner(self) -> T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.take().unwrap() } - #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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) } - - // It's theoretically possible to implement the `GuestConnection` trait twice - // so guard against using it with two different types here. #[doc(hidden)] fn type_guard() { use core::any::TypeId; static mut LAST_TYPE: Option = None; unsafe { - assert!(!cfg!(target_feature = "threads")); + assert!(! cfg!(target_feature = "atomics")); let id = TypeId::of::(); match LAST_TYPE { - Some(ty) => assert!( - ty == id, - "cannot use two types with this resource type" - ), + Some(ty) => { + assert!( + ty == id, "cannot use two types with this resource type" + ) + } None => LAST_TYPE = Some(id), } } } - #[doc(hidden)] pub unsafe fn dtor(handle: *mut u8) { Self::type_guard::(); - let _ = _rt::Box::from_raw(handle as *mut _ConnectionRep); + let _ = unsafe { + _rt::Box::from_raw(handle as *mut _ConnectionRep) + }; } - fn as_ptr(&self) -> *mut _ConnectionRep { Connection::type_guard::(); T::_resource_rep(self.handle()).cast() } } - /// A borrowed version of [`Connection`] which represents a borrowed value /// with the lifetime `'a`. #[derive(Debug)] @@ -11078,7 +12282,6 @@ pub mod exports { rep: *mut u8, _marker: core::marker::PhantomData<&'a Connection>, } - impl<'a> ConnectionBorrow<'a> { #[doc(hidden)] pub unsafe fn lift(rep: usize) -> Self { @@ -11087,106 +12290,130 @@ pub mod exports { _marker: core::marker::PhantomData, } } - /// Gets access to the underlying `T` in this resource. pub fn get(&self) -> &T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_ref().unwrap() } - - // NB: mutable access is not allowed due to the component model allowing - // multiple borrows of the same resource. - fn as_ptr(&self) -> *mut _ConnectionRep { Connection::type_guard::(); self.rep.cast() } } - unsafe impl _rt::WasmResource for Connection { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]fermyon:spin/postgres@2.0.0")] - extern "C" { + #[link( + wasm_import_module = "[export]fermyon:spin/postgres@2.0.0" + )] + unsafe extern "C" { #[link_name = "[resource-drop]connection"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_static_connection_open_cabi( arg0: *mut u8, arg1: usize, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg1; let bytes0 = _rt::Vec::from_raw_parts(arg0.cast(), len0, len0); let result1 = T::open(_rt::string_lift(bytes0)); - let ptr2 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr2 = (&raw mut _RET_AREA.0).cast::(); match result1 { Ok(e) => { *ptr2.add(0).cast::() = (0i32) as u8; - *ptr2.add(4).cast::() = (e).take_handle() as i32; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (e).take_handle() as i32; } Err(e) => { *ptr2.add(0).cast::() = (1i32) as u8; use super::super::super::super::exports::fermyon::spin::rdbms_types::Error as V8; match e { V8::ConnectionFailed(e) => { - *ptr2.add(4).cast::() = (0i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; let vec3 = (e.into_bytes()).into_boxed_slice(); let ptr3 = vec3.as_ptr().cast::(); let len3 = vec3.len(); ::core::mem::forget(vec3); - *ptr2.add(12).cast::() = len3; - *ptr2.add(8).cast::<*mut u8>() = ptr3.cast_mut(); + *ptr2 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len3; + *ptr2 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr3.cast_mut(); } V8::BadParameter(e) => { - *ptr2.add(4).cast::() = (1i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; let vec4 = (e.into_bytes()).into_boxed_slice(); let ptr4 = vec4.as_ptr().cast::(); let len4 = vec4.len(); ::core::mem::forget(vec4); - *ptr2.add(12).cast::() = len4; - *ptr2.add(8).cast::<*mut u8>() = ptr4.cast_mut(); + *ptr2 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len4; + *ptr2 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr4.cast_mut(); } V8::QueryFailed(e) => { - *ptr2.add(4).cast::() = (2i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (2i32) as u8; let vec5 = (e.into_bytes()).into_boxed_slice(); let ptr5 = vec5.as_ptr().cast::(); let len5 = vec5.len(); ::core::mem::forget(vec5); - *ptr2.add(12).cast::() = len5; - *ptr2.add(8).cast::<*mut u8>() = ptr5.cast_mut(); + *ptr2 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len5; + *ptr2 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr5.cast_mut(); } V8::ValueConversionFailed(e) => { - *ptr2.add(4).cast::() = (3i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (3i32) as u8; let vec6 = (e.into_bytes()).into_boxed_slice(); let ptr6 = vec6.as_ptr().cast::(); let len6 = vec6.len(); ::core::mem::forget(vec6); - *ptr2.add(12).cast::() = len6; - *ptr2.add(8).cast::<*mut u8>() = ptr6.cast_mut(); + *ptr2 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len6; + *ptr2 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr6.cast_mut(); } V8::Other(e) => { - *ptr2.add(4).cast::() = (4i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (4i32) as u8; let vec7 = (e.into_bytes()).into_boxed_slice(); let ptr7 = vec7.as_ptr().cast::(); let len7 = vec7.len(); ::core::mem::forget(vec7); - *ptr2.add(12).cast::() = len7; - *ptr2.add(8).cast::<*mut u8>() = ptr7.cast_mut(); + *ptr2 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len7; + *ptr2 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr7.cast_mut(); } } } @@ -11200,33 +12427,55 @@ pub mod exports { ) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { - 0 => (), + 0 => {} _ => { - let l1 = i32::from(*arg0.add(4).cast::()); + let l1 = i32::from( + *arg0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); match l1 { 0 => { - let l2 = *arg0.add(8).cast::<*mut u8>(); - let l3 = *arg0.add(12).cast::(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l3 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l2, l3, 1); } 1 => { - let l4 = *arg0.add(8).cast::<*mut u8>(); - let l5 = *arg0.add(12).cast::(); + let l4 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l5 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l4, l5, 1); } 2 => { - let l6 = *arg0.add(8).cast::<*mut u8>(); - let l7 = *arg0.add(12).cast::(); + let l6 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l7 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l6, l7, 1); } 3 => { - let l8 = *arg0.add(8).cast::<*mut u8>(); - let l9 = *arg0.add(12).cast::(); + let l8 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l9 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l8, l9, 1); } _ => { - let l10 = *arg0.add(8).cast::<*mut u8>(); - let l11 = *arg0.add(12).cast::(); + let l10 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l11 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l10, l11, 1); } } @@ -11242,15 +12491,15 @@ pub mod exports { arg3: *mut u8, arg4: usize, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg2; let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0); let base20 = arg3; let len20 = arg4; let mut result20 = _rt::Vec::with_capacity(len20); for i in 0..len20 { - let base = base20.add(i * 16); + let base = base20 + .add(i * (8 + 2 * ::core::mem::size_of::<*const u8>())); let e20 = { let l1 = i32::from(*base.add(0).cast::()); use super::super::super::super::exports::fermyon::spin::rdbms_types::ParameterValue as V19; @@ -11258,7 +12507,6 @@ pub mod exports { 0 => { let e19 = { let l2 = i32::from(*base.add(8).cast::()); - _rt::bool_lift(l2 as u8) }; V19::Boolean(e19) @@ -11266,7 +12514,6 @@ pub mod exports { 1 => { let e19 = { let l3 = i32::from(*base.add(8).cast::()); - l3 as i8 }; V19::Int8(e19) @@ -11274,7 +12521,6 @@ pub mod exports { 2 => { let e19 = { let l4 = i32::from(*base.add(8).cast::()); - l4 as i16 }; V19::Int16(e19) @@ -11282,7 +12528,6 @@ pub mod exports { 3 => { let e19 = { let l5 = *base.add(8).cast::(); - l5 }; V19::Int32(e19) @@ -11290,7 +12535,6 @@ pub mod exports { 4 => { let e19 = { let l6 = *base.add(8).cast::(); - l6 }; V19::Int64(e19) @@ -11298,7 +12542,6 @@ pub mod exports { 5 => { let e19 = { let l7 = i32::from(*base.add(8).cast::()); - l7 as u8 }; V19::Uint8(e19) @@ -11306,7 +12549,6 @@ pub mod exports { 6 => { let e19 = { let l8 = i32::from(*base.add(8).cast::()); - l8 as u16 }; V19::Uint16(e19) @@ -11314,7 +12556,6 @@ pub mod exports { 7 => { let e19 = { let l9 = *base.add(8).cast::(); - l9 as u32 }; V19::Uint32(e19) @@ -11322,7 +12563,6 @@ pub mod exports { 8 => { let e19 = { let l10 = *base.add(8).cast::(); - l10 as u64 }; V19::Uint64(e19) @@ -11330,7 +12570,6 @@ pub mod exports { 9 => { let e19 = { let l11 = *base.add(8).cast::(); - l11 }; V19::Floating32(e19) @@ -11338,7 +12577,6 @@ pub mod exports { 10 => { let e19 = { let l12 = *base.add(8).cast::(); - l12 }; V19::Floating64(e19) @@ -11346,11 +12584,15 @@ pub mod exports { 11 => { let e19 = { let l13 = *base.add(8).cast::<*mut u8>(); - let l14 = *base.add(12).cast::(); + let l14 = *base + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(); let len15 = l14; - let bytes15 = - _rt::Vec::from_raw_parts(l13.cast(), len15, len15); - + let bytes15 = _rt::Vec::from_raw_parts( + l13.cast(), + len15, + len15, + ); _rt::string_lift(bytes15) }; V19::Str(e19) @@ -11358,9 +12600,10 @@ pub mod exports { 12 => { let e19 = { let l16 = *base.add(8).cast::<*mut u8>(); - let l17 = *base.add(12).cast::(); + let l17 = *base + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(); let len18 = l17; - _rt::Vec::from_raw_parts(l16.cast(), len18, len18) }; V19::Binary(e19) @@ -11370,26 +12613,34 @@ pub mod exports { V19::DbNull } }; - v19 }; result20.push(e20); } - _rt::cabi_dealloc(base20, len20 * 16, 8); + _rt::cabi_dealloc( + base20, + len20 * (8 + 2 * ::core::mem::size_of::<*const u8>()), + 8, + ); let result21 = T::query( - ConnectionBorrow::lift(arg0 as u32 as usize).get(), + unsafe { ConnectionBorrow::lift(arg0 as u32 as usize) }.get(), _rt::string_lift(bytes0), result20, ); - let ptr22 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr22 = (&raw mut _RET_AREA.0).cast::(); match result21 { Ok(e) => { *ptr22.add(0).cast::() = (0i32) as u8; - let super::super::super::super::exports::fermyon::spin::rdbms_types::RowSet{ columns:columns23, rows:rows23, } = e; + let super::super::super::super::exports::fermyon::spin::rdbms_types::RowSet { + columns: columns23, + rows: rows23, + } = e; let vec26 = columns23; let len26 = vec26.len(); - let layout26 = - _rt::alloc::Layout::from_size_align_unchecked(vec26.len() * 12, 4); + let layout26 = _rt::alloc::Layout::from_size_align_unchecked( + vec26.len() * (3 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); let result26 = if layout26.size() != 0 { let ptr = _rt::alloc::alloc(layout26).cast::(); if ptr.is_null() { @@ -11397,29 +12648,41 @@ pub mod exports { } ptr } else { - { - ::core::ptr::null_mut() - } + ::core::ptr::null_mut() }; for (i, e) in vec26.into_iter().enumerate() { - let base = result26.add(i * 12); + let base = result26 + .add(i * (3 * ::core::mem::size_of::<*const u8>())); { - let super::super::super::super::exports::fermyon::spin::rdbms_types::Column{ name:name24, data_type:data_type24, } = e; + let super::super::super::super::exports::fermyon::spin::rdbms_types::Column { + name: name24, + data_type: data_type24, + } = e; let vec25 = (name24.into_bytes()).into_boxed_slice(); let ptr25 = vec25.as_ptr().cast::(); let len25 = vec25.len(); ::core::mem::forget(vec25); - *base.add(4).cast::() = len25; + *base + .add(::core::mem::size_of::<*const u8>()) + .cast::() = len25; *base.add(0).cast::<*mut u8>() = ptr25.cast_mut(); - *base.add(8).cast::() = (data_type24.clone() as i32) as u8; + *base + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::() = (data_type24.clone() as i32) as u8; } } - *ptr22.add(8).cast::() = len26; - *ptr22.add(4).cast::<*mut u8>() = result26; + *ptr22 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len26; + *ptr22 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = result26; let vec31 = rows23; let len31 = vec31.len(); - let layout31 = - _rt::alloc::Layout::from_size_align_unchecked(vec31.len() * 8, 4); + let layout31 = _rt::alloc::Layout::from_size_align_unchecked( + vec31.len() * (2 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); let result31 = if layout31.size() != 0 { let ptr = _rt::alloc::alloc(layout31).cast::(); if ptr.is_null() { @@ -11427,17 +12690,16 @@ pub mod exports { } ptr } else { - { - ::core::ptr::null_mut() - } + ::core::ptr::null_mut() }; for (i, e) in vec31.into_iter().enumerate() { - let base = result31.add(i * 8); + let base = result31 + .add(i * (2 * ::core::mem::size_of::<*const u8>())); { let vec30 = e; let len30 = vec30.len(); let layout30 = _rt::alloc::Layout::from_size_align_unchecked( - vec30.len() * 16, + vec30.len() * (8 + 2 * ::core::mem::size_of::<*const u8>()), 8, ); let result30 = if layout30.size() != 0 { @@ -11447,12 +12709,11 @@ pub mod exports { } ptr } else { - { - ::core::ptr::null_mut() - } + ::core::ptr::null_mut() }; for (i, e) in vec30.into_iter().enumerate() { - let base = result30.add(i * 16); + let base = result30 + .add(i * (8 + 2 * ::core::mem::size_of::<*const u8>())); { use super::super::super::super::exports::fermyon::spin::rdbms_types::DbValue as V29; match e { @@ -11461,18 +12722,15 @@ pub mod exports { *base.add(8).cast::() = (match e { true => 1, false => 0, - }) - as u8; + }) as u8; } V29::Int8(e) => { *base.add(0).cast::() = (1i32) as u8; - *base.add(8).cast::() = - (_rt::as_i32(e)) as u8; + *base.add(8).cast::() = (_rt::as_i32(e)) as u8; } V29::Int16(e) => { *base.add(0).cast::() = (2i32) as u8; - *base.add(8).cast::() = - (_rt::as_i32(e)) as u16; + *base.add(8).cast::() = (_rt::as_i32(e)) as u16; } V29::Int32(e) => { *base.add(0).cast::() = (3i32) as u8; @@ -11484,13 +12742,11 @@ pub mod exports { } V29::Uint8(e) => { *base.add(0).cast::() = (5i32) as u8; - *base.add(8).cast::() = - (_rt::as_i32(e)) as u8; + *base.add(8).cast::() = (_rt::as_i32(e)) as u8; } V29::Uint16(e) => { *base.add(0).cast::() = (6i32) as u8; - *base.add(8).cast::() = - (_rt::as_i32(e)) as u16; + *base.add(8).cast::() = (_rt::as_i32(e)) as u16; } V29::Uint32(e) => { *base.add(0).cast::() = (7i32) as u8; @@ -11514,9 +12770,10 @@ pub mod exports { let ptr27 = vec27.as_ptr().cast::(); let len27 = vec27.len(); ::core::mem::forget(vec27); - *base.add(12).cast::() = len27; - *base.add(8).cast::<*mut u8>() = - ptr27.cast_mut(); + *base + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::() = len27; + *base.add(8).cast::<*mut u8>() = ptr27.cast_mut(); } V29::Binary(e) => { *base.add(0).cast::() = (12i32) as u8; @@ -11524,9 +12781,10 @@ pub mod exports { let ptr28 = vec28.as_ptr().cast::(); let len28 = vec28.len(); ::core::mem::forget(vec28); - *base.add(12).cast::() = len28; - *base.add(8).cast::<*mut u8>() = - ptr28.cast_mut(); + *base + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::() = len28; + *base.add(8).cast::<*mut u8>() = ptr28.cast_mut(); } V29::DbNull => { *base.add(0).cast::() = (13i32) as u8; @@ -11537,61 +12795,97 @@ pub mod exports { } } } - *base.add(4).cast::() = len30; + *base + .add(::core::mem::size_of::<*const u8>()) + .cast::() = len30; *base.add(0).cast::<*mut u8>() = result30; } } - *ptr22.add(16).cast::() = len31; - *ptr22.add(12).cast::<*mut u8>() = result31; + *ptr22 + .add(4 * ::core::mem::size_of::<*const u8>()) + .cast::() = len31; + *ptr22 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = result31; } Err(e) => { *ptr22.add(0).cast::() = (1i32) as u8; use super::super::super::super::exports::fermyon::spin::rdbms_types::Error as V37; match e { V37::ConnectionFailed(e) => { - *ptr22.add(4).cast::() = (0i32) as u8; + *ptr22 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; let vec32 = (e.into_bytes()).into_boxed_slice(); let ptr32 = vec32.as_ptr().cast::(); let len32 = vec32.len(); ::core::mem::forget(vec32); - *ptr22.add(12).cast::() = len32; - *ptr22.add(8).cast::<*mut u8>() = ptr32.cast_mut(); + *ptr22 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len32; + *ptr22 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr32.cast_mut(); } V37::BadParameter(e) => { - *ptr22.add(4).cast::() = (1i32) as u8; + *ptr22 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; let vec33 = (e.into_bytes()).into_boxed_slice(); let ptr33 = vec33.as_ptr().cast::(); let len33 = vec33.len(); ::core::mem::forget(vec33); - *ptr22.add(12).cast::() = len33; - *ptr22.add(8).cast::<*mut u8>() = ptr33.cast_mut(); + *ptr22 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len33; + *ptr22 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr33.cast_mut(); } V37::QueryFailed(e) => { - *ptr22.add(4).cast::() = (2i32) as u8; + *ptr22 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (2i32) as u8; let vec34 = (e.into_bytes()).into_boxed_slice(); let ptr34 = vec34.as_ptr().cast::(); let len34 = vec34.len(); ::core::mem::forget(vec34); - *ptr22.add(12).cast::() = len34; - *ptr22.add(8).cast::<*mut u8>() = ptr34.cast_mut(); + *ptr22 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len34; + *ptr22 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr34.cast_mut(); } V37::ValueConversionFailed(e) => { - *ptr22.add(4).cast::() = (3i32) as u8; + *ptr22 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (3i32) as u8; let vec35 = (e.into_bytes()).into_boxed_slice(); let ptr35 = vec35.as_ptr().cast::(); let len35 = vec35.len(); ::core::mem::forget(vec35); - *ptr22.add(12).cast::() = len35; - *ptr22.add(8).cast::<*mut u8>() = ptr35.cast_mut(); + *ptr22 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len35; + *ptr22 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr35.cast_mut(); } V37::Other(e) => { - *ptr22.add(4).cast::() = (4i32) as u8; + *ptr22 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (4i32) as u8; let vec36 = (e.into_bytes()).into_boxed_slice(); let ptr36 = vec36.as_ptr().cast::(); let len36 = vec36.len(); ::core::mem::forget(vec36); - *ptr22.add(12).cast::() = len36; - *ptr22.add(8).cast::<*mut u8>() = ptr36.cast_mut(); + *ptr22 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len36; + *ptr22 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr36.cast_mut(); } } } @@ -11606,94 +12900,147 @@ pub mod exports { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { 0 => { - let l3 = *arg0.add(4).cast::<*mut u8>(); - let l4 = *arg0.add(8).cast::(); - let base5 = l3; - let len5 = l4; + let l1 = *arg0 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let base5 = l1; + let len5 = l2; for i in 0..len5 { - let base = base5.add(i * 12); + let base = base5 + .add(i * (3 * ::core::mem::size_of::<*const u8>())); { - let l1 = *base.add(0).cast::<*mut u8>(); - let l2 = *base.add(4).cast::(); - _rt::cabi_dealloc(l1, l2, 1); + let l3 = *base.add(0).cast::<*mut u8>(); + let l4 = *base + .add(::core::mem::size_of::<*const u8>()) + .cast::(); + _rt::cabi_dealloc(l3, l4, 1); } } - _rt::cabi_dealloc(base5, len5 * 12, 4); - let l15 = *arg0.add(12).cast::<*mut u8>(); - let l16 = *arg0.add(16).cast::(); - let base17 = l15; - let len17 = l16; + _rt::cabi_dealloc( + base5, + len5 * (3 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); + let l6 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l7 = *arg0 + .add(4 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let base17 = l6; + let len17 = l7; for i in 0..len17 { - let base = base17.add(i * 8); + let base = base17 + .add(i * (2 * ::core::mem::size_of::<*const u8>())); { - let l12 = *base.add(0).cast::<*mut u8>(); - let l13 = *base.add(4).cast::(); - let base14 = l12; - let len14 = l13; - for i in 0..len14 { - let base = base14.add(i * 16); + let l8 = *base.add(0).cast::<*mut u8>(); + let l9 = *base + .add(::core::mem::size_of::<*const u8>()) + .cast::(); + let base16 = l8; + let len16 = l9; + for i in 0..len16 { + let base = base16 + .add(i * (8 + 2 * ::core::mem::size_of::<*const u8>())); { - let l6 = i32::from(*base.add(0).cast::()); - match l6 { - 0 => (), - 1 => (), - 2 => (), - 3 => (), - 4 => (), - 5 => (), - 6 => (), - 7 => (), - 8 => (), - 9 => (), - 10 => (), + let l10 = i32::from(*base.add(0).cast::()); + match l10 { + 0 => {} + 1 => {} + 2 => {} + 3 => {} + 4 => {} + 5 => {} + 6 => {} + 7 => {} + 8 => {} + 9 => {} + 10 => {} 11 => { - let l7 = *base.add(8).cast::<*mut u8>(); - let l8 = *base.add(12).cast::(); - _rt::cabi_dealloc(l7, l8, 1); + let l11 = *base.add(8).cast::<*mut u8>(); + let l12 = *base + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(); + _rt::cabi_dealloc(l11, l12, 1); } 12 => { - let l9 = *base.add(8).cast::<*mut u8>(); - let l10 = *base.add(12).cast::(); - let base11 = l9; - let len11 = l10; - _rt::cabi_dealloc(base11, len11 * 1, 1); + let l13 = *base.add(8).cast::<*mut u8>(); + let l14 = *base + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let base15 = l13; + let len15 = l14; + _rt::cabi_dealloc(base15, len15 * 1, 1); } - 13 => (), - _ => (), + 13 => {} + _ => {} } } } - _rt::cabi_dealloc(base14, len14 * 16, 8); + _rt::cabi_dealloc( + base16, + len16 * (8 + 2 * ::core::mem::size_of::<*const u8>()), + 8, + ); } } - _rt::cabi_dealloc(base17, len17 * 8, 4); + _rt::cabi_dealloc( + base17, + len17 * (2 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); } _ => { - let l18 = i32::from(*arg0.add(4).cast::()); + let l18 = i32::from( + *arg0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); match l18 { 0 => { - let l19 = *arg0.add(8).cast::<*mut u8>(); - let l20 = *arg0.add(12).cast::(); + let l19 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l20 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l19, l20, 1); } 1 => { - let l21 = *arg0.add(8).cast::<*mut u8>(); - let l22 = *arg0.add(12).cast::(); + let l21 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l22 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l21, l22, 1); } 2 => { - let l23 = *arg0.add(8).cast::<*mut u8>(); - let l24 = *arg0.add(12).cast::(); + let l23 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l24 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l23, l24, 1); } 3 => { - let l25 = *arg0.add(8).cast::<*mut u8>(); - let l26 = *arg0.add(12).cast::(); + let l25 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l26 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l25, l26, 1); } _ => { - let l27 = *arg0.add(8).cast::<*mut u8>(); - let l28 = *arg0.add(12).cast::(); + let l27 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l28 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l27, l28, 1); } } @@ -11709,15 +13056,15 @@ pub mod exports { arg3: *mut u8, arg4: usize, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg2; let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0); let base20 = arg3; let len20 = arg4; let mut result20 = _rt::Vec::with_capacity(len20); for i in 0..len20 { - let base = base20.add(i * 16); + let base = base20 + .add(i * (8 + 2 * ::core::mem::size_of::<*const u8>())); let e20 = { let l1 = i32::from(*base.add(0).cast::()); use super::super::super::super::exports::fermyon::spin::rdbms_types::ParameterValue as V19; @@ -11725,7 +13072,6 @@ pub mod exports { 0 => { let e19 = { let l2 = i32::from(*base.add(8).cast::()); - _rt::bool_lift(l2 as u8) }; V19::Boolean(e19) @@ -11733,7 +13079,6 @@ pub mod exports { 1 => { let e19 = { let l3 = i32::from(*base.add(8).cast::()); - l3 as i8 }; V19::Int8(e19) @@ -11741,7 +13086,6 @@ pub mod exports { 2 => { let e19 = { let l4 = i32::from(*base.add(8).cast::()); - l4 as i16 }; V19::Int16(e19) @@ -11749,7 +13093,6 @@ pub mod exports { 3 => { let e19 = { let l5 = *base.add(8).cast::(); - l5 }; V19::Int32(e19) @@ -11757,7 +13100,6 @@ pub mod exports { 4 => { let e19 = { let l6 = *base.add(8).cast::(); - l6 }; V19::Int64(e19) @@ -11765,7 +13107,6 @@ pub mod exports { 5 => { let e19 = { let l7 = i32::from(*base.add(8).cast::()); - l7 as u8 }; V19::Uint8(e19) @@ -11773,7 +13114,6 @@ pub mod exports { 6 => { let e19 = { let l8 = i32::from(*base.add(8).cast::()); - l8 as u16 }; V19::Uint16(e19) @@ -11781,7 +13121,6 @@ pub mod exports { 7 => { let e19 = { let l9 = *base.add(8).cast::(); - l9 as u32 }; V19::Uint32(e19) @@ -11789,7 +13128,6 @@ pub mod exports { 8 => { let e19 = { let l10 = *base.add(8).cast::(); - l10 as u64 }; V19::Uint64(e19) @@ -11797,7 +13135,6 @@ pub mod exports { 9 => { let e19 = { let l11 = *base.add(8).cast::(); - l11 }; V19::Floating32(e19) @@ -11805,7 +13142,6 @@ pub mod exports { 10 => { let e19 = { let l12 = *base.add(8).cast::(); - l12 }; V19::Floating64(e19) @@ -11813,11 +13149,15 @@ pub mod exports { 11 => { let e19 = { let l13 = *base.add(8).cast::<*mut u8>(); - let l14 = *base.add(12).cast::(); + let l14 = *base + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(); let len15 = l14; - let bytes15 = - _rt::Vec::from_raw_parts(l13.cast(), len15, len15); - + let bytes15 = _rt::Vec::from_raw_parts( + l13.cast(), + len15, + len15, + ); _rt::string_lift(bytes15) }; V19::Str(e19) @@ -11825,9 +13165,10 @@ pub mod exports { 12 => { let e19 = { let l16 = *base.add(8).cast::<*mut u8>(); - let l17 = *base.add(12).cast::(); + let l17 = *base + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(); let len18 = l17; - _rt::Vec::from_raw_parts(l16.cast(), len18, len18) }; V19::Binary(e19) @@ -11837,18 +13178,21 @@ pub mod exports { V19::DbNull } }; - v19 }; result20.push(e20); } - _rt::cabi_dealloc(base20, len20 * 16, 8); + _rt::cabi_dealloc( + base20, + len20 * (8 + 2 * ::core::mem::size_of::<*const u8>()), + 8, + ); let result21 = T::execute( - ConnectionBorrow::lift(arg0 as u32 as usize).get(), + unsafe { ConnectionBorrow::lift(arg0 as u32 as usize) }.get(), _rt::string_lift(bytes0), result20, ); - let ptr22 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr22 = (&raw mut _RET_AREA.0).cast::(); match result21 { Ok(e) => { *ptr22.add(0).cast::() = (0i32) as u8; @@ -11864,8 +13208,12 @@ pub mod exports { let ptr23 = vec23.as_ptr().cast::(); let len23 = vec23.len(); ::core::mem::forget(vec23); - *ptr22.add(16).cast::() = len23; - *ptr22.add(12).cast::<*mut u8>() = ptr23.cast_mut(); + *ptr22 + .add(8 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len23; + *ptr22 + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr23.cast_mut(); } V28::BadParameter(e) => { *ptr22.add(8).cast::() = (1i32) as u8; @@ -11873,8 +13221,12 @@ pub mod exports { let ptr24 = vec24.as_ptr().cast::(); let len24 = vec24.len(); ::core::mem::forget(vec24); - *ptr22.add(16).cast::() = len24; - *ptr22.add(12).cast::<*mut u8>() = ptr24.cast_mut(); + *ptr22 + .add(8 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len24; + *ptr22 + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr24.cast_mut(); } V28::QueryFailed(e) => { *ptr22.add(8).cast::() = (2i32) as u8; @@ -11882,8 +13234,12 @@ pub mod exports { let ptr25 = vec25.as_ptr().cast::(); let len25 = vec25.len(); ::core::mem::forget(vec25); - *ptr22.add(16).cast::() = len25; - *ptr22.add(12).cast::<*mut u8>() = ptr25.cast_mut(); + *ptr22 + .add(8 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len25; + *ptr22 + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr25.cast_mut(); } V28::ValueConversionFailed(e) => { *ptr22.add(8).cast::() = (3i32) as u8; @@ -11891,8 +13247,12 @@ pub mod exports { let ptr26 = vec26.as_ptr().cast::(); let len26 = vec26.len(); ::core::mem::forget(vec26); - *ptr22.add(16).cast::() = len26; - *ptr22.add(12).cast::<*mut u8>() = ptr26.cast_mut(); + *ptr22 + .add(8 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len26; + *ptr22 + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr26.cast_mut(); } V28::Other(e) => { *ptr22.add(8).cast::() = (4i32) as u8; @@ -11900,8 +13260,12 @@ pub mod exports { let ptr27 = vec27.as_ptr().cast::(); let len27 = vec27.len(); ::core::mem::forget(vec27); - *ptr22.add(16).cast::() = len27; - *ptr22.add(12).cast::<*mut u8>() = ptr27.cast_mut(); + *ptr22 + .add(8 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len27; + *ptr22 + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr27.cast_mut(); } } } @@ -11910,38 +13274,58 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn __post_return_method_connection_execute( - arg0: *mut u8, - ) { + pub unsafe fn __post_return_method_connection_execute< + T: GuestConnection, + >(arg0: *mut u8) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { - 0 => (), + 0 => {} _ => { let l1 = i32::from(*arg0.add(8).cast::()); match l1 { 0 => { - let l2 = *arg0.add(12).cast::<*mut u8>(); - let l3 = *arg0.add(16).cast::(); + let l2 = *arg0 + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l3 = *arg0 + .add(8 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l2, l3, 1); } 1 => { - let l4 = *arg0.add(12).cast::<*mut u8>(); - let l5 = *arg0.add(16).cast::(); + let l4 = *arg0 + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l5 = *arg0 + .add(8 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l4, l5, 1); } 2 => { - let l6 = *arg0.add(12).cast::<*mut u8>(); - let l7 = *arg0.add(16).cast::(); + let l6 = *arg0 + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l7 = *arg0 + .add(8 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l6, l7, 1); } 3 => { - let l8 = *arg0.add(12).cast::<*mut u8>(); - let l9 = *arg0.add(16).cast::(); + let l8 = *arg0 + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l9 = *arg0 + .add(8 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l8, l9, 1); } _ => { - let l10 = *arg0.add(12).cast::<*mut u8>(); - let l11 = *arg0.add(16).cast::(); + let l10 = *arg0 + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l11 = *arg0 + .add(8 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l10, l11, 1); } } @@ -11962,18 +13346,18 @@ pub mod exports { let _ = val; unreachable!(); } - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]fermyon:spin/postgres@2.0.0")] - extern "C" { + #[link( + wasm_import_module = "[export]fermyon:spin/postgres@2.0.0" + )] + unsafe extern "C" { #[link_name = "[resource-new]connection"] fn new(_: *mut u8) -> u32; } - new(val) + unsafe { new(val) } } } - #[doc(hidden)] fn _resource_rep(handle: u32) -> *mut u8 where @@ -11984,18 +13368,18 @@ pub mod exports { let _ = handle; unreachable!(); } - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]fermyon:spin/postgres@2.0.0")] - extern "C" { + #[link( + wasm_import_module = "[export]fermyon:spin/postgres@2.0.0" + )] + unsafe extern "C" { #[link_name = "[resource-rep]connection"] fn rep(_: u32) -> *mut u8; } unsafe { rep(handle) } } } - /// Open a connection to the Postgres instance at `address`. fn open(address: _rt::String) -> Result; /// Query the database. @@ -12012,62 +13396,71 @@ pub mod exports { ) -> Result; } #[doc(hidden)] - - macro_rules! __export_fermyon_spin_postgres_2_0_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "fermyon:spin/postgres@2.0.0#[static]connection.open"] - unsafe extern "C" fn export_static_connection_open(arg0: *mut u8,arg1: usize,) -> *mut u8 { - $($path_to_types)*::_export_static_connection_open_cabi::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0, arg1) - } - #[export_name = "cabi_post_fermyon:spin/postgres@2.0.0#[static]connection.open"] - unsafe extern "C" fn _post_return_static_connection_open(arg0: *mut u8,) { - $($path_to_types)*::__post_return_static_connection_open::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0) - } - #[export_name = "fermyon:spin/postgres@2.0.0#[method]connection.query"] - unsafe extern "C" fn export_method_connection_query(arg0: *mut u8,arg1: *mut u8,arg2: usize,arg3: *mut u8,arg4: usize,) -> *mut u8 { - $($path_to_types)*::_export_method_connection_query_cabi::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0, arg1, arg2, arg3, arg4) - } - #[export_name = "cabi_post_fermyon:spin/postgres@2.0.0#[method]connection.query"] - unsafe extern "C" fn _post_return_method_connection_query(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_connection_query::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0) - } - #[export_name = "fermyon:spin/postgres@2.0.0#[method]connection.execute"] - unsafe extern "C" fn export_method_connection_execute(arg0: *mut u8,arg1: *mut u8,arg2: usize,arg3: *mut u8,arg4: usize,) -> *mut u8 { - $($path_to_types)*::_export_method_connection_execute_cabi::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0, arg1, arg2, arg3, arg4) - } - #[export_name = "cabi_post_fermyon:spin/postgres@2.0.0#[method]connection.execute"] - unsafe extern "C" fn _post_return_method_connection_execute(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_connection_execute::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0) - } - - const _: () = { - #[doc(hidden)] - #[export_name = "fermyon:spin/postgres@2.0.0#[dtor]connection"] - #[allow(non_snake_case)] - unsafe extern "C" fn dtor(rep: *mut u8) { - $($path_to_types)*::Connection::dtor::< - <$ty as $($path_to_types)*::Guest>::Connection - >(rep) - } - }; - - };); -} - #[doc(hidden)] + macro_rules! __export_fermyon_spin_postgres_2_0_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "fermyon:spin/postgres@2.0.0#[static]connection.open")] unsafe + extern "C" fn export_static_connection_open(arg0 : * mut u8, arg1 + : usize,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_static_connection_open_cabi::<<$ty as + $($path_to_types)*:: Guest >::Connection > (arg0, arg1) } } + #[unsafe (export_name = + "cabi_post_fermyon:spin/postgres@2.0.0#[static]connection.open")] + unsafe extern "C" fn _post_return_static_connection_open(arg0 : * + mut u8,) { unsafe { $($path_to_types)*:: + __post_return_static_connection_open::<<$ty as + $($path_to_types)*:: Guest >::Connection > (arg0) } } #[unsafe + (export_name = + "fermyon:spin/postgres@2.0.0#[method]connection.query")] unsafe + extern "C" fn export_method_connection_query(arg0 : * mut u8, + arg1 : * mut u8, arg2 : usize, arg3 : * mut u8, arg4 : usize,) -> + * mut u8 { unsafe { $($path_to_types)*:: + _export_method_connection_query_cabi::<<$ty as + $($path_to_types)*:: Guest >::Connection > (arg0, arg1, arg2, + arg3, arg4) } } #[unsafe (export_name = + "cabi_post_fermyon:spin/postgres@2.0.0#[method]connection.query")] + unsafe extern "C" fn _post_return_method_connection_query(arg0 : + * mut u8,) { unsafe { $($path_to_types)*:: + __post_return_method_connection_query::<<$ty as + $($path_to_types)*:: Guest >::Connection > (arg0) } } #[unsafe + (export_name = + "fermyon:spin/postgres@2.0.0#[method]connection.execute")] unsafe + extern "C" fn export_method_connection_execute(arg0 : * mut u8, + arg1 : * mut u8, arg2 : usize, arg3 : * mut u8, arg4 : usize,) -> + * mut u8 { unsafe { $($path_to_types)*:: + _export_method_connection_execute_cabi::<<$ty as + $($path_to_types)*:: Guest >::Connection > (arg0, arg1, arg2, + arg3, arg4) } } #[unsafe (export_name = + "cabi_post_fermyon:spin/postgres@2.0.0#[method]connection.execute")] + unsafe extern "C" fn _post_return_method_connection_execute(arg0 + : * mut u8,) { unsafe { $($path_to_types)*:: + __post_return_method_connection_execute::<<$ty as + $($path_to_types)*:: Guest >::Connection > (arg0) } } const _ : + () = { #[doc(hidden)] #[unsafe (export_name = + "fermyon:spin/postgres@2.0.0#[dtor]connection")] + #[allow(non_snake_case)] unsafe extern "C" fn dtor(rep : * mut + u8) { unsafe { $($path_to_types)*:: Connection::dtor::< <$ty as + $($path_to_types)*:: Guest >::Connection > (rep) } } }; }; + }; + } + #[doc(hidden)] pub(crate) use __export_fermyon_spin_postgres_2_0_0_cabi; #[repr(align(8))] - struct _RetArea([::core::mem::MaybeUninit; 24]); - static mut _RET_AREA: _RetArea = _RetArea([::core::mem::MaybeUninit::uninit(); 24]); + struct _RetArea( + [::core::mem::MaybeUninit< + u8, + >; 8 + 4 * ::core::mem::size_of::<*const u8>()], + ); + static mut _RET_AREA: _RetArea = _RetArea( + [::core::mem::MaybeUninit::uninit(); 8 + + 4 * ::core::mem::size_of::<*const u8>()], + ); } - - #[allow(dead_code, clippy::all)] + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod mqtt { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; /// Errors related to interacting with Mqtt #[derive(Clone)] @@ -12082,7 +13475,10 @@ pub mod exports { Other(_rt::String), } impl ::core::fmt::Debug for Error { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { Error::InvalidAddress => { f.debug_tuple("Error::InvalidAddress").finish() @@ -12093,60 +13489,65 @@ pub mod exports { Error::ConnectionFailed(e) => { f.debug_tuple("Error::ConnectionFailed").field(e).finish() } - Error::Other(e) => f.debug_tuple("Error::Other").field(e).finish(), + Error::Other(e) => { + f.debug_tuple("Error::Other").field(e).finish() + } } } } impl ::core::fmt::Display for Error { - 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 Error {} /// QoS for publishing Mqtt messages #[repr(u8)] - #[derive(Clone, Copy, Eq, PartialEq)] + #[derive(Clone, Copy, Eq, Ord, PartialEq, PartialOrd)] pub enum Qos { AtMostOnce, AtLeastOnce, ExactlyOnce, } impl ::core::fmt::Debug for Qos { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { Qos::AtMostOnce => f.debug_tuple("Qos::AtMostOnce").finish(), - Qos::AtLeastOnce => f.debug_tuple("Qos::AtLeastOnce").finish(), - Qos::ExactlyOnce => f.debug_tuple("Qos::ExactlyOnce").finish(), + Qos::AtLeastOnce => { + f.debug_tuple("Qos::AtLeastOnce").finish() + } + Qos::ExactlyOnce => { + f.debug_tuple("Qos::ExactlyOnce").finish() + } } } } - impl Qos { #[doc(hidden)] pub unsafe fn _lift(val: u8) -> Qos { if !cfg!(debug_assertions) { return ::core::mem::transmute(val); } - match val { 0 => Qos::AtMostOnce, 1 => Qos::AtLeastOnce, 2 => Qos::ExactlyOnce, - _ => panic!("invalid enum discriminant"), } } } - #[derive(Debug)] #[repr(transparent)] pub struct Connection { handle: _rt::Resource, } - type _ConnectionRep = Option; - impl Connection { /// Creates a new resource from the specified representation. /// @@ -12156,77 +13557,70 @@ pub mod exports { pub fn new(val: T) -> Self { Self::type_guard::(); let val: _ConnectionRep = Some(val); - let ptr: *mut _ConnectionRep = _rt::Box::into_raw(_rt::Box::new(val)); + let ptr: *mut _ConnectionRep = _rt::Box::into_raw( + _rt::Box::new(val), + ); unsafe { Self::from_handle(T::_resource_new(ptr.cast())) } } - /// Gets access to the underlying `T` which represents this resource. pub fn get(&self) -> &T { let ptr = unsafe { &*self.as_ptr::() }; ptr.as_ref().unwrap() } - /// Gets mutable access to the underlying `T` which represents this /// resource. pub fn get_mut(&mut self) -> &mut T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_mut().unwrap() } - /// Consumes this resource and returns the underlying `T`. pub fn into_inner(self) -> T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.take().unwrap() } - #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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) } - - // It's theoretically possible to implement the `GuestConnection` trait twice - // so guard against using it with two different types here. #[doc(hidden)] fn type_guard() { use core::any::TypeId; static mut LAST_TYPE: Option = None; unsafe { - assert!(!cfg!(target_feature = "threads")); + assert!(! cfg!(target_feature = "atomics")); let id = TypeId::of::(); match LAST_TYPE { - Some(ty) => assert!( - ty == id, - "cannot use two types with this resource type" - ), + Some(ty) => { + assert!( + ty == id, "cannot use two types with this resource type" + ) + } None => LAST_TYPE = Some(id), } } } - #[doc(hidden)] pub unsafe fn dtor(handle: *mut u8) { Self::type_guard::(); - let _ = _rt::Box::from_raw(handle as *mut _ConnectionRep); + let _ = unsafe { + _rt::Box::from_raw(handle as *mut _ConnectionRep) + }; } - fn as_ptr(&self) -> *mut _ConnectionRep { Connection::type_guard::(); T::_resource_rep(self.handle()).cast() } } - /// A borrowed version of [`Connection`] which represents a borrowed value /// with the lifetime `'a`. #[derive(Debug)] @@ -12235,7 +13629,6 @@ pub mod exports { rep: *mut u8, _marker: core::marker::PhantomData<&'a Connection>, } - impl<'a> ConnectionBorrow<'a> { #[doc(hidden)] pub unsafe fn lift(rep: usize) -> Self { @@ -12244,41 +13637,34 @@ pub mod exports { _marker: core::marker::PhantomData, } } - /// Gets access to the underlying `T` in this resource. pub fn get(&self) -> &T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_ref().unwrap() } - - // NB: mutable access is not allowed due to the component model allowing - // multiple borrows of the same resource. - fn as_ptr(&self) -> *mut _ConnectionRep { Connection::type_guard::(); self.rep.cast() } } - unsafe impl _rt::WasmResource for Connection { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]fermyon:spin/mqtt@2.0.0")] - extern "C" { + #[link( + wasm_import_module = "[export]fermyon:spin/mqtt@2.0.0" + )] + unsafe extern "C" { #[link_name = "[resource-drop]connection"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - /// The message payload. pub type Payload = _rt::Vec; #[doc(hidden)] @@ -12292,8 +13678,7 @@ pub mod exports { arg5: usize, arg6: i64, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg1; let bytes0 = _rt::Vec::from_raw_parts(arg0.cast(), len0, len0); let len1 = arg3; @@ -12306,38 +13691,56 @@ pub mod exports { _rt::string_lift(bytes2), arg6 as u64, ); - let ptr4 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr4 = (&raw mut _RET_AREA.0).cast::(); match result3 { Ok(e) => { *ptr4.add(0).cast::() = (0i32) as u8; - *ptr4.add(4).cast::() = (e).take_handle() as i32; + *ptr4 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (e).take_handle() as i32; } Err(e) => { *ptr4.add(0).cast::() = (1i32) as u8; match e { Error::InvalidAddress => { - *ptr4.add(4).cast::() = (0i32) as u8; + *ptr4 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } Error::TooManyConnections => { - *ptr4.add(4).cast::() = (1i32) as u8; + *ptr4 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; } Error::ConnectionFailed(e) => { - *ptr4.add(4).cast::() = (2i32) as u8; + *ptr4 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (2i32) as u8; let vec5 = (e.into_bytes()).into_boxed_slice(); let ptr5 = vec5.as_ptr().cast::(); let len5 = vec5.len(); ::core::mem::forget(vec5); - *ptr4.add(12).cast::() = len5; - *ptr4.add(8).cast::<*mut u8>() = ptr5.cast_mut(); + *ptr4 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len5; + *ptr4 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr5.cast_mut(); } Error::Other(e) => { - *ptr4.add(4).cast::() = (3i32) as u8; + *ptr4 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (3i32) as u8; let vec6 = (e.into_bytes()).into_boxed_slice(); let ptr6 = vec6.as_ptr().cast::(); let len6 = vec6.len(); ::core::mem::forget(vec6); - *ptr4.add(12).cast::() = len6; - *ptr4.add(8).cast::<*mut u8>() = ptr6.cast_mut(); + *ptr4 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len6; + *ptr4 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr6.cast_mut(); } } } @@ -12351,20 +13754,30 @@ pub mod exports { ) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { - 0 => (), + 0 => {} _ => { - let l1 = i32::from(*arg0.add(4).cast::()); + let l1 = i32::from( + *arg0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); match l1 { - 0 => (), - 1 => (), + 0 => {} + 1 => {} 2 => { - let l2 = *arg0.add(8).cast::<*mut u8>(); - let l3 = *arg0.add(12).cast::(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l3 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l2, l3, 1); } _ => { - let l4 = *arg0.add(8).cast::<*mut u8>(); - let l5 = *arg0.add(12).cast::(); + let l4 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l5 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l4, l5, 1); } } @@ -12381,18 +13794,17 @@ pub mod exports { arg4: usize, arg5: i32, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg2; let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0); let len1 = arg4; let result2 = T::publish( - ConnectionBorrow::lift(arg0 as u32 as usize).get(), + unsafe { ConnectionBorrow::lift(arg0 as u32 as usize) }.get(), _rt::string_lift(bytes0), _rt::Vec::from_raw_parts(arg3.cast(), len1, len1), Qos::_lift(arg5 as u8), ); - let ptr3 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr3 = (&raw mut _RET_AREA.0).cast::(); match result2 { Ok(_) => { *ptr3.add(0).cast::() = (0i32) as u8; @@ -12401,28 +13813,44 @@ pub mod exports { *ptr3.add(0).cast::() = (1i32) as u8; match e { Error::InvalidAddress => { - *ptr3.add(4).cast::() = (0i32) as u8; + *ptr3 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } Error::TooManyConnections => { - *ptr3.add(4).cast::() = (1i32) as u8; + *ptr3 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; } Error::ConnectionFailed(e) => { - *ptr3.add(4).cast::() = (2i32) as u8; + *ptr3 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (2i32) as u8; let vec4 = (e.into_bytes()).into_boxed_slice(); let ptr4 = vec4.as_ptr().cast::(); let len4 = vec4.len(); ::core::mem::forget(vec4); - *ptr3.add(12).cast::() = len4; - *ptr3.add(8).cast::<*mut u8>() = ptr4.cast_mut(); + *ptr3 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len4; + *ptr3 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr4.cast_mut(); } Error::Other(e) => { - *ptr3.add(4).cast::() = (3i32) as u8; + *ptr3 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (3i32) as u8; let vec5 = (e.into_bytes()).into_boxed_slice(); let ptr5 = vec5.as_ptr().cast::(); let len5 = vec5.len(); ::core::mem::forget(vec5); - *ptr3.add(12).cast::() = len5; - *ptr3.add(8).cast::<*mut u8>() = ptr5.cast_mut(); + *ptr3 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len5; + *ptr3 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr5.cast_mut(); } } } @@ -12431,25 +13859,35 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn __post_return_method_connection_publish( - arg0: *mut u8, - ) { + pub unsafe fn __post_return_method_connection_publish< + T: GuestConnection, + >(arg0: *mut u8) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { - 0 => (), + 0 => {} _ => { - let l1 = i32::from(*arg0.add(4).cast::()); + let l1 = i32::from( + *arg0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); match l1 { - 0 => (), - 1 => (), + 0 => {} + 1 => {} 2 => { - let l2 = *arg0.add(8).cast::<*mut u8>(); - let l3 = *arg0.add(12).cast::(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l3 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l2, l3, 1); } _ => { - let l4 = *arg0.add(8).cast::<*mut u8>(); - let l5 = *arg0.add(12).cast::(); + let l4 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l5 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l4, l5, 1); } } @@ -12470,18 +13908,18 @@ pub mod exports { let _ = val; unreachable!(); } - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]fermyon:spin/mqtt@2.0.0")] - extern "C" { + #[link( + wasm_import_module = "[export]fermyon:spin/mqtt@2.0.0" + )] + unsafe extern "C" { #[link_name = "[resource-new]connection"] fn new(_: *mut u8) -> u32; } - new(val) + unsafe { new(val) } } } - #[doc(hidden)] fn _resource_rep(handle: u32) -> *mut u8 where @@ -12492,18 +13930,18 @@ pub mod exports { let _ = handle; unreachable!(); } - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]fermyon:spin/mqtt@2.0.0")] - extern "C" { + #[link( + wasm_import_module = "[export]fermyon:spin/mqtt@2.0.0" + )] + unsafe extern "C" { #[link_name = "[resource-rep]connection"] fn rep(_: u32) -> *mut u8; } unsafe { rep(handle) } } } - /// Open a connection to the Mqtt instance at `address`. fn open( address: _rt::String, @@ -12520,71 +13958,71 @@ pub mod exports { ) -> Result<(), Error>; } #[doc(hidden)] - - macro_rules! __export_fermyon_spin_mqtt_2_0_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "fermyon:spin/mqtt@2.0.0#[static]connection.open"] - unsafe extern "C" fn export_static_connection_open(arg0: *mut u8,arg1: usize,arg2: *mut u8,arg3: usize,arg4: *mut u8,arg5: usize,arg6: i64,) -> *mut u8 { - $($path_to_types)*::_export_static_connection_open_cabi::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0, arg1, arg2, arg3, arg4, arg5, arg6) - } - #[export_name = "cabi_post_fermyon:spin/mqtt@2.0.0#[static]connection.open"] - unsafe extern "C" fn _post_return_static_connection_open(arg0: *mut u8,) { - $($path_to_types)*::__post_return_static_connection_open::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0) - } - #[export_name = "fermyon:spin/mqtt@2.0.0#[method]connection.publish"] - unsafe extern "C" fn export_method_connection_publish(arg0: *mut u8,arg1: *mut u8,arg2: usize,arg3: *mut u8,arg4: usize,arg5: i32,) -> *mut u8 { - $($path_to_types)*::_export_method_connection_publish_cabi::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0, arg1, arg2, arg3, arg4, arg5) - } - #[export_name = "cabi_post_fermyon:spin/mqtt@2.0.0#[method]connection.publish"] - unsafe extern "C" fn _post_return_method_connection_publish(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_connection_publish::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0) - } - - const _: () = { - #[doc(hidden)] - #[export_name = "fermyon:spin/mqtt@2.0.0#[dtor]connection"] - #[allow(non_snake_case)] - unsafe extern "C" fn dtor(rep: *mut u8) { - $($path_to_types)*::Connection::dtor::< - <$ty as $($path_to_types)*::Guest>::Connection - >(rep) - } - }; - - };); -} + macro_rules! __export_fermyon_spin_mqtt_2_0_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "fermyon:spin/mqtt@2.0.0#[static]connection.open")] unsafe extern + "C" fn export_static_connection_open(arg0 : * mut u8, arg1 : + usize, arg2 : * mut u8, arg3 : usize, arg4 : * mut u8, arg5 : + usize, arg6 : i64,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_static_connection_open_cabi::<<$ty as + $($path_to_types)*:: Guest >::Connection > (arg0, arg1, arg2, + arg3, arg4, arg5, arg6) } } #[unsafe (export_name = + "cabi_post_fermyon:spin/mqtt@2.0.0#[static]connection.open")] + unsafe extern "C" fn _post_return_static_connection_open(arg0 : * + mut u8,) { unsafe { $($path_to_types)*:: + __post_return_static_connection_open::<<$ty as + $($path_to_types)*:: Guest >::Connection > (arg0) } } #[unsafe + (export_name = + "fermyon:spin/mqtt@2.0.0#[method]connection.publish")] unsafe + extern "C" fn export_method_connection_publish(arg0 : * mut u8, + arg1 : * mut u8, arg2 : usize, arg3 : * mut u8, arg4 : usize, + arg5 : i32,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_connection_publish_cabi::<<$ty as + $($path_to_types)*:: Guest >::Connection > (arg0, arg1, arg2, + arg3, arg4, arg5) } } #[unsafe (export_name = + "cabi_post_fermyon:spin/mqtt@2.0.0#[method]connection.publish")] + unsafe extern "C" fn _post_return_method_connection_publish(arg0 + : * mut u8,) { unsafe { $($path_to_types)*:: + __post_return_method_connection_publish::<<$ty as + $($path_to_types)*:: Guest >::Connection > (arg0) } } const _ : + () = { #[doc(hidden)] #[unsafe (export_name = + "fermyon:spin/mqtt@2.0.0#[dtor]connection")] + #[allow(non_snake_case)] unsafe extern "C" fn dtor(rep : * mut + u8) { unsafe { $($path_to_types)*:: Connection::dtor::< <$ty as + $($path_to_types)*:: Guest >::Connection > (rep) } } }; }; + }; + } #[doc(hidden)] pub(crate) use __export_fermyon_spin_mqtt_2_0_0_cabi; - #[repr(align(4))] - struct _RetArea([::core::mem::MaybeUninit; 16]); - static mut _RET_AREA: _RetArea = _RetArea([::core::mem::MaybeUninit::uninit(); 16]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct _RetArea( + [::core::mem::MaybeUninit< + u8, + >; 4 * ::core::mem::size_of::<*const u8>()], + ); + static mut _RET_AREA: _RetArea = _RetArea( + [::core::mem::MaybeUninit::uninit(); 4 + * ::core::mem::size_of::<*const u8>()], + ); } - - #[allow(dead_code, clippy::all)] + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod mysql { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; - pub type ParameterValue = - super::super::super::super::exports::fermyon::spin::rdbms_types::ParameterValue; - pub type RowSet = - super::super::super::super::exports::fermyon::spin::rdbms_types::RowSet; - pub type Error = - super::super::super::super::exports::fermyon::spin::rdbms_types::Error; + pub type ParameterValue = super::super::super::super::exports::fermyon::spin::rdbms_types::ParameterValue; + pub type RowSet = super::super::super::super::exports::fermyon::spin::rdbms_types::RowSet; + pub type Error = super::super::super::super::exports::fermyon::spin::rdbms_types::Error; /// A connection to a MySQL database. - #[derive(Debug)] #[repr(transparent)] pub struct Connection { handle: _rt::Resource, } - type _ConnectionRep = Option; - impl Connection { /// Creates a new resource from the specified representation. /// @@ -12594,77 +14032,70 @@ pub mod exports { pub fn new(val: T) -> Self { Self::type_guard::(); let val: _ConnectionRep = Some(val); - let ptr: *mut _ConnectionRep = _rt::Box::into_raw(_rt::Box::new(val)); + let ptr: *mut _ConnectionRep = _rt::Box::into_raw( + _rt::Box::new(val), + ); unsafe { Self::from_handle(T::_resource_new(ptr.cast())) } } - /// Gets access to the underlying `T` which represents this resource. pub fn get(&self) -> &T { let ptr = unsafe { &*self.as_ptr::() }; ptr.as_ref().unwrap() } - /// Gets mutable access to the underlying `T` which represents this /// resource. pub fn get_mut(&mut self) -> &mut T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_mut().unwrap() } - /// Consumes this resource and returns the underlying `T`. pub fn into_inner(self) -> T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.take().unwrap() } - #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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) } - - // It's theoretically possible to implement the `GuestConnection` trait twice - // so guard against using it with two different types here. #[doc(hidden)] fn type_guard() { use core::any::TypeId; static mut LAST_TYPE: Option = None; unsafe { - assert!(!cfg!(target_feature = "threads")); + assert!(! cfg!(target_feature = "atomics")); let id = TypeId::of::(); match LAST_TYPE { - Some(ty) => assert!( - ty == id, - "cannot use two types with this resource type" - ), + Some(ty) => { + assert!( + ty == id, "cannot use two types with this resource type" + ) + } None => LAST_TYPE = Some(id), } } } - #[doc(hidden)] pub unsafe fn dtor(handle: *mut u8) { Self::type_guard::(); - let _ = _rt::Box::from_raw(handle as *mut _ConnectionRep); + let _ = unsafe { + _rt::Box::from_raw(handle as *mut _ConnectionRep) + }; } - fn as_ptr(&self) -> *mut _ConnectionRep { Connection::type_guard::(); T::_resource_rep(self.handle()).cast() } } - /// A borrowed version of [`Connection`] which represents a borrowed value /// with the lifetime `'a`. #[derive(Debug)] @@ -12673,7 +14104,6 @@ pub mod exports { rep: *mut u8, _marker: core::marker::PhantomData<&'a Connection>, } - impl<'a> ConnectionBorrow<'a> { #[doc(hidden)] pub unsafe fn lift(rep: usize) -> Self { @@ -12682,106 +14112,130 @@ pub mod exports { _marker: core::marker::PhantomData, } } - /// Gets access to the underlying `T` in this resource. pub fn get(&self) -> &T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_ref().unwrap() } - - // NB: mutable access is not allowed due to the component model allowing - // multiple borrows of the same resource. - fn as_ptr(&self) -> *mut _ConnectionRep { Connection::type_guard::(); self.rep.cast() } } - unsafe impl _rt::WasmResource for Connection { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]fermyon:spin/mysql@2.0.0")] - extern "C" { + #[link( + wasm_import_module = "[export]fermyon:spin/mysql@2.0.0" + )] + unsafe extern "C" { #[link_name = "[resource-drop]connection"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_static_connection_open_cabi( arg0: *mut u8, arg1: usize, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg1; let bytes0 = _rt::Vec::from_raw_parts(arg0.cast(), len0, len0); let result1 = T::open(_rt::string_lift(bytes0)); - let ptr2 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr2 = (&raw mut _RET_AREA.0).cast::(); match result1 { Ok(e) => { *ptr2.add(0).cast::() = (0i32) as u8; - *ptr2.add(4).cast::() = (e).take_handle() as i32; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (e).take_handle() as i32; } Err(e) => { *ptr2.add(0).cast::() = (1i32) as u8; use super::super::super::super::exports::fermyon::spin::rdbms_types::Error as V8; match e { V8::ConnectionFailed(e) => { - *ptr2.add(4).cast::() = (0i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; let vec3 = (e.into_bytes()).into_boxed_slice(); let ptr3 = vec3.as_ptr().cast::(); let len3 = vec3.len(); ::core::mem::forget(vec3); - *ptr2.add(12).cast::() = len3; - *ptr2.add(8).cast::<*mut u8>() = ptr3.cast_mut(); + *ptr2 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len3; + *ptr2 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr3.cast_mut(); } V8::BadParameter(e) => { - *ptr2.add(4).cast::() = (1i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; let vec4 = (e.into_bytes()).into_boxed_slice(); let ptr4 = vec4.as_ptr().cast::(); let len4 = vec4.len(); ::core::mem::forget(vec4); - *ptr2.add(12).cast::() = len4; - *ptr2.add(8).cast::<*mut u8>() = ptr4.cast_mut(); + *ptr2 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len4; + *ptr2 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr4.cast_mut(); } V8::QueryFailed(e) => { - *ptr2.add(4).cast::() = (2i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (2i32) as u8; let vec5 = (e.into_bytes()).into_boxed_slice(); let ptr5 = vec5.as_ptr().cast::(); let len5 = vec5.len(); ::core::mem::forget(vec5); - *ptr2.add(12).cast::() = len5; - *ptr2.add(8).cast::<*mut u8>() = ptr5.cast_mut(); + *ptr2 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len5; + *ptr2 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr5.cast_mut(); } V8::ValueConversionFailed(e) => { - *ptr2.add(4).cast::() = (3i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (3i32) as u8; let vec6 = (e.into_bytes()).into_boxed_slice(); let ptr6 = vec6.as_ptr().cast::(); let len6 = vec6.len(); ::core::mem::forget(vec6); - *ptr2.add(12).cast::() = len6; - *ptr2.add(8).cast::<*mut u8>() = ptr6.cast_mut(); + *ptr2 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len6; + *ptr2 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr6.cast_mut(); } V8::Other(e) => { - *ptr2.add(4).cast::() = (4i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (4i32) as u8; let vec7 = (e.into_bytes()).into_boxed_slice(); let ptr7 = vec7.as_ptr().cast::(); let len7 = vec7.len(); ::core::mem::forget(vec7); - *ptr2.add(12).cast::() = len7; - *ptr2.add(8).cast::<*mut u8>() = ptr7.cast_mut(); + *ptr2 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len7; + *ptr2 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr7.cast_mut(); } } } @@ -12795,33 +14249,55 @@ pub mod exports { ) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { - 0 => (), + 0 => {} _ => { - let l1 = i32::from(*arg0.add(4).cast::()); + let l1 = i32::from( + *arg0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); match l1 { 0 => { - let l2 = *arg0.add(8).cast::<*mut u8>(); - let l3 = *arg0.add(12).cast::(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l3 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l2, l3, 1); } 1 => { - let l4 = *arg0.add(8).cast::<*mut u8>(); - let l5 = *arg0.add(12).cast::(); + let l4 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l5 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l4, l5, 1); } 2 => { - let l6 = *arg0.add(8).cast::<*mut u8>(); - let l7 = *arg0.add(12).cast::(); + let l6 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l7 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l6, l7, 1); } 3 => { - let l8 = *arg0.add(8).cast::<*mut u8>(); - let l9 = *arg0.add(12).cast::(); + let l8 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l9 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l8, l9, 1); } _ => { - let l10 = *arg0.add(8).cast::<*mut u8>(); - let l11 = *arg0.add(12).cast::(); + let l10 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l11 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l10, l11, 1); } } @@ -12837,15 +14313,15 @@ pub mod exports { arg3: *mut u8, arg4: usize, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg2; let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0); let base20 = arg3; let len20 = arg4; let mut result20 = _rt::Vec::with_capacity(len20); for i in 0..len20 { - let base = base20.add(i * 16); + let base = base20 + .add(i * (8 + 2 * ::core::mem::size_of::<*const u8>())); let e20 = { let l1 = i32::from(*base.add(0).cast::()); use super::super::super::super::exports::fermyon::spin::rdbms_types::ParameterValue as V19; @@ -12853,7 +14329,6 @@ pub mod exports { 0 => { let e19 = { let l2 = i32::from(*base.add(8).cast::()); - _rt::bool_lift(l2 as u8) }; V19::Boolean(e19) @@ -12861,7 +14336,6 @@ pub mod exports { 1 => { let e19 = { let l3 = i32::from(*base.add(8).cast::()); - l3 as i8 }; V19::Int8(e19) @@ -12869,7 +14343,6 @@ pub mod exports { 2 => { let e19 = { let l4 = i32::from(*base.add(8).cast::()); - l4 as i16 }; V19::Int16(e19) @@ -12877,7 +14350,6 @@ pub mod exports { 3 => { let e19 = { let l5 = *base.add(8).cast::(); - l5 }; V19::Int32(e19) @@ -12885,7 +14357,6 @@ pub mod exports { 4 => { let e19 = { let l6 = *base.add(8).cast::(); - l6 }; V19::Int64(e19) @@ -12893,7 +14364,6 @@ pub mod exports { 5 => { let e19 = { let l7 = i32::from(*base.add(8).cast::()); - l7 as u8 }; V19::Uint8(e19) @@ -12901,7 +14371,6 @@ pub mod exports { 6 => { let e19 = { let l8 = i32::from(*base.add(8).cast::()); - l8 as u16 }; V19::Uint16(e19) @@ -12909,7 +14378,6 @@ pub mod exports { 7 => { let e19 = { let l9 = *base.add(8).cast::(); - l9 as u32 }; V19::Uint32(e19) @@ -12917,7 +14385,6 @@ pub mod exports { 8 => { let e19 = { let l10 = *base.add(8).cast::(); - l10 as u64 }; V19::Uint64(e19) @@ -12925,7 +14392,6 @@ pub mod exports { 9 => { let e19 = { let l11 = *base.add(8).cast::(); - l11 }; V19::Floating32(e19) @@ -12933,7 +14399,6 @@ pub mod exports { 10 => { let e19 = { let l12 = *base.add(8).cast::(); - l12 }; V19::Floating64(e19) @@ -12941,11 +14406,15 @@ pub mod exports { 11 => { let e19 = { let l13 = *base.add(8).cast::<*mut u8>(); - let l14 = *base.add(12).cast::(); + let l14 = *base + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(); let len15 = l14; - let bytes15 = - _rt::Vec::from_raw_parts(l13.cast(), len15, len15); - + let bytes15 = _rt::Vec::from_raw_parts( + l13.cast(), + len15, + len15, + ); _rt::string_lift(bytes15) }; V19::Str(e19) @@ -12953,9 +14422,10 @@ pub mod exports { 12 => { let e19 = { let l16 = *base.add(8).cast::<*mut u8>(); - let l17 = *base.add(12).cast::(); + let l17 = *base + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(); let len18 = l17; - _rt::Vec::from_raw_parts(l16.cast(), len18, len18) }; V19::Binary(e19) @@ -12965,26 +14435,34 @@ pub mod exports { V19::DbNull } }; - v19 }; result20.push(e20); } - _rt::cabi_dealloc(base20, len20 * 16, 8); + _rt::cabi_dealloc( + base20, + len20 * (8 + 2 * ::core::mem::size_of::<*const u8>()), + 8, + ); let result21 = T::query( - ConnectionBorrow::lift(arg0 as u32 as usize).get(), + unsafe { ConnectionBorrow::lift(arg0 as u32 as usize) }.get(), _rt::string_lift(bytes0), result20, ); - let ptr22 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr22 = (&raw mut _RET_AREA.0).cast::(); match result21 { Ok(e) => { *ptr22.add(0).cast::() = (0i32) as u8; - let super::super::super::super::exports::fermyon::spin::rdbms_types::RowSet{ columns:columns23, rows:rows23, } = e; + let super::super::super::super::exports::fermyon::spin::rdbms_types::RowSet { + columns: columns23, + rows: rows23, + } = e; let vec26 = columns23; let len26 = vec26.len(); - let layout26 = - _rt::alloc::Layout::from_size_align_unchecked(vec26.len() * 12, 4); + let layout26 = _rt::alloc::Layout::from_size_align_unchecked( + vec26.len() * (3 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); let result26 = if layout26.size() != 0 { let ptr = _rt::alloc::alloc(layout26).cast::(); if ptr.is_null() { @@ -12992,29 +14470,41 @@ pub mod exports { } ptr } else { - { - ::core::ptr::null_mut() - } + ::core::ptr::null_mut() }; for (i, e) in vec26.into_iter().enumerate() { - let base = result26.add(i * 12); + let base = result26 + .add(i * (3 * ::core::mem::size_of::<*const u8>())); { - let super::super::super::super::exports::fermyon::spin::rdbms_types::Column{ name:name24, data_type:data_type24, } = e; + let super::super::super::super::exports::fermyon::spin::rdbms_types::Column { + name: name24, + data_type: data_type24, + } = e; let vec25 = (name24.into_bytes()).into_boxed_slice(); let ptr25 = vec25.as_ptr().cast::(); let len25 = vec25.len(); ::core::mem::forget(vec25); - *base.add(4).cast::() = len25; + *base + .add(::core::mem::size_of::<*const u8>()) + .cast::() = len25; *base.add(0).cast::<*mut u8>() = ptr25.cast_mut(); - *base.add(8).cast::() = (data_type24.clone() as i32) as u8; + *base + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::() = (data_type24.clone() as i32) as u8; } } - *ptr22.add(8).cast::() = len26; - *ptr22.add(4).cast::<*mut u8>() = result26; + *ptr22 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len26; + *ptr22 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = result26; let vec31 = rows23; let len31 = vec31.len(); - let layout31 = - _rt::alloc::Layout::from_size_align_unchecked(vec31.len() * 8, 4); + let layout31 = _rt::alloc::Layout::from_size_align_unchecked( + vec31.len() * (2 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); let result31 = if layout31.size() != 0 { let ptr = _rt::alloc::alloc(layout31).cast::(); if ptr.is_null() { @@ -13022,17 +14512,16 @@ pub mod exports { } ptr } else { - { - ::core::ptr::null_mut() - } + ::core::ptr::null_mut() }; for (i, e) in vec31.into_iter().enumerate() { - let base = result31.add(i * 8); + let base = result31 + .add(i * (2 * ::core::mem::size_of::<*const u8>())); { let vec30 = e; let len30 = vec30.len(); let layout30 = _rt::alloc::Layout::from_size_align_unchecked( - vec30.len() * 16, + vec30.len() * (8 + 2 * ::core::mem::size_of::<*const u8>()), 8, ); let result30 = if layout30.size() != 0 { @@ -13042,12 +14531,11 @@ pub mod exports { } ptr } else { - { - ::core::ptr::null_mut() - } + ::core::ptr::null_mut() }; for (i, e) in vec30.into_iter().enumerate() { - let base = result30.add(i * 16); + let base = result30 + .add(i * (8 + 2 * ::core::mem::size_of::<*const u8>())); { use super::super::super::super::exports::fermyon::spin::rdbms_types::DbValue as V29; match e { @@ -13056,18 +14544,15 @@ pub mod exports { *base.add(8).cast::() = (match e { true => 1, false => 0, - }) - as u8; + }) as u8; } V29::Int8(e) => { *base.add(0).cast::() = (1i32) as u8; - *base.add(8).cast::() = - (_rt::as_i32(e)) as u8; + *base.add(8).cast::() = (_rt::as_i32(e)) as u8; } V29::Int16(e) => { *base.add(0).cast::() = (2i32) as u8; - *base.add(8).cast::() = - (_rt::as_i32(e)) as u16; + *base.add(8).cast::() = (_rt::as_i32(e)) as u16; } V29::Int32(e) => { *base.add(0).cast::() = (3i32) as u8; @@ -13079,13 +14564,11 @@ pub mod exports { } V29::Uint8(e) => { *base.add(0).cast::() = (5i32) as u8; - *base.add(8).cast::() = - (_rt::as_i32(e)) as u8; + *base.add(8).cast::() = (_rt::as_i32(e)) as u8; } V29::Uint16(e) => { *base.add(0).cast::() = (6i32) as u8; - *base.add(8).cast::() = - (_rt::as_i32(e)) as u16; + *base.add(8).cast::() = (_rt::as_i32(e)) as u16; } V29::Uint32(e) => { *base.add(0).cast::() = (7i32) as u8; @@ -13109,9 +14592,10 @@ pub mod exports { let ptr27 = vec27.as_ptr().cast::(); let len27 = vec27.len(); ::core::mem::forget(vec27); - *base.add(12).cast::() = len27; - *base.add(8).cast::<*mut u8>() = - ptr27.cast_mut(); + *base + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::() = len27; + *base.add(8).cast::<*mut u8>() = ptr27.cast_mut(); } V29::Binary(e) => { *base.add(0).cast::() = (12i32) as u8; @@ -13119,9 +14603,10 @@ pub mod exports { let ptr28 = vec28.as_ptr().cast::(); let len28 = vec28.len(); ::core::mem::forget(vec28); - *base.add(12).cast::() = len28; - *base.add(8).cast::<*mut u8>() = - ptr28.cast_mut(); + *base + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::() = len28; + *base.add(8).cast::<*mut u8>() = ptr28.cast_mut(); } V29::DbNull => { *base.add(0).cast::() = (13i32) as u8; @@ -13132,61 +14617,97 @@ pub mod exports { } } } - *base.add(4).cast::() = len30; + *base + .add(::core::mem::size_of::<*const u8>()) + .cast::() = len30; *base.add(0).cast::<*mut u8>() = result30; } } - *ptr22.add(16).cast::() = len31; - *ptr22.add(12).cast::<*mut u8>() = result31; + *ptr22 + .add(4 * ::core::mem::size_of::<*const u8>()) + .cast::() = len31; + *ptr22 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = result31; } Err(e) => { *ptr22.add(0).cast::() = (1i32) as u8; use super::super::super::super::exports::fermyon::spin::rdbms_types::Error as V37; match e { V37::ConnectionFailed(e) => { - *ptr22.add(4).cast::() = (0i32) as u8; + *ptr22 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; let vec32 = (e.into_bytes()).into_boxed_slice(); let ptr32 = vec32.as_ptr().cast::(); let len32 = vec32.len(); ::core::mem::forget(vec32); - *ptr22.add(12).cast::() = len32; - *ptr22.add(8).cast::<*mut u8>() = ptr32.cast_mut(); + *ptr22 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len32; + *ptr22 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr32.cast_mut(); } V37::BadParameter(e) => { - *ptr22.add(4).cast::() = (1i32) as u8; + *ptr22 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; let vec33 = (e.into_bytes()).into_boxed_slice(); let ptr33 = vec33.as_ptr().cast::(); let len33 = vec33.len(); ::core::mem::forget(vec33); - *ptr22.add(12).cast::() = len33; - *ptr22.add(8).cast::<*mut u8>() = ptr33.cast_mut(); + *ptr22 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len33; + *ptr22 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr33.cast_mut(); } V37::QueryFailed(e) => { - *ptr22.add(4).cast::() = (2i32) as u8; + *ptr22 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (2i32) as u8; let vec34 = (e.into_bytes()).into_boxed_slice(); let ptr34 = vec34.as_ptr().cast::(); let len34 = vec34.len(); ::core::mem::forget(vec34); - *ptr22.add(12).cast::() = len34; - *ptr22.add(8).cast::<*mut u8>() = ptr34.cast_mut(); + *ptr22 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len34; + *ptr22 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr34.cast_mut(); } V37::ValueConversionFailed(e) => { - *ptr22.add(4).cast::() = (3i32) as u8; + *ptr22 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (3i32) as u8; let vec35 = (e.into_bytes()).into_boxed_slice(); let ptr35 = vec35.as_ptr().cast::(); let len35 = vec35.len(); ::core::mem::forget(vec35); - *ptr22.add(12).cast::() = len35; - *ptr22.add(8).cast::<*mut u8>() = ptr35.cast_mut(); + *ptr22 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len35; + *ptr22 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr35.cast_mut(); } V37::Other(e) => { - *ptr22.add(4).cast::() = (4i32) as u8; + *ptr22 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (4i32) as u8; let vec36 = (e.into_bytes()).into_boxed_slice(); let ptr36 = vec36.as_ptr().cast::(); let len36 = vec36.len(); ::core::mem::forget(vec36); - *ptr22.add(12).cast::() = len36; - *ptr22.add(8).cast::<*mut u8>() = ptr36.cast_mut(); + *ptr22 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len36; + *ptr22 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr36.cast_mut(); } } } @@ -13201,94 +14722,147 @@ pub mod exports { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { 0 => { - let l3 = *arg0.add(4).cast::<*mut u8>(); - let l4 = *arg0.add(8).cast::(); - let base5 = l3; - let len5 = l4; + let l1 = *arg0 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let base5 = l1; + let len5 = l2; for i in 0..len5 { - let base = base5.add(i * 12); + let base = base5 + .add(i * (3 * ::core::mem::size_of::<*const u8>())); { - let l1 = *base.add(0).cast::<*mut u8>(); - let l2 = *base.add(4).cast::(); - _rt::cabi_dealloc(l1, l2, 1); + let l3 = *base.add(0).cast::<*mut u8>(); + let l4 = *base + .add(::core::mem::size_of::<*const u8>()) + .cast::(); + _rt::cabi_dealloc(l3, l4, 1); } } - _rt::cabi_dealloc(base5, len5 * 12, 4); - let l15 = *arg0.add(12).cast::<*mut u8>(); - let l16 = *arg0.add(16).cast::(); - let base17 = l15; - let len17 = l16; + _rt::cabi_dealloc( + base5, + len5 * (3 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); + let l6 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l7 = *arg0 + .add(4 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let base17 = l6; + let len17 = l7; for i in 0..len17 { - let base = base17.add(i * 8); + let base = base17 + .add(i * (2 * ::core::mem::size_of::<*const u8>())); { - let l12 = *base.add(0).cast::<*mut u8>(); - let l13 = *base.add(4).cast::(); - let base14 = l12; - let len14 = l13; - for i in 0..len14 { - let base = base14.add(i * 16); + let l8 = *base.add(0).cast::<*mut u8>(); + let l9 = *base + .add(::core::mem::size_of::<*const u8>()) + .cast::(); + let base16 = l8; + let len16 = l9; + for i in 0..len16 { + let base = base16 + .add(i * (8 + 2 * ::core::mem::size_of::<*const u8>())); { - let l6 = i32::from(*base.add(0).cast::()); - match l6 { - 0 => (), - 1 => (), - 2 => (), - 3 => (), - 4 => (), - 5 => (), - 6 => (), - 7 => (), - 8 => (), - 9 => (), - 10 => (), + let l10 = i32::from(*base.add(0).cast::()); + match l10 { + 0 => {} + 1 => {} + 2 => {} + 3 => {} + 4 => {} + 5 => {} + 6 => {} + 7 => {} + 8 => {} + 9 => {} + 10 => {} 11 => { - let l7 = *base.add(8).cast::<*mut u8>(); - let l8 = *base.add(12).cast::(); - _rt::cabi_dealloc(l7, l8, 1); + let l11 = *base.add(8).cast::<*mut u8>(); + let l12 = *base + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(); + _rt::cabi_dealloc(l11, l12, 1); } 12 => { - let l9 = *base.add(8).cast::<*mut u8>(); - let l10 = *base.add(12).cast::(); - let base11 = l9; - let len11 = l10; - _rt::cabi_dealloc(base11, len11 * 1, 1); + let l13 = *base.add(8).cast::<*mut u8>(); + let l14 = *base + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let base15 = l13; + let len15 = l14; + _rt::cabi_dealloc(base15, len15 * 1, 1); } - 13 => (), - _ => (), + 13 => {} + _ => {} } } } - _rt::cabi_dealloc(base14, len14 * 16, 8); + _rt::cabi_dealloc( + base16, + len16 * (8 + 2 * ::core::mem::size_of::<*const u8>()), + 8, + ); } } - _rt::cabi_dealloc(base17, len17 * 8, 4); + _rt::cabi_dealloc( + base17, + len17 * (2 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); } _ => { - let l18 = i32::from(*arg0.add(4).cast::()); + let l18 = i32::from( + *arg0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); match l18 { 0 => { - let l19 = *arg0.add(8).cast::<*mut u8>(); - let l20 = *arg0.add(12).cast::(); + let l19 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l20 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l19, l20, 1); } 1 => { - let l21 = *arg0.add(8).cast::<*mut u8>(); - let l22 = *arg0.add(12).cast::(); + let l21 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l22 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l21, l22, 1); } 2 => { - let l23 = *arg0.add(8).cast::<*mut u8>(); - let l24 = *arg0.add(12).cast::(); + let l23 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l24 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l23, l24, 1); } 3 => { - let l25 = *arg0.add(8).cast::<*mut u8>(); - let l26 = *arg0.add(12).cast::(); + let l25 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l26 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l25, l26, 1); } _ => { - let l27 = *arg0.add(8).cast::<*mut u8>(); - let l28 = *arg0.add(12).cast::(); + let l27 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l28 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l27, l28, 1); } } @@ -13304,15 +14878,15 @@ pub mod exports { arg3: *mut u8, arg4: usize, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg2; let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0); let base20 = arg3; let len20 = arg4; let mut result20 = _rt::Vec::with_capacity(len20); for i in 0..len20 { - let base = base20.add(i * 16); + let base = base20 + .add(i * (8 + 2 * ::core::mem::size_of::<*const u8>())); let e20 = { let l1 = i32::from(*base.add(0).cast::()); use super::super::super::super::exports::fermyon::spin::rdbms_types::ParameterValue as V19; @@ -13320,7 +14894,6 @@ pub mod exports { 0 => { let e19 = { let l2 = i32::from(*base.add(8).cast::()); - _rt::bool_lift(l2 as u8) }; V19::Boolean(e19) @@ -13328,7 +14901,6 @@ pub mod exports { 1 => { let e19 = { let l3 = i32::from(*base.add(8).cast::()); - l3 as i8 }; V19::Int8(e19) @@ -13336,7 +14908,6 @@ pub mod exports { 2 => { let e19 = { let l4 = i32::from(*base.add(8).cast::()); - l4 as i16 }; V19::Int16(e19) @@ -13344,7 +14915,6 @@ pub mod exports { 3 => { let e19 = { let l5 = *base.add(8).cast::(); - l5 }; V19::Int32(e19) @@ -13352,7 +14922,6 @@ pub mod exports { 4 => { let e19 = { let l6 = *base.add(8).cast::(); - l6 }; V19::Int64(e19) @@ -13360,7 +14929,6 @@ pub mod exports { 5 => { let e19 = { let l7 = i32::from(*base.add(8).cast::()); - l7 as u8 }; V19::Uint8(e19) @@ -13368,7 +14936,6 @@ pub mod exports { 6 => { let e19 = { let l8 = i32::from(*base.add(8).cast::()); - l8 as u16 }; V19::Uint16(e19) @@ -13376,7 +14943,6 @@ pub mod exports { 7 => { let e19 = { let l9 = *base.add(8).cast::(); - l9 as u32 }; V19::Uint32(e19) @@ -13384,7 +14950,6 @@ pub mod exports { 8 => { let e19 = { let l10 = *base.add(8).cast::(); - l10 as u64 }; V19::Uint64(e19) @@ -13392,7 +14957,6 @@ pub mod exports { 9 => { let e19 = { let l11 = *base.add(8).cast::(); - l11 }; V19::Floating32(e19) @@ -13400,7 +14964,6 @@ pub mod exports { 10 => { let e19 = { let l12 = *base.add(8).cast::(); - l12 }; V19::Floating64(e19) @@ -13408,11 +14971,15 @@ pub mod exports { 11 => { let e19 = { let l13 = *base.add(8).cast::<*mut u8>(); - let l14 = *base.add(12).cast::(); + let l14 = *base + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(); let len15 = l14; - let bytes15 = - _rt::Vec::from_raw_parts(l13.cast(), len15, len15); - + let bytes15 = _rt::Vec::from_raw_parts( + l13.cast(), + len15, + len15, + ); _rt::string_lift(bytes15) }; V19::Str(e19) @@ -13420,9 +14987,10 @@ pub mod exports { 12 => { let e19 = { let l16 = *base.add(8).cast::<*mut u8>(); - let l17 = *base.add(12).cast::(); + let l17 = *base + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(); let len18 = l17; - _rt::Vec::from_raw_parts(l16.cast(), len18, len18) }; V19::Binary(e19) @@ -13432,18 +15000,21 @@ pub mod exports { V19::DbNull } }; - v19 }; result20.push(e20); } - _rt::cabi_dealloc(base20, len20 * 16, 8); + _rt::cabi_dealloc( + base20, + len20 * (8 + 2 * ::core::mem::size_of::<*const u8>()), + 8, + ); let result21 = T::execute( - ConnectionBorrow::lift(arg0 as u32 as usize).get(), + unsafe { ConnectionBorrow::lift(arg0 as u32 as usize) }.get(), _rt::string_lift(bytes0), result20, ); - let ptr22 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr22 = (&raw mut _RET_AREA.0).cast::(); match result21 { Ok(_) => { *ptr22.add(0).cast::() = (0i32) as u8; @@ -13453,49 +15024,79 @@ pub mod exports { use super::super::super::super::exports::fermyon::spin::rdbms_types::Error as V28; match e { V28::ConnectionFailed(e) => { - *ptr22.add(4).cast::() = (0i32) as u8; + *ptr22 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; let vec23 = (e.into_bytes()).into_boxed_slice(); let ptr23 = vec23.as_ptr().cast::(); let len23 = vec23.len(); ::core::mem::forget(vec23); - *ptr22.add(12).cast::() = len23; - *ptr22.add(8).cast::<*mut u8>() = ptr23.cast_mut(); + *ptr22 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len23; + *ptr22 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr23.cast_mut(); } V28::BadParameter(e) => { - *ptr22.add(4).cast::() = (1i32) as u8; + *ptr22 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; let vec24 = (e.into_bytes()).into_boxed_slice(); let ptr24 = vec24.as_ptr().cast::(); let len24 = vec24.len(); ::core::mem::forget(vec24); - *ptr22.add(12).cast::() = len24; - *ptr22.add(8).cast::<*mut u8>() = ptr24.cast_mut(); + *ptr22 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len24; + *ptr22 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr24.cast_mut(); } V28::QueryFailed(e) => { - *ptr22.add(4).cast::() = (2i32) as u8; + *ptr22 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (2i32) as u8; let vec25 = (e.into_bytes()).into_boxed_slice(); let ptr25 = vec25.as_ptr().cast::(); let len25 = vec25.len(); ::core::mem::forget(vec25); - *ptr22.add(12).cast::() = len25; - *ptr22.add(8).cast::<*mut u8>() = ptr25.cast_mut(); + *ptr22 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len25; + *ptr22 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr25.cast_mut(); } V28::ValueConversionFailed(e) => { - *ptr22.add(4).cast::() = (3i32) as u8; + *ptr22 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (3i32) as u8; let vec26 = (e.into_bytes()).into_boxed_slice(); let ptr26 = vec26.as_ptr().cast::(); let len26 = vec26.len(); ::core::mem::forget(vec26); - *ptr22.add(12).cast::() = len26; - *ptr22.add(8).cast::<*mut u8>() = ptr26.cast_mut(); + *ptr22 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len26; + *ptr22 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr26.cast_mut(); } V28::Other(e) => { - *ptr22.add(4).cast::() = (4i32) as u8; + *ptr22 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (4i32) as u8; let vec27 = (e.into_bytes()).into_boxed_slice(); let ptr27 = vec27.as_ptr().cast::(); let len27 = vec27.len(); ::core::mem::forget(vec27); - *ptr22.add(12).cast::() = len27; - *ptr22.add(8).cast::<*mut u8>() = ptr27.cast_mut(); + *ptr22 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len27; + *ptr22 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr27.cast_mut(); } } } @@ -13504,38 +15105,60 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn __post_return_method_connection_execute( - arg0: *mut u8, - ) { + pub unsafe fn __post_return_method_connection_execute< + T: GuestConnection, + >(arg0: *mut u8) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { - 0 => (), + 0 => {} _ => { - let l1 = i32::from(*arg0.add(4).cast::()); + let l1 = i32::from( + *arg0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); match l1 { 0 => { - let l2 = *arg0.add(8).cast::<*mut u8>(); - let l3 = *arg0.add(12).cast::(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l3 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l2, l3, 1); } 1 => { - let l4 = *arg0.add(8).cast::<*mut u8>(); - let l5 = *arg0.add(12).cast::(); + let l4 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l5 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l4, l5, 1); } 2 => { - let l6 = *arg0.add(8).cast::<*mut u8>(); - let l7 = *arg0.add(12).cast::(); + let l6 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l7 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l6, l7, 1); } 3 => { - let l8 = *arg0.add(8).cast::<*mut u8>(); - let l9 = *arg0.add(12).cast::(); + let l8 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l9 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l8, l9, 1); } _ => { - let l10 = *arg0.add(8).cast::<*mut u8>(); - let l11 = *arg0.add(12).cast::(); + let l10 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l11 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l10, l11, 1); } } @@ -13556,18 +15179,18 @@ pub mod exports { let _ = val; unreachable!(); } - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]fermyon:spin/mysql@2.0.0")] - extern "C" { + #[link( + wasm_import_module = "[export]fermyon:spin/mysql@2.0.0" + )] + unsafe extern "C" { #[link_name = "[resource-new]connection"] fn new(_: *mut u8) -> u32; } - new(val) + unsafe { new(val) } } } - #[doc(hidden)] fn _resource_rep(handle: u32) -> *mut u8 where @@ -13578,18 +15201,18 @@ pub mod exports { let _ = handle; unreachable!(); } - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]fermyon:spin/mysql@2.0.0")] - extern "C" { + #[link( + wasm_import_module = "[export]fermyon:spin/mysql@2.0.0" + )] + unsafe extern "C" { #[link_name = "[resource-rep]connection"] fn rep(_: u32) -> *mut u8; } unsafe { rep(handle) } } } - /// Open a connection to the MySQL instance at `address`. fn open(address: _rt::String) -> Result; /// query the database: select @@ -13606,73 +15229,80 @@ pub mod exports { ) -> Result<(), Error>; } #[doc(hidden)] - - macro_rules! __export_fermyon_spin_mysql_2_0_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "fermyon:spin/mysql@2.0.0#[static]connection.open"] - unsafe extern "C" fn export_static_connection_open(arg0: *mut u8,arg1: usize,) -> *mut u8 { - $($path_to_types)*::_export_static_connection_open_cabi::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0, arg1) - } - #[export_name = "cabi_post_fermyon:spin/mysql@2.0.0#[static]connection.open"] - unsafe extern "C" fn _post_return_static_connection_open(arg0: *mut u8,) { - $($path_to_types)*::__post_return_static_connection_open::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0) - } - #[export_name = "fermyon:spin/mysql@2.0.0#[method]connection.query"] - unsafe extern "C" fn export_method_connection_query(arg0: *mut u8,arg1: *mut u8,arg2: usize,arg3: *mut u8,arg4: usize,) -> *mut u8 { - $($path_to_types)*::_export_method_connection_query_cabi::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0, arg1, arg2, arg3, arg4) - } - #[export_name = "cabi_post_fermyon:spin/mysql@2.0.0#[method]connection.query"] - unsafe extern "C" fn _post_return_method_connection_query(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_connection_query::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0) - } - #[export_name = "fermyon:spin/mysql@2.0.0#[method]connection.execute"] - unsafe extern "C" fn export_method_connection_execute(arg0: *mut u8,arg1: *mut u8,arg2: usize,arg3: *mut u8,arg4: usize,) -> *mut u8 { - $($path_to_types)*::_export_method_connection_execute_cabi::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0, arg1, arg2, arg3, arg4) - } - #[export_name = "cabi_post_fermyon:spin/mysql@2.0.0#[method]connection.execute"] - unsafe extern "C" fn _post_return_method_connection_execute(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_connection_execute::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0) - } - - const _: () = { - #[doc(hidden)] - #[export_name = "fermyon:spin/mysql@2.0.0#[dtor]connection"] - #[allow(non_snake_case)] - unsafe extern "C" fn dtor(rep: *mut u8) { - $($path_to_types)*::Connection::dtor::< - <$ty as $($path_to_types)*::Guest>::Connection - >(rep) - } - }; - - };); -} + macro_rules! __export_fermyon_spin_mysql_2_0_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "fermyon:spin/mysql@2.0.0#[static]connection.open")] unsafe + extern "C" fn export_static_connection_open(arg0 : * mut u8, arg1 + : usize,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_static_connection_open_cabi::<<$ty as + $($path_to_types)*:: Guest >::Connection > (arg0, arg1) } } + #[unsafe (export_name = + "cabi_post_fermyon:spin/mysql@2.0.0#[static]connection.open")] + unsafe extern "C" fn _post_return_static_connection_open(arg0 : * + mut u8,) { unsafe { $($path_to_types)*:: + __post_return_static_connection_open::<<$ty as + $($path_to_types)*:: Guest >::Connection > (arg0) } } #[unsafe + (export_name = + "fermyon:spin/mysql@2.0.0#[method]connection.query")] unsafe + extern "C" fn export_method_connection_query(arg0 : * mut u8, + arg1 : * mut u8, arg2 : usize, arg3 : * mut u8, arg4 : usize,) -> + * mut u8 { unsafe { $($path_to_types)*:: + _export_method_connection_query_cabi::<<$ty as + $($path_to_types)*:: Guest >::Connection > (arg0, arg1, arg2, + arg3, arg4) } } #[unsafe (export_name = + "cabi_post_fermyon:spin/mysql@2.0.0#[method]connection.query")] + unsafe extern "C" fn _post_return_method_connection_query(arg0 : + * mut u8,) { unsafe { $($path_to_types)*:: + __post_return_method_connection_query::<<$ty as + $($path_to_types)*:: Guest >::Connection > (arg0) } } #[unsafe + (export_name = + "fermyon:spin/mysql@2.0.0#[method]connection.execute")] unsafe + extern "C" fn export_method_connection_execute(arg0 : * mut u8, + arg1 : * mut u8, arg2 : usize, arg3 : * mut u8, arg4 : usize,) -> + * mut u8 { unsafe { $($path_to_types)*:: + _export_method_connection_execute_cabi::<<$ty as + $($path_to_types)*:: Guest >::Connection > (arg0, arg1, arg2, + arg3, arg4) } } #[unsafe (export_name = + "cabi_post_fermyon:spin/mysql@2.0.0#[method]connection.execute")] + unsafe extern "C" fn _post_return_method_connection_execute(arg0 + : * mut u8,) { unsafe { $($path_to_types)*:: + __post_return_method_connection_execute::<<$ty as + $($path_to_types)*:: Guest >::Connection > (arg0) } } const _ : + () = { #[doc(hidden)] #[unsafe (export_name = + "fermyon:spin/mysql@2.0.0#[dtor]connection")] + #[allow(non_snake_case)] unsafe extern "C" fn dtor(rep : * mut + u8) { unsafe { $($path_to_types)*:: Connection::dtor::< <$ty as + $($path_to_types)*:: Guest >::Connection > (rep) } } }; }; + }; + } #[doc(hidden)] pub(crate) use __export_fermyon_spin_mysql_2_0_0_cabi; - #[repr(align(4))] - struct _RetArea([::core::mem::MaybeUninit; 20]); - static mut _RET_AREA: _RetArea = _RetArea([::core::mem::MaybeUninit::uninit(); 20]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct _RetArea( + [::core::mem::MaybeUninit< + u8, + >; 5 * ::core::mem::size_of::<*const u8>()], + ); + static mut _RET_AREA: _RetArea = _RetArea( + [::core::mem::MaybeUninit::uninit(); 5 + * ::core::mem::size_of::<*const u8>()], + ); } - - #[allow(dead_code, clippy::all)] + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod sqlite { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; /// A handle to an open sqlite instance - #[derive(Debug)] #[repr(transparent)] pub struct Connection { handle: _rt::Resource, } - type _ConnectionRep = Option; - impl Connection { /// Creates a new resource from the specified representation. /// @@ -13682,77 +15312,70 @@ pub mod exports { pub fn new(val: T) -> Self { Self::type_guard::(); let val: _ConnectionRep = Some(val); - let ptr: *mut _ConnectionRep = _rt::Box::into_raw(_rt::Box::new(val)); + let ptr: *mut _ConnectionRep = _rt::Box::into_raw( + _rt::Box::new(val), + ); unsafe { Self::from_handle(T::_resource_new(ptr.cast())) } } - /// Gets access to the underlying `T` which represents this resource. pub fn get(&self) -> &T { let ptr = unsafe { &*self.as_ptr::() }; ptr.as_ref().unwrap() } - /// Gets mutable access to the underlying `T` which represents this /// resource. pub fn get_mut(&mut self) -> &mut T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_mut().unwrap() } - /// Consumes this resource and returns the underlying `T`. pub fn into_inner(self) -> T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.take().unwrap() } - #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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) } - - // It's theoretically possible to implement the `GuestConnection` trait twice - // so guard against using it with two different types here. #[doc(hidden)] fn type_guard() { use core::any::TypeId; static mut LAST_TYPE: Option = None; unsafe { - assert!(!cfg!(target_feature = "threads")); + assert!(! cfg!(target_feature = "atomics")); let id = TypeId::of::(); match LAST_TYPE { - Some(ty) => assert!( - ty == id, - "cannot use two types with this resource type" - ), + Some(ty) => { + assert!( + ty == id, "cannot use two types with this resource type" + ) + } None => LAST_TYPE = Some(id), } } } - #[doc(hidden)] pub unsafe fn dtor(handle: *mut u8) { Self::type_guard::(); - let _ = _rt::Box::from_raw(handle as *mut _ConnectionRep); + let _ = unsafe { + _rt::Box::from_raw(handle as *mut _ConnectionRep) + }; } - fn as_ptr(&self) -> *mut _ConnectionRep { Connection::type_guard::(); T::_resource_rep(self.handle()).cast() } } - /// A borrowed version of [`Connection`] which represents a borrowed value /// with the lifetime `'a`. #[derive(Debug)] @@ -13761,7 +15384,6 @@ pub mod exports { rep: *mut u8, _marker: core::marker::PhantomData<&'a Connection>, } - impl<'a> ConnectionBorrow<'a> { #[doc(hidden)] pub unsafe fn lift(rep: usize) -> Self { @@ -13770,41 +15392,34 @@ pub mod exports { _marker: core::marker::PhantomData, } } - /// Gets access to the underlying `T` in this resource. pub fn get(&self) -> &T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_ref().unwrap() } - - // NB: mutable access is not allowed due to the component model allowing - // multiple borrows of the same resource. - fn as_ptr(&self) -> *mut _ConnectionRep { Connection::type_guard::(); self.rep.cast() } } - unsafe impl _rt::WasmResource for Connection { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]fermyon:spin/sqlite@2.0.0")] - extern "C" { + #[link( + wasm_import_module = "[export]fermyon:spin/sqlite@2.0.0" + )] + unsafe extern "C" { #[link_name = "[resource-drop]connection"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - /// The set of errors which may be raised by functions in this interface #[derive(Clone)] pub enum Error { @@ -13820,26 +15435,35 @@ pub mod exports { Io(_rt::String), } impl ::core::fmt::Debug for Error { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { Error::NoSuchDatabase => { f.debug_tuple("Error::NoSuchDatabase").finish() } - Error::AccessDenied => f.debug_tuple("Error::AccessDenied").finish(), + Error::AccessDenied => { + f.debug_tuple("Error::AccessDenied").finish() + } Error::InvalidConnection => { f.debug_tuple("Error::InvalidConnection").finish() } - Error::DatabaseFull => f.debug_tuple("Error::DatabaseFull").finish(), + Error::DatabaseFull => { + f.debug_tuple("Error::DatabaseFull").finish() + } Error::Io(e) => f.debug_tuple("Error::Io").field(e).finish(), } } } impl ::core::fmt::Display for Error { - 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 Error {} /// A single column's result from a database query #[derive(Clone)] @@ -13851,12 +15475,23 @@ pub mod exports { Null, } impl ::core::fmt::Debug for Value { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { - Value::Integer(e) => f.debug_tuple("Value::Integer").field(e).finish(), - Value::Real(e) => f.debug_tuple("Value::Real").field(e).finish(), - Value::Text(e) => f.debug_tuple("Value::Text").field(e).finish(), - Value::Blob(e) => f.debug_tuple("Value::Blob").field(e).finish(), + Value::Integer(e) => { + f.debug_tuple("Value::Integer").field(e).finish() + } + Value::Real(e) => { + f.debug_tuple("Value::Real").field(e).finish() + } + Value::Text(e) => { + f.debug_tuple("Value::Text").field(e).finish() + } + Value::Blob(e) => { + f.debug_tuple("Value::Blob").field(e).finish() + } Value::Null => f.debug_tuple("Value::Null").finish(), } } @@ -13867,7 +15502,10 @@ pub mod exports { pub values: _rt::Vec, } impl ::core::fmt::Debug for RowResult { - 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("RowResult") .field("values", &self.values) .finish() @@ -13882,7 +15520,10 @@ pub mod exports { pub rows: _rt::Vec, } impl ::core::fmt::Debug for QueryResult { - 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("QueryResult") .field("columns", &self.columns) .field("rows", &self.rows) @@ -13895,40 +15536,55 @@ pub mod exports { arg0: *mut u8, arg1: usize, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg1; let bytes0 = _rt::Vec::from_raw_parts(arg0.cast(), len0, len0); let result1 = T::open(_rt::string_lift(bytes0)); - let ptr2 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr2 = (&raw mut _RET_AREA.0).cast::(); match result1 { Ok(e) => { *ptr2.add(0).cast::() = (0i32) as u8; - *ptr2.add(4).cast::() = (e).take_handle() as i32; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (e).take_handle() as i32; } Err(e) => { *ptr2.add(0).cast::() = (1i32) as u8; match e { Error::NoSuchDatabase => { - *ptr2.add(4).cast::() = (0i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } Error::AccessDenied => { - *ptr2.add(4).cast::() = (1i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; } Error::InvalidConnection => { - *ptr2.add(4).cast::() = (2i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (2i32) as u8; } Error::DatabaseFull => { - *ptr2.add(4).cast::() = (3i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (3i32) as u8; } Error::Io(e) => { - *ptr2.add(4).cast::() = (4i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (4i32) as u8; let vec3 = (e.into_bytes()).into_boxed_slice(); let ptr3 = vec3.as_ptr().cast::(); let len3 = vec3.len(); ::core::mem::forget(vec3); - *ptr2.add(12).cast::() = len3; - *ptr2.add(8).cast::<*mut u8>() = ptr3.cast_mut(); + *ptr2 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len3; + *ptr2 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr3.cast_mut(); } } } @@ -13942,17 +15598,23 @@ pub mod exports { ) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { - 0 => (), + 0 => {} _ => { - let l1 = i32::from(*arg0.add(4).cast::()); + let l1 = i32::from( + *arg0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); match l1 { - 0 => (), - 1 => (), - 2 => (), - 3 => (), + 0 => {} + 1 => {} + 2 => {} + 3 => {} _ => { - let l2 = *arg0.add(8).cast::<*mut u8>(); - let l3 = *arg0.add(12).cast::(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l3 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l2, l3, 1); } } @@ -13968,22 +15630,21 @@ pub mod exports { arg3: *mut u8, arg4: usize, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg2; let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0); let base11 = arg3; let len11 = arg4; let mut result11 = _rt::Vec::with_capacity(len11); for i in 0..len11 { - let base = base11.add(i * 16); + let base = base11 + .add(i * (8 + 2 * ::core::mem::size_of::<*const u8>())); let e11 = { let l1 = i32::from(*base.add(0).cast::()); let v10 = match l1 { 0 => { let e10 = { let l2 = *base.add(8).cast::(); - l2 }; Value::Integer(e10) @@ -13991,7 +15652,6 @@ pub mod exports { 1 => { let e10 = { let l3 = *base.add(8).cast::(); - l3 }; Value::Real(e10) @@ -13999,11 +15659,15 @@ pub mod exports { 2 => { let e10 = { let l4 = *base.add(8).cast::<*mut u8>(); - let l5 = *base.add(12).cast::(); + let l5 = *base + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(); let len6 = l5; - let bytes6 = - _rt::Vec::from_raw_parts(l4.cast(), len6, len6); - + let bytes6 = _rt::Vec::from_raw_parts( + l4.cast(), + len6, + len6, + ); _rt::string_lift(bytes6) }; Value::Text(e10) @@ -14011,9 +15675,10 @@ pub mod exports { 3 => { let e10 = { let l7 = *base.add(8).cast::<*mut u8>(); - let l8 = *base.add(12).cast::(); + let l8 = *base + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(); let len9 = l8; - _rt::Vec::from_raw_parts(l7.cast(), len9, len9) }; Value::Blob(e10) @@ -14023,29 +15688,31 @@ pub mod exports { Value::Null } }; - v10 }; result11.push(e11); } - _rt::cabi_dealloc(base11, len11 * 16, 8); + _rt::cabi_dealloc( + base11, + len11 * (8 + 2 * ::core::mem::size_of::<*const u8>()), + 8, + ); let result12 = T::execute( - ConnectionBorrow::lift(arg0 as u32 as usize).get(), + unsafe { ConnectionBorrow::lift(arg0 as u32 as usize) }.get(), _rt::string_lift(bytes0), result11, ); - let ptr13 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr13 = (&raw mut _RET_AREA.0).cast::(); match result12 { Ok(e) => { *ptr13.add(0).cast::() = (0i32) as u8; - let QueryResult { - columns: columns14, - rows: rows14, - } = e; + let QueryResult { columns: columns14, rows: rows14 } = e; let vec16 = columns14; let len16 = vec16.len(); - let layout16 = - _rt::alloc::Layout::from_size_align_unchecked(vec16.len() * 8, 4); + let layout16 = _rt::alloc::Layout::from_size_align_unchecked( + vec16.len() * (2 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); let result16 = if layout16.size() != 0 { let ptr = _rt::alloc::alloc(layout16).cast::(); if ptr.is_null() { @@ -14053,46 +15720,52 @@ pub mod exports { } ptr } else { - { - ::core::ptr::null_mut() - } + ::core::ptr::null_mut() }; for (i, e) in vec16.into_iter().enumerate() { - let base = result16.add(i * 8); + let base = result16 + .add(i * (2 * ::core::mem::size_of::<*const u8>())); { let vec15 = (e.into_bytes()).into_boxed_slice(); let ptr15 = vec15.as_ptr().cast::(); let len15 = vec15.len(); ::core::mem::forget(vec15); - *base.add(4).cast::() = len15; + *base + .add(::core::mem::size_of::<*const u8>()) + .cast::() = len15; *base.add(0).cast::<*mut u8>() = ptr15.cast_mut(); } } - *ptr13.add(8).cast::() = len16; - *ptr13.add(4).cast::<*mut u8>() = result16; + *ptr13 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len16; + *ptr13 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = result16; let vec21 = rows14; let len21 = vec21.len(); - let layout21 = - _rt::alloc::Layout::from_size_align_unchecked(vec21.len() * 8, 4); + let layout21 = _rt::alloc::Layout::from_size_align_unchecked( + vec21.len() * (2 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); let result21 = if layout21.size() != 0 { let ptr = _rt::alloc::alloc(layout21).cast::(); if ptr.is_null() { _rt::alloc::handle_alloc_error(layout21); } ptr - } else { - { - ::core::ptr::null_mut() - } + } else { + ::core::ptr::null_mut() }; for (i, e) in vec21.into_iter().enumerate() { - let base = result21.add(i * 8); + let base = result21 + .add(i * (2 * ::core::mem::size_of::<*const u8>())); { let RowResult { values: values17 } = e; let vec20 = values17; let len20 = vec20.len(); let layout20 = _rt::alloc::Layout::from_size_align_unchecked( - vec20.len() * 16, + vec20.len() * (8 + 2 * ::core::mem::size_of::<*const u8>()), 8, ); let result20 = if layout20.size() != 0 { @@ -14102,12 +15775,11 @@ pub mod exports { } ptr } else { - { - ::core::ptr::null_mut() - } + ::core::ptr::null_mut() }; for (i, e) in vec20.into_iter().enumerate() { - let base = result20.add(i * 16); + let base = result20 + .add(i * (8 + 2 * ::core::mem::size_of::<*const u8>())); { match e { Value::Integer(e) => { @@ -14124,9 +15796,10 @@ pub mod exports { let ptr18 = vec18.as_ptr().cast::(); let len18 = vec18.len(); ::core::mem::forget(vec18); - *base.add(12).cast::() = len18; - *base.add(8).cast::<*mut u8>() = - ptr18.cast_mut(); + *base + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::() = len18; + *base.add(8).cast::<*mut u8>() = ptr18.cast_mut(); } Value::Blob(e) => { *base.add(0).cast::() = (3i32) as u8; @@ -14134,9 +15807,10 @@ pub mod exports { let ptr19 = vec19.as_ptr().cast::(); let len19 = vec19.len(); ::core::mem::forget(vec19); - *base.add(12).cast::() = len19; - *base.add(8).cast::<*mut u8>() = - ptr19.cast_mut(); + *base + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::() = len19; + *base.add(8).cast::<*mut u8>() = ptr19.cast_mut(); } Value::Null => { *base.add(0).cast::() = (4i32) as u8; @@ -14144,36 +15818,56 @@ pub mod exports { } } } - *base.add(4).cast::() = len20; + *base + .add(::core::mem::size_of::<*const u8>()) + .cast::() = len20; *base.add(0).cast::<*mut u8>() = result20; } } - *ptr13.add(16).cast::() = len21; - *ptr13.add(12).cast::<*mut u8>() = result21; + *ptr13 + .add(4 * ::core::mem::size_of::<*const u8>()) + .cast::() = len21; + *ptr13 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = result21; } Err(e) => { *ptr13.add(0).cast::() = (1i32) as u8; match e { Error::NoSuchDatabase => { - *ptr13.add(4).cast::() = (0i32) as u8; + *ptr13 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } Error::AccessDenied => { - *ptr13.add(4).cast::() = (1i32) as u8; + *ptr13 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; } Error::InvalidConnection => { - *ptr13.add(4).cast::() = (2i32) as u8; + *ptr13 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (2i32) as u8; } Error::DatabaseFull => { - *ptr13.add(4).cast::() = (3i32) as u8; + *ptr13 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (3i32) as u8; } Error::Io(e) => { - *ptr13.add(4).cast::() = (4i32) as u8; + *ptr13 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (4i32) as u8; let vec22 = (e.into_bytes()).into_boxed_slice(); let ptr22 = vec22.as_ptr().cast::(); let len22 = vec22.len(); ::core::mem::forget(vec22); - *ptr13.add(12).cast::() = len22; - *ptr13.add(8).cast::<*mut u8>() = ptr22.cast_mut(); + *ptr13 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len22; + *ptr13 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr22.cast_mut(); } } } @@ -14182,74 +15876,111 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn __post_return_method_connection_execute( - arg0: *mut u8, - ) { + pub unsafe fn __post_return_method_connection_execute< + T: GuestConnection, + >(arg0: *mut u8) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { 0 => { - let l3 = *arg0.add(4).cast::<*mut u8>(); - let l4 = *arg0.add(8).cast::(); - let base5 = l3; - let len5 = l4; + let l1 = *arg0 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let base5 = l1; + let len5 = l2; for i in 0..len5 { - let base = base5.add(i * 8); + let base = base5 + .add(i * (2 * ::core::mem::size_of::<*const u8>())); { - let l1 = *base.add(0).cast::<*mut u8>(); - let l2 = *base.add(4).cast::(); - _rt::cabi_dealloc(l1, l2, 1); + let l3 = *base.add(0).cast::<*mut u8>(); + let l4 = *base + .add(::core::mem::size_of::<*const u8>()) + .cast::(); + _rt::cabi_dealloc(l3, l4, 1); } } - _rt::cabi_dealloc(base5, len5 * 8, 4); - let l15 = *arg0.add(12).cast::<*mut u8>(); - let l16 = *arg0.add(16).cast::(); - let base17 = l15; - let len17 = l16; + _rt::cabi_dealloc( + base5, + len5 * (2 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); + let l6 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l7 = *arg0 + .add(4 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let base17 = l6; + let len17 = l7; for i in 0..len17 { - let base = base17.add(i * 8); + let base = base17 + .add(i * (2 * ::core::mem::size_of::<*const u8>())); { - let l12 = *base.add(0).cast::<*mut u8>(); - let l13 = *base.add(4).cast::(); - let base14 = l12; - let len14 = l13; - for i in 0..len14 { - let base = base14.add(i * 16); + let l8 = *base.add(0).cast::<*mut u8>(); + let l9 = *base + .add(::core::mem::size_of::<*const u8>()) + .cast::(); + let base16 = l8; + let len16 = l9; + for i in 0..len16 { + let base = base16 + .add(i * (8 + 2 * ::core::mem::size_of::<*const u8>())); { - let l6 = i32::from(*base.add(0).cast::()); - match l6 { - 0 => (), - 1 => (), + let l10 = i32::from(*base.add(0).cast::()); + match l10 { + 0 => {} + 1 => {} 2 => { - let l7 = *base.add(8).cast::<*mut u8>(); - let l8 = *base.add(12).cast::(); - _rt::cabi_dealloc(l7, l8, 1); + let l11 = *base.add(8).cast::<*mut u8>(); + let l12 = *base + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(); + _rt::cabi_dealloc(l11, l12, 1); } 3 => { - let l9 = *base.add(8).cast::<*mut u8>(); - let l10 = *base.add(12).cast::(); - let base11 = l9; - let len11 = l10; - _rt::cabi_dealloc(base11, len11 * 1, 1); + let l13 = *base.add(8).cast::<*mut u8>(); + let l14 = *base + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let base15 = l13; + let len15 = l14; + _rt::cabi_dealloc(base15, len15 * 1, 1); } - _ => (), + _ => {} } } } - _rt::cabi_dealloc(base14, len14 * 16, 8); + _rt::cabi_dealloc( + base16, + len16 * (8 + 2 * ::core::mem::size_of::<*const u8>()), + 8, + ); } } - _rt::cabi_dealloc(base17, len17 * 8, 4); + _rt::cabi_dealloc( + base17, + len17 * (2 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); } _ => { - let l18 = i32::from(*arg0.add(4).cast::()); + let l18 = i32::from( + *arg0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); match l18 { - 0 => (), - 1 => (), - 2 => (), - 3 => (), + 0 => {} + 1 => {} + 2 => {} + 3 => {} _ => { - let l19 = *arg0.add(8).cast::<*mut u8>(); - let l20 = *arg0.add(12).cast::(); + let l19 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l20 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l19, l20, 1); } } @@ -14270,18 +16001,18 @@ pub mod exports { let _ = val; unreachable!(); } - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]fermyon:spin/sqlite@2.0.0")] - extern "C" { + #[link( + wasm_import_module = "[export]fermyon:spin/sqlite@2.0.0" + )] + unsafe extern "C" { #[link_name = "[resource-new]connection"] fn new(_: *mut u8) -> u32; } - new(val) + unsafe { new(val) } } } - #[doc(hidden)] fn _resource_rep(handle: u32) -> *mut u8 where @@ -14292,18 +16023,18 @@ pub mod exports { let _ = handle; unreachable!(); } - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]fermyon:spin/sqlite@2.0.0")] - extern "C" { + #[link( + wasm_import_module = "[export]fermyon:spin/sqlite@2.0.0" + )] + unsafe extern "C" { #[link_name = "[resource-rep]connection"] fn rep(_: u32) -> *mut u8; } unsafe { rep(handle) } } } - /// Open a connection to a named database instance. /// /// If `database` is "default", the default instance is opened. @@ -14318,54 +16049,59 @@ pub mod exports { ) -> Result; } #[doc(hidden)] - - macro_rules! __export_fermyon_spin_sqlite_2_0_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "fermyon:spin/sqlite@2.0.0#[static]connection.open"] - unsafe extern "C" fn export_static_connection_open(arg0: *mut u8,arg1: usize,) -> *mut u8 { - $($path_to_types)*::_export_static_connection_open_cabi::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0, arg1) - } - #[export_name = "cabi_post_fermyon:spin/sqlite@2.0.0#[static]connection.open"] - unsafe extern "C" fn _post_return_static_connection_open(arg0: *mut u8,) { - $($path_to_types)*::__post_return_static_connection_open::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0) - } - #[export_name = "fermyon:spin/sqlite@2.0.0#[method]connection.execute"] - unsafe extern "C" fn export_method_connection_execute(arg0: *mut u8,arg1: *mut u8,arg2: usize,arg3: *mut u8,arg4: usize,) -> *mut u8 { - $($path_to_types)*::_export_method_connection_execute_cabi::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0, arg1, arg2, arg3, arg4) - } - #[export_name = "cabi_post_fermyon:spin/sqlite@2.0.0#[method]connection.execute"] - unsafe extern "C" fn _post_return_method_connection_execute(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_connection_execute::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0) - } - - const _: () = { - #[doc(hidden)] - #[export_name = "fermyon:spin/sqlite@2.0.0#[dtor]connection"] - #[allow(non_snake_case)] - unsafe extern "C" fn dtor(rep: *mut u8) { - $($path_to_types)*::Connection::dtor::< - <$ty as $($path_to_types)*::Guest>::Connection - >(rep) - } - }; - - };); -} + macro_rules! __export_fermyon_spin_sqlite_2_0_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "fermyon:spin/sqlite@2.0.0#[static]connection.open")] unsafe + extern "C" fn export_static_connection_open(arg0 : * mut u8, arg1 + : usize,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_static_connection_open_cabi::<<$ty as + $($path_to_types)*:: Guest >::Connection > (arg0, arg1) } } + #[unsafe (export_name = + "cabi_post_fermyon:spin/sqlite@2.0.0#[static]connection.open")] + unsafe extern "C" fn _post_return_static_connection_open(arg0 : * + mut u8,) { unsafe { $($path_to_types)*:: + __post_return_static_connection_open::<<$ty as + $($path_to_types)*:: Guest >::Connection > (arg0) } } #[unsafe + (export_name = + "fermyon:spin/sqlite@2.0.0#[method]connection.execute")] unsafe + extern "C" fn export_method_connection_execute(arg0 : * mut u8, + arg1 : * mut u8, arg2 : usize, arg3 : * mut u8, arg4 : usize,) -> + * mut u8 { unsafe { $($path_to_types)*:: + _export_method_connection_execute_cabi::<<$ty as + $($path_to_types)*:: Guest >::Connection > (arg0, arg1, arg2, + arg3, arg4) } } #[unsafe (export_name = + "cabi_post_fermyon:spin/sqlite@2.0.0#[method]connection.execute")] + unsafe extern "C" fn _post_return_method_connection_execute(arg0 + : * mut u8,) { unsafe { $($path_to_types)*:: + __post_return_method_connection_execute::<<$ty as + $($path_to_types)*:: Guest >::Connection > (arg0) } } const _ : + () = { #[doc(hidden)] #[unsafe (export_name = + "fermyon:spin/sqlite@2.0.0#[dtor]connection")] + #[allow(non_snake_case)] unsafe extern "C" fn dtor(rep : * mut + u8) { unsafe { $($path_to_types)*:: Connection::dtor::< <$ty as + $($path_to_types)*:: Guest >::Connection > (rep) } } }; }; + }; + } #[doc(hidden)] pub(crate) use __export_fermyon_spin_sqlite_2_0_0_cabi; - #[repr(align(4))] - struct _RetArea([::core::mem::MaybeUninit; 20]); - static mut _RET_AREA: _RetArea = _RetArea([::core::mem::MaybeUninit::uninit(); 20]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct _RetArea( + [::core::mem::MaybeUninit< + u8, + >; 5 * ::core::mem::size_of::<*const u8>()], + ); + static mut _RET_AREA: _RetArea = _RetArea( + [::core::mem::MaybeUninit::uninit(); 5 + * ::core::mem::size_of::<*const u8>()], + ); } - - #[allow(dead_code, clippy::all)] + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod variables { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; /// The set of errors which may be raised by functions in this interface. #[derive(Clone)] @@ -14380,7 +16116,10 @@ pub mod exports { Other(_rt::String), } impl ::core::fmt::Debug for Error { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { Error::InvalidName(e) => { f.debug_tuple("Error::InvalidName").field(e).finish() @@ -14391,26 +16130,32 @@ pub mod exports { Error::Provider(e) => { f.debug_tuple("Error::Provider").field(e).finish() } - Error::Other(e) => f.debug_tuple("Error::Other").field(e).finish(), + Error::Other(e) => { + f.debug_tuple("Error::Other").field(e).finish() + } } } } impl ::core::fmt::Display for Error { - 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 Error {} #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_get_cabi(arg0: *mut u8, arg1: usize) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + pub unsafe fn _export_get_cabi( + arg0: *mut u8, + arg1: usize, + ) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg1; let bytes0 = _rt::Vec::from_raw_parts(arg0.cast(), len0, len0); let result1 = T::get(_rt::string_lift(bytes0)); - let ptr2 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr2 = (&raw mut _RET_AREA.0).cast::(); match result1 { Ok(e) => { *ptr2.add(0).cast::() = (0i32) as u8; @@ -14418,47 +16163,75 @@ pub mod exports { let ptr3 = vec3.as_ptr().cast::(); let len3 = vec3.len(); ::core::mem::forget(vec3); - *ptr2.add(8).cast::() = len3; - *ptr2.add(4).cast::<*mut u8>() = ptr3.cast_mut(); + *ptr2 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len3; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr3.cast_mut(); } Err(e) => { *ptr2.add(0).cast::() = (1i32) as u8; match e { Error::InvalidName(e) => { - *ptr2.add(4).cast::() = (0i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; let vec4 = (e.into_bytes()).into_boxed_slice(); let ptr4 = vec4.as_ptr().cast::(); let len4 = vec4.len(); ::core::mem::forget(vec4); - *ptr2.add(12).cast::() = len4; - *ptr2.add(8).cast::<*mut u8>() = ptr4.cast_mut(); + *ptr2 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len4; + *ptr2 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr4.cast_mut(); } Error::Undefined(e) => { - *ptr2.add(4).cast::() = (1i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; let vec5 = (e.into_bytes()).into_boxed_slice(); let ptr5 = vec5.as_ptr().cast::(); let len5 = vec5.len(); ::core::mem::forget(vec5); - *ptr2.add(12).cast::() = len5; - *ptr2.add(8).cast::<*mut u8>() = ptr5.cast_mut(); + *ptr2 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len5; + *ptr2 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr5.cast_mut(); } Error::Provider(e) => { - *ptr2.add(4).cast::() = (2i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (2i32) as u8; let vec6 = (e.into_bytes()).into_boxed_slice(); let ptr6 = vec6.as_ptr().cast::(); let len6 = vec6.len(); ::core::mem::forget(vec6); - *ptr2.add(12).cast::() = len6; - *ptr2.add(8).cast::<*mut u8>() = ptr6.cast_mut(); + *ptr2 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len6; + *ptr2 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr6.cast_mut(); } Error::Other(e) => { - *ptr2.add(4).cast::() = (3i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (3i32) as u8; let vec7 = (e.into_bytes()).into_boxed_slice(); let ptr7 = vec7.as_ptr().cast::(); let len7 = vec7.len(); ::core::mem::forget(vec7); - *ptr2.add(12).cast::() = len7; - *ptr2.add(8).cast::<*mut u8>() = ptr7.cast_mut(); + *ptr2 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len7; + *ptr2 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr7.cast_mut(); } } } @@ -14471,31 +16244,53 @@ pub mod exports { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { 0 => { - let l1 = *arg0.add(4).cast::<*mut u8>(); - let l2 = *arg0.add(8).cast::(); + let l1 = *arg0 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l1, l2, 1); } _ => { - let l3 = i32::from(*arg0.add(4).cast::()); + let l3 = i32::from( + *arg0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); match l3 { 0 => { - let l4 = *arg0.add(8).cast::<*mut u8>(); - let l5 = *arg0.add(12).cast::(); + let l4 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l5 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l4, l5, 1); } 1 => { - let l6 = *arg0.add(8).cast::<*mut u8>(); - let l7 = *arg0.add(12).cast::(); + let l6 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l7 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l6, l7, 1); } 2 => { - let l8 = *arg0.add(8).cast::<*mut u8>(); - let l9 = *arg0.add(12).cast::(); + let l8 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l9 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l8, l9, 1); } _ => { - let l10 = *arg0.add(8).cast::<*mut u8>(); - let l11 = *arg0.add(12).cast::(); + let l10 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l11 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l10, l11, 1); } } @@ -14509,47 +16304,48 @@ pub mod exports { fn get(name: _rt::String) -> Result<_rt::String, Error>; } #[doc(hidden)] - - macro_rules! __export_fermyon_spin_variables_2_0_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "fermyon:spin/variables@2.0.0#get"] - unsafe extern "C" fn export_get(arg0: *mut u8,arg1: usize,) -> *mut u8 { - $($path_to_types)*::_export_get_cabi::<$ty>(arg0, arg1) - } - #[export_name = "cabi_post_fermyon:spin/variables@2.0.0#get"] - unsafe extern "C" fn _post_return_get(arg0: *mut u8,) { - $($path_to_types)*::__post_return_get::<$ty>(arg0) - } - };); -} + macro_rules! __export_fermyon_spin_variables_2_0_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "fermyon:spin/variables@2.0.0#get")] unsafe extern "C" fn + export_get(arg0 : * mut u8, arg1 : usize,) -> * mut u8 { unsafe { + $($path_to_types)*:: _export_get_cabi::<$ty > (arg0, arg1) } } + #[unsafe (export_name = + "cabi_post_fermyon:spin/variables@2.0.0#get")] unsafe extern "C" + fn _post_return_get(arg0 : * mut u8,) { unsafe { + $($path_to_types)*:: __post_return_get::<$ty > (arg0) } } }; + }; + } #[doc(hidden)] pub(crate) use __export_fermyon_spin_variables_2_0_0_cabi; - #[repr(align(4))] - struct _RetArea([::core::mem::MaybeUninit; 16]); - static mut _RET_AREA: _RetArea = _RetArea([::core::mem::MaybeUninit::uninit(); 16]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct _RetArea( + [::core::mem::MaybeUninit< + u8, + >; 4 * ::core::mem::size_of::<*const u8>()], + ); + static mut _RET_AREA: _RetArea = _RetArea( + [::core::mem::MaybeUninit::uninit(); 4 + * ::core::mem::size_of::<*const u8>()], + ); } } - #[allow(dead_code)] pub mod spin_test_virt { - #[allow(dead_code, clippy::all)] + /// Interface for introspecting the `fermyon:spin/key-value` interface + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod key_value { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; /// An open key-value store - #[derive(Debug)] #[repr(transparent)] pub struct Store { handle: _rt::Resource, } - type _StoreRep = Option; - impl Store { /// Creates a new resource from the specified representation. /// @@ -14559,77 +16355,70 @@ pub mod exports { pub fn new(val: T) -> Self { Self::type_guard::(); let val: _StoreRep = Some(val); - let ptr: *mut _StoreRep = _rt::Box::into_raw(_rt::Box::new(val)); + let ptr: *mut _StoreRep = _rt::Box::into_raw( + _rt::Box::new(val), + ); unsafe { Self::from_handle(T::_resource_new(ptr.cast())) } } - /// Gets access to the underlying `T` which represents this resource. pub fn get(&self) -> &T { let ptr = unsafe { &*self.as_ptr::() }; ptr.as_ref().unwrap() } - /// Gets mutable access to the underlying `T` which represents this /// resource. pub fn get_mut(&mut self) -> &mut T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_mut().unwrap() } - /// Consumes this resource and returns the underlying `T`. pub fn into_inner(self) -> T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.take().unwrap() } - #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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) } - - // It's theoretically possible to implement the `GuestStore` trait twice - // so guard against using it with two different types here. #[doc(hidden)] fn type_guard() { use core::any::TypeId; static mut LAST_TYPE: Option = None; unsafe { - assert!(!cfg!(target_feature = "threads")); + assert!(! cfg!(target_feature = "atomics")); let id = TypeId::of::(); match LAST_TYPE { - Some(ty) => assert!( - ty == id, - "cannot use two types with this resource type" - ), + Some(ty) => { + assert!( + ty == id, "cannot use two types with this resource type" + ) + } None => LAST_TYPE = Some(id), } } } - #[doc(hidden)] pub unsafe fn dtor(handle: *mut u8) { Self::type_guard::(); - let _ = _rt::Box::from_raw(handle as *mut _StoreRep); + let _ = unsafe { + _rt::Box::from_raw(handle as *mut _StoreRep) + }; } - fn as_ptr(&self) -> *mut _StoreRep { Store::type_guard::(); T::_resource_rep(self.handle()).cast() } } - /// A borrowed version of [`Store`] which represents a borrowed value /// with the lifetime `'a`. #[derive(Debug)] @@ -14638,7 +16427,6 @@ pub mod exports { rep: *mut u8, _marker: core::marker::PhantomData<&'a Store>, } - impl<'a> StoreBorrow<'a> { #[doc(hidden)] pub unsafe fn lift(rep: usize) -> Self { @@ -14647,41 +16435,34 @@ pub mod exports { _marker: core::marker::PhantomData, } } - /// Gets access to the underlying `T` in this resource. pub fn get(&self) -> &T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_ref().unwrap() } - - // NB: mutable access is not allowed due to the component model allowing - // multiple borrows of the same resource. - fn as_ptr(&self) -> *mut _StoreRep { Store::type_guard::(); self.rep.cast() } } - unsafe impl _rt::WasmResource for Store { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]fermyon:spin-test-virt/key-value")] - extern "C" { + #[link( + wasm_import_module = "[export]fermyon:spin-test-virt/key-value" + )] + unsafe extern "C" { #[link_name = "[resource-drop]store"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - /// A call to the key-value interface #[derive(Clone)] pub enum Call { @@ -14692,12 +16473,19 @@ pub mod exports { GetKeys, } impl ::core::fmt::Debug for Call { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { Call::Get(e) => f.debug_tuple("Call::Get").field(e).finish(), Call::Set(e) => f.debug_tuple("Call::Set").field(e).finish(), - Call::Delete(e) => f.debug_tuple("Call::Delete").field(e).finish(), - Call::Exists(e) => f.debug_tuple("Call::Exists").field(e).finish(), + Call::Delete(e) => { + f.debug_tuple("Call::Delete").field(e).finish() + } + Call::Exists(e) => { + f.debug_tuple("Call::Exists").field(e).finish() + } Call::GetKeys => f.debug_tuple("Call::GetKeys").finish(), } } @@ -14708,8 +16496,7 @@ pub mod exports { arg0: *mut u8, arg1: usize, ) -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg1; let bytes0 = _rt::Vec::from_raw_parts(arg0.cast(), len0, len0); let result1 = T::open(_rt::string_lift(bytes0)); @@ -14720,23 +16507,28 @@ pub mod exports { pub unsafe fn _export_method_store_label_cabi( arg0: *mut u8, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = T::label(StoreBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::label( + unsafe { StoreBorrow::lift(arg0 as u32 as usize) }.get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); let vec2 = (result0.into_bytes()).into_boxed_slice(); let ptr2 = vec2.as_ptr().cast::(); let len2 = vec2.len(); ::core::mem::forget(vec2); - *ptr1.add(4).cast::() = len2; + *ptr1.add(::core::mem::size_of::<*const u8>()).cast::() = len2; *ptr1.add(0).cast::<*mut u8>() = ptr2.cast_mut(); ptr1 } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn __post_return_method_store_label(arg0: *mut u8) { + pub unsafe fn __post_return_method_store_label( + arg0: *mut u8, + ) { let l0 = *arg0.add(0).cast::<*mut u8>(); - let l1 = *arg0.add(4).cast::(); + let l1 = *arg0 + .add(::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l0, l1, 1); } #[doc(hidden)] @@ -14746,15 +16538,14 @@ pub mod exports { arg1: *mut u8, arg2: usize, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg2; let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0); let result1 = T::get( - StoreBorrow::lift(arg0 as u32 as usize).get(), + unsafe { StoreBorrow::lift(arg0 as u32 as usize) }.get(), _rt::string_lift(bytes0), ); - let ptr2 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr2 = (&raw mut _RET_AREA.0).cast::(); match result1 { Some(e) => { *ptr2.add(0).cast::() = (1i32) as u8; @@ -14762,8 +16553,12 @@ pub mod exports { let ptr3 = vec3.as_ptr().cast::(); let len3 = vec3.len(); ::core::mem::forget(vec3); - *ptr2.add(8).cast::() = len3; - *ptr2.add(4).cast::<*mut u8>() = ptr3.cast_mut(); + *ptr2 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len3; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr3.cast_mut(); } None => { *ptr2.add(0).cast::() = (0i32) as u8; @@ -14773,13 +16568,19 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn __post_return_method_store_get(arg0: *mut u8) { + pub unsafe fn __post_return_method_store_get( + arg0: *mut u8, + ) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { - 0 => (), + 0 => {} _ => { - let l1 = *arg0.add(4).cast::<*mut u8>(); - let l2 = *arg0.add(8).cast::(); + let l1 = *arg0 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); let base3 = l1; let len3 = l2; _rt::cabi_dealloc(base3, len3 * 1, 1); @@ -14795,13 +16596,12 @@ pub mod exports { arg3: *mut u8, arg4: usize, ) { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg2; let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0); let len1 = arg4; T::set( - StoreBorrow::lift(arg0 as u32 as usize).get(), + unsafe { StoreBorrow::lift(arg0 as u32 as usize) }.get(), _rt::string_lift(bytes0), _rt::Vec::from_raw_parts(arg3.cast(), len1, len1), ); @@ -14813,26 +16613,26 @@ pub mod exports { arg1: *mut u8, arg2: usize, ) { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg2; let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0); T::delete( - StoreBorrow::lift(arg0 as u32 as usize).get(), + unsafe { StoreBorrow::lift(arg0 as u32 as usize) }.get(), _rt::string_lift(bytes0), ); } #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_calls_cabi() -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::calls(); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); let vec11 = result0; let len11 = vec11.len(); - let layout11 = - _rt::alloc::Layout::from_size_align_unchecked(vec11.len() * 16, 4); + let layout11 = _rt::alloc::Layout::from_size_align_unchecked( + vec11.len() * (4 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); let result11 = if layout11.size() != 0 { let ptr = _rt::alloc::alloc(layout11).cast::(); if ptr.is_null() { @@ -14840,24 +16640,27 @@ pub mod exports { } ptr } else { - { - ::core::ptr::null_mut() - } + ::core::ptr::null_mut() }; for (i, e) in vec11.into_iter().enumerate() { - let base = result11.add(i * 16); + let base = result11 + .add(i * (4 * ::core::mem::size_of::<*const u8>())); { let (t2_0, t2_1) = e; let vec3 = (t2_0.into_bytes()).into_boxed_slice(); let ptr3 = vec3.as_ptr().cast::(); let len3 = vec3.len(); ::core::mem::forget(vec3); - *base.add(4).cast::() = len3; + *base + .add(::core::mem::size_of::<*const u8>()) + .cast::() = len3; *base.add(0).cast::<*mut u8>() = ptr3.cast_mut(); let vec10 = t2_1; let len10 = vec10.len(); - let layout10 = - _rt::alloc::Layout::from_size_align_unchecked(vec10.len() * 20, 4); + let layout10 = _rt::alloc::Layout::from_size_align_unchecked( + vec10.len() * (5 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); let result10 = if layout10.size() != 0 { let ptr = _rt::alloc::alloc(layout10).cast::(); if ptr.is_null() { @@ -14865,12 +16668,11 @@ pub mod exports { } ptr } else { - { - ::core::ptr::null_mut() - } + ::core::ptr::null_mut() }; for (i, e) in vec10.into_iter().enumerate() { - let base = result10.add(i * 20); + let base = result10 + .add(i * (5 * ::core::mem::size_of::<*const u8>())); { match e { Call::Get(e) => { @@ -14879,8 +16681,12 @@ pub mod exports { let ptr4 = vec4.as_ptr().cast::(); let len4 = vec4.len(); ::core::mem::forget(vec4); - *base.add(8).cast::() = len4; - *base.add(4).cast::<*mut u8>() = ptr4.cast_mut(); + *base + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len4; + *base + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr4.cast_mut(); } Call::Set(e) => { *base.add(0).cast::() = (1i32) as u8; @@ -14889,14 +16695,22 @@ pub mod exports { let ptr6 = vec6.as_ptr().cast::(); let len6 = vec6.len(); ::core::mem::forget(vec6); - *base.add(8).cast::() = len6; - *base.add(4).cast::<*mut u8>() = ptr6.cast_mut(); + *base + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len6; + *base + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr6.cast_mut(); let vec7 = (t5_1).into_boxed_slice(); let ptr7 = vec7.as_ptr().cast::(); let len7 = vec7.len(); ::core::mem::forget(vec7); - *base.add(16).cast::() = len7; - *base.add(12).cast::<*mut u8>() = ptr7.cast_mut(); + *base + .add(4 * ::core::mem::size_of::<*const u8>()) + .cast::() = len7; + *base + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr7.cast_mut(); } Call::Delete(e) => { *base.add(0).cast::() = (2i32) as u8; @@ -14904,8 +16718,12 @@ pub mod exports { let ptr8 = vec8.as_ptr().cast::(); let len8 = vec8.len(); ::core::mem::forget(vec8); - *base.add(8).cast::() = len8; - *base.add(4).cast::<*mut u8>() = ptr8.cast_mut(); + *base + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len8; + *base + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr8.cast_mut(); } Call::Exists(e) => { *base.add(0).cast::() = (3i32) as u8; @@ -14913,8 +16731,12 @@ pub mod exports { let ptr9 = vec9.as_ptr().cast::(); let len9 = vec9.len(); ::core::mem::forget(vec9); - *base.add(8).cast::() = len9; - *base.add(4).cast::<*mut u8>() = ptr9.cast_mut(); + *base + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len9; + *base + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr9.cast_mut(); } Call::GetKeys => { *base.add(0).cast::() = (4i32) as u8; @@ -14922,75 +16744,116 @@ pub mod exports { } } } - *base.add(12).cast::() = len10; - *base.add(8).cast::<*mut u8>() = result10; + *base + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len10; + *base + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = result10; } } - *ptr1.add(4).cast::() = len11; + *ptr1.add(::core::mem::size_of::<*const u8>()).cast::() = len11; *ptr1.add(0).cast::<*mut u8>() = result11; ptr1 } #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn __post_return_calls(arg0: *mut u8) { - let l17 = *arg0.add(0).cast::<*mut u8>(); - let l18 = *arg0.add(4).cast::(); - let base19 = l17; - let len19 = l18; + let l0 = *arg0.add(0).cast::<*mut u8>(); + let l1 = *arg0 + .add(::core::mem::size_of::<*const u8>()) + .cast::(); + let base19 = l0; + let len19 = l1; for i in 0..len19 { - let base = base19.add(i * 16); + let base = base19 + .add(i * (4 * ::core::mem::size_of::<*const u8>())); { - let l0 = *base.add(0).cast::<*mut u8>(); - let l1 = *base.add(4).cast::(); - _rt::cabi_dealloc(l0, l1, 1); - let l14 = *base.add(8).cast::<*mut u8>(); - let l15 = *base.add(12).cast::(); - let base16 = l14; - let len16 = l15; - for i in 0..len16 { - let base = base16.add(i * 20); + let l2 = *base.add(0).cast::<*mut u8>(); + let l3 = *base + .add(::core::mem::size_of::<*const u8>()) + .cast::(); + _rt::cabi_dealloc(l2, l3, 1); + let l4 = *base + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l5 = *base + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let base18 = l4; + let len18 = l5; + for i in 0..len18 { + let base = base18 + .add(i * (5 * ::core::mem::size_of::<*const u8>())); { - let l2 = i32::from(*base.add(0).cast::()); - match l2 { + let l6 = i32::from(*base.add(0).cast::()); + match l6 { 0 => { - let l3 = *base.add(4).cast::<*mut u8>(); - let l4 = *base.add(8).cast::(); - _rt::cabi_dealloc(l3, l4, 1); + let l7 = *base + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l8 = *base + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + _rt::cabi_dealloc(l7, l8, 1); } 1 => { - let l5 = *base.add(4).cast::<*mut u8>(); - let l6 = *base.add(8).cast::(); - _rt::cabi_dealloc(l5, l6, 1); - let l7 = *base.add(12).cast::<*mut u8>(); - let l8 = *base.add(16).cast::(); - let base9 = l7; - let len9 = l8; - _rt::cabi_dealloc(base9, len9 * 1, 1); + let l9 = *base + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l10 = *base + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + _rt::cabi_dealloc(l9, l10, 1); + let l11 = *base + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l12 = *base + .add(4 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let base13 = l11; + let len13 = l12; + _rt::cabi_dealloc(base13, len13 * 1, 1); } 2 => { - let l10 = *base.add(4).cast::<*mut u8>(); - let l11 = *base.add(8).cast::(); - _rt::cabi_dealloc(l10, l11, 1); + let l14 = *base + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l15 = *base + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + _rt::cabi_dealloc(l14, l15, 1); } 3 => { - let l12 = *base.add(4).cast::<*mut u8>(); - let l13 = *base.add(8).cast::(); - _rt::cabi_dealloc(l12, l13, 1); + let l16 = *base + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l17 = *base + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + _rt::cabi_dealloc(l16, l17, 1); } - _ => (), + _ => {} } } } - _rt::cabi_dealloc(base16, len16 * 20, 4); + _rt::cabi_dealloc( + base18, + len18 * (5 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); } } - _rt::cabi_dealloc(base19, len19 * 16, 4); + _rt::cabi_dealloc( + base19, + len19 * (4 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); } #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_reset_calls_cabi() { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); T::reset_calls(); } pub trait Guest { @@ -14998,7 +16861,7 @@ pub mod exports { /// Get the recorded calls to the key-value interface fn calls() -> _rt::Vec<(_rt::String, _rt::Vec)>; /// Reset the state of the call tracking - fn reset_calls(); + fn reset_calls() -> (); } pub trait GuestStore: 'static { #[doc(hidden)] @@ -15011,18 +16874,18 @@ pub mod exports { let _ = val; unreachable!(); } - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]fermyon:spin-test-virt/key-value")] - extern "C" { + #[link( + wasm_import_module = "[export]fermyon:spin-test-virt/key-value" + )] + unsafe extern "C" { #[link_name = "[resource-new]store"] fn new(_: *mut u8) -> u32; } - new(val) + unsafe { new(val) } } } - #[doc(hidden)] fn _resource_rep(handle: u32) -> *mut u8 where @@ -15033,18 +16896,18 @@ pub mod exports { let _ = handle; unreachable!(); } - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]fermyon:spin-test-virt/key-value")] - extern "C" { + #[link( + wasm_import_module = "[export]fermyon:spin-test-virt/key-value" + )] + unsafe extern "C" { #[link_name = "[resource-rep]store"] fn rep(_: u32) -> *mut u8; } unsafe { rep(handle) } } } - /// Open the store with the specified label. fn open(label: _rt::String) -> Store; /// Get this stores label @@ -15054,97 +16917,98 @@ pub mod exports { /// Returns `ok(none)` if the key does not exist. fn get(&self, key: _rt::String) -> Option<_rt::Vec>; /// Set the `value` associated with the specified `key` overwriting any existing value. - fn set(&self, key: _rt::String, value: _rt::Vec); + fn set(&self, key: _rt::String, value: _rt::Vec) -> (); /// Delete the tuple with the specified `key` - fn delete(&self, key: _rt::String); + fn delete(&self, key: _rt::String) -> (); } #[doc(hidden)] - - macro_rules! __export_fermyon_spin_test_virt_key_value_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "fermyon:spin-test-virt/key-value#[static]store.open"] - unsafe extern "C" fn export_static_store_open(arg0: *mut u8,arg1: usize,) -> i32 { - $($path_to_types)*::_export_static_store_open_cabi::<<$ty as $($path_to_types)*::Guest>::Store>(arg0, arg1) - } - #[export_name = "fermyon:spin-test-virt/key-value#[method]store.label"] - unsafe extern "C" fn export_method_store_label(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_store_label_cabi::<<$ty as $($path_to_types)*::Guest>::Store>(arg0) - } - #[export_name = "cabi_post_fermyon:spin-test-virt/key-value#[method]store.label"] - unsafe extern "C" fn _post_return_method_store_label(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_store_label::<<$ty as $($path_to_types)*::Guest>::Store>(arg0) - } - #[export_name = "fermyon:spin-test-virt/key-value#[method]store.get"] - unsafe extern "C" fn export_method_store_get(arg0: *mut u8,arg1: *mut u8,arg2: usize,) -> *mut u8 { - $($path_to_types)*::_export_method_store_get_cabi::<<$ty as $($path_to_types)*::Guest>::Store>(arg0, arg1, arg2) - } - #[export_name = "cabi_post_fermyon:spin-test-virt/key-value#[method]store.get"] - unsafe extern "C" fn _post_return_method_store_get(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_store_get::<<$ty as $($path_to_types)*::Guest>::Store>(arg0) - } - #[export_name = "fermyon:spin-test-virt/key-value#[method]store.set"] - unsafe extern "C" fn export_method_store_set(arg0: *mut u8,arg1: *mut u8,arg2: usize,arg3: *mut u8,arg4: usize,) { - $($path_to_types)*::_export_method_store_set_cabi::<<$ty as $($path_to_types)*::Guest>::Store>(arg0, arg1, arg2, arg3, arg4) - } - #[export_name = "fermyon:spin-test-virt/key-value#[method]store.delete"] - unsafe extern "C" fn export_method_store_delete(arg0: *mut u8,arg1: *mut u8,arg2: usize,) { - $($path_to_types)*::_export_method_store_delete_cabi::<<$ty as $($path_to_types)*::Guest>::Store>(arg0, arg1, arg2) - } - #[export_name = "fermyon:spin-test-virt/key-value#calls"] - unsafe extern "C" fn export_calls() -> *mut u8 { - $($path_to_types)*::_export_calls_cabi::<$ty>() - } - #[export_name = "cabi_post_fermyon:spin-test-virt/key-value#calls"] - unsafe extern "C" fn _post_return_calls(arg0: *mut u8,) { - $($path_to_types)*::__post_return_calls::<$ty>(arg0) - } - #[export_name = "fermyon:spin-test-virt/key-value#reset-calls"] - unsafe extern "C" fn export_reset_calls() { - $($path_to_types)*::_export_reset_calls_cabi::<$ty>() - } - - const _: () = { - #[doc(hidden)] - #[export_name = "fermyon:spin-test-virt/key-value#[dtor]store"] - #[allow(non_snake_case)] - unsafe extern "C" fn dtor(rep: *mut u8) { - $($path_to_types)*::Store::dtor::< - <$ty as $($path_to_types)*::Guest>::Store - >(rep) - } - }; - - };); -} + macro_rules! __export_fermyon_spin_test_virt_key_value_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "fermyon:spin-test-virt/key-value#[static]store.open")] unsafe + extern "C" fn export_static_store_open(arg0 : * mut u8, arg1 : + usize,) -> i32 { unsafe { $($path_to_types)*:: + _export_static_store_open_cabi::<<$ty as $($path_to_types)*:: + Guest >::Store > (arg0, arg1) } } #[unsafe (export_name = + "fermyon:spin-test-virt/key-value#[method]store.label")] unsafe + extern "C" fn export_method_store_label(arg0 : * mut u8,) -> * + mut u8 { unsafe { $($path_to_types)*:: + _export_method_store_label_cabi::<<$ty as $($path_to_types)*:: + Guest >::Store > (arg0) } } #[unsafe (export_name = + "cabi_post_fermyon:spin-test-virt/key-value#[method]store.label")] + unsafe extern "C" fn _post_return_method_store_label(arg0 : * mut + u8,) { unsafe { $($path_to_types)*:: + __post_return_method_store_label::<<$ty as $($path_to_types)*:: + Guest >::Store > (arg0) } } #[unsafe (export_name = + "fermyon:spin-test-virt/key-value#[method]store.get")] unsafe + extern "C" fn export_method_store_get(arg0 : * mut u8, arg1 : * + mut u8, arg2 : usize,) -> * mut u8 { unsafe { + $($path_to_types)*:: _export_method_store_get_cabi::<<$ty as + $($path_to_types)*:: Guest >::Store > (arg0, arg1, arg2) } } + #[unsafe (export_name = + "cabi_post_fermyon:spin-test-virt/key-value#[method]store.get")] + unsafe extern "C" fn _post_return_method_store_get(arg0 : * mut + u8,) { unsafe { $($path_to_types)*:: + __post_return_method_store_get::<<$ty as $($path_to_types)*:: + Guest >::Store > (arg0) } } #[unsafe (export_name = + "fermyon:spin-test-virt/key-value#[method]store.set")] unsafe + extern "C" fn export_method_store_set(arg0 : * mut u8, arg1 : * + mut u8, arg2 : usize, arg3 : * mut u8, arg4 : usize,) { unsafe { + $($path_to_types)*:: _export_method_store_set_cabi::<<$ty as + $($path_to_types)*:: Guest >::Store > (arg0, arg1, arg2, arg3, + arg4) } } #[unsafe (export_name = + "fermyon:spin-test-virt/key-value#[method]store.delete")] unsafe + extern "C" fn export_method_store_delete(arg0 : * mut u8, arg1 : + * mut u8, arg2 : usize,) { unsafe { $($path_to_types)*:: + _export_method_store_delete_cabi::<<$ty as $($path_to_types)*:: + Guest >::Store > (arg0, arg1, arg2) } } #[unsafe (export_name = + "fermyon:spin-test-virt/key-value#calls")] unsafe extern "C" fn + export_calls() -> * mut u8 { unsafe { $($path_to_types)*:: + _export_calls_cabi::<$ty > () } } #[unsafe (export_name = + "cabi_post_fermyon:spin-test-virt/key-value#calls")] unsafe + extern "C" fn _post_return_calls(arg0 : * mut u8,) { unsafe { + $($path_to_types)*:: __post_return_calls::<$ty > (arg0) } } + #[unsafe (export_name = + "fermyon:spin-test-virt/key-value#reset-calls")] unsafe extern + "C" fn export_reset_calls() { unsafe { $($path_to_types)*:: + _export_reset_calls_cabi::<$ty > () } } const _ : () = { + #[doc(hidden)] #[unsafe (export_name = + "fermyon:spin-test-virt/key-value#[dtor]store")] + #[allow(non_snake_case)] unsafe extern "C" fn dtor(rep : * mut + u8) { unsafe { $($path_to_types)*:: Store::dtor::< <$ty as + $($path_to_types)*:: Guest >::Store > (rep) } } }; }; + }; + } #[doc(hidden)] pub(crate) use __export_fermyon_spin_test_virt_key_value_cabi; - #[repr(align(4))] - struct _RetArea([::core::mem::MaybeUninit; 12]); - static mut _RET_AREA: _RetArea = _RetArea([::core::mem::MaybeUninit::uninit(); 12]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct _RetArea( + [::core::mem::MaybeUninit< + u8, + >; 3 * ::core::mem::size_of::<*const u8>()], + ); + static mut _RET_AREA: _RetArea = _RetArea( + [::core::mem::MaybeUninit::uninit(); 3 + * ::core::mem::size_of::<*const u8>()], + ); } - - #[allow(dead_code, clippy::all)] + /// Interface for configuring the behavior of `fermyon:spin/sqlite` interface + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod sqlite { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; pub type Value = super::super::super::super::exports::fermyon::spin::sqlite::Value; - pub type QueryResult = - super::super::super::super::exports::fermyon::spin::sqlite::QueryResult; + pub type QueryResult = super::super::super::super::exports::fermyon::spin::sqlite::QueryResult; pub type Error = super::super::super::super::exports::fermyon::spin::sqlite::Error; - #[derive(Debug)] #[repr(transparent)] pub struct Connection { handle: _rt::Resource, } - type _ConnectionRep = Option; - impl Connection { /// Creates a new resource from the specified representation. /// @@ -15154,77 +17018,70 @@ pub mod exports { pub fn new(val: T) -> Self { Self::type_guard::(); let val: _ConnectionRep = Some(val); - let ptr: *mut _ConnectionRep = _rt::Box::into_raw(_rt::Box::new(val)); + let ptr: *mut _ConnectionRep = _rt::Box::into_raw( + _rt::Box::new(val), + ); unsafe { Self::from_handle(T::_resource_new(ptr.cast())) } } - /// Gets access to the underlying `T` which represents this resource. pub fn get(&self) -> &T { let ptr = unsafe { &*self.as_ptr::() }; ptr.as_ref().unwrap() } - /// Gets mutable access to the underlying `T` which represents this /// resource. pub fn get_mut(&mut self) -> &mut T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_mut().unwrap() } - /// Consumes this resource and returns the underlying `T`. pub fn into_inner(self) -> T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.take().unwrap() } - #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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) } - - // It's theoretically possible to implement the `GuestConnection` trait twice - // so guard against using it with two different types here. #[doc(hidden)] fn type_guard() { use core::any::TypeId; static mut LAST_TYPE: Option = None; unsafe { - assert!(!cfg!(target_feature = "threads")); + assert!(! cfg!(target_feature = "atomics")); let id = TypeId::of::(); match LAST_TYPE { - Some(ty) => assert!( - ty == id, - "cannot use two types with this resource type" - ), + Some(ty) => { + assert!( + ty == id, "cannot use two types with this resource type" + ) + } None => LAST_TYPE = Some(id), } } } - #[doc(hidden)] pub unsafe fn dtor(handle: *mut u8) { Self::type_guard::(); - let _ = _rt::Box::from_raw(handle as *mut _ConnectionRep); + let _ = unsafe { + _rt::Box::from_raw(handle as *mut _ConnectionRep) + }; } - fn as_ptr(&self) -> *mut _ConnectionRep { Connection::type_guard::(); T::_resource_rep(self.handle()).cast() } } - /// A borrowed version of [`Connection`] which represents a borrowed value /// with the lifetime `'a`. #[derive(Debug)] @@ -15233,7 +17090,6 @@ pub mod exports { rep: *mut u8, _marker: core::marker::PhantomData<&'a Connection>, } - impl<'a> ConnectionBorrow<'a> { #[doc(hidden)] pub unsafe fn lift(rep: usize) -> Self { @@ -15242,82 +17098,90 @@ pub mod exports { _marker: core::marker::PhantomData, } } - /// Gets access to the underlying `T` in this resource. pub fn get(&self) -> &T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_ref().unwrap() } - - // NB: mutable access is not allowed due to the component model allowing - // multiple borrows of the same resource. - fn as_ptr(&self) -> *mut _ConnectionRep { Connection::type_guard::(); self.rep.cast() } } - unsafe impl _rt::WasmResource for Connection { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]fermyon:spin-test-virt/sqlite")] - extern "C" { + #[link( + wasm_import_module = "[export]fermyon:spin-test-virt/sqlite" + )] + unsafe extern "C" { #[link_name = "[resource-drop]connection"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_static_connection_open_cabi( arg0: *mut u8, arg1: usize, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg1; let bytes0 = _rt::Vec::from_raw_parts(arg0.cast(), len0, len0); let result1 = T::open(_rt::string_lift(bytes0)); - let ptr2 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr2 = (&raw mut _RET_AREA.0).cast::(); match result1 { Ok(e) => { *ptr2.add(0).cast::() = (0i32) as u8; - *ptr2.add(4).cast::() = (e).take_handle() as i32; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (e).take_handle() as i32; } Err(e) => { *ptr2.add(0).cast::() = (1i32) as u8; use super::super::super::super::exports::fermyon::spin::sqlite::Error as V4; match e { V4::NoSuchDatabase => { - *ptr2.add(4).cast::() = (0i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } V4::AccessDenied => { - *ptr2.add(4).cast::() = (1i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; } V4::InvalidConnection => { - *ptr2.add(4).cast::() = (2i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (2i32) as u8; } V4::DatabaseFull => { - *ptr2.add(4).cast::() = (3i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (3i32) as u8; } V4::Io(e) => { - *ptr2.add(4).cast::() = (4i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (4i32) as u8; let vec3 = (e.into_bytes()).into_boxed_slice(); let ptr3 = vec3.as_ptr().cast::(); let len3 = vec3.len(); ::core::mem::forget(vec3); - *ptr2.add(12).cast::() = len3; - *ptr2.add(8).cast::<*mut u8>() = ptr3.cast_mut(); + *ptr2 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len3; + *ptr2 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr3.cast_mut(); } } } @@ -15331,17 +17195,23 @@ pub mod exports { ) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { - 0 => (), + 0 => {} _ => { - let l1 = i32::from(*arg0.add(4).cast::()); + let l1 = i32::from( + *arg0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); match l1 { - 0 => (), - 1 => (), - 2 => (), - 3 => (), + 0 => {} + 1 => {} + 2 => {} + 3 => {} _ => { - let l2 = *arg0.add(8).cast::<*mut u8>(); - let l3 = *arg0.add(12).cast::(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l3 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l2, l3, 1); } } @@ -15357,15 +17227,15 @@ pub mod exports { arg3: *mut u8, arg4: usize, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg2; let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0); let base11 = arg3; let len11 = arg4; let mut result11 = _rt::Vec::with_capacity(len11); for i in 0..len11 { - let base = base11.add(i * 16); + let base = base11 + .add(i * (8 + 2 * ::core::mem::size_of::<*const u8>())); let e11 = { let l1 = i32::from(*base.add(0).cast::()); use super::super::super::super::exports::fermyon::spin::sqlite::Value as V10; @@ -15373,7 +17243,6 @@ pub mod exports { 0 => { let e10 = { let l2 = *base.add(8).cast::(); - l2 }; V10::Integer(e10) @@ -15381,7 +17250,6 @@ pub mod exports { 1 => { let e10 = { let l3 = *base.add(8).cast::(); - l3 }; V10::Real(e10) @@ -15389,11 +17257,15 @@ pub mod exports { 2 => { let e10 = { let l4 = *base.add(8).cast::<*mut u8>(); - let l5 = *base.add(12).cast::(); + let l5 = *base + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(); let len6 = l5; - let bytes6 = - _rt::Vec::from_raw_parts(l4.cast(), len6, len6); - + let bytes6 = _rt::Vec::from_raw_parts( + l4.cast(), + len6, + len6, + ); _rt::string_lift(bytes6) }; V10::Text(e10) @@ -15401,9 +17273,10 @@ pub mod exports { 3 => { let e10 = { let l7 = *base.add(8).cast::<*mut u8>(); - let l8 = *base.add(12).cast::(); + let l8 = *base + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(); let len9 = l8; - _rt::Vec::from_raw_parts(l7.cast(), len9, len9) }; V10::Blob(e10) @@ -15413,26 +17286,34 @@ pub mod exports { V10::Null } }; - v10 }; result11.push(e11); } - _rt::cabi_dealloc(base11, len11 * 16, 8); + _rt::cabi_dealloc( + base11, + len11 * (8 + 2 * ::core::mem::size_of::<*const u8>()), + 8, + ); let result12 = T::execute( - ConnectionBorrow::lift(arg0 as u32 as usize).get(), + unsafe { ConnectionBorrow::lift(arg0 as u32 as usize) }.get(), _rt::string_lift(bytes0), result11, ); - let ptr13 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr13 = (&raw mut _RET_AREA.0).cast::(); match result12 { Ok(e) => { *ptr13.add(0).cast::() = (0i32) as u8; - let super::super::super::super::exports::fermyon::spin::sqlite::QueryResult{ columns:columns14, rows:rows14, } = e; + let super::super::super::super::exports::fermyon::spin::sqlite::QueryResult { + columns: columns14, + rows: rows14, + } = e; let vec16 = columns14; let len16 = vec16.len(); - let layout16 = - _rt::alloc::Layout::from_size_align_unchecked(vec16.len() * 8, 4); + let layout16 = _rt::alloc::Layout::from_size_align_unchecked( + vec16.len() * (2 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); let result16 = if layout16.size() != 0 { let ptr = _rt::alloc::alloc(layout16).cast::(); if ptr.is_null() { @@ -15440,27 +17321,34 @@ pub mod exports { } ptr } else { - { - ::core::ptr::null_mut() - } + ::core::ptr::null_mut() }; for (i, e) in vec16.into_iter().enumerate() { - let base = result16.add(i * 8); + let base = result16 + .add(i * (2 * ::core::mem::size_of::<*const u8>())); { let vec15 = (e.into_bytes()).into_boxed_slice(); let ptr15 = vec15.as_ptr().cast::(); let len15 = vec15.len(); ::core::mem::forget(vec15); - *base.add(4).cast::() = len15; + *base + .add(::core::mem::size_of::<*const u8>()) + .cast::() = len15; *base.add(0).cast::<*mut u8>() = ptr15.cast_mut(); } } - *ptr13.add(8).cast::() = len16; - *ptr13.add(4).cast::<*mut u8>() = result16; + *ptr13 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len16; + *ptr13 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = result16; let vec22 = rows14; let len22 = vec22.len(); - let layout22 = - _rt::alloc::Layout::from_size_align_unchecked(vec22.len() * 8, 4); + let layout22 = _rt::alloc::Layout::from_size_align_unchecked( + vec22.len() * (2 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); let result22 = if layout22.size() != 0 { let ptr = _rt::alloc::alloc(layout22).cast::(); if ptr.is_null() { @@ -15468,18 +17356,19 @@ pub mod exports { } ptr } else { - { - ::core::ptr::null_mut() - } + ::core::ptr::null_mut() }; for (i, e) in vec22.into_iter().enumerate() { - let base = result22.add(i * 8); + let base = result22 + .add(i * (2 * ::core::mem::size_of::<*const u8>())); { - let super::super::super::super::exports::fermyon::spin::sqlite::RowResult{ values:values17, } = e; + let super::super::super::super::exports::fermyon::spin::sqlite::RowResult { + values: values17, + } = e; let vec21 = values17; let len21 = vec21.len(); let layout21 = _rt::alloc::Layout::from_size_align_unchecked( - vec21.len() * 16, + vec21.len() * (8 + 2 * ::core::mem::size_of::<*const u8>()), 8, ); let result21 = if layout21.size() != 0 { @@ -15489,12 +17378,11 @@ pub mod exports { } ptr } else { - { - ::core::ptr::null_mut() - } + ::core::ptr::null_mut() }; for (i, e) in vec21.into_iter().enumerate() { - let base = result21.add(i * 16); + let base = result21 + .add(i * (8 + 2 * ::core::mem::size_of::<*const u8>())); { use super::super::super::super::exports::fermyon::spin::sqlite::Value as V20; match e { @@ -15512,9 +17400,10 @@ pub mod exports { let ptr18 = vec18.as_ptr().cast::(); let len18 = vec18.len(); ::core::mem::forget(vec18); - *base.add(12).cast::() = len18; - *base.add(8).cast::<*mut u8>() = - ptr18.cast_mut(); + *base + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::() = len18; + *base.add(8).cast::<*mut u8>() = ptr18.cast_mut(); } V20::Blob(e) => { *base.add(0).cast::() = (3i32) as u8; @@ -15522,9 +17411,10 @@ pub mod exports { let ptr19 = vec19.as_ptr().cast::(); let len19 = vec19.len(); ::core::mem::forget(vec19); - *base.add(12).cast::() = len19; - *base.add(8).cast::<*mut u8>() = - ptr19.cast_mut(); + *base + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::() = len19; + *base.add(8).cast::<*mut u8>() = ptr19.cast_mut(); } V20::Null => { *base.add(0).cast::() = (4i32) as u8; @@ -15532,37 +17422,57 @@ pub mod exports { } } } - *base.add(4).cast::() = len21; + *base + .add(::core::mem::size_of::<*const u8>()) + .cast::() = len21; *base.add(0).cast::<*mut u8>() = result21; } } - *ptr13.add(16).cast::() = len22; - *ptr13.add(12).cast::<*mut u8>() = result22; + *ptr13 + .add(4 * ::core::mem::size_of::<*const u8>()) + .cast::() = len22; + *ptr13 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = result22; } Err(e) => { *ptr13.add(0).cast::() = (1i32) as u8; use super::super::super::super::exports::fermyon::spin::sqlite::Error as V24; match e { V24::NoSuchDatabase => { - *ptr13.add(4).cast::() = (0i32) as u8; + *ptr13 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } V24::AccessDenied => { - *ptr13.add(4).cast::() = (1i32) as u8; + *ptr13 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; } V24::InvalidConnection => { - *ptr13.add(4).cast::() = (2i32) as u8; + *ptr13 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (2i32) as u8; } V24::DatabaseFull => { - *ptr13.add(4).cast::() = (3i32) as u8; + *ptr13 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (3i32) as u8; } V24::Io(e) => { - *ptr13.add(4).cast::() = (4i32) as u8; + *ptr13 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (4i32) as u8; let vec23 = (e.into_bytes()).into_boxed_slice(); let ptr23 = vec23.as_ptr().cast::(); let len23 = vec23.len(); ::core::mem::forget(vec23); - *ptr13.add(12).cast::() = len23; - *ptr13.add(8).cast::<*mut u8>() = ptr23.cast_mut(); + *ptr13 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len23; + *ptr13 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr23.cast_mut(); } } } @@ -15571,74 +17481,111 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn __post_return_method_connection_execute( - arg0: *mut u8, - ) { + pub unsafe fn __post_return_method_connection_execute< + T: GuestConnection, + >(arg0: *mut u8) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { 0 => { - let l3 = *arg0.add(4).cast::<*mut u8>(); - let l4 = *arg0.add(8).cast::(); - let base5 = l3; - let len5 = l4; + let l1 = *arg0 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let base5 = l1; + let len5 = l2; for i in 0..len5 { - let base = base5.add(i * 8); + let base = base5 + .add(i * (2 * ::core::mem::size_of::<*const u8>())); { - let l1 = *base.add(0).cast::<*mut u8>(); - let l2 = *base.add(4).cast::(); - _rt::cabi_dealloc(l1, l2, 1); + let l3 = *base.add(0).cast::<*mut u8>(); + let l4 = *base + .add(::core::mem::size_of::<*const u8>()) + .cast::(); + _rt::cabi_dealloc(l3, l4, 1); } } - _rt::cabi_dealloc(base5, len5 * 8, 4); - let l15 = *arg0.add(12).cast::<*mut u8>(); - let l16 = *arg0.add(16).cast::(); - let base17 = l15; - let len17 = l16; + _rt::cabi_dealloc( + base5, + len5 * (2 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); + let l6 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l7 = *arg0 + .add(4 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let base17 = l6; + let len17 = l7; for i in 0..len17 { - let base = base17.add(i * 8); + let base = base17 + .add(i * (2 * ::core::mem::size_of::<*const u8>())); { - let l12 = *base.add(0).cast::<*mut u8>(); - let l13 = *base.add(4).cast::(); - let base14 = l12; - let len14 = l13; - for i in 0..len14 { - let base = base14.add(i * 16); + let l8 = *base.add(0).cast::<*mut u8>(); + let l9 = *base + .add(::core::mem::size_of::<*const u8>()) + .cast::(); + let base16 = l8; + let len16 = l9; + for i in 0..len16 { + let base = base16 + .add(i * (8 + 2 * ::core::mem::size_of::<*const u8>())); { - let l6 = i32::from(*base.add(0).cast::()); - match l6 { - 0 => (), - 1 => (), + let l10 = i32::from(*base.add(0).cast::()); + match l10 { + 0 => {} + 1 => {} 2 => { - let l7 = *base.add(8).cast::<*mut u8>(); - let l8 = *base.add(12).cast::(); - _rt::cabi_dealloc(l7, l8, 1); + let l11 = *base.add(8).cast::<*mut u8>(); + let l12 = *base + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(); + _rt::cabi_dealloc(l11, l12, 1); } 3 => { - let l9 = *base.add(8).cast::<*mut u8>(); - let l10 = *base.add(12).cast::(); - let base11 = l9; - let len11 = l10; - _rt::cabi_dealloc(base11, len11 * 1, 1); + let l13 = *base.add(8).cast::<*mut u8>(); + let l14 = *base + .add(8 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let base15 = l13; + let len15 = l14; + _rt::cabi_dealloc(base15, len15 * 1, 1); } - _ => (), + _ => {} } } } - _rt::cabi_dealloc(base14, len14 * 16, 8); + _rt::cabi_dealloc( + base16, + len16 * (8 + 2 * ::core::mem::size_of::<*const u8>()), + 8, + ); } } - _rt::cabi_dealloc(base17, len17 * 8, 4); + _rt::cabi_dealloc( + base17, + len17 * (2 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); } _ => { - let l18 = i32::from(*arg0.add(4).cast::()); + let l18 = i32::from( + *arg0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); match l18 { - 0 => (), - 1 => (), - 2 => (), - 3 => (), + 0 => {} + 1 => {} + 2 => {} + 3 => {} _ => { - let l19 = *arg0.add(8).cast::<*mut u8>(); - let l20 = *arg0.add(12).cast::(); + let l19 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l20 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l19, l20, 1); } } @@ -15659,18 +17606,18 @@ pub mod exports { let _ = val; unreachable!(); } - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]fermyon:spin-test-virt/sqlite")] - extern "C" { + #[link( + wasm_import_module = "[export]fermyon:spin-test-virt/sqlite" + )] + unsafe extern "C" { #[link_name = "[resource-new]connection"] fn new(_: *mut u8) -> u32; } - new(val) + unsafe { new(val) } } } - #[doc(hidden)] fn _resource_rep(handle: u32) -> *mut u8 where @@ -15681,18 +17628,18 @@ pub mod exports { let _ = handle; unreachable!(); } - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]fermyon:spin-test-virt/sqlite")] - extern "C" { + #[link( + wasm_import_module = "[export]fermyon:spin-test-virt/sqlite" + )] + unsafe extern "C" { #[link_name = "[resource-rep]connection"] fn rep(_: u32) -> *mut u8; } unsafe { rep(handle) } } } - /// Open a connection to a named database instance. /// /// If `database` is "default", the default instance is opened. @@ -15707,54 +17654,60 @@ pub mod exports { ) -> Result; } #[doc(hidden)] - - macro_rules! __export_fermyon_spin_test_virt_sqlite_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "fermyon:spin-test-virt/sqlite#[static]connection.open"] - unsafe extern "C" fn export_static_connection_open(arg0: *mut u8,arg1: usize,) -> *mut u8 { - $($path_to_types)*::_export_static_connection_open_cabi::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0, arg1) - } - #[export_name = "cabi_post_fermyon:spin-test-virt/sqlite#[static]connection.open"] - unsafe extern "C" fn _post_return_static_connection_open(arg0: *mut u8,) { - $($path_to_types)*::__post_return_static_connection_open::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0) - } - #[export_name = "fermyon:spin-test-virt/sqlite#[method]connection.execute"] - unsafe extern "C" fn export_method_connection_execute(arg0: *mut u8,arg1: *mut u8,arg2: usize,arg3: *mut u8,arg4: usize,) -> *mut u8 { - $($path_to_types)*::_export_method_connection_execute_cabi::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0, arg1, arg2, arg3, arg4) - } - #[export_name = "cabi_post_fermyon:spin-test-virt/sqlite#[method]connection.execute"] - unsafe extern "C" fn _post_return_method_connection_execute(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_connection_execute::<<$ty as $($path_to_types)*::Guest>::Connection>(arg0) - } - - const _: () = { - #[doc(hidden)] - #[export_name = "fermyon:spin-test-virt/sqlite#[dtor]connection"] - #[allow(non_snake_case)] - unsafe extern "C" fn dtor(rep: *mut u8) { - $($path_to_types)*::Connection::dtor::< - <$ty as $($path_to_types)*::Guest>::Connection - >(rep) - } - }; - - };); -} + macro_rules! __export_fermyon_spin_test_virt_sqlite_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "fermyon:spin-test-virt/sqlite#[static]connection.open")] unsafe + extern "C" fn export_static_connection_open(arg0 : * mut u8, arg1 + : usize,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_static_connection_open_cabi::<<$ty as + $($path_to_types)*:: Guest >::Connection > (arg0, arg1) } } + #[unsafe (export_name = + "cabi_post_fermyon:spin-test-virt/sqlite#[static]connection.open")] + unsafe extern "C" fn _post_return_static_connection_open(arg0 : * + mut u8,) { unsafe { $($path_to_types)*:: + __post_return_static_connection_open::<<$ty as + $($path_to_types)*:: Guest >::Connection > (arg0) } } #[unsafe + (export_name = + "fermyon:spin-test-virt/sqlite#[method]connection.execute")] + unsafe extern "C" fn export_method_connection_execute(arg0 : * + mut u8, arg1 : * mut u8, arg2 : usize, arg3 : * mut u8, arg4 : + usize,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_connection_execute_cabi::<<$ty as + $($path_to_types)*:: Guest >::Connection > (arg0, arg1, arg2, + arg3, arg4) } } #[unsafe (export_name = + "cabi_post_fermyon:spin-test-virt/sqlite#[method]connection.execute")] + unsafe extern "C" fn _post_return_method_connection_execute(arg0 + : * mut u8,) { unsafe { $($path_to_types)*:: + __post_return_method_connection_execute::<<$ty as + $($path_to_types)*:: Guest >::Connection > (arg0) } } const _ : + () = { #[doc(hidden)] #[unsafe (export_name = + "fermyon:spin-test-virt/sqlite#[dtor]connection")] + #[allow(non_snake_case)] unsafe extern "C" fn dtor(rep : * mut + u8) { unsafe { $($path_to_types)*:: Connection::dtor::< <$ty as + $($path_to_types)*:: Guest >::Connection > (rep) } } }; }; + }; + } #[doc(hidden)] pub(crate) use __export_fermyon_spin_test_virt_sqlite_cabi; - #[repr(align(4))] - struct _RetArea([::core::mem::MaybeUninit; 20]); - static mut _RET_AREA: _RetArea = _RetArea([::core::mem::MaybeUninit::uninit(); 20]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct _RetArea( + [::core::mem::MaybeUninit< + u8, + >; 5 * ::core::mem::size_of::<*const u8>()], + ); + static mut _RET_AREA: _RetArea = _RetArea( + [::core::mem::MaybeUninit::uninit(); 5 + * ::core::mem::size_of::<*const u8>()], + ); } - - #[allow(dead_code, clippy::all)] + /// Interface for configuring variables + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod variables { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; #[doc(hidden)] #[allow(non_snake_case)] @@ -15764,8 +17717,7 @@ pub mod exports { arg2: *mut u8, arg3: usize, ) { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg1; let bytes0 = _rt::Vec::from_raw_parts(arg0.cast(), len0, len0); let len1 = arg3; @@ -15773,45 +17725,43 @@ pub mod exports { T::set(_rt::string_lift(bytes0), _rt::string_lift(bytes1)); } pub trait Guest { - fn set(key: _rt::String, value: _rt::String); + fn set(key: _rt::String, value: _rt::String) -> (); } #[doc(hidden)] - - macro_rules! __export_fermyon_spin_test_virt_variables_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "fermyon:spin-test-virt/variables#set"] - unsafe extern "C" fn export_set(arg0: *mut u8,arg1: usize,arg2: *mut u8,arg3: usize,) { - $($path_to_types)*::_export_set_cabi::<$ty>(arg0, arg1, arg2, arg3) - } - };); -} + macro_rules! __export_fermyon_spin_test_virt_variables_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "fermyon:spin-test-virt/variables#set")] unsafe extern "C" fn + export_set(arg0 : * mut u8, arg1 : usize, arg2 : * mut u8, arg3 : + usize,) { unsafe { $($path_to_types)*:: _export_set_cabi::<$ty > + (arg0, arg1, arg2, arg3) } } }; + }; + } #[doc(hidden)] pub(crate) use __export_fermyon_spin_test_virt_variables_cabi; } } - #[allow(dead_code)] pub mod spin_wasi_virt { - #[allow(dead_code, clippy::all)] + /// Interface for configuring the behavior of `wasi:http/outgoing-handler` interface + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod http_handler { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; - pub type OutgoingResponse = - super::super::super::super::exports::wasi::http::types::OutgoingResponse; - pub type OutgoingResponseBorrow<'a> = - super::super::super::super::exports::wasi::http::types::OutgoingResponseBorrow< - 'a, - >; + pub type OutgoingResponse = super::super::super::super::exports::wasi::http::types::OutgoingResponse; + pub type OutgoingResponseBorrow<'a> = super::super::super::super::exports::wasi::http::types::OutgoingResponseBorrow< + 'a, + >; pub enum ResponseHandler { Echo, Response(OutgoingResponse), } impl ::core::fmt::Debug for ResponseHandler { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { ResponseHandler::Echo => { f.debug_tuple("ResponseHandler::Echo").finish() @@ -15830,15 +17780,18 @@ pub mod exports { arg2: i32, arg3: i32, ) { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg1; let bytes0 = _rt::Vec::from_raw_parts(arg0.cast(), len0, len0); let v1 = match arg2 { 0 => ResponseHandler::Echo, n => { debug_assert_eq!(n, 1, "invalid enum discriminant"); - let e1 = super::super::super::super::exports::wasi::http::types::OutgoingResponse::from_handle(arg3 as u32); + let e1 = unsafe { + super::super::super::super::exports::wasi::http::types::OutgoingResponse::from_handle( + arg3 as u32, + ) + }; ResponseHandler::Response(e1) } }; @@ -15846,74 +17799,61 @@ pub mod exports { } pub trait Guest { /// Set a response for a given url - fn set_response(url: _rt::String, response: ResponseHandler); + fn set_response(url: _rt::String, response: ResponseHandler) -> (); } #[doc(hidden)] - - macro_rules! __export_fermyon_spin_wasi_virt_http_handler_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "fermyon:spin-wasi-virt/http-handler#set-response"] - unsafe extern "C" fn export_set_response(arg0: *mut u8,arg1: usize,arg2: i32,arg3: i32,) { - $($path_to_types)*::_export_set_response_cabi::<$ty>(arg0, arg1, arg2, arg3) - } - };); - } + macro_rules! __export_fermyon_spin_wasi_virt_http_handler_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "fermyon:spin-wasi-virt/http-handler#set-response")] unsafe + extern "C" fn export_set_response(arg0 : * mut u8, arg1 : usize, + arg2 : i32, arg3 : i32,) { unsafe { $($path_to_types)*:: + _export_set_response_cabi::<$ty > (arg0, arg1, arg2, arg3) } } }; + }; + } #[doc(hidden)] pub(crate) use __export_fermyon_spin_wasi_virt_http_handler_cabi; } - - #[allow(dead_code, clippy::all)] + /// Helpers for overcoming the limitations of `wasi:http@0.2.0` + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod http_helper { - #[used] - #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; - use super::super::super::super::_rt; - pub type IncomingRequest = - super::super::super::super::exports::wasi::http::types::IncomingRequest; - pub type IncomingRequestBorrow<'a> = - super::super::super::super::exports::wasi::http::types::IncomingRequestBorrow< - 'a, - >; - pub type IncomingResponse = - super::super::super::super::exports::wasi::http::types::IncomingResponse; - pub type IncomingResponseBorrow<'a> = - super::super::super::super::exports::wasi::http::types::IncomingResponseBorrow< - 'a, - >; - pub type OutgoingResponseBorrow<'a> = - super::super::super::super::exports::wasi::http::types::OutgoingResponseBorrow< - 'a, - >; - pub type OutgoingRequest = - super::super::super::super::exports::wasi::http::types::OutgoingRequest; - pub type OutgoingRequestBorrow<'a> = - super::super::super::super::exports::wasi::http::types::OutgoingRequestBorrow< - 'a, - >; - pub type ResponseOutparam = - super::super::super::super::exports::wasi::http::types::ResponseOutparam; - pub type ResponseOutparamBorrow<'a> = - super::super::super::super::exports::wasi::http::types::ResponseOutparamBorrow< - 'a, - >; - pub type FutureIncomingResponseBorrow<'a> = super::super::super::super::exports::wasi::http::types::FutureIncomingResponseBorrow<'a>; - pub type IncomingBody = - super::super::super::super::exports::wasi::http::types::IncomingBody; - pub type IncomingBodyBorrow<'a> = - super::super::super::super::exports::wasi::http::types::IncomingBodyBorrow<'a>; + #[used] + #[doc(hidden)] + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; + use super::super::super::super::_rt; + pub type IncomingRequest = super::super::super::super::exports::wasi::http::types::IncomingRequest; + pub type IncomingRequestBorrow<'a> = super::super::super::super::exports::wasi::http::types::IncomingRequestBorrow< + 'a, + >; + pub type IncomingResponse = super::super::super::super::exports::wasi::http::types::IncomingResponse; + pub type IncomingResponseBorrow<'a> = super::super::super::super::exports::wasi::http::types::IncomingResponseBorrow< + 'a, + >; + pub type OutgoingResponseBorrow<'a> = super::super::super::super::exports::wasi::http::types::OutgoingResponseBorrow< + 'a, + >; + pub type OutgoingRequest = super::super::super::super::exports::wasi::http::types::OutgoingRequest; + pub type OutgoingRequestBorrow<'a> = super::super::super::super::exports::wasi::http::types::OutgoingRequestBorrow< + 'a, + >; + pub type ResponseOutparam = super::super::super::super::exports::wasi::http::types::ResponseOutparam; + pub type ResponseOutparamBorrow<'a> = super::super::super::super::exports::wasi::http::types::ResponseOutparamBorrow< + 'a, + >; + pub type FutureIncomingResponseBorrow<'a> = super::super::super::super::exports::wasi::http::types::FutureIncomingResponseBorrow< + 'a, + >; + pub type IncomingBody = super::super::super::super::exports::wasi::http::types::IncomingBody; + pub type IncomingBodyBorrow<'a> = super::super::super::super::exports::wasi::http::types::IncomingBodyBorrow< + 'a, + >; /// A receiver of an `incoming-response` - #[derive(Debug)] #[repr(transparent)] pub struct ResponseReceiver { handle: _rt::Resource, } - type _ResponseReceiverRep = Option; - impl ResponseReceiver { /// Creates a new resource from the specified representation. /// @@ -15923,78 +17863,72 @@ pub mod exports { pub fn new(val: T) -> Self { Self::type_guard::(); let val: _ResponseReceiverRep = Some(val); - let ptr: *mut _ResponseReceiverRep = - _rt::Box::into_raw(_rt::Box::new(val)); + let ptr: *mut _ResponseReceiverRep = _rt::Box::into_raw( + _rt::Box::new(val), + ); unsafe { Self::from_handle(T::_resource_new(ptr.cast())) } } - /// Gets access to the underlying `T` which represents this resource. pub fn get(&self) -> &T { let ptr = unsafe { &*self.as_ptr::() }; ptr.as_ref().unwrap() } - /// Gets mutable access to the underlying `T` which represents this /// resource. pub fn get_mut(&mut self) -> &mut T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_mut().unwrap() } - /// Consumes this resource and returns the underlying `T`. pub fn into_inner(self) -> T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.take().unwrap() } - #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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) } - - // It's theoretically possible to implement the `GuestResponseReceiver` trait twice - // so guard against using it with two different types here. #[doc(hidden)] fn type_guard() { use core::any::TypeId; static mut LAST_TYPE: Option = None; unsafe { - assert!(!cfg!(target_feature = "threads")); + assert!(! cfg!(target_feature = "atomics")); let id = TypeId::of::(); match LAST_TYPE { - Some(ty) => assert!( - ty == id, - "cannot use two types with this resource type" - ), + Some(ty) => { + assert!( + ty == id, "cannot use two types with this resource type" + ) + } None => LAST_TYPE = Some(id), } } } - #[doc(hidden)] pub unsafe fn dtor(handle: *mut u8) { Self::type_guard::(); - let _ = _rt::Box::from_raw(handle as *mut _ResponseReceiverRep); + let _ = unsafe { + _rt::Box::from_raw(handle as *mut _ResponseReceiverRep) + }; } - - fn as_ptr(&self) -> *mut _ResponseReceiverRep { + fn as_ptr( + &self, + ) -> *mut _ResponseReceiverRep { ResponseReceiver::type_guard::(); T::_resource_rep(self.handle()).cast() } } - /// A borrowed version of [`ResponseReceiver`] which represents a borrowed value /// with the lifetime `'a`. #[derive(Debug)] @@ -16003,7 +17937,6 @@ pub mod exports { rep: *mut u8, _marker: core::marker::PhantomData<&'a ResponseReceiver>, } - impl<'a> ResponseReceiverBorrow<'a> { #[doc(hidden)] pub unsafe fn lift(rep: usize) -> Self { @@ -16012,54 +17945,45 @@ pub mod exports { _marker: core::marker::PhantomData, } } - /// Gets access to the underlying `T` in this resource. pub fn get(&self) -> &T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_ref().unwrap() } - - // NB: mutable access is not allowed due to the component model allowing - // multiple borrows of the same resource. - fn as_ptr(&self) -> *mut _ResponseReceiverRep { ResponseReceiver::type_guard::(); self.rep.cast() } } - unsafe impl _rt::WasmResource for ResponseReceiver { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link( wasm_import_module = "[export]fermyon:spin-wasi-virt/http-helper" )] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]response-receiver"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_method_response_receiver_get_cabi< T: GuestResponseReceiver, - >( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = T::get(ResponseReceiverBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::get( + unsafe { ResponseReceiverBorrow::lift(arg0 as u32 as usize) } + .get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Some(e) => { *ptr1.add(0).cast::() = (1i32) as u8; @@ -16078,25 +18002,34 @@ pub mod exports { arg1: i32, arg2: i32, ) -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = T::new_request(super::super::super::super::exports::wasi::http::types::OutgoingRequest::from_handle(arg0 as u32), match arg1 { - 0 => None, - 1 => { - let e = super::super::super::super::exports::wasi::http::types::IncomingBody::from_handle(arg2 as u32); - Some(e) - } - _ => _rt::invalid_enum_discriminant(), -}); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::new_request( + unsafe { + super::super::super::super::exports::wasi::http::types::OutgoingRequest::from_handle( + arg0 as u32, + ) + }, + match arg1 { + 0 => None, + 1 => { + let e = unsafe { + super::super::super::super::exports::wasi::http::types::IncomingBody::from_handle( + arg2 as u32, + ) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + ); (result0).take_handle() as i32 } #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_new_response_cabi() -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::new_response(); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); let (t2_0, t2_1) = result0; *ptr1.add(0).cast::() = (t2_0).take_handle() as i32; *ptr1.add(4).cast::() = (t2_1).take_handle() as i32; @@ -16126,20 +18059,18 @@ pub mod exports { let _ = val; unreachable!(); } - #[cfg(target_arch = "wasm32")] { #[link( wasm_import_module = "[export]fermyon:spin-wasi-virt/http-helper" )] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-new]response-receiver"] fn new(_: *mut u8) -> u32; } - new(val) + unsafe { new(val) } } } - #[doc(hidden)] fn _resource_rep(handle: u32) -> *mut u8 where @@ -16150,67 +18081,59 @@ pub mod exports { let _ = handle; unreachable!(); } - #[cfg(target_arch = "wasm32")] { #[link( wasm_import_module = "[export]fermyon:spin-wasi-virt/http-helper" )] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-rep]response-receiver"] fn rep(_: u32) -> *mut u8; } unsafe { rep(handle) } } } - fn get(&self) -> Option; } #[doc(hidden)] - - macro_rules! __export_fermyon_spin_wasi_virt_http_helper_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "fermyon:spin-wasi-virt/http-helper#[method]response-receiver.get"] - unsafe extern "C" fn export_method_response_receiver_get(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_response_receiver_get_cabi::<<$ty as $($path_to_types)*::Guest>::ResponseReceiver>(arg0) - } - #[export_name = "fermyon:spin-wasi-virt/http-helper#new-request"] - unsafe extern "C" fn export_new_request(arg0: i32,arg1: i32,arg2: i32,) -> i32 { - $($path_to_types)*::_export_new_request_cabi::<$ty>(arg0, arg1, arg2) - } - #[export_name = "fermyon:spin-wasi-virt/http-helper#new-response"] - unsafe extern "C" fn export_new_response() -> *mut u8 { - $($path_to_types)*::_export_new_response_cabi::<$ty>() - } - - const _: () = { - #[doc(hidden)] - #[export_name = "fermyon:spin-wasi-virt/http-helper#[dtor]response-receiver"] - #[allow(non_snake_case)] - unsafe extern "C" fn dtor(rep: *mut u8) { - $($path_to_types)*::ResponseReceiver::dtor::< - <$ty as $($path_to_types)*::Guest>::ResponseReceiver - >(rep) - } - }; - - };); -} + macro_rules! __export_fermyon_spin_wasi_virt_http_helper_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "fermyon:spin-wasi-virt/http-helper#[method]response-receiver.get")] + unsafe extern "C" fn export_method_response_receiver_get(arg0 : * + mut u8,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_response_receiver_get_cabi::<<$ty as + $($path_to_types)*:: Guest >::ResponseReceiver > (arg0) } } + #[unsafe (export_name = + "fermyon:spin-wasi-virt/http-helper#new-request")] unsafe extern + "C" fn export_new_request(arg0 : i32, arg1 : i32, arg2 : i32,) -> + i32 { unsafe { $($path_to_types)*:: + _export_new_request_cabi::<$ty > (arg0, arg1, arg2) } } #[unsafe + (export_name = + "fermyon:spin-wasi-virt/http-helper#new-response")] unsafe extern + "C" fn export_new_response() -> * mut u8 { unsafe { + $($path_to_types)*:: _export_new_response_cabi::<$ty > () } } + const _ : () = { #[doc(hidden)] #[unsafe (export_name = + "fermyon:spin-wasi-virt/http-helper#[dtor]response-receiver")] + #[allow(non_snake_case)] unsafe extern "C" fn dtor(rep : * mut + u8) { unsafe { $($path_to_types)*:: ResponseReceiver::dtor::< + <$ty as $($path_to_types)*:: Guest >::ResponseReceiver > (rep) } + } }; }; + }; + } #[doc(hidden)] pub(crate) use __export_fermyon_spin_wasi_virt_http_helper_cabi; #[repr(align(4))] struct _RetArea([::core::mem::MaybeUninit; 8]); - static mut _RET_AREA: _RetArea = _RetArea([::core::mem::MaybeUninit::uninit(); 8]); + static mut _RET_AREA: _RetArea = _RetArea( + [::core::mem::MaybeUninit::uninit(); 8], + ); } - - #[allow(dead_code, clippy::all)] + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod fs_handler { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; #[doc(hidden)] #[allow(non_snake_case)] @@ -16220,8 +18143,7 @@ pub mod exports { arg2: *mut u8, arg3: usize, ) { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg1; let bytes0 = _rt::Vec::from_raw_parts(arg0.cast(), len0, len0); let len1 = arg3; @@ -16231,45 +18153,39 @@ pub mod exports { ); } pub trait Guest { - fn add_file(path: _rt::String, contents: _rt::Vec); + fn add_file(path: _rt::String, contents: _rt::Vec) -> (); } #[doc(hidden)] - - macro_rules! __export_fermyon_spin_wasi_virt_fs_handler_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "fermyon:spin-wasi-virt/fs-handler#add-file"] - unsafe extern "C" fn export_add_file(arg0: *mut u8,arg1: usize,arg2: *mut u8,arg3: usize,) { - $($path_to_types)*::_export_add_file_cabi::<$ty>(arg0, arg1, arg2, arg3) - } - };); -} + macro_rules! __export_fermyon_spin_wasi_virt_fs_handler_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "fermyon:spin-wasi-virt/fs-handler#add-file")] unsafe extern "C" + fn export_add_file(arg0 : * mut u8, arg1 : usize, arg2 : * mut + u8, arg3 : usize,) { unsafe { $($path_to_types)*:: + _export_add_file_cabi::<$ty > (arg0, arg1, arg2, arg3) } } }; + }; + } #[doc(hidden)] pub(crate) use __export_fermyon_spin_wasi_virt_fs_handler_cabi; } } } - #[allow(dead_code)] pub mod wasi { - #[allow(dead_code)] pub mod cli { - #[allow(dead_code, clippy::all)] + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod stdout { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; - pub type OutputStream = - super::super::super::super::exports::wasi::io::streams::OutputStream; - pub type OutputStreamBorrow<'a> = - super::super::super::super::exports::wasi::io::streams::OutputStreamBorrow<'a>; + pub type OutputStream = super::super::super::super::exports::wasi::io::streams::OutputStream; + pub type OutputStreamBorrow<'a> = super::super::super::super::exports::wasi::io::streams::OutputStreamBorrow< + 'a, + >; #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_get_stdout_cabi() -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::get_stdout(); (result0).take_handle() as i32 } @@ -16277,37 +18193,31 @@ pub mod exports { fn get_stdout() -> OutputStream; } #[doc(hidden)] - - macro_rules! __export_wasi_cli_stdout_0_2_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "wasi:cli/stdout@0.2.0#get-stdout"] - unsafe extern "C" fn export_get_stdout() -> i32 { - $($path_to_types)*::_export_get_stdout_cabi::<$ty>() - } - };); - } + macro_rules! __export_wasi_cli_stdout_0_2_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "wasi:cli/stdout@0.2.0#get-stdout")] unsafe extern "C" fn + export_get_stdout() -> i32 { unsafe { $($path_to_types)*:: + _export_get_stdout_cabi::<$ty > () } } }; + }; + } #[doc(hidden)] pub(crate) use __export_wasi_cli_stdout_0_2_0_cabi; } - - #[allow(dead_code, clippy::all)] + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod stdin { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; - pub type InputStream = - super::super::super::super::exports::wasi::io::streams::InputStream; - pub type InputStreamBorrow<'a> = - super::super::super::super::exports::wasi::io::streams::InputStreamBorrow<'a>; + pub type InputStream = super::super::super::super::exports::wasi::io::streams::InputStream; + pub type InputStreamBorrow<'a> = super::super::super::super::exports::wasi::io::streams::InputStreamBorrow< + 'a, + >; #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_get_stdin_cabi() -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::get_stdin(); (result0).take_handle() as i32 } @@ -16315,37 +18225,31 @@ pub mod exports { fn get_stdin() -> InputStream; } #[doc(hidden)] - - macro_rules! __export_wasi_cli_stdin_0_2_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "wasi:cli/stdin@0.2.0#get-stdin"] - unsafe extern "C" fn export_get_stdin() -> i32 { - $($path_to_types)*::_export_get_stdin_cabi::<$ty>() - } - };); - } + macro_rules! __export_wasi_cli_stdin_0_2_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "wasi:cli/stdin@0.2.0#get-stdin")] unsafe extern "C" fn + export_get_stdin() -> i32 { unsafe { $($path_to_types)*:: + _export_get_stdin_cabi::<$ty > () } } }; + }; + } #[doc(hidden)] pub(crate) use __export_wasi_cli_stdin_0_2_0_cabi; } - - #[allow(dead_code, clippy::all)] + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod stderr { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; - pub type OutputStream = - super::super::super::super::exports::wasi::io::streams::OutputStream; - pub type OutputStreamBorrow<'a> = - super::super::super::super::exports::wasi::io::streams::OutputStreamBorrow<'a>; + pub type OutputStream = super::super::super::super::exports::wasi::io::streams::OutputStream; + pub type OutputStreamBorrow<'a> = super::super::super::super::exports::wasi::io::streams::OutputStreamBorrow< + 'a, + >; #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_get_stderr_cabi() -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::get_stderr(); (result0).take_handle() as i32 } @@ -16353,38 +18257,35 @@ pub mod exports { fn get_stderr() -> OutputStream; } #[doc(hidden)] - - macro_rules! __export_wasi_cli_stderr_0_2_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "wasi:cli/stderr@0.2.0#get-stderr"] - unsafe extern "C" fn export_get_stderr() -> i32 { - $($path_to_types)*::_export_get_stderr_cabi::<$ty>() - } - };); -} + macro_rules! __export_wasi_cli_stderr_0_2_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "wasi:cli/stderr@0.2.0#get-stderr")] unsafe extern "C" fn + export_get_stderr() -> i32 { unsafe { $($path_to_types)*:: + _export_get_stderr_cabi::<$ty > () } } }; + }; + } #[doc(hidden)] pub(crate) use __export_wasi_cli_stderr_0_2_0_cabi; } - - #[allow(dead_code, clippy::all)] + /// Terminal input. + /// + /// In the future, this may include functions for disabling echoing, + /// disabling input buffering so that keyboard events are sent through + /// immediately, querying supported features, and so on. + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod terminal_input { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; /// The input side of a terminal. - #[derive(Debug)] #[repr(transparent)] pub struct TerminalInput { handle: _rt::Resource, } - type _TerminalInputRep = Option; - impl TerminalInput { /// Creates a new resource from the specified representation. /// @@ -16394,77 +18295,72 @@ pub mod exports { pub fn new(val: T) -> Self { Self::type_guard::(); let val: _TerminalInputRep = Some(val); - let ptr: *mut _TerminalInputRep = _rt::Box::into_raw(_rt::Box::new(val)); + let ptr: *mut _TerminalInputRep = _rt::Box::into_raw( + _rt::Box::new(val), + ); unsafe { Self::from_handle(T::_resource_new(ptr.cast())) } } - /// Gets access to the underlying `T` which represents this resource. pub fn get(&self) -> &T { let ptr = unsafe { &*self.as_ptr::() }; ptr.as_ref().unwrap() } - /// Gets mutable access to the underlying `T` which represents this /// resource. pub fn get_mut(&mut self) -> &mut T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_mut().unwrap() } - /// Consumes this resource and returns the underlying `T`. pub fn into_inner(self) -> T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.take().unwrap() } - #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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) } - - // It's theoretically possible to implement the `GuestTerminalInput` trait twice - // so guard against using it with two different types here. #[doc(hidden)] fn type_guard() { use core::any::TypeId; static mut LAST_TYPE: Option = None; unsafe { - assert!(!cfg!(target_feature = "threads")); + assert!(! cfg!(target_feature = "atomics")); let id = TypeId::of::(); match LAST_TYPE { - Some(ty) => assert!( - ty == id, - "cannot use two types with this resource type" - ), + Some(ty) => { + assert!( + ty == id, "cannot use two types with this resource type" + ) + } None => LAST_TYPE = Some(id), } } } - #[doc(hidden)] pub unsafe fn dtor(handle: *mut u8) { Self::type_guard::(); - let _ = _rt::Box::from_raw(handle as *mut _TerminalInputRep); + let _ = unsafe { + _rt::Box::from_raw(handle as *mut _TerminalInputRep) + }; } - - fn as_ptr(&self) -> *mut _TerminalInputRep { + fn as_ptr( + &self, + ) -> *mut _TerminalInputRep { TerminalInput::type_guard::(); T::_resource_rep(self.handle()).cast() } } - /// A borrowed version of [`TerminalInput`] which represents a borrowed value /// with the lifetime `'a`. #[derive(Debug)] @@ -16473,7 +18369,6 @@ pub mod exports { rep: *mut u8, _marker: core::marker::PhantomData<&'a TerminalInput>, } - impl<'a> TerminalInputBorrow<'a> { #[doc(hidden)] pub unsafe fn lift(rep: usize) -> Self { @@ -16482,41 +18377,34 @@ pub mod exports { _marker: core::marker::PhantomData, } } - /// Gets access to the underlying `T` in this resource. pub fn get(&self) -> &T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_ref().unwrap() } - - // NB: mutable access is not allowed due to the component model allowing - // multiple borrows of the same resource. - fn as_ptr(&self) -> *mut _TerminalInputRep { TerminalInput::type_guard::(); self.rep.cast() } } - unsafe impl _rt::WasmResource for TerminalInput { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]wasi:cli/terminal-input@0.2.0")] - extern "C" { + #[link( + wasm_import_module = "[export]wasi:cli/terminal-input@0.2.0" + )] + unsafe extern "C" { #[link_name = "[resource-drop]terminal-input"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - pub trait Guest { type TerminalInput: GuestTerminalInput; } @@ -16531,18 +18419,18 @@ pub mod exports { let _ = val; unreachable!(); } - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]wasi:cli/terminal-input@0.2.0")] - extern "C" { + #[link( + wasm_import_module = "[export]wasi:cli/terminal-input@0.2.0" + )] + unsafe extern "C" { #[link_name = "[resource-new]terminal-input"] fn new(_: *mut u8) -> u32; } - new(val) + unsafe { new(val) } } } - #[doc(hidden)] fn _resource_rep(handle: u32) -> *mut u8 where @@ -16553,11 +18441,12 @@ pub mod exports { let _ = handle; unreachable!(); } - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]wasi:cli/terminal-input@0.2.0")] - extern "C" { + #[link( + wasm_import_module = "[export]wasi:cli/terminal-input@0.2.0" + )] + unsafe extern "C" { #[link_name = "[resource-rep]terminal-input"] fn rep(_: u32) -> *mut u8; } @@ -16566,46 +18455,37 @@ pub mod exports { } } #[doc(hidden)] - - macro_rules! __export_wasi_cli_terminal_input_0_2_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - - const _: () = { - #[doc(hidden)] - #[export_name = "wasi:cli/terminal-input@0.2.0#[dtor]terminal-input"] - #[allow(non_snake_case)] - unsafe extern "C" fn dtor(rep: *mut u8) { - $($path_to_types)*::TerminalInput::dtor::< - <$ty as $($path_to_types)*::Guest>::TerminalInput - >(rep) - } - }; - - };); - } + macro_rules! __export_wasi_cli_terminal_input_0_2_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { const _ : () = { #[doc(hidden)] #[unsafe + (export_name = + "wasi:cli/terminal-input@0.2.0#[dtor]terminal-input")] + #[allow(non_snake_case)] unsafe extern "C" fn dtor(rep : * mut + u8) { unsafe { $($path_to_types)*:: TerminalInput::dtor::< <$ty + as $($path_to_types)*:: Guest >::TerminalInput > (rep) } } }; }; + }; + } #[doc(hidden)] pub(crate) use __export_wasi_cli_terminal_input_0_2_0_cabi; } - - #[allow(dead_code, clippy::all)] + /// Terminal output. + /// + /// In the future, this may include functions for querying the terminal + /// size, being notified of terminal size changes, querying supported + /// features, and so on. + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod terminal_output { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; /// The output side of a terminal. - #[derive(Debug)] #[repr(transparent)] pub struct TerminalOutput { handle: _rt::Resource, } - type _TerminalOutputRep = Option; - impl TerminalOutput { /// Creates a new resource from the specified representation. /// @@ -16615,78 +18495,72 @@ pub mod exports { pub fn new(val: T) -> Self { Self::type_guard::(); let val: _TerminalOutputRep = Some(val); - let ptr: *mut _TerminalOutputRep = - _rt::Box::into_raw(_rt::Box::new(val)); + let ptr: *mut _TerminalOutputRep = _rt::Box::into_raw( + _rt::Box::new(val), + ); unsafe { Self::from_handle(T::_resource_new(ptr.cast())) } } - /// Gets access to the underlying `T` which represents this resource. pub fn get(&self) -> &T { let ptr = unsafe { &*self.as_ptr::() }; ptr.as_ref().unwrap() } - /// Gets mutable access to the underlying `T` which represents this /// resource. pub fn get_mut(&mut self) -> &mut T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_mut().unwrap() } - /// Consumes this resource and returns the underlying `T`. pub fn into_inner(self) -> T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.take().unwrap() } - #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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) } - - // It's theoretically possible to implement the `GuestTerminalOutput` trait twice - // so guard against using it with two different types here. #[doc(hidden)] fn type_guard() { use core::any::TypeId; static mut LAST_TYPE: Option = None; unsafe { - assert!(!cfg!(target_feature = "threads")); + assert!(! cfg!(target_feature = "atomics")); let id = TypeId::of::(); match LAST_TYPE { - Some(ty) => assert!( - ty == id, - "cannot use two types with this resource type" - ), + Some(ty) => { + assert!( + ty == id, "cannot use two types with this resource type" + ) + } None => LAST_TYPE = Some(id), } } } - #[doc(hidden)] pub unsafe fn dtor(handle: *mut u8) { Self::type_guard::(); - let _ = _rt::Box::from_raw(handle as *mut _TerminalOutputRep); + let _ = unsafe { + _rt::Box::from_raw(handle as *mut _TerminalOutputRep) + }; } - - fn as_ptr(&self) -> *mut _TerminalOutputRep { + fn as_ptr( + &self, + ) -> *mut _TerminalOutputRep { TerminalOutput::type_guard::(); T::_resource_rep(self.handle()).cast() } } - /// A borrowed version of [`TerminalOutput`] which represents a borrowed value /// with the lifetime `'a`. #[derive(Debug)] @@ -16695,7 +18569,6 @@ pub mod exports { rep: *mut u8, _marker: core::marker::PhantomData<&'a TerminalOutput>, } - impl<'a> TerminalOutputBorrow<'a> { #[doc(hidden)] pub unsafe fn lift(rep: usize) -> Self { @@ -16704,41 +18577,34 @@ pub mod exports { _marker: core::marker::PhantomData, } } - /// Gets access to the underlying `T` in this resource. pub fn get(&self) -> &T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_ref().unwrap() } - - // NB: mutable access is not allowed due to the component model allowing - // multiple borrows of the same resource. - fn as_ptr(&self) -> *mut _TerminalOutputRep { TerminalOutput::type_guard::(); self.rep.cast() } } - unsafe impl _rt::WasmResource for TerminalOutput { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]wasi:cli/terminal-output@0.2.0")] - extern "C" { + #[link( + wasm_import_module = "[export]wasi:cli/terminal-output@0.2.0" + )] + unsafe extern "C" { #[link_name = "[resource-drop]terminal-output"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - pub trait Guest { type TerminalOutput: GuestTerminalOutput; } @@ -16753,18 +18619,18 @@ pub mod exports { let _ = val; unreachable!(); } - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]wasi:cli/terminal-output@0.2.0")] - extern "C" { + #[link( + wasm_import_module = "[export]wasi:cli/terminal-output@0.2.0" + )] + unsafe extern "C" { #[link_name = "[resource-new]terminal-output"] fn new(_: *mut u8) -> u32; } - new(val) + unsafe { new(val) } } } - #[doc(hidden)] fn _resource_rep(handle: u32) -> *mut u8 where @@ -16775,11 +18641,12 @@ pub mod exports { let _ = handle; unreachable!(); } - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]wasi:cli/terminal-output@0.2.0")] - extern "C" { + #[link( + wasm_import_module = "[export]wasi:cli/terminal-output@0.2.0" + )] + unsafe extern "C" { #[link_name = "[resource-rep]terminal-output"] fn rep(_: u32) -> *mut u8; } @@ -16788,46 +18655,37 @@ pub mod exports { } } #[doc(hidden)] - - macro_rules! __export_wasi_cli_terminal_output_0_2_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - - const _: () = { - #[doc(hidden)] - #[export_name = "wasi:cli/terminal-output@0.2.0#[dtor]terminal-output"] - #[allow(non_snake_case)] - unsafe extern "C" fn dtor(rep: *mut u8) { - $($path_to_types)*::TerminalOutput::dtor::< - <$ty as $($path_to_types)*::Guest>::TerminalOutput - >(rep) - } - }; - - };); - } + macro_rules! __export_wasi_cli_terminal_output_0_2_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { const _ : () = { #[doc(hidden)] #[unsafe + (export_name = + "wasi:cli/terminal-output@0.2.0#[dtor]terminal-output")] + #[allow(non_snake_case)] unsafe extern "C" fn dtor(rep : * mut + u8) { unsafe { $($path_to_types)*:: TerminalOutput::dtor::< <$ty + as $($path_to_types)*:: Guest >::TerminalOutput > (rep) } } }; }; + }; + } #[doc(hidden)] pub(crate) use __export_wasi_cli_terminal_output_0_2_0_cabi; } - - #[allow(dead_code, clippy::all)] + /// An interface providing an optional `terminal-input` for stdin as a + /// link-time authority. + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod terminal_stdin { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; - pub type TerminalInput = - super::super::super::super::exports::wasi::cli::terminal_input::TerminalInput; - pub type TerminalInputBorrow<'a> = super::super::super::super::exports::wasi::cli::terminal_input::TerminalInputBorrow<'a>; + pub type TerminalInput = super::super::super::super::exports::wasi::cli::terminal_input::TerminalInput; + pub type TerminalInputBorrow<'a> = super::super::super::super::exports::wasi::cli::terminal_input::TerminalInputBorrow< + 'a, + >; #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_get_terminal_stdin_cabi() -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::get_terminal_stdin(); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Some(e) => { *ptr1.add(0).cast::() = (1i32) as u8; @@ -16845,41 +18703,41 @@ pub mod exports { fn get_terminal_stdin() -> Option; } #[doc(hidden)] - - macro_rules! __export_wasi_cli_terminal_stdin_0_2_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "wasi:cli/terminal-stdin@0.2.0#get-terminal-stdin"] - unsafe extern "C" fn export_get_terminal_stdin() -> *mut u8 { - $($path_to_types)*::_export_get_terminal_stdin_cabi::<$ty>() - } - };); -} + macro_rules! __export_wasi_cli_terminal_stdin_0_2_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "wasi:cli/terminal-stdin@0.2.0#get-terminal-stdin")] unsafe + extern "C" fn export_get_terminal_stdin() -> * mut u8 { unsafe { + $($path_to_types)*:: _export_get_terminal_stdin_cabi::<$ty > () } + } }; + }; + } #[doc(hidden)] pub(crate) use __export_wasi_cli_terminal_stdin_0_2_0_cabi; #[repr(align(4))] struct _RetArea([::core::mem::MaybeUninit; 8]); - static mut _RET_AREA: _RetArea = _RetArea([::core::mem::MaybeUninit::uninit(); 8]); + static mut _RET_AREA: _RetArea = _RetArea( + [::core::mem::MaybeUninit::uninit(); 8], + ); } - - #[allow(dead_code, clippy::all)] + /// An interface providing an optional `terminal-output` for stdout as a + /// link-time authority. + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod terminal_stdout { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; - pub type TerminalOutput = - super::super::super::super::exports::wasi::cli::terminal_output::TerminalOutput; - pub type TerminalOutputBorrow<'a> = super::super::super::super::exports::wasi::cli::terminal_output::TerminalOutputBorrow<'a>; + pub type TerminalOutput = super::super::super::super::exports::wasi::cli::terminal_output::TerminalOutput; + pub type TerminalOutputBorrow<'a> = super::super::super::super::exports::wasi::cli::terminal_output::TerminalOutputBorrow< + 'a, + >; #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_get_terminal_stdout_cabi() -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::get_terminal_stdout(); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Some(e) => { *ptr1.add(0).cast::() = (1i32) as u8; @@ -16897,41 +18755,41 @@ pub mod exports { fn get_terminal_stdout() -> Option; } #[doc(hidden)] - - macro_rules! __export_wasi_cli_terminal_stdout_0_2_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "wasi:cli/terminal-stdout@0.2.0#get-terminal-stdout"] - unsafe extern "C" fn export_get_terminal_stdout() -> *mut u8 { - $($path_to_types)*::_export_get_terminal_stdout_cabi::<$ty>() - } - };); -} + macro_rules! __export_wasi_cli_terminal_stdout_0_2_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "wasi:cli/terminal-stdout@0.2.0#get-terminal-stdout")] unsafe + extern "C" fn export_get_terminal_stdout() -> * mut u8 { unsafe { + $($path_to_types)*:: _export_get_terminal_stdout_cabi::<$ty > () + } } }; + }; + } #[doc(hidden)] pub(crate) use __export_wasi_cli_terminal_stdout_0_2_0_cabi; #[repr(align(4))] struct _RetArea([::core::mem::MaybeUninit; 8]); - static mut _RET_AREA: _RetArea = _RetArea([::core::mem::MaybeUninit::uninit(); 8]); + static mut _RET_AREA: _RetArea = _RetArea( + [::core::mem::MaybeUninit::uninit(); 8], + ); } - - #[allow(dead_code, clippy::all)] + /// An interface providing an optional `terminal-output` for stderr as a + /// link-time authority. + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod terminal_stderr { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; - pub type TerminalOutput = - super::super::super::super::exports::wasi::cli::terminal_output::TerminalOutput; - pub type TerminalOutputBorrow<'a> = super::super::super::super::exports::wasi::cli::terminal_output::TerminalOutputBorrow<'a>; + pub type TerminalOutput = super::super::super::super::exports::wasi::cli::terminal_output::TerminalOutput; + pub type TerminalOutputBorrow<'a> = super::super::super::super::exports::wasi::cli::terminal_output::TerminalOutputBorrow< + 'a, + >; #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_get_terminal_stderr_cabi() -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::get_terminal_stderr(); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Some(e) => { *ptr1.add(0).cast::() = (1i32) as u8; @@ -16949,41 +18807,41 @@ pub mod exports { fn get_terminal_stderr() -> Option; } #[doc(hidden)] - - macro_rules! __export_wasi_cli_terminal_stderr_0_2_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "wasi:cli/terminal-stderr@0.2.0#get-terminal-stderr"] - unsafe extern "C" fn export_get_terminal_stderr() -> *mut u8 { - $($path_to_types)*::_export_get_terminal_stderr_cabi::<$ty>() - } - };); -} + macro_rules! __export_wasi_cli_terminal_stderr_0_2_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "wasi:cli/terminal-stderr@0.2.0#get-terminal-stderr")] unsafe + extern "C" fn export_get_terminal_stderr() -> * mut u8 { unsafe { + $($path_to_types)*:: _export_get_terminal_stderr_cabi::<$ty > () + } } }; + }; + } #[doc(hidden)] pub(crate) use __export_wasi_cli_terminal_stderr_0_2_0_cabi; #[repr(align(4))] struct _RetArea([::core::mem::MaybeUninit; 8]); - static mut _RET_AREA: _RetArea = _RetArea([::core::mem::MaybeUninit::uninit(); 8]); + static mut _RET_AREA: _RetArea = _RetArea( + [::core::mem::MaybeUninit::uninit(); 8], + ); } - - #[allow(dead_code, clippy::all)] + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod environment { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_get_environment_cabi() -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::get_environment(); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); let vec5 = result0; let len5 = vec5.len(); - let layout5 = _rt::alloc::Layout::from_size_align_unchecked(vec5.len() * 16, 4); + let layout5 = _rt::alloc::Layout::from_size_align_unchecked( + vec5.len() * (4 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); let result5 = if layout5.size() != 0 { let ptr = _rt::alloc::alloc(layout5).cast::(); if ptr.is_null() { @@ -16991,62 +18849,82 @@ pub mod exports { } ptr } else { - { - ::core::ptr::null_mut() - } + ::core::ptr::null_mut() }; for (i, e) in vec5.into_iter().enumerate() { - let base = result5.add(i * 16); + let base = result5 + .add(i * (4 * ::core::mem::size_of::<*const u8>())); { let (t2_0, t2_1) = e; let vec3 = (t2_0.into_bytes()).into_boxed_slice(); let ptr3 = vec3.as_ptr().cast::(); let len3 = vec3.len(); ::core::mem::forget(vec3); - *base.add(4).cast::() = len3; + *base + .add(::core::mem::size_of::<*const u8>()) + .cast::() = len3; *base.add(0).cast::<*mut u8>() = ptr3.cast_mut(); let vec4 = (t2_1.into_bytes()).into_boxed_slice(); let ptr4 = vec4.as_ptr().cast::(); let len4 = vec4.len(); ::core::mem::forget(vec4); - *base.add(12).cast::() = len4; - *base.add(8).cast::<*mut u8>() = ptr4.cast_mut(); + *base + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len4; + *base + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr4.cast_mut(); } } - *ptr1.add(4).cast::() = len5; + *ptr1.add(::core::mem::size_of::<*const u8>()).cast::() = len5; *ptr1.add(0).cast::<*mut u8>() = result5; ptr1 } #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn __post_return_get_environment(arg0: *mut u8) { - let l4 = *arg0.add(0).cast::<*mut u8>(); - let l5 = *arg0.add(4).cast::(); - let base6 = l4; - let len6 = l5; + let l0 = *arg0.add(0).cast::<*mut u8>(); + let l1 = *arg0 + .add(::core::mem::size_of::<*const u8>()) + .cast::(); + let base6 = l0; + let len6 = l1; for i in 0..len6 { - let base = base6.add(i * 16); + let base = base6 + .add(i * (4 * ::core::mem::size_of::<*const u8>())); { - let l0 = *base.add(0).cast::<*mut u8>(); - let l1 = *base.add(4).cast::(); - _rt::cabi_dealloc(l0, l1, 1); - let l2 = *base.add(8).cast::<*mut u8>(); - let l3 = *base.add(12).cast::(); + let l2 = *base.add(0).cast::<*mut u8>(); + let l3 = *base + .add(::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l2, l3, 1); - } - } - _rt::cabi_dealloc(base6, len6 * 16, 4); + let l4 = *base + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l5 = *base + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + _rt::cabi_dealloc(l4, l5, 1); + } + } + _rt::cabi_dealloc( + base6, + len6 * (4 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); } #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_get_arguments_cabi() -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::get_arguments(); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); let vec3 = result0; let len3 = vec3.len(); - let layout3 = _rt::alloc::Layout::from_size_align_unchecked(vec3.len() * 8, 4); + let layout3 = _rt::alloc::Layout::from_size_align_unchecked( + vec3.len() * (2 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); let result3 = if layout3.size() != 0 { let ptr = _rt::alloc::alloc(layout3).cast::(); if ptr.is_null() { @@ -17054,49 +18932,58 @@ pub mod exports { } ptr } else { - { - ::core::ptr::null_mut() - } + ::core::ptr::null_mut() }; for (i, e) in vec3.into_iter().enumerate() { - let base = result3.add(i * 8); + let base = result3 + .add(i * (2 * ::core::mem::size_of::<*const u8>())); { let vec2 = (e.into_bytes()).into_boxed_slice(); let ptr2 = vec2.as_ptr().cast::(); let len2 = vec2.len(); ::core::mem::forget(vec2); - *base.add(4).cast::() = len2; + *base + .add(::core::mem::size_of::<*const u8>()) + .cast::() = len2; *base.add(0).cast::<*mut u8>() = ptr2.cast_mut(); } } - *ptr1.add(4).cast::() = len3; + *ptr1.add(::core::mem::size_of::<*const u8>()).cast::() = len3; *ptr1.add(0).cast::<*mut u8>() = result3; ptr1 } #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn __post_return_get_arguments(arg0: *mut u8) { - let l2 = *arg0.add(0).cast::<*mut u8>(); - let l3 = *arg0.add(4).cast::(); - let base4 = l2; - let len4 = l3; + let l0 = *arg0.add(0).cast::<*mut u8>(); + let l1 = *arg0 + .add(::core::mem::size_of::<*const u8>()) + .cast::(); + let base4 = l0; + let len4 = l1; for i in 0..len4 { - let base = base4.add(i * 8); + let base = base4 + .add(i * (2 * ::core::mem::size_of::<*const u8>())); { - let l0 = *base.add(0).cast::<*mut u8>(); - let l1 = *base.add(4).cast::(); - _rt::cabi_dealloc(l0, l1, 1); + let l2 = *base.add(0).cast::<*mut u8>(); + let l3 = *base + .add(::core::mem::size_of::<*const u8>()) + .cast::(); + _rt::cabi_dealloc(l2, l3, 1); } } - _rt::cabi_dealloc(base4, len4 * 8, 4); + _rt::cabi_dealloc( + base4, + len4 * (2 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); } #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_initial_cwd_cabi() -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::initial_cwd(); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Some(e) => { *ptr1.add(0).cast::() = (1i32) as u8; @@ -17104,8 +18991,12 @@ pub mod exports { let ptr2 = vec2.as_ptr().cast::(); let len2 = vec2.len(); ::core::mem::forget(vec2); - *ptr1.add(8).cast::() = len2; - *ptr1.add(4).cast::<*mut u8>() = ptr2.cast_mut(); + *ptr1 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len2; + *ptr1 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr2.cast_mut(); } None => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -17118,10 +19009,14 @@ pub mod exports { pub unsafe fn __post_return_initial_cwd(arg0: *mut u8) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { - 0 => (), + 0 => {} _ => { - let l1 = *arg0.add(4).cast::<*mut u8>(); - let l2 = *arg0.add(8).cast::(); + let l1 = *arg0 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l1, l2, 1); } } @@ -17138,105 +19033,115 @@ pub mod exports { fn get_environment() -> _rt::Vec<(_rt::String, _rt::String)>; /// Get the POSIX-style arguments to the program. fn get_arguments() -> _rt::Vec<_rt::String>; - /// Return a path that programs should use as their initial current working - /// directory, interpreting `.` as shorthand for this. - fn initial_cwd() -> Option<_rt::String>; - } - #[doc(hidden)] - - macro_rules! __export_wasi_cli_environment_0_2_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "wasi:cli/environment@0.2.0#get-environment"] - unsafe extern "C" fn export_get_environment() -> *mut u8 { - $($path_to_types)*::_export_get_environment_cabi::<$ty>() - } - #[export_name = "cabi_post_wasi:cli/environment@0.2.0#get-environment"] - unsafe extern "C" fn _post_return_get_environment(arg0: *mut u8,) { - $($path_to_types)*::__post_return_get_environment::<$ty>(arg0) - } - #[export_name = "wasi:cli/environment@0.2.0#get-arguments"] - unsafe extern "C" fn export_get_arguments() -> *mut u8 { - $($path_to_types)*::_export_get_arguments_cabi::<$ty>() - } - #[export_name = "cabi_post_wasi:cli/environment@0.2.0#get-arguments"] - unsafe extern "C" fn _post_return_get_arguments(arg0: *mut u8,) { - $($path_to_types)*::__post_return_get_arguments::<$ty>(arg0) - } - #[export_name = "wasi:cli/environment@0.2.0#initial-cwd"] - unsafe extern "C" fn export_initial_cwd() -> *mut u8 { - $($path_to_types)*::_export_initial_cwd_cabi::<$ty>() - } - #[export_name = "cabi_post_wasi:cli/environment@0.2.0#initial-cwd"] - unsafe extern "C" fn _post_return_initial_cwd(arg0: *mut u8,) { - $($path_to_types)*::__post_return_initial_cwd::<$ty>(arg0) - } - };); -} + /// Return a path that programs should use as their initial current working + /// directory, interpreting `.` as shorthand for this. + fn initial_cwd() -> Option<_rt::String>; + } + #[doc(hidden)] + macro_rules! __export_wasi_cli_environment_0_2_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "wasi:cli/environment@0.2.0#get-environment")] unsafe extern "C" + fn export_get_environment() -> * mut u8 { unsafe { + $($path_to_types)*:: _export_get_environment_cabi::<$ty > () } } + #[unsafe (export_name = + "cabi_post_wasi:cli/environment@0.2.0#get-environment")] unsafe + extern "C" fn _post_return_get_environment(arg0 : * mut u8,) { + unsafe { $($path_to_types)*:: __post_return_get_environment::<$ty + > (arg0) } } #[unsafe (export_name = + "wasi:cli/environment@0.2.0#get-arguments")] unsafe extern "C" fn + export_get_arguments() -> * mut u8 { unsafe { + $($path_to_types)*:: _export_get_arguments_cabi::<$ty > () } } + #[unsafe (export_name = + "cabi_post_wasi:cli/environment@0.2.0#get-arguments")] unsafe + extern "C" fn _post_return_get_arguments(arg0 : * mut u8,) { + unsafe { $($path_to_types)*:: __post_return_get_arguments::<$ty > + (arg0) } } #[unsafe (export_name = + "wasi:cli/environment@0.2.0#initial-cwd")] unsafe extern "C" fn + export_initial_cwd() -> * mut u8 { unsafe { $($path_to_types)*:: + _export_initial_cwd_cabi::<$ty > () } } #[unsafe (export_name = + "cabi_post_wasi:cli/environment@0.2.0#initial-cwd")] unsafe + extern "C" fn _post_return_initial_cwd(arg0 : * mut u8,) { unsafe + { $($path_to_types)*:: __post_return_initial_cwd::<$ty > (arg0) } + } }; + }; + } #[doc(hidden)] pub(crate) use __export_wasi_cli_environment_0_2_0_cabi; - #[repr(align(4))] - struct _RetArea([::core::mem::MaybeUninit; 12]); - static mut _RET_AREA: _RetArea = _RetArea([::core::mem::MaybeUninit::uninit(); 12]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct _RetArea( + [::core::mem::MaybeUninit< + u8, + >; 3 * ::core::mem::size_of::<*const u8>()], + ); + static mut _RET_AREA: _RetArea = _RetArea( + [::core::mem::MaybeUninit::uninit(); 3 + * ::core::mem::size_of::<*const u8>()], + ); } - - #[allow(dead_code, clippy::all)] + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod exit { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_exit_cabi(arg0: i32) { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - T::exit(match arg0 { - 0 => { - let e = (); - Ok(e) - } - 1 => { - let e = (); - Err(e) - } - _ => _rt::invalid_enum_discriminant(), - }); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + T::exit( + match arg0 { + 0 => { + let e = (); + Ok(e) + } + 1 => { + let e = (); + Err(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + ); } pub trait Guest { /// Exit the current instance and any linked instances. - fn exit(status: Result<(), ()>); + fn exit(status: Result<(), ()>) -> (); } #[doc(hidden)] - - macro_rules! __export_wasi_cli_exit_0_2_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "wasi:cli/exit@0.2.0#exit"] - unsafe extern "C" fn export_exit(arg0: i32,) { - $($path_to_types)*::_export_exit_cabi::<$ty>(arg0) - } - };); -} + macro_rules! __export_wasi_cli_exit_0_2_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "wasi:cli/exit@0.2.0#exit")] unsafe extern "C" fn + export_exit(arg0 : i32,) { unsafe { $($path_to_types)*:: + _export_exit_cabi::<$ty > (arg0) } } }; + }; + } #[doc(hidden)] pub(crate) use __export_wasi_cli_exit_0_2_0_cabi; } } - #[allow(dead_code)] pub mod clocks { - #[allow(dead_code, clippy::all)] + /// WASI Monotonic Clock is a clock API intended to let users measure elapsed + /// time. + /// + /// It is intended to be portable at least between Unix-family platforms and + /// Windows. + /// + /// A monotonic clock is a clock which has an unspecified initial value, and + /// successive reads of the clock will produce non-decreasing values. + /// + /// It is intended for measuring elapsed time. + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod monotonic_clock { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; pub type Pollable = super::super::super::super::exports::wasi::io::poll::Pollable; - pub type PollableBorrow<'a> = - super::super::super::super::exports::wasi::io::poll::PollableBorrow<'a>; + pub type PollableBorrow<'a> = super::super::super::super::exports::wasi::io::poll::PollableBorrow< + 'a, + >; /// An instant in time, in nanoseconds. An instant is relative to an /// unspecified initial value, and can only be compared to instances from /// the same monotonic-clock. @@ -17246,32 +19151,32 @@ pub mod exports { #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_now_cabi() -> i64 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::now(); _rt::as_i64(result0) } #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_resolution_cabi() -> i64 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::resolution(); _rt::as_i64(result0) } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_subscribe_instant_cabi(arg0: i64) -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + pub unsafe fn _export_subscribe_instant_cabi( + arg0: i64, + ) -> i32 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::subscribe_instant(arg0 as u64); (result0).take_handle() as i32 } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_subscribe_duration_cabi(arg0: i64) -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + pub unsafe fn _export_subscribe_duration_cabi( + arg0: i64, + ) -> i32 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::subscribe_duration(arg0 as u64); (result0).take_handle() as i32 } @@ -17293,39 +19198,48 @@ pub mod exports { fn subscribe_duration(when: Duration) -> Pollable; } #[doc(hidden)] - - macro_rules! __export_wasi_clocks_monotonic_clock_0_2_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "wasi:clocks/monotonic-clock@0.2.0#now"] - unsafe extern "C" fn export_now() -> i64 { - $($path_to_types)*::_export_now_cabi::<$ty>() - } - #[export_name = "wasi:clocks/monotonic-clock@0.2.0#resolution"] - unsafe extern "C" fn export_resolution() -> i64 { - $($path_to_types)*::_export_resolution_cabi::<$ty>() - } - #[export_name = "wasi:clocks/monotonic-clock@0.2.0#subscribe-instant"] - unsafe extern "C" fn export_subscribe_instant(arg0: i64,) -> i32 { - $($path_to_types)*::_export_subscribe_instant_cabi::<$ty>(arg0) - } - #[export_name = "wasi:clocks/monotonic-clock@0.2.0#subscribe-duration"] - unsafe extern "C" fn export_subscribe_duration(arg0: i64,) -> i32 { - $($path_to_types)*::_export_subscribe_duration_cabi::<$ty>(arg0) - } - };); -} + macro_rules! __export_wasi_clocks_monotonic_clock_0_2_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "wasi:clocks/monotonic-clock@0.2.0#now")] unsafe extern "C" fn + export_now() -> i64 { unsafe { $($path_to_types)*:: + _export_now_cabi::<$ty > () } } #[unsafe (export_name = + "wasi:clocks/monotonic-clock@0.2.0#resolution")] unsafe extern + "C" fn export_resolution() -> i64 { unsafe { $($path_to_types)*:: + _export_resolution_cabi::<$ty > () } } #[unsafe (export_name = + "wasi:clocks/monotonic-clock@0.2.0#subscribe-instant")] unsafe + extern "C" fn export_subscribe_instant(arg0 : i64,) -> i32 { + unsafe { $($path_to_types)*:: + _export_subscribe_instant_cabi::<$ty > (arg0) } } #[unsafe + (export_name = + "wasi:clocks/monotonic-clock@0.2.0#subscribe-duration")] unsafe + extern "C" fn export_subscribe_duration(arg0 : i64,) -> i32 { + unsafe { $($path_to_types)*:: + _export_subscribe_duration_cabi::<$ty > (arg0) } } }; + }; + } #[doc(hidden)] pub(crate) use __export_wasi_clocks_monotonic_clock_0_2_0_cabi; } - - #[allow(dead_code, clippy::all)] + /// WASI Wall Clock is a clock API intended to let users query the current + /// time. The name "wall" makes an analogy to a "clock on the wall", which + /// is not necessarily monotonic as it may be reset. + /// + /// It is intended to be portable at least between Unix-family platforms and + /// Windows. + /// + /// A wall clock is a clock which measures the date and time according to + /// some external reference. + /// + /// External references may be reset, so this clock is not necessarily + /// monotonic, making it unsuitable for measuring elapsed time. + /// + /// It is intended for reporting the current date and time for humans. + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod wall_clock { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; /// A time and date in seconds plus nanoseconds. #[repr(C)] @@ -17335,7 +19249,10 @@ pub mod exports { pub nanoseconds: u32, } impl ::core::fmt::Debug for Datetime { - 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("Datetime") .field("seconds", &self.seconds) .field("nanoseconds", &self.nanoseconds) @@ -17345,14 +19262,10 @@ pub mod exports { #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_now_cabi() -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::now(); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); - let Datetime { - seconds: seconds2, - nanoseconds: nanoseconds2, - } = result0; + let ptr1 = (&raw mut _RET_AREA.0).cast::(); + let Datetime { seconds: seconds2, nanoseconds: nanoseconds2 } = result0; *ptr1.add(0).cast::() = _rt::as_i64(seconds2); *ptr1.add(8).cast::() = _rt::as_i32(nanoseconds2); ptr1 @@ -17360,14 +19273,10 @@ pub mod exports { #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_resolution_cabi() -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::resolution(); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); - let Datetime { - seconds: seconds2, - nanoseconds: nanoseconds2, - } = result0; + let ptr1 = (&raw mut _RET_AREA.0).cast::(); + let Datetime { seconds: seconds2, nanoseconds: nanoseconds2 } = result0; *ptr1.add(0).cast::() = _rt::as_i64(seconds2); *ptr1.add(8).cast::() = _rt::as_i32(nanoseconds2); ptr1 @@ -17393,57 +19302,77 @@ pub mod exports { fn resolution() -> Datetime; } #[doc(hidden)] - - macro_rules! __export_wasi_clocks_wall_clock_0_2_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "wasi:clocks/wall-clock@0.2.0#now"] - unsafe extern "C" fn export_now() -> *mut u8 { - $($path_to_types)*::_export_now_cabi::<$ty>() - } - #[export_name = "wasi:clocks/wall-clock@0.2.0#resolution"] - unsafe extern "C" fn export_resolution() -> *mut u8 { - $($path_to_types)*::_export_resolution_cabi::<$ty>() - } - };); -} + macro_rules! __export_wasi_clocks_wall_clock_0_2_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "wasi:clocks/wall-clock@0.2.0#now")] unsafe extern "C" fn + export_now() -> * mut u8 { unsafe { $($path_to_types)*:: + _export_now_cabi::<$ty > () } } #[unsafe (export_name = + "wasi:clocks/wall-clock@0.2.0#resolution")] unsafe extern "C" fn + export_resolution() -> * mut u8 { unsafe { $($path_to_types)*:: + _export_resolution_cabi::<$ty > () } } }; + }; + } #[doc(hidden)] pub(crate) use __export_wasi_clocks_wall_clock_0_2_0_cabi; #[repr(align(8))] struct _RetArea([::core::mem::MaybeUninit; 16]); - static mut _RET_AREA: _RetArea = _RetArea([::core::mem::MaybeUninit::uninit(); 16]); + static mut _RET_AREA: _RetArea = _RetArea( + [::core::mem::MaybeUninit::uninit(); 16], + ); } } - #[allow(dead_code)] pub mod filesystem { - #[allow(dead_code, clippy::all)] + /// WASI filesystem is a filesystem API primarily intended to let users run WASI + /// programs that access their files on their existing filesystems, without + /// significant overhead. + /// + /// It is intended to be roughly portable between Unix-family platforms and + /// Windows, though it does not hide many of the major differences. + /// + /// Paths are passed as interface-type `string`s, meaning they must consist of + /// a sequence of Unicode Scalar Values (USVs). Some filesystems may contain + /// paths which are not accessible by this API. + /// + /// The directory separator in WASI is always the forward-slash (`/`). + /// + /// All paths in WASI are relative paths, and are interpreted relative to a + /// `descriptor` referring to a base directory. If a `path` argument to any WASI + /// function starts with `/`, or if any step of resolving a `path`, including + /// `..` and symbolic link steps, reaches a directory outside of the base + /// directory, or reaches a symlink to an absolute or rooted path in the + /// underlying filesystem, the function fails with `error-code::not-permitted`. + /// + /// For more information about WASI path resolution and sandboxing, see + /// [WASI filesystem path resolution]. + /// + /// [WASI filesystem path resolution]: https://github.com/WebAssembly/wasi-filesystem/blob/main/path-resolution.md + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod types { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; - pub type InputStream = - super::super::super::super::exports::wasi::io::streams::InputStream; - pub type InputStreamBorrow<'a> = - super::super::super::super::exports::wasi::io::streams::InputStreamBorrow<'a>; - pub type OutputStream = - super::super::super::super::exports::wasi::io::streams::OutputStream; - pub type OutputStreamBorrow<'a> = - super::super::super::super::exports::wasi::io::streams::OutputStreamBorrow<'a>; + pub type InputStream = super::super::super::super::exports::wasi::io::streams::InputStream; + pub type InputStreamBorrow<'a> = super::super::super::super::exports::wasi::io::streams::InputStreamBorrow< + 'a, + >; + pub type OutputStream = super::super::super::super::exports::wasi::io::streams::OutputStream; + pub type OutputStreamBorrow<'a> = super::super::super::super::exports::wasi::io::streams::OutputStreamBorrow< + 'a, + >; pub type Error = super::super::super::super::exports::wasi::io::streams::Error; - pub type ErrorBorrow<'a> = - super::super::super::super::exports::wasi::io::streams::ErrorBorrow<'a>; - pub type Datetime = - super::super::super::super::exports::wasi::clocks::wall_clock::Datetime; + pub type ErrorBorrow<'a> = super::super::super::super::exports::wasi::io::streams::ErrorBorrow< + 'a, + >; + pub type Datetime = super::super::super::super::exports::wasi::clocks::wall_clock::Datetime; /// File size or length of a region within a file. pub type Filesize = u64; /// The type of a filesystem object referenced by a descriptor. /// /// Note: This was called `filetype` in earlier versions of WASI. #[repr(u8)] - #[derive(Clone, Copy, Eq, PartialEq)] + #[derive(Clone, Copy, Eq, Ord, PartialEq, PartialOrd)] pub enum DescriptorType { /// The type of the descriptor or file is unknown or is different from /// any of the other types specified. @@ -17464,7 +19393,10 @@ pub mod exports { Socket, } impl ::core::fmt::Debug for DescriptorType { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { DescriptorType::Unknown => { f.debug_tuple("DescriptorType::Unknown").finish() @@ -17478,7 +19410,9 @@ pub mod exports { DescriptorType::Directory => { f.debug_tuple("DescriptorType::Directory").finish() } - DescriptorType::Fifo => f.debug_tuple("DescriptorType::Fifo").finish(), + DescriptorType::Fifo => { + f.debug_tuple("DescriptorType::Fifo").finish() + } DescriptorType::SymbolicLink => { f.debug_tuple("DescriptorType::SymbolicLink").finish() } @@ -17491,14 +19425,12 @@ pub mod exports { } } } - impl DescriptorType { #[doc(hidden)] pub unsafe fn _lift(val: u8) -> DescriptorType { if !cfg!(debug_assertions) { return ::core::mem::transmute(val); } - match val { 0 => DescriptorType::Unknown, 1 => DescriptorType::BlockDevice, @@ -17508,79 +19440,75 @@ pub mod exports { 5 => DescriptorType::SymbolicLink, 6 => DescriptorType::RegularFile, 7 => DescriptorType::Socket, - _ => panic!("invalid enum discriminant"), } } } - wit_bindgen_rt::bitflags::bitflags! { - /// Descriptor flags. - /// - /// Note: This was called `fdflags` in earlier versions of WASI. - #[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)] - pub struct DescriptorFlags: u8 { - /// Read mode: Data can be read. - const READ = 1 << 0; - /// Write mode: Data can be written to. - const WRITE = 1 << 1; - /// Request that writes be performed according to synchronized I/O file - /// integrity completion. The data stored in the file and the file's - /// metadata are synchronized. This is similar to `O_SYNC` in POSIX. - /// - /// The precise semantics of this operation have not yet been defined for - /// WASI. At this time, it should be interpreted as a request, and not a - /// requirement. - const FILE_INTEGRITY_SYNC = 1 << 2; - /// Request that writes be performed according to synchronized I/O data - /// integrity completion. Only the data stored in the file is - /// synchronized. This is similar to `O_DSYNC` in POSIX. - /// - /// The precise semantics of this operation have not yet been defined for - /// WASI. At this time, it should be interpreted as a request, and not a - /// requirement. - const DATA_INTEGRITY_SYNC = 1 << 3; - /// Requests that reads be performed at the same level of integrety - /// requested for writes. This is similar to `O_RSYNC` in POSIX. - /// - /// The precise semantics of this operation have not yet been defined for - /// WASI. At this time, it should be interpreted as a request, and not a - /// requirement. - const REQUESTED_WRITE_SYNC = 1 << 4; - /// Mutating directories mode: Directory contents may be mutated. - /// - /// When this flag is unset on a descriptor, operations using the - /// descriptor which would create, rename, delete, modify the data or - /// metadata of filesystem objects, or obtain another handle which - /// would permit any of those, shall fail with `error-code::read-only` if - /// they would otherwise succeed. - /// - /// This may only be set on directories. - const MUTATE_DIRECTORY = 1 << 5; - } + #[doc = " Descriptor flags."] #[doc = ""] #[doc = + " Note: This was called `fdflags` in earlier versions of WASI."] + #[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)] + pub struct DescriptorFlags : u8 { #[doc = + " Read mode: Data can be read."] const READ = 1 << 0; #[doc = + " Write mode: Data can be written to."] const WRITE = 1 << 1; #[doc = + " Request that writes be performed according to synchronized I/O file"] + #[doc = + " integrity completion. The data stored in the file and the file's"] + #[doc = + " metadata are synchronized. This is similar to `O_SYNC` in POSIX."] + #[doc = ""] #[doc = + " The precise semantics of this operation have not yet been defined for"] + #[doc = + " WASI. At this time, it should be interpreted as a request, and not a"] + #[doc = " requirement."] const FILE_INTEGRITY_SYNC = 1 << 2; #[doc = + " Request that writes be performed according to synchronized I/O data"] + #[doc = " integrity completion. Only the data stored in the file is"] + #[doc = " synchronized. This is similar to `O_DSYNC` in POSIX."] + #[doc = ""] #[doc = + " The precise semantics of this operation have not yet been defined for"] + #[doc = + " WASI. At this time, it should be interpreted as a request, and not a"] + #[doc = " requirement."] const DATA_INTEGRITY_SYNC = 1 << 3; #[doc = + " Requests that reads be performed at the same level of integrety"] + #[doc = + " requested for writes. This is similar to `O_RSYNC` in POSIX."] + #[doc = ""] #[doc = + " The precise semantics of this operation have not yet been defined for"] + #[doc = + " WASI. At this time, it should be interpreted as a request, and not a"] + #[doc = " requirement."] const REQUESTED_WRITE_SYNC = 1 << 4; #[doc = + " Mutating directories mode: Directory contents may be mutated."] + #[doc = ""] #[doc = + " When this flag is unset on a descriptor, operations using the"] + #[doc = + " descriptor which would create, rename, delete, modify the data or"] + #[doc = + " metadata of filesystem objects, or obtain another handle which"] + #[doc = + " would permit any of those, shall fail with `error-code::read-only` if"] + #[doc = " they would otherwise succeed."] #[doc = ""] #[doc = + " This may only be set on directories."] const MUTATE_DIRECTORY = 1 + << 5; } } wit_bindgen_rt::bitflags::bitflags! { - /// Flags determining the method of how paths are resolved. - #[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)] - pub struct PathFlags: u8 { - /// As long as the resolved path corresponds to a symbolic link, it is - /// expanded. - const SYMLINK_FOLLOW = 1 << 0; - } + #[doc = " Flags determining the method of how paths are resolved."] + #[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)] + pub struct PathFlags : u8 { #[doc = + " As long as the resolved path corresponds to a symbolic link, it is"] + #[doc = " expanded."] const SYMLINK_FOLLOW = 1 << 0; } } wit_bindgen_rt::bitflags::bitflags! { - /// Open flags used by `open-at`. - #[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)] - pub struct OpenFlags: u8 { - /// Create file if it does not exist, similar to `O_CREAT` in POSIX. - const CREATE = 1 << 0; - /// Fail if not a directory, similar to `O_DIRECTORY` in POSIX. - const DIRECTORY = 1 << 1; - /// Fail if file already exists, similar to `O_EXCL` in POSIX. - const EXCLUSIVE = 1 << 2; - /// Truncate file to size 0, similar to `O_TRUNC` in POSIX. - const TRUNCATE = 1 << 3; - } + #[doc = " Open flags used by `open-at`."] #[derive(PartialEq, Eq, + PartialOrd, Ord, Hash, Debug, Clone, Copy)] pub struct OpenFlags : u8 + { #[doc = + " Create file if it does not exist, similar to `O_CREAT` in POSIX."] + const CREATE = 1 << 0; #[doc = + " Fail if not a directory, similar to `O_DIRECTORY` in POSIX."] const + DIRECTORY = 1 << 1; #[doc = + " Fail if file already exists, similar to `O_EXCL` in POSIX."] const + EXCLUSIVE = 1 << 2; #[doc = + " Truncate file to size 0, similar to `O_TRUNC` in POSIX."] const + TRUNCATE = 1 << 3; } } /// Number of hard links to an inode. pub type LinkCount = u64; @@ -17614,7 +19542,10 @@ pub mod exports { pub status_change_timestamp: Option, } impl ::core::fmt::Debug for DescriptorStat { - 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("DescriptorStat") .field("type", &self.type_) .field("link-count", &self.link_count) @@ -17624,7 +19555,10 @@ pub mod exports { "data-modification-timestamp", &self.data_modification_timestamp, ) - .field("status-change-timestamp", &self.status_change_timestamp) + .field( + "status-change-timestamp", + &self.status_change_timestamp, + ) .finish() } } @@ -17640,12 +19574,17 @@ pub mod exports { Timestamp(Datetime), } impl ::core::fmt::Debug for NewTimestamp { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { NewTimestamp::NoChange => { f.debug_tuple("NewTimestamp::NoChange").finish() } - NewTimestamp::Now => f.debug_tuple("NewTimestamp::Now").finish(), + NewTimestamp::Now => { + f.debug_tuple("NewTimestamp::Now").finish() + } NewTimestamp::Timestamp(e) => { f.debug_tuple("NewTimestamp::Timestamp").field(e).finish() } @@ -17661,7 +19600,10 @@ pub mod exports { pub name: _rt::String, } impl ::core::fmt::Debug for DirectoryEntry { - 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("DirectoryEntry") .field("type", &self.type_) .field("name", &self.name) @@ -17673,7 +19615,7 @@ pub mod exports { /// API; some are used in higher-level library layers, and others are provided /// merely for alignment with POSIX. #[repr(u8)] - #[derive(Clone, Copy, Eq, PartialEq)] + #[derive(Clone, Copy, Eq, Ord, PartialEq, PartialOrd)] pub enum ErrorCode { /// Permission denied, similar to `EACCES` in POSIX. Access, @@ -17794,48 +19736,123 @@ pub mod exports { } pub fn message(&self) -> &'static str { match self { - ErrorCode::Access => "Permission denied, similar to `EACCES` in POSIX.", - ErrorCode::WouldBlock => "Resource unavailable, or operation would block, similar to `EAGAIN` and `EWOULDBLOCK` in POSIX.", - ErrorCode::Already => "Connection already in progress, similar to `EALREADY` in POSIX.", - ErrorCode::BadDescriptor => "Bad descriptor, similar to `EBADF` in POSIX.", - ErrorCode::Busy => "Device or resource busy, similar to `EBUSY` in POSIX.", - ErrorCode::Deadlock => "Resource deadlock would occur, similar to `EDEADLK` in POSIX.", - ErrorCode::Quota => "Storage quota exceeded, similar to `EDQUOT` in POSIX.", - ErrorCode::Exist => "File exists, similar to `EEXIST` in POSIX.", - ErrorCode::FileTooLarge => "File too large, similar to `EFBIG` in POSIX.", - ErrorCode::IllegalByteSequence => "Illegal byte sequence, similar to `EILSEQ` in POSIX.", - ErrorCode::InProgress => "Operation in progress, similar to `EINPROGRESS` in POSIX.", - ErrorCode::Interrupted => "Interrupted function, similar to `EINTR` in POSIX.", - ErrorCode::Invalid => "Invalid argument, similar to `EINVAL` in POSIX.", - ErrorCode::Io => "I/O error, similar to `EIO` in POSIX.", - ErrorCode::IsDirectory => "Is a directory, similar to `EISDIR` in POSIX.", - ErrorCode::Loop => "Too many levels of symbolic links, similar to `ELOOP` in POSIX.", - ErrorCode::TooManyLinks => "Too many links, similar to `EMLINK` in POSIX.", - ErrorCode::MessageSize => "Message too large, similar to `EMSGSIZE` in POSIX.", - ErrorCode::NameTooLong => "Filename too long, similar to `ENAMETOOLONG` in POSIX.", - ErrorCode::NoDevice => "No such device, similar to `ENODEV` in POSIX.", - ErrorCode::NoEntry => "No such file or directory, similar to `ENOENT` in POSIX.", - ErrorCode::NoLock => "No locks available, similar to `ENOLCK` in POSIX.", - ErrorCode::InsufficientMemory => "Not enough space, similar to `ENOMEM` in POSIX.", - ErrorCode::InsufficientSpace => "No space left on device, similar to `ENOSPC` in POSIX.", - ErrorCode::NotDirectory => "Not a directory or a symbolic link to a directory, similar to `ENOTDIR` in POSIX.", - ErrorCode::NotEmpty => "Directory not empty, similar to `ENOTEMPTY` in POSIX.", - ErrorCode::NotRecoverable => "State not recoverable, similar to `ENOTRECOVERABLE` in POSIX.", - ErrorCode::Unsupported => "Not supported, similar to `ENOTSUP` and `ENOSYS` in POSIX.", - ErrorCode::NoTty => "Inappropriate I/O control operation, similar to `ENOTTY` in POSIX.", - ErrorCode::NoSuchDevice => "No such device or address, similar to `ENXIO` in POSIX.", - ErrorCode::Overflow => "Value too large to be stored in data type, similar to `EOVERFLOW` in POSIX.", - ErrorCode::NotPermitted => "Operation not permitted, similar to `EPERM` in POSIX.", - ErrorCode::Pipe => "Broken pipe, similar to `EPIPE` in POSIX.", - ErrorCode::ReadOnly => "Read-only file system, similar to `EROFS` in POSIX.", - ErrorCode::InvalidSeek => "Invalid seek, similar to `ESPIPE` in POSIX.", - ErrorCode::TextFileBusy => "Text file busy, similar to `ETXTBSY` in POSIX.", - ErrorCode::CrossDevice => "Cross-device link, similar to `EXDEV` in POSIX.", - } + ErrorCode::Access => { + "Permission denied, similar to `EACCES` in POSIX." + } + ErrorCode::WouldBlock => { + "Resource unavailable, or operation would block, similar to `EAGAIN` and `EWOULDBLOCK` in POSIX." + } + ErrorCode::Already => { + "Connection already in progress, similar to `EALREADY` in POSIX." + } + ErrorCode::BadDescriptor => { + "Bad descriptor, similar to `EBADF` in POSIX." + } + ErrorCode::Busy => { + "Device or resource busy, similar to `EBUSY` in POSIX." + } + ErrorCode::Deadlock => { + "Resource deadlock would occur, similar to `EDEADLK` in POSIX." + } + ErrorCode::Quota => { + "Storage quota exceeded, similar to `EDQUOT` in POSIX." + } + ErrorCode::Exist => { + "File exists, similar to `EEXIST` in POSIX." + } + ErrorCode::FileTooLarge => { + "File too large, similar to `EFBIG` in POSIX." + } + ErrorCode::IllegalByteSequence => { + "Illegal byte sequence, similar to `EILSEQ` in POSIX." + } + ErrorCode::InProgress => { + "Operation in progress, similar to `EINPROGRESS` in POSIX." + } + ErrorCode::Interrupted => { + "Interrupted function, similar to `EINTR` in POSIX." + } + ErrorCode::Invalid => { + "Invalid argument, similar to `EINVAL` in POSIX." + } + ErrorCode::Io => "I/O error, similar to `EIO` in POSIX.", + ErrorCode::IsDirectory => { + "Is a directory, similar to `EISDIR` in POSIX." + } + ErrorCode::Loop => { + "Too many levels of symbolic links, similar to `ELOOP` in POSIX." + } + ErrorCode::TooManyLinks => { + "Too many links, similar to `EMLINK` in POSIX." + } + ErrorCode::MessageSize => { + "Message too large, similar to `EMSGSIZE` in POSIX." + } + ErrorCode::NameTooLong => { + "Filename too long, similar to `ENAMETOOLONG` in POSIX." + } + ErrorCode::NoDevice => { + "No such device, similar to `ENODEV` in POSIX." + } + ErrorCode::NoEntry => { + "No such file or directory, similar to `ENOENT` in POSIX." + } + ErrorCode::NoLock => { + "No locks available, similar to `ENOLCK` in POSIX." + } + ErrorCode::InsufficientMemory => { + "Not enough space, similar to `ENOMEM` in POSIX." + } + ErrorCode::InsufficientSpace => { + "No space left on device, similar to `ENOSPC` in POSIX." + } + ErrorCode::NotDirectory => { + "Not a directory or a symbolic link to a directory, similar to `ENOTDIR` in POSIX." + } + ErrorCode::NotEmpty => { + "Directory not empty, similar to `ENOTEMPTY` in POSIX." + } + ErrorCode::NotRecoverable => { + "State not recoverable, similar to `ENOTRECOVERABLE` in POSIX." + } + ErrorCode::Unsupported => { + "Not supported, similar to `ENOTSUP` and `ENOSYS` in POSIX." + } + ErrorCode::NoTty => { + "Inappropriate I/O control operation, similar to `ENOTTY` in POSIX." + } + ErrorCode::NoSuchDevice => { + "No such device or address, similar to `ENXIO` in POSIX." + } + ErrorCode::Overflow => { + "Value too large to be stored in data type, similar to `EOVERFLOW` in POSIX." + } + ErrorCode::NotPermitted => { + "Operation not permitted, similar to `EPERM` in POSIX." + } + ErrorCode::Pipe => { + "Broken pipe, similar to `EPIPE` in POSIX." + } + ErrorCode::ReadOnly => { + "Read-only file system, similar to `EROFS` in POSIX." + } + ErrorCode::InvalidSeek => { + "Invalid seek, similar to `ESPIPE` in POSIX." + } + ErrorCode::TextFileBusy => { + "Text file busy, similar to `ETXTBSY` in POSIX." + } + ErrorCode::CrossDevice => { + "Cross-device link, similar to `EXDEV` in POSIX." + } + } } } impl ::core::fmt::Debug for ErrorCode { - 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("ErrorCode") .field("code", &(*self as i32)) .field("name", &self.name()) @@ -17844,20 +19861,20 @@ pub mod exports { } } impl ::core::fmt::Display for ErrorCode { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - write!(f, "{} (error {})", self.name(), *self as i32) + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { + write!(f, "{} (error {})", self.name(), * self as i32) } } - impl std::error::Error for ErrorCode {} - impl ErrorCode { #[doc(hidden)] pub unsafe fn _lift(val: u8) -> ErrorCode { if !cfg!(debug_assertions) { return ::core::mem::transmute(val); } - match val { 0 => ErrorCode::Access, 1 => ErrorCode::WouldBlock, @@ -17896,15 +19913,13 @@ pub mod exports { 34 => ErrorCode::InvalidSeek, 35 => ErrorCode::TextFileBusy, 36 => ErrorCode::CrossDevice, - _ => panic!("invalid enum discriminant"), } } } - /// File or memory access pattern advisory information. #[repr(u8)] - #[derive(Clone, Copy, Eq, PartialEq)] + #[derive(Clone, Copy, Eq, Ord, PartialEq, PartialOrd)] pub enum Advice { /// The application has no advice to give on its behavior with respect /// to the specified data. @@ -17926,25 +19941,32 @@ pub mod exports { NoReuse, } impl ::core::fmt::Debug for Advice { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { Advice::Normal => f.debug_tuple("Advice::Normal").finish(), - Advice::Sequential => f.debug_tuple("Advice::Sequential").finish(), + Advice::Sequential => { + f.debug_tuple("Advice::Sequential").finish() + } Advice::Random => f.debug_tuple("Advice::Random").finish(), - Advice::WillNeed => f.debug_tuple("Advice::WillNeed").finish(), - Advice::DontNeed => f.debug_tuple("Advice::DontNeed").finish(), + Advice::WillNeed => { + f.debug_tuple("Advice::WillNeed").finish() + } + Advice::DontNeed => { + f.debug_tuple("Advice::DontNeed").finish() + } Advice::NoReuse => f.debug_tuple("Advice::NoReuse").finish(), } } } - impl Advice { #[doc(hidden)] pub unsafe fn _lift(val: u8) -> Advice { if !cfg!(debug_assertions) { return ::core::mem::transmute(val); } - match val { 0 => Advice::Normal, 1 => Advice::Sequential, @@ -17952,12 +19974,10 @@ pub mod exports { 3 => Advice::WillNeed, 4 => Advice::DontNeed, 5 => Advice::NoReuse, - _ => panic!("invalid enum discriminant"), } } } - /// A 128-bit hash value, split into parts because wasm doesn't have a /// 128-bit integer type. #[repr(C)] @@ -17969,7 +19989,10 @@ pub mod exports { pub upper: u64, } impl ::core::fmt::Debug for MetadataHashValue { - 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("MetadataHashValue") .field("lower", &self.lower) .field("upper", &self.upper) @@ -17979,15 +20002,12 @@ pub mod exports { /// A descriptor is a reference to a filesystem object, which may be a file, /// directory, named pipe, special file, or other object on which filesystem /// calls may be made. - #[derive(Debug)] #[repr(transparent)] pub struct Descriptor { handle: _rt::Resource, } - type _DescriptorRep = Option; - impl Descriptor { /// Creates a new resource from the specified representation. /// @@ -17997,77 +20017,70 @@ pub mod exports { pub fn new(val: T) -> Self { Self::type_guard::(); let val: _DescriptorRep = Some(val); - let ptr: *mut _DescriptorRep = _rt::Box::into_raw(_rt::Box::new(val)); + let ptr: *mut _DescriptorRep = _rt::Box::into_raw( + _rt::Box::new(val), + ); unsafe { Self::from_handle(T::_resource_new(ptr.cast())) } } - /// Gets access to the underlying `T` which represents this resource. pub fn get(&self) -> &T { let ptr = unsafe { &*self.as_ptr::() }; ptr.as_ref().unwrap() } - /// Gets mutable access to the underlying `T` which represents this /// resource. pub fn get_mut(&mut self) -> &mut T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_mut().unwrap() } - /// Consumes this resource and returns the underlying `T`. pub fn into_inner(self) -> T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.take().unwrap() } - #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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) } - - // It's theoretically possible to implement the `GuestDescriptor` trait twice - // so guard against using it with two different types here. #[doc(hidden)] fn type_guard() { use core::any::TypeId; static mut LAST_TYPE: Option = None; unsafe { - assert!(!cfg!(target_feature = "threads")); + assert!(! cfg!(target_feature = "atomics")); let id = TypeId::of::(); match LAST_TYPE { - Some(ty) => assert!( - ty == id, - "cannot use two types with this resource type" - ), + Some(ty) => { + assert!( + ty == id, "cannot use two types with this resource type" + ) + } None => LAST_TYPE = Some(id), } } } - #[doc(hidden)] pub unsafe fn dtor(handle: *mut u8) { Self::type_guard::(); - let _ = _rt::Box::from_raw(handle as *mut _DescriptorRep); + let _ = unsafe { + _rt::Box::from_raw(handle as *mut _DescriptorRep) + }; } - fn as_ptr(&self) -> *mut _DescriptorRep { Descriptor::type_guard::(); T::_resource_rep(self.handle()).cast() } } - /// A borrowed version of [`Descriptor`] which represents a borrowed value /// with the lifetime `'a`. #[derive(Debug)] @@ -18076,7 +20089,6 @@ pub mod exports { rep: *mut u8, _marker: core::marker::PhantomData<&'a Descriptor>, } - impl<'a> DescriptorBorrow<'a> { #[doc(hidden)] pub unsafe fn lift(rep: usize) -> Self { @@ -18085,51 +20097,41 @@ pub mod exports { _marker: core::marker::PhantomData, } } - /// Gets access to the underlying `T` in this resource. pub fn get(&self) -> &T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_ref().unwrap() } - - // NB: mutable access is not allowed due to the component model allowing - // multiple borrows of the same resource. - fn as_ptr(&self) -> *mut _DescriptorRep { Descriptor::type_guard::(); self.rep.cast() } } - unsafe impl _rt::WasmResource for Descriptor { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]wasi:filesystem/types@0.2.0")] - extern "C" { + #[link( + wasm_import_module = "[export]wasi:filesystem/types@0.2.0" + )] + unsafe extern "C" { #[link_name = "[resource-drop]descriptor"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - /// A stream of directory entries. - #[derive(Debug)] #[repr(transparent)] pub struct DirectoryEntryStream { handle: _rt::Resource, } - type _DirectoryEntryStreamRep = Option; - impl DirectoryEntryStream { /// Creates a new resource from the specified representation. /// @@ -18139,72 +20141,67 @@ pub mod exports { pub fn new(val: T) -> Self { Self::type_guard::(); let val: _DirectoryEntryStreamRep = Some(val); - let ptr: *mut _DirectoryEntryStreamRep = - _rt::Box::into_raw(_rt::Box::new(val)); + let ptr: *mut _DirectoryEntryStreamRep = _rt::Box::into_raw( + _rt::Box::new(val), + ); unsafe { Self::from_handle(T::_resource_new(ptr.cast())) } } - /// Gets access to the underlying `T` which represents this resource. pub fn get(&self) -> &T { let ptr = unsafe { &*self.as_ptr::() }; ptr.as_ref().unwrap() } - /// Gets mutable access to the underlying `T` which represents this /// resource. pub fn get_mut(&mut self) -> &mut T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_mut().unwrap() } - /// Consumes this resource and returns the underlying `T`. pub fn into_inner(self) -> T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.take().unwrap() } - #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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) } - - // It's theoretically possible to implement the `GuestDirectoryEntryStream` trait twice - // so guard against using it with two different types here. #[doc(hidden)] fn type_guard() { use core::any::TypeId; static mut LAST_TYPE: Option = None; unsafe { - assert!(!cfg!(target_feature = "threads")); + assert!(! cfg!(target_feature = "atomics")); let id = TypeId::of::(); match LAST_TYPE { - Some(ty) => assert!( - ty == id, - "cannot use two types with this resource type" - ), + Some(ty) => { + assert!( + ty == id, "cannot use two types with this resource type" + ) + } None => LAST_TYPE = Some(id), } } } - #[doc(hidden)] pub unsafe fn dtor(handle: *mut u8) { Self::type_guard::(); - let _ = _rt::Box::from_raw(handle as *mut _DirectoryEntryStreamRep); + let _ = unsafe { + _rt::Box::from_raw( + handle as *mut _DirectoryEntryStreamRep, + ) + }; } - fn as_ptr( &self, ) -> *mut _DirectoryEntryStreamRep { @@ -18212,7 +20209,6 @@ pub mod exports { T::_resource_rep(self.handle()).cast() } } - /// A borrowed version of [`DirectoryEntryStream`] which represents a borrowed value /// with the lifetime `'a`. #[derive(Debug)] @@ -18221,7 +20217,6 @@ pub mod exports { rep: *mut u8, _marker: core::marker::PhantomData<&'a DirectoryEntryStream>, } - impl<'a> DirectoryEntryStreamBorrow<'a> { #[doc(hidden)] pub unsafe fn lift(rep: usize) -> Self { @@ -18230,54 +20225,45 @@ pub mod exports { _marker: core::marker::PhantomData, } } - /// Gets access to the underlying `T` in this resource. pub fn get(&self) -> &T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_ref().unwrap() } - - // NB: mutable access is not allowed due to the component model allowing - // multiple borrows of the same resource. - fn as_ptr(&self) -> *mut _DirectoryEntryStreamRep { DirectoryEntryStream::type_guard::(); self.rep.cast() } } - unsafe impl _rt::WasmResource for DirectoryEntryStream { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]wasi:filesystem/types@0.2.0")] - extern "C" { + #[link( + wasm_import_module = "[export]wasi:filesystem/types@0.2.0" + )] + unsafe extern "C" { #[link_name = "[resource-drop]directory-entry-stream"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_descriptor_read_via_stream_cabi( - arg0: *mut u8, - arg1: i64, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + pub unsafe fn _export_method_descriptor_read_via_stream_cabi< + T: GuestDescriptor, + >(arg0: *mut u8, arg1: i64) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::read_via_stream( - DescriptorBorrow::lift(arg0 as u32 as usize).get(), + unsafe { DescriptorBorrow::lift(arg0 as u32 as usize) }.get(), arg1 as u64, ); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -18294,17 +20280,13 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_descriptor_write_via_stream_cabi< T: GuestDescriptor, - >( - arg0: *mut u8, - arg1: i64, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + >(arg0: *mut u8, arg1: i64) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::write_via_stream( - DescriptorBorrow::lift(arg0 as u32 as usize).get(), + unsafe { DescriptorBorrow::lift(arg0 as u32 as usize) }.get(), arg1 as u64, ); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -18321,14 +20303,12 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_descriptor_append_via_stream_cabi< T: GuestDescriptor, - >( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::append_via_stream(DescriptorBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::append_via_stream( + unsafe { DescriptorBorrow::lift(arg0 as u32 as usize) }.get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -18349,15 +20329,14 @@ pub mod exports { arg2: i64, arg3: i32, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::advise( - DescriptorBorrow::lift(arg0 as u32 as usize).get(), + unsafe { DescriptorBorrow::lift(arg0 as u32 as usize) }.get(), arg1 as u64, arg2 as u64, Advice::_lift(arg3 as u8), ); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(_) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -18371,13 +20350,14 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_descriptor_sync_data_cabi( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = T::sync_data(DescriptorBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + pub unsafe fn _export_method_descriptor_sync_data_cabi< + T: GuestDescriptor, + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::sync_data( + unsafe { DescriptorBorrow::lift(arg0 as u32 as usize) }.get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(_) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -18391,18 +20371,20 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_descriptor_get_flags_cabi( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = T::get_flags(DescriptorBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + pub unsafe fn _export_method_descriptor_get_flags_cabi< + T: GuestDescriptor, + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::get_flags( + unsafe { DescriptorBorrow::lift(arg0 as u32 as usize) }.get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; let flags2 = e; - *ptr1.add(1).cast::() = ((flags2.bits() >> 0) as i32) as u8; + *ptr1.add(1).cast::() = ((flags2.bits() >> 0) as i32) + as u8; } Err(e) => { *ptr1.add(0).cast::() = (1i32) as u8; @@ -18413,13 +20395,14 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_descriptor_get_type_cabi( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = T::get_type(DescriptorBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + pub unsafe fn _export_method_descriptor_get_type_cabi< + T: GuestDescriptor, + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::get_type( + unsafe { DescriptorBorrow::lift(arg0 as u32 as usize) }.get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -18434,17 +20417,15 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_descriptor_set_size_cabi( - arg0: *mut u8, - arg1: i64, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + pub unsafe fn _export_method_descriptor_set_size_cabi< + T: GuestDescriptor, + >(arg0: *mut u8, arg1: i64) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::set_size( - DescriptorBorrow::lift(arg0 as u32 as usize).get(), + unsafe { DescriptorBorrow::lift(arg0 as u32 as usize) }.get(), arg1 as u64, ); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(_) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -18458,7 +20439,9 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_descriptor_set_times_cabi( + pub unsafe fn _export_method_descriptor_set_times_cabi< + T: GuestDescriptor, + >( arg0: *mut u8, arg1: i32, arg2: i64, @@ -18467,17 +20450,16 @@ pub mod exports { arg5: i64, arg6: i32, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let v0 = match arg1 { 0 => NewTimestamp::NoChange, 1 => NewTimestamp::Now, n => { debug_assert_eq!(n, 2, "invalid enum discriminant"); - let e0 = super::super::super::super::exports::wasi::clocks::wall_clock::Datetime{ - seconds: arg2 as u64, - nanoseconds: arg3 as u32, - }; + let e0 = super::super::super::super::exports::wasi::clocks::wall_clock::Datetime { + seconds: arg2 as u64, + nanoseconds: arg3 as u32, + }; NewTimestamp::Timestamp(e0) } }; @@ -18486,16 +20468,19 @@ pub mod exports { 1 => NewTimestamp::Now, n => { debug_assert_eq!(n, 2, "invalid enum discriminant"); - let e1 = super::super::super::super::exports::wasi::clocks::wall_clock::Datetime{ - seconds: arg5 as u64, - nanoseconds: arg6 as u32, - }; + let e1 = super::super::super::super::exports::wasi::clocks::wall_clock::Datetime { + seconds: arg5 as u64, + nanoseconds: arg6 as u32, + }; NewTimestamp::Timestamp(e1) } }; - let result2 = - T::set_times(DescriptorBorrow::lift(arg0 as u32 as usize).get(), v0, v1); - let ptr3 = _RET_AREA.0.as_mut_ptr().cast::(); + let result2 = T::set_times( + unsafe { DescriptorBorrow::lift(arg0 as u32 as usize) }.get(), + v0, + v1, + ); + let ptr3 = (&raw mut _RET_AREA.0).cast::(); match result2 { Ok(_) => { *ptr3.add(0).cast::() = (0i32) as u8; @@ -18514,14 +20499,13 @@ pub mod exports { arg1: i64, arg2: i64, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::read( - DescriptorBorrow::lift(arg0 as u32 as usize).get(), + unsafe { DescriptorBorrow::lift(arg0 as u32 as usize) }.get(), arg1 as u64, arg2 as u64, ); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -18530,16 +20514,24 @@ pub mod exports { let ptr3 = vec3.as_ptr().cast::(); let len3 = vec3.len(); ::core::mem::forget(vec3); - *ptr1.add(8).cast::() = len3; - *ptr1.add(4).cast::<*mut u8>() = ptr3.cast_mut(); - *ptr1.add(12).cast::() = (match t2_1 { + *ptr1 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len3; + *ptr1 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr3.cast_mut(); + *ptr1 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (match t2_1 { true => 1, false => 0, }) as u8; } Err(e) => { *ptr1.add(0).cast::() = (1i32) as u8; - *ptr1.add(4).cast::() = (e.clone() as i32) as u8; + *ptr1 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (e.clone() as i32) as u8; } }; ptr1 @@ -18552,13 +20544,17 @@ pub mod exports { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { 0 => { - let l1 = *arg0.add(4).cast::<*mut u8>(); - let l2 = *arg0.add(8).cast::(); + let l1 = *arg0 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); let base3 = l1; let len3 = l2; _rt::cabi_dealloc(base3, len3 * 1, 1); } - _ => (), + _ => {} } } #[doc(hidden)] @@ -18569,15 +20565,14 @@ pub mod exports { arg2: usize, arg3: i64, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg2; let result1 = T::write( - DescriptorBorrow::lift(arg0 as u32 as usize).get(), + unsafe { DescriptorBorrow::lift(arg0 as u32 as usize) }.get(), _rt::Vec::from_raw_parts(arg1.cast(), len0, len0), arg3 as u64, ); - let ptr2 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr2 = (&raw mut _RET_AREA.0).cast::(); match result1 { Ok(e) => { *ptr2.add(0).cast::() = (0i32) as u8; @@ -18592,14 +20587,14 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_descriptor_read_directory_cabi( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::read_directory(DescriptorBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + pub unsafe fn _export_method_descriptor_read_directory_cabi< + T: GuestDescriptor, + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::read_directory( + unsafe { DescriptorBorrow::lift(arg0 as u32 as usize) }.get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -18617,10 +20612,11 @@ pub mod exports { pub unsafe fn _export_method_descriptor_sync_cabi( arg0: *mut u8, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = T::sync(DescriptorBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::sync( + unsafe { DescriptorBorrow::lift(arg0 as u32 as usize) }.get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(_) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -18636,20 +20632,15 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_descriptor_create_directory_at_cabi< T: GuestDescriptor, - >( - arg0: *mut u8, - arg1: *mut u8, - arg2: usize, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + >(arg0: *mut u8, arg1: *mut u8, arg2: usize) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg2; let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0); let result1 = T::create_directory_at( - DescriptorBorrow::lift(arg0 as u32 as usize).get(), + unsafe { DescriptorBorrow::lift(arg0 as u32 as usize) }.get(), _rt::string_lift(bytes0), ); - let ptr2 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr2 = (&raw mut _RET_AREA.0).cast::(); match result1 { Ok(_) => { *ptr2.add(0).cast::() = (0i32) as u8; @@ -18666,10 +20657,11 @@ pub mod exports { pub unsafe fn _export_method_descriptor_stat_cabi( arg0: *mut u8, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = T::stat(DescriptorBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::stat( + unsafe { DescriptorBorrow::lift(arg0 as u32 as usize) }.get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -18687,7 +20679,10 @@ pub mod exports { match data_access_timestamp2 { Some(e) => { *ptr1.add(32).cast::() = (1i32) as u8; - let super::super::super::super::exports::wasi::clocks::wall_clock::Datetime{ seconds:seconds3, nanoseconds:nanoseconds3, } = e; + let super::super::super::super::exports::wasi::clocks::wall_clock::Datetime { + seconds: seconds3, + nanoseconds: nanoseconds3, + } = e; *ptr1.add(40).cast::() = _rt::as_i64(seconds3); *ptr1.add(48).cast::() = _rt::as_i32(nanoseconds3); } @@ -18698,7 +20693,10 @@ pub mod exports { match data_modification_timestamp2 { Some(e) => { *ptr1.add(56).cast::() = (1i32) as u8; - let super::super::super::super::exports::wasi::clocks::wall_clock::Datetime{ seconds:seconds4, nanoseconds:nanoseconds4, } = e; + let super::super::super::super::exports::wasi::clocks::wall_clock::Datetime { + seconds: seconds4, + nanoseconds: nanoseconds4, + } = e; *ptr1.add(64).cast::() = _rt::as_i64(seconds4); *ptr1.add(72).cast::() = _rt::as_i32(nanoseconds4); } @@ -18709,7 +20707,10 @@ pub mod exports { match status_change_timestamp2 { Some(e) => { *ptr1.add(80).cast::() = (1i32) as u8; - let super::super::super::super::exports::wasi::clocks::wall_clock::Datetime{ seconds:seconds5, nanoseconds:nanoseconds5, } = e; + let super::super::super::super::exports::wasi::clocks::wall_clock::Datetime { + seconds: seconds5, + nanoseconds: nanoseconds5, + } = e; *ptr1.add(88).cast::() = _rt::as_i64(seconds5); *ptr1.add(96).cast::() = _rt::as_i32(nanoseconds5); } @@ -18733,16 +20734,16 @@ pub mod exports { arg2: *mut u8, arg3: usize, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg3; let bytes0 = _rt::Vec::from_raw_parts(arg2.cast(), len0, len0); let result1 = T::stat_at( - DescriptorBorrow::lift(arg0 as u32 as usize).get(), - PathFlags::empty() | PathFlags::from_bits_retain(((arg1 as u8) << 0) as _), + unsafe { DescriptorBorrow::lift(arg0 as u32 as usize) }.get(), + PathFlags::empty() + | PathFlags::from_bits_retain(((arg1 as u8) << 0) as _), _rt::string_lift(bytes0), ); - let ptr2 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr2 = (&raw mut _RET_AREA.0).cast::(); match result1 { Ok(e) => { *ptr2.add(0).cast::() = (0i32) as u8; @@ -18760,7 +20761,10 @@ pub mod exports { match data_access_timestamp3 { Some(e) => { *ptr2.add(32).cast::() = (1i32) as u8; - let super::super::super::super::exports::wasi::clocks::wall_clock::Datetime{ seconds:seconds4, nanoseconds:nanoseconds4, } = e; + let super::super::super::super::exports::wasi::clocks::wall_clock::Datetime { + seconds: seconds4, + nanoseconds: nanoseconds4, + } = e; *ptr2.add(40).cast::() = _rt::as_i64(seconds4); *ptr2.add(48).cast::() = _rt::as_i32(nanoseconds4); } @@ -18771,7 +20775,10 @@ pub mod exports { match data_modification_timestamp3 { Some(e) => { *ptr2.add(56).cast::() = (1i32) as u8; - let super::super::super::super::exports::wasi::clocks::wall_clock::Datetime{ seconds:seconds5, nanoseconds:nanoseconds5, } = e; + let super::super::super::super::exports::wasi::clocks::wall_clock::Datetime { + seconds: seconds5, + nanoseconds: nanoseconds5, + } = e; *ptr2.add(64).cast::() = _rt::as_i64(seconds5); *ptr2.add(72).cast::() = _rt::as_i32(nanoseconds5); } @@ -18782,7 +20789,10 @@ pub mod exports { match status_change_timestamp3 { Some(e) => { *ptr2.add(80).cast::() = (1i32) as u8; - let super::super::super::super::exports::wasi::clocks::wall_clock::Datetime{ seconds:seconds6, nanoseconds:nanoseconds6, } = e; + let super::super::super::super::exports::wasi::clocks::wall_clock::Datetime { + seconds: seconds6, + nanoseconds: nanoseconds6, + } = e; *ptr2.add(88).cast::() = _rt::as_i64(seconds6); *ptr2.add(96).cast::() = _rt::as_i32(nanoseconds6); } @@ -18800,7 +20810,9 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_descriptor_set_times_at_cabi( + pub unsafe fn _export_method_descriptor_set_times_at_cabi< + T: GuestDescriptor, + >( arg0: *mut u8, arg1: i32, arg2: *mut u8, @@ -18812,8 +20824,7 @@ pub mod exports { arg8: i64, arg9: i32, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg3; let bytes0 = _rt::Vec::from_raw_parts(arg2.cast(), len0, len0); let v1 = match arg4 { @@ -18821,10 +20832,10 @@ pub mod exports { 1 => NewTimestamp::Now, n => { debug_assert_eq!(n, 2, "invalid enum discriminant"); - let e1 = super::super::super::super::exports::wasi::clocks::wall_clock::Datetime{ - seconds: arg5 as u64, - nanoseconds: arg6 as u32, - }; + let e1 = super::super::super::super::exports::wasi::clocks::wall_clock::Datetime { + seconds: arg5 as u64, + nanoseconds: arg6 as u32, + }; NewTimestamp::Timestamp(e1) } }; @@ -18833,21 +20844,22 @@ pub mod exports { 1 => NewTimestamp::Now, n => { debug_assert_eq!(n, 2, "invalid enum discriminant"); - let e2 = super::super::super::super::exports::wasi::clocks::wall_clock::Datetime{ - seconds: arg8 as u64, - nanoseconds: arg9 as u32, - }; + let e2 = super::super::super::super::exports::wasi::clocks::wall_clock::Datetime { + seconds: arg8 as u64, + nanoseconds: arg9 as u32, + }; NewTimestamp::Timestamp(e2) } }; let result3 = T::set_times_at( - DescriptorBorrow::lift(arg0 as u32 as usize).get(), - PathFlags::empty() | PathFlags::from_bits_retain(((arg1 as u8) << 0) as _), + unsafe { DescriptorBorrow::lift(arg0 as u32 as usize) }.get(), + PathFlags::empty() + | PathFlags::from_bits_retain(((arg1 as u8) << 0) as _), _rt::string_lift(bytes0), v1, v2, ); - let ptr4 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr4 = (&raw mut _RET_AREA.0).cast::(); match result3 { Ok(_) => { *ptr4.add(0).cast::() = (0i32) as u8; @@ -18870,20 +20882,20 @@ pub mod exports { arg5: *mut u8, arg6: usize, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg3; let bytes0 = _rt::Vec::from_raw_parts(arg2.cast(), len0, len0); let len1 = arg6; let bytes1 = _rt::Vec::from_raw_parts(arg5.cast(), len1, len1); let result2 = T::link_at( - DescriptorBorrow::lift(arg0 as u32 as usize).get(), - PathFlags::empty() | PathFlags::from_bits_retain(((arg1 as u8) << 0) as _), + unsafe { DescriptorBorrow::lift(arg0 as u32 as usize) }.get(), + PathFlags::empty() + | PathFlags::from_bits_retain(((arg1 as u8) << 0) as _), _rt::string_lift(bytes0), - DescriptorBorrow::lift(arg4 as u32 as usize), + unsafe { DescriptorBorrow::lift(arg4 as u32 as usize) }, _rt::string_lift(bytes1), ); - let ptr3 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr3 = (&raw mut _RET_AREA.0).cast::(); match result2 { Ok(_) => { *ptr3.add(0).cast::() = (0i32) as u8; @@ -18905,19 +20917,20 @@ pub mod exports { arg4: i32, arg5: i32, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg3; let bytes0 = _rt::Vec::from_raw_parts(arg2.cast(), len0, len0); let result1 = T::open_at( - DescriptorBorrow::lift(arg0 as u32 as usize).get(), - PathFlags::empty() | PathFlags::from_bits_retain(((arg1 as u8) << 0) as _), + unsafe { DescriptorBorrow::lift(arg0 as u32 as usize) }.get(), + PathFlags::empty() + | PathFlags::from_bits_retain(((arg1 as u8) << 0) as _), _rt::string_lift(bytes0), - OpenFlags::empty() | OpenFlags::from_bits_retain(((arg4 as u8) << 0) as _), + OpenFlags::empty() + | OpenFlags::from_bits_retain(((arg4 as u8) << 0) as _), DescriptorFlags::empty() | DescriptorFlags::from_bits_retain(((arg5 as u8) << 0) as _), ); - let ptr2 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr2 = (&raw mut _RET_AREA.0).cast::(); match result1 { Ok(e) => { *ptr2.add(0).cast::() = (0i32) as u8; @@ -18932,20 +20945,17 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_descriptor_readlink_at_cabi( - arg0: *mut u8, - arg1: *mut u8, - arg2: usize, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + pub unsafe fn _export_method_descriptor_readlink_at_cabi< + T: GuestDescriptor, + >(arg0: *mut u8, arg1: *mut u8, arg2: usize) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg2; let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0); let result1 = T::readlink_at( - DescriptorBorrow::lift(arg0 as u32 as usize).get(), + unsafe { DescriptorBorrow::lift(arg0 as u32 as usize) }.get(), _rt::string_lift(bytes0), ); - let ptr2 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr2 = (&raw mut _RET_AREA.0).cast::(); match result1 { Ok(e) => { *ptr2.add(0).cast::() = (0i32) as u8; @@ -18953,49 +20963,54 @@ pub mod exports { let ptr3 = vec3.as_ptr().cast::(); let len3 = vec3.len(); ::core::mem::forget(vec3); - *ptr2.add(8).cast::() = len3; - *ptr2.add(4).cast::<*mut u8>() = ptr3.cast_mut(); + *ptr2 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len3; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr3.cast_mut(); } Err(e) => { *ptr2.add(0).cast::() = (1i32) as u8; - *ptr2.add(4).cast::() = (e.clone() as i32) as u8; + *ptr2 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (e.clone() as i32) as u8; } }; ptr2 } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn __post_return_method_descriptor_readlink_at( - arg0: *mut u8, - ) { + pub unsafe fn __post_return_method_descriptor_readlink_at< + T: GuestDescriptor, + >(arg0: *mut u8) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { 0 => { - let l1 = *arg0.add(4).cast::<*mut u8>(); - let l2 = *arg0.add(8).cast::(); + let l1 = *arg0 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l1, l2, 1); } - _ => (), + _ => {} } } #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_method_descriptor_remove_directory_at_cabi< T: GuestDescriptor, - >( - arg0: *mut u8, - arg1: *mut u8, - arg2: usize, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + >(arg0: *mut u8, arg1: *mut u8, arg2: usize) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg2; let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0); let result1 = T::remove_directory_at( - DescriptorBorrow::lift(arg0 as u32 as usize).get(), + unsafe { DescriptorBorrow::lift(arg0 as u32 as usize) }.get(), _rt::string_lift(bytes0), ); - let ptr2 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr2 = (&raw mut _RET_AREA.0).cast::(); match result1 { Ok(_) => { *ptr2.add(0).cast::() = (0i32) as u8; @@ -19009,7 +21024,9 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_descriptor_rename_at_cabi( + pub unsafe fn _export_method_descriptor_rename_at_cabi< + T: GuestDescriptor, + >( arg0: *mut u8, arg1: *mut u8, arg2: usize, @@ -19017,19 +21034,18 @@ pub mod exports { arg4: *mut u8, arg5: usize, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg2; let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0); let len1 = arg5; let bytes1 = _rt::Vec::from_raw_parts(arg4.cast(), len1, len1); let result2 = T::rename_at( - DescriptorBorrow::lift(arg0 as u32 as usize).get(), + unsafe { DescriptorBorrow::lift(arg0 as u32 as usize) }.get(), _rt::string_lift(bytes0), - DescriptorBorrow::lift(arg3 as u32 as usize), + unsafe { DescriptorBorrow::lift(arg3 as u32 as usize) }, _rt::string_lift(bytes1), ); - let ptr3 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr3 = (&raw mut _RET_AREA.0).cast::(); match result2 { Ok(_) => { *ptr3.add(0).cast::() = (0i32) as u8; @@ -19043,25 +21059,26 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_descriptor_symlink_at_cabi( + pub unsafe fn _export_method_descriptor_symlink_at_cabi< + T: GuestDescriptor, + >( arg0: *mut u8, arg1: *mut u8, arg2: usize, arg3: *mut u8, arg4: usize, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg2; let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0); let len1 = arg4; let bytes1 = _rt::Vec::from_raw_parts(arg3.cast(), len1, len1); let result2 = T::symlink_at( - DescriptorBorrow::lift(arg0 as u32 as usize).get(), + unsafe { DescriptorBorrow::lift(arg0 as u32 as usize) }.get(), _rt::string_lift(bytes0), _rt::string_lift(bytes1), ); - let ptr3 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr3 = (&raw mut _RET_AREA.0).cast::(); match result2 { Ok(_) => { *ptr3.add(0).cast::() = (0i32) as u8; @@ -19075,20 +21092,17 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_descriptor_unlink_file_at_cabi( - arg0: *mut u8, - arg1: *mut u8, - arg2: usize, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + pub unsafe fn _export_method_descriptor_unlink_file_at_cabi< + T: GuestDescriptor, + >(arg0: *mut u8, arg1: *mut u8, arg2: usize) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg2; let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0); let result1 = T::unlink_file_at( - DescriptorBorrow::lift(arg0 as u32 as usize).get(), + unsafe { DescriptorBorrow::lift(arg0 as u32 as usize) }.get(), _rt::string_lift(bytes0), ); - let ptr2 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr2 = (&raw mut _RET_AREA.0).cast::(); match result1 { Ok(_) => { *ptr2.add(0).cast::() = (0i32) as u8; @@ -19102,15 +21116,13 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_descriptor_is_same_object_cabi( - arg0: *mut u8, - arg1: i32, - ) -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + pub unsafe fn _export_method_descriptor_is_same_object_cabi< + T: GuestDescriptor, + >(arg0: *mut u8, arg1: i32) -> i32 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::is_same_object( - DescriptorBorrow::lift(arg0 as u32 as usize).get(), - DescriptorBorrow::lift(arg1 as u32 as usize), + unsafe { DescriptorBorrow::lift(arg0 as u32 as usize) }.get(), + unsafe { DescriptorBorrow::lift(arg1 as u32 as usize) }, ); match result0 { true => 1, @@ -19119,21 +21131,18 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_descriptor_metadata_hash_cabi( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::metadata_hash(DescriptorBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + pub unsafe fn _export_method_descriptor_metadata_hash_cabi< + T: GuestDescriptor, + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::metadata_hash( + unsafe { DescriptorBorrow::lift(arg0 as u32 as usize) }.get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; - let MetadataHashValue { - lower: lower2, - upper: upper2, - } = e; + let MetadataHashValue { lower: lower2, upper: upper2 } = e; *ptr1.add(8).cast::() = _rt::as_i64(lower2); *ptr1.add(16).cast::() = _rt::as_i64(upper2); } @@ -19148,29 +21157,21 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_descriptor_metadata_hash_at_cabi< T: GuestDescriptor, - >( - arg0: *mut u8, - arg1: i32, - arg2: *mut u8, - arg3: usize, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + >(arg0: *mut u8, arg1: i32, arg2: *mut u8, arg3: usize) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg3; let bytes0 = _rt::Vec::from_raw_parts(arg2.cast(), len0, len0); let result1 = T::metadata_hash_at( - DescriptorBorrow::lift(arg0 as u32 as usize).get(), - PathFlags::empty() | PathFlags::from_bits_retain(((arg1 as u8) << 0) as _), + unsafe { DescriptorBorrow::lift(arg0 as u32 as usize) }.get(), + PathFlags::empty() + | PathFlags::from_bits_retain(((arg1 as u8) << 0) as _), _rt::string_lift(bytes0), ); - let ptr2 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr2 = (&raw mut _RET_AREA.0).cast::(); match result1 { Ok(e) => { *ptr2.add(0).cast::() = (0i32) as u8; - let MetadataHashValue { - lower: lower3, - upper: upper3, - } = e; + let MetadataHashValue { lower: lower3, upper: upper3 } = e; *ptr2.add(8).cast::() = _rt::as_i64(lower3); *ptr2.add(16).cast::() = _rt::as_i64(upper3); } @@ -19185,41 +21186,48 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_directory_entry_stream_read_directory_entry_cabi< T: GuestDirectoryEntryStream, - >( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::read_directory_entry( - DirectoryEntryStreamBorrow::lift(arg0 as u32 as usize).get(), + unsafe { DirectoryEntryStreamBorrow::lift(arg0 as u32 as usize) } + .get(), ); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; match e { Some(e) => { - *ptr1.add(4).cast::() = (1i32) as u8; - let DirectoryEntry { - type_: type_2, - name: name2, - } = e; - *ptr1.add(8).cast::() = (type_2.clone() as i32) as u8; + *ptr1 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; + let DirectoryEntry { type_: type_2, name: name2 } = e; + *ptr1 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::() = (type_2.clone() as i32) as u8; let vec3 = (name2.into_bytes()).into_boxed_slice(); let ptr3 = vec3.as_ptr().cast::(); let len3 = vec3.len(); ::core::mem::forget(vec3); - *ptr1.add(16).cast::() = len3; - *ptr1.add(12).cast::<*mut u8>() = ptr3.cast_mut(); + *ptr1 + .add(4 * ::core::mem::size_of::<*const u8>()) + .cast::() = len3; + *ptr1 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr3.cast_mut(); } None => { - *ptr1.add(4).cast::() = (0i32) as u8; + *ptr1 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } }; } Err(e) => { *ptr1.add(0).cast::() = (1i32) as u8; - *ptr1.add(4).cast::() = (e.clone() as i32) as u8; + *ptr1 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (e.clone() as i32) as u8; } }; ptr1 @@ -19228,32 +21236,39 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn __post_return_method_directory_entry_stream_read_directory_entry< T: GuestDirectoryEntryStream, - >( - arg0: *mut u8, - ) { + >(arg0: *mut u8) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { 0 => { - let l1 = i32::from(*arg0.add(4).cast::()); + let l1 = i32::from( + *arg0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); match l1 { - 0 => (), + 0 => {} _ => { - let l2 = *arg0.add(12).cast::<*mut u8>(); - let l3 = *arg0.add(16).cast::(); + let l2 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l3 = *arg0 + .add(4 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l2, l3, 1); } } } - _ => (), + _ => {} } } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_filesystem_error_code_cabi(arg0: i32) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = T::filesystem_error_code(ErrorBorrow::lift(arg0 as u32 as usize)); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + pub unsafe fn _export_filesystem_error_code_cabi( + arg0: i32, + ) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::filesystem_error_code(unsafe { + ErrorBorrow::lift(arg0 as u32 as usize) + }); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Some(e) => { *ptr1.add(0).cast::() = (1i32) as u8; @@ -19291,18 +21306,18 @@ pub mod exports { let _ = val; unreachable!(); } - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]wasi:filesystem/types@0.2.0")] - extern "C" { + #[link( + wasm_import_module = "[export]wasi:filesystem/types@0.2.0" + )] + unsafe extern "C" { #[link_name = "[resource-new]descriptor"] fn new(_: *mut u8) -> u32; } - new(val) + unsafe { new(val) } } } - #[doc(hidden)] fn _resource_rep(handle: u32) -> *mut u8 where @@ -19313,18 +21328,18 @@ pub mod exports { let _ = handle; unreachable!(); } - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]wasi:filesystem/types@0.2.0")] - extern "C" { + #[link( + wasm_import_module = "[export]wasi:filesystem/types@0.2.0" + )] + unsafe extern "C" { #[link_name = "[resource-rep]descriptor"] fn rep(_: u32) -> *mut u8; } unsafe { rep(handle) } } } - /// Return a stream for reading from a file, if available. /// /// May fail with an error-code describing why the file cannot be read. @@ -19333,15 +21348,20 @@ pub mod exports { /// file and they do not interfere with each other. /// /// Note: This allows using `read-stream`, which is similar to `read` in POSIX. - fn read_via_stream(&self, offset: Filesize) -> Result; + fn read_via_stream( + &self, + offset: Filesize, + ) -> Result; /// Return a stream for writing to a file, if available. /// /// May fail with an error-code describing why the file cannot be written. /// /// Note: This allows using `write-stream`, which is similar to `write` in /// POSIX. - fn write_via_stream(&self, offset: Filesize) - -> Result; + fn write_via_stream( + &self, + offset: Filesize, + ) -> Result; /// Return a stream for appending to a file, if available. /// /// May fail with an error-code describing why the file cannot be appended. @@ -19448,7 +21468,10 @@ pub mod exports { /// Create a directory. /// /// Note: This is similar to `mkdirat` in POSIX. - fn create_directory_at(&self, path: _rt::String) -> Result<(), ErrorCode>; + fn create_directory_at( + &self, + path: _rt::String, + ) -> Result<(), ErrorCode>; /// Return the attributes of an open file or directory. /// /// Note: This is similar to `fstat` in POSIX, except that it does not return @@ -19525,13 +21548,19 @@ pub mod exports { /// filesystem, this function fails with `error-code::not-permitted`. /// /// Note: This is similar to `readlinkat` in POSIX. - fn readlink_at(&self, path: _rt::String) -> Result<_rt::String, ErrorCode>; + fn readlink_at( + &self, + path: _rt::String, + ) -> Result<_rt::String, ErrorCode>; /// Remove a directory. /// /// Return `error-code::not-empty` if the directory is not empty. /// /// Note: This is similar to `unlinkat(fd, path, AT_REMOVEDIR)` in POSIX. - fn remove_directory_at(&self, path: _rt::String) -> Result<(), ErrorCode>; + fn remove_directory_at( + &self, + path: _rt::String, + ) -> Result<(), ErrorCode>; /// Rename a filesystem object. /// /// Note: This is similar to `renameat` in POSIX. @@ -19575,12 +21604,12 @@ pub mod exports { /// /// Implementations are encourated to provide the following properties: /// - /// - If the file is not modified or replaced, the computed hash value should - /// usually not change. - /// - If the object is modified or replaced, the computed hash value should - /// usually change. - /// - The inputs to the hash should not be easily computable from the - /// computed hash. + /// - If the file is not modified or replaced, the computed hash value should + /// usually not change. + /// - If the object is modified or replaced, the computed hash value should + /// usually change. + /// - The inputs to the hash should not be easily computable from the + /// computed hash. /// /// However, none of these is required. fn metadata_hash(&self) -> Result; @@ -19605,18 +21634,18 @@ pub mod exports { let _ = val; unreachable!(); } - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]wasi:filesystem/types@0.2.0")] - extern "C" { + #[link( + wasm_import_module = "[export]wasi:filesystem/types@0.2.0" + )] + unsafe extern "C" { #[link_name = "[resource-new]directory-entry-stream"] fn new(_: *mut u8) -> u32; } - new(val) + unsafe { new(val) } } } - #[doc(hidden)] fn _resource_rep(handle: u32) -> *mut u8 where @@ -19627,212 +21656,285 @@ pub mod exports { let _ = handle; unreachable!(); } - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]wasi:filesystem/types@0.2.0")] - extern "C" { + #[link( + wasm_import_module = "[export]wasi:filesystem/types@0.2.0" + )] + unsafe extern "C" { #[link_name = "[resource-rep]directory-entry-stream"] fn rep(_: u32) -> *mut u8; } unsafe { rep(handle) } } } - /// Read a single directory entry from a `directory-entry-stream`. - fn read_directory_entry(&self) -> Result, ErrorCode>; + fn read_directory_entry( + &self, + ) -> Result, ErrorCode>; } #[doc(hidden)] - - macro_rules! __export_wasi_filesystem_types_0_2_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "wasi:filesystem/types@0.2.0#[method]descriptor.read-via-stream"] - unsafe extern "C" fn export_method_descriptor_read_via_stream(arg0: *mut u8,arg1: i64,) -> *mut u8 { - $($path_to_types)*::_export_method_descriptor_read_via_stream_cabi::<<$ty as $($path_to_types)*::Guest>::Descriptor>(arg0, arg1) - } - #[export_name = "wasi:filesystem/types@0.2.0#[method]descriptor.write-via-stream"] - unsafe extern "C" fn export_method_descriptor_write_via_stream(arg0: *mut u8,arg1: i64,) -> *mut u8 { - $($path_to_types)*::_export_method_descriptor_write_via_stream_cabi::<<$ty as $($path_to_types)*::Guest>::Descriptor>(arg0, arg1) - } - #[export_name = "wasi:filesystem/types@0.2.0#[method]descriptor.append-via-stream"] - unsafe extern "C" fn export_method_descriptor_append_via_stream(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_descriptor_append_via_stream_cabi::<<$ty as $($path_to_types)*::Guest>::Descriptor>(arg0) - } - #[export_name = "wasi:filesystem/types@0.2.0#[method]descriptor.advise"] - unsafe extern "C" fn export_method_descriptor_advise(arg0: *mut u8,arg1: i64,arg2: i64,arg3: i32,) -> *mut u8 { - $($path_to_types)*::_export_method_descriptor_advise_cabi::<<$ty as $($path_to_types)*::Guest>::Descriptor>(arg0, arg1, arg2, arg3) - } - #[export_name = "wasi:filesystem/types@0.2.0#[method]descriptor.sync-data"] - unsafe extern "C" fn export_method_descriptor_sync_data(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_descriptor_sync_data_cabi::<<$ty as $($path_to_types)*::Guest>::Descriptor>(arg0) - } - #[export_name = "wasi:filesystem/types@0.2.0#[method]descriptor.get-flags"] - unsafe extern "C" fn export_method_descriptor_get_flags(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_descriptor_get_flags_cabi::<<$ty as $($path_to_types)*::Guest>::Descriptor>(arg0) - } - #[export_name = "wasi:filesystem/types@0.2.0#[method]descriptor.get-type"] - unsafe extern "C" fn export_method_descriptor_get_type(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_descriptor_get_type_cabi::<<$ty as $($path_to_types)*::Guest>::Descriptor>(arg0) - } - #[export_name = "wasi:filesystem/types@0.2.0#[method]descriptor.set-size"] - unsafe extern "C" fn export_method_descriptor_set_size(arg0: *mut u8,arg1: i64,) -> *mut u8 { - $($path_to_types)*::_export_method_descriptor_set_size_cabi::<<$ty as $($path_to_types)*::Guest>::Descriptor>(arg0, arg1) - } - #[export_name = "wasi:filesystem/types@0.2.0#[method]descriptor.set-times"] - unsafe extern "C" fn export_method_descriptor_set_times(arg0: *mut u8,arg1: i32,arg2: i64,arg3: i32,arg4: i32,arg5: i64,arg6: i32,) -> *mut u8 { - $($path_to_types)*::_export_method_descriptor_set_times_cabi::<<$ty as $($path_to_types)*::Guest>::Descriptor>(arg0, arg1, arg2, arg3, arg4, arg5, arg6) - } - #[export_name = "wasi:filesystem/types@0.2.0#[method]descriptor.read"] - unsafe extern "C" fn export_method_descriptor_read(arg0: *mut u8,arg1: i64,arg2: i64,) -> *mut u8 { - $($path_to_types)*::_export_method_descriptor_read_cabi::<<$ty as $($path_to_types)*::Guest>::Descriptor>(arg0, arg1, arg2) - } - #[export_name = "cabi_post_wasi:filesystem/types@0.2.0#[method]descriptor.read"] - unsafe extern "C" fn _post_return_method_descriptor_read(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_descriptor_read::<<$ty as $($path_to_types)*::Guest>::Descriptor>(arg0) - } - #[export_name = "wasi:filesystem/types@0.2.0#[method]descriptor.write"] - unsafe extern "C" fn export_method_descriptor_write(arg0: *mut u8,arg1: *mut u8,arg2: usize,arg3: i64,) -> *mut u8 { - $($path_to_types)*::_export_method_descriptor_write_cabi::<<$ty as $($path_to_types)*::Guest>::Descriptor>(arg0, arg1, arg2, arg3) - } - #[export_name = "wasi:filesystem/types@0.2.0#[method]descriptor.read-directory"] - unsafe extern "C" fn export_method_descriptor_read_directory(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_descriptor_read_directory_cabi::<<$ty as $($path_to_types)*::Guest>::Descriptor>(arg0) - } - #[export_name = "wasi:filesystem/types@0.2.0#[method]descriptor.sync"] - unsafe extern "C" fn export_method_descriptor_sync(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_descriptor_sync_cabi::<<$ty as $($path_to_types)*::Guest>::Descriptor>(arg0) - } - #[export_name = "wasi:filesystem/types@0.2.0#[method]descriptor.create-directory-at"] - unsafe extern "C" fn export_method_descriptor_create_directory_at(arg0: *mut u8,arg1: *mut u8,arg2: usize,) -> *mut u8 { - $($path_to_types)*::_export_method_descriptor_create_directory_at_cabi::<<$ty as $($path_to_types)*::Guest>::Descriptor>(arg0, arg1, arg2) - } - #[export_name = "wasi:filesystem/types@0.2.0#[method]descriptor.stat"] - unsafe extern "C" fn export_method_descriptor_stat(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_descriptor_stat_cabi::<<$ty as $($path_to_types)*::Guest>::Descriptor>(arg0) - } - #[export_name = "wasi:filesystem/types@0.2.0#[method]descriptor.stat-at"] - unsafe extern "C" fn export_method_descriptor_stat_at(arg0: *mut u8,arg1: i32,arg2: *mut u8,arg3: usize,) -> *mut u8 { - $($path_to_types)*::_export_method_descriptor_stat_at_cabi::<<$ty as $($path_to_types)*::Guest>::Descriptor>(arg0, arg1, arg2, arg3) - } - #[export_name = "wasi:filesystem/types@0.2.0#[method]descriptor.set-times-at"] - unsafe extern "C" fn export_method_descriptor_set_times_at(arg0: *mut u8,arg1: i32,arg2: *mut u8,arg3: usize,arg4: i32,arg5: i64,arg6: i32,arg7: i32,arg8: i64,arg9: i32,) -> *mut u8 { - $($path_to_types)*::_export_method_descriptor_set_times_at_cabi::<<$ty as $($path_to_types)*::Guest>::Descriptor>(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) - } - #[export_name = "wasi:filesystem/types@0.2.0#[method]descriptor.link-at"] - unsafe extern "C" fn export_method_descriptor_link_at(arg0: *mut u8,arg1: i32,arg2: *mut u8,arg3: usize,arg4: i32,arg5: *mut u8,arg6: usize,) -> *mut u8 { - $($path_to_types)*::_export_method_descriptor_link_at_cabi::<<$ty as $($path_to_types)*::Guest>::Descriptor>(arg0, arg1, arg2, arg3, arg4, arg5, arg6) - } - #[export_name = "wasi:filesystem/types@0.2.0#[method]descriptor.open-at"] - unsafe extern "C" fn export_method_descriptor_open_at(arg0: *mut u8,arg1: i32,arg2: *mut u8,arg3: usize,arg4: i32,arg5: i32,) -> *mut u8 { - $($path_to_types)*::_export_method_descriptor_open_at_cabi::<<$ty as $($path_to_types)*::Guest>::Descriptor>(arg0, arg1, arg2, arg3, arg4, arg5) - } - #[export_name = "wasi:filesystem/types@0.2.0#[method]descriptor.readlink-at"] - unsafe extern "C" fn export_method_descriptor_readlink_at(arg0: *mut u8,arg1: *mut u8,arg2: usize,) -> *mut u8 { - $($path_to_types)*::_export_method_descriptor_readlink_at_cabi::<<$ty as $($path_to_types)*::Guest>::Descriptor>(arg0, arg1, arg2) - } - #[export_name = "cabi_post_wasi:filesystem/types@0.2.0#[method]descriptor.readlink-at"] - unsafe extern "C" fn _post_return_method_descriptor_readlink_at(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_descriptor_readlink_at::<<$ty as $($path_to_types)*::Guest>::Descriptor>(arg0) - } - #[export_name = "wasi:filesystem/types@0.2.0#[method]descriptor.remove-directory-at"] - unsafe extern "C" fn export_method_descriptor_remove_directory_at(arg0: *mut u8,arg1: *mut u8,arg2: usize,) -> *mut u8 { - $($path_to_types)*::_export_method_descriptor_remove_directory_at_cabi::<<$ty as $($path_to_types)*::Guest>::Descriptor>(arg0, arg1, arg2) - } - #[export_name = "wasi:filesystem/types@0.2.0#[method]descriptor.rename-at"] - unsafe extern "C" fn export_method_descriptor_rename_at(arg0: *mut u8,arg1: *mut u8,arg2: usize,arg3: i32,arg4: *mut u8,arg5: usize,) -> *mut u8 { - $($path_to_types)*::_export_method_descriptor_rename_at_cabi::<<$ty as $($path_to_types)*::Guest>::Descriptor>(arg0, arg1, arg2, arg3, arg4, arg5) - } - #[export_name = "wasi:filesystem/types@0.2.0#[method]descriptor.symlink-at"] - unsafe extern "C" fn export_method_descriptor_symlink_at(arg0: *mut u8,arg1: *mut u8,arg2: usize,arg3: *mut u8,arg4: usize,) -> *mut u8 { - $($path_to_types)*::_export_method_descriptor_symlink_at_cabi::<<$ty as $($path_to_types)*::Guest>::Descriptor>(arg0, arg1, arg2, arg3, arg4) - } - #[export_name = "wasi:filesystem/types@0.2.0#[method]descriptor.unlink-file-at"] - unsafe extern "C" fn export_method_descriptor_unlink_file_at(arg0: *mut u8,arg1: *mut u8,arg2: usize,) -> *mut u8 { - $($path_to_types)*::_export_method_descriptor_unlink_file_at_cabi::<<$ty as $($path_to_types)*::Guest>::Descriptor>(arg0, arg1, arg2) - } - #[export_name = "wasi:filesystem/types@0.2.0#[method]descriptor.is-same-object"] - unsafe extern "C" fn export_method_descriptor_is_same_object(arg0: *mut u8,arg1: i32,) -> i32 { - $($path_to_types)*::_export_method_descriptor_is_same_object_cabi::<<$ty as $($path_to_types)*::Guest>::Descriptor>(arg0, arg1) - } - #[export_name = "wasi:filesystem/types@0.2.0#[method]descriptor.metadata-hash"] - unsafe extern "C" fn export_method_descriptor_metadata_hash(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_descriptor_metadata_hash_cabi::<<$ty as $($path_to_types)*::Guest>::Descriptor>(arg0) - } - #[export_name = "wasi:filesystem/types@0.2.0#[method]descriptor.metadata-hash-at"] - unsafe extern "C" fn export_method_descriptor_metadata_hash_at(arg0: *mut u8,arg1: i32,arg2: *mut u8,arg3: usize,) -> *mut u8 { - $($path_to_types)*::_export_method_descriptor_metadata_hash_at_cabi::<<$ty as $($path_to_types)*::Guest>::Descriptor>(arg0, arg1, arg2, arg3) - } - #[export_name = "wasi:filesystem/types@0.2.0#[method]directory-entry-stream.read-directory-entry"] - unsafe extern "C" fn export_method_directory_entry_stream_read_directory_entry(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_directory_entry_stream_read_directory_entry_cabi::<<$ty as $($path_to_types)*::Guest>::DirectoryEntryStream>(arg0) - } - #[export_name = "cabi_post_wasi:filesystem/types@0.2.0#[method]directory-entry-stream.read-directory-entry"] - unsafe extern "C" fn _post_return_method_directory_entry_stream_read_directory_entry(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_directory_entry_stream_read_directory_entry::<<$ty as $($path_to_types)*::Guest>::DirectoryEntryStream>(arg0) - } - #[export_name = "wasi:filesystem/types@0.2.0#filesystem-error-code"] - unsafe extern "C" fn export_filesystem_error_code(arg0: i32,) -> *mut u8 { - $($path_to_types)*::_export_filesystem_error_code_cabi::<$ty>(arg0) - } - - const _: () = { - #[doc(hidden)] - #[export_name = "wasi:filesystem/types@0.2.0#[dtor]descriptor"] - #[allow(non_snake_case)] - unsafe extern "C" fn dtor(rep: *mut u8) { - $($path_to_types)*::Descriptor::dtor::< - <$ty as $($path_to_types)*::Guest>::Descriptor - >(rep) - } - }; - - - const _: () = { - #[doc(hidden)] - #[export_name = "wasi:filesystem/types@0.2.0#[dtor]directory-entry-stream"] - #[allow(non_snake_case)] - unsafe extern "C" fn dtor(rep: *mut u8) { - $($path_to_types)*::DirectoryEntryStream::dtor::< - <$ty as $($path_to_types)*::Guest>::DirectoryEntryStream - >(rep) - } - }; - - };); -} + macro_rules! __export_wasi_filesystem_types_0_2_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "wasi:filesystem/types@0.2.0#[method]descriptor.read-via-stream")] + unsafe extern "C" fn + export_method_descriptor_read_via_stream(arg0 : * mut u8, arg1 : + i64,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_descriptor_read_via_stream_cabi::<<$ty as + $($path_to_types)*:: Guest >::Descriptor > (arg0, arg1) } } + #[unsafe (export_name = + "wasi:filesystem/types@0.2.0#[method]descriptor.write-via-stream")] + unsafe extern "C" fn + export_method_descriptor_write_via_stream(arg0 : * mut u8, arg1 : + i64,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_descriptor_write_via_stream_cabi::<<$ty as + $($path_to_types)*:: Guest >::Descriptor > (arg0, arg1) } } + #[unsafe (export_name = + "wasi:filesystem/types@0.2.0#[method]descriptor.append-via-stream")] + unsafe extern "C" fn + export_method_descriptor_append_via_stream(arg0 : * mut u8,) -> * + mut u8 { unsafe { $($path_to_types)*:: + _export_method_descriptor_append_via_stream_cabi::<<$ty as + $($path_to_types)*:: Guest >::Descriptor > (arg0) } } #[unsafe + (export_name = + "wasi:filesystem/types@0.2.0#[method]descriptor.advise")] unsafe + extern "C" fn export_method_descriptor_advise(arg0 : * mut u8, + arg1 : i64, arg2 : i64, arg3 : i32,) -> * mut u8 { unsafe { + $($path_to_types)*:: _export_method_descriptor_advise_cabi::<<$ty + as $($path_to_types)*:: Guest >::Descriptor > (arg0, arg1, arg2, + arg3) } } #[unsafe (export_name = + "wasi:filesystem/types@0.2.0#[method]descriptor.sync-data")] + unsafe extern "C" fn export_method_descriptor_sync_data(arg0 : * + mut u8,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_descriptor_sync_data_cabi::<<$ty as + $($path_to_types)*:: Guest >::Descriptor > (arg0) } } #[unsafe + (export_name = + "wasi:filesystem/types@0.2.0#[method]descriptor.get-flags")] + unsafe extern "C" fn export_method_descriptor_get_flags(arg0 : * + mut u8,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_descriptor_get_flags_cabi::<<$ty as + $($path_to_types)*:: Guest >::Descriptor > (arg0) } } #[unsafe + (export_name = + "wasi:filesystem/types@0.2.0#[method]descriptor.get-type")] + unsafe extern "C" fn export_method_descriptor_get_type(arg0 : * + mut u8,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_descriptor_get_type_cabi::<<$ty as + $($path_to_types)*:: Guest >::Descriptor > (arg0) } } #[unsafe + (export_name = + "wasi:filesystem/types@0.2.0#[method]descriptor.set-size")] + unsafe extern "C" fn export_method_descriptor_set_size(arg0 : * + mut u8, arg1 : i64,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_descriptor_set_size_cabi::<<$ty as + $($path_to_types)*:: Guest >::Descriptor > (arg0, arg1) } } + #[unsafe (export_name = + "wasi:filesystem/types@0.2.0#[method]descriptor.set-times")] + unsafe extern "C" fn export_method_descriptor_set_times(arg0 : * + mut u8, arg1 : i32, arg2 : i64, arg3 : i32, arg4 : i32, arg5 : + i64, arg6 : i32,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_descriptor_set_times_cabi::<<$ty as + $($path_to_types)*:: Guest >::Descriptor > (arg0, arg1, arg2, + arg3, arg4, arg5, arg6) } } #[unsafe (export_name = + "wasi:filesystem/types@0.2.0#[method]descriptor.read")] unsafe + extern "C" fn export_method_descriptor_read(arg0 : * mut u8, arg1 + : i64, arg2 : i64,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_descriptor_read_cabi::<<$ty as + $($path_to_types)*:: Guest >::Descriptor > (arg0, arg1, arg2) } } + #[unsafe (export_name = + "cabi_post_wasi:filesystem/types@0.2.0#[method]descriptor.read")] + unsafe extern "C" fn _post_return_method_descriptor_read(arg0 : * + mut u8,) { unsafe { $($path_to_types)*:: + __post_return_method_descriptor_read::<<$ty as + $($path_to_types)*:: Guest >::Descriptor > (arg0) } } #[unsafe + (export_name = + "wasi:filesystem/types@0.2.0#[method]descriptor.write")] unsafe + extern "C" fn export_method_descriptor_write(arg0 : * mut u8, + arg1 : * mut u8, arg2 : usize, arg3 : i64,) -> * mut u8 { unsafe + { $($path_to_types)*:: + _export_method_descriptor_write_cabi::<<$ty as + $($path_to_types)*:: Guest >::Descriptor > (arg0, arg1, arg2, + arg3) } } #[unsafe (export_name = + "wasi:filesystem/types@0.2.0#[method]descriptor.read-directory")] + unsafe extern "C" fn export_method_descriptor_read_directory(arg0 + : * mut u8,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_descriptor_read_directory_cabi::<<$ty as + $($path_to_types)*:: Guest >::Descriptor > (arg0) } } #[unsafe + (export_name = + "wasi:filesystem/types@0.2.0#[method]descriptor.sync")] unsafe + extern "C" fn export_method_descriptor_sync(arg0 : * mut u8,) -> + * mut u8 { unsafe { $($path_to_types)*:: + _export_method_descriptor_sync_cabi::<<$ty as + $($path_to_types)*:: Guest >::Descriptor > (arg0) } } #[unsafe + (export_name = + "wasi:filesystem/types@0.2.0#[method]descriptor.create-directory-at")] + unsafe extern "C" fn + export_method_descriptor_create_directory_at(arg0 : * mut u8, + arg1 : * mut u8, arg2 : usize,) -> * mut u8 { unsafe { + $($path_to_types)*:: + _export_method_descriptor_create_directory_at_cabi::<<$ty as + $($path_to_types)*:: Guest >::Descriptor > (arg0, arg1, arg2) } } + #[unsafe (export_name = + "wasi:filesystem/types@0.2.0#[method]descriptor.stat")] unsafe + extern "C" fn export_method_descriptor_stat(arg0 : * mut u8,) -> + * mut u8 { unsafe { $($path_to_types)*:: + _export_method_descriptor_stat_cabi::<<$ty as + $($path_to_types)*:: Guest >::Descriptor > (arg0) } } #[unsafe + (export_name = + "wasi:filesystem/types@0.2.0#[method]descriptor.stat-at")] unsafe + extern "C" fn export_method_descriptor_stat_at(arg0 : * mut u8, + arg1 : i32, arg2 : * mut u8, arg3 : usize,) -> * mut u8 { unsafe + { $($path_to_types)*:: + _export_method_descriptor_stat_at_cabi::<<$ty as + $($path_to_types)*:: Guest >::Descriptor > (arg0, arg1, arg2, + arg3) } } #[unsafe (export_name = + "wasi:filesystem/types@0.2.0#[method]descriptor.set-times-at")] + unsafe extern "C" fn export_method_descriptor_set_times_at(arg0 : + * mut u8, arg1 : i32, arg2 : * mut u8, arg3 : usize, arg4 : i32, + arg5 : i64, arg6 : i32, arg7 : i32, arg8 : i64, arg9 : i32,) -> * + mut u8 { unsafe { $($path_to_types)*:: + _export_method_descriptor_set_times_at_cabi::<<$ty as + $($path_to_types)*:: Guest >::Descriptor > (arg0, arg1, arg2, + arg3, arg4, arg5, arg6, arg7, arg8, arg9) } } #[unsafe + (export_name = + "wasi:filesystem/types@0.2.0#[method]descriptor.link-at")] unsafe + extern "C" fn export_method_descriptor_link_at(arg0 : * mut u8, + arg1 : i32, arg2 : * mut u8, arg3 : usize, arg4 : i32, arg5 : * + mut u8, arg6 : usize,) -> * mut u8 { unsafe { + $($path_to_types)*:: + _export_method_descriptor_link_at_cabi::<<$ty as + $($path_to_types)*:: Guest >::Descriptor > (arg0, arg1, arg2, + arg3, arg4, arg5, arg6) } } #[unsafe (export_name = + "wasi:filesystem/types@0.2.0#[method]descriptor.open-at")] unsafe + extern "C" fn export_method_descriptor_open_at(arg0 : * mut u8, + arg1 : i32, arg2 : * mut u8, arg3 : usize, arg4 : i32, arg5 : + i32,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_descriptor_open_at_cabi::<<$ty as + $($path_to_types)*:: Guest >::Descriptor > (arg0, arg1, arg2, + arg3, arg4, arg5) } } #[unsafe (export_name = + "wasi:filesystem/types@0.2.0#[method]descriptor.readlink-at")] + unsafe extern "C" fn export_method_descriptor_readlink_at(arg0 : + * mut u8, arg1 : * mut u8, arg2 : usize,) -> * mut u8 { unsafe { + $($path_to_types)*:: + _export_method_descriptor_readlink_at_cabi::<<$ty as + $($path_to_types)*:: Guest >::Descriptor > (arg0, arg1, arg2) } } + #[unsafe (export_name = + "cabi_post_wasi:filesystem/types@0.2.0#[method]descriptor.readlink-at")] + unsafe extern "C" fn + _post_return_method_descriptor_readlink_at(arg0 : * mut u8,) { + unsafe { $($path_to_types)*:: + __post_return_method_descriptor_readlink_at::<<$ty as + $($path_to_types)*:: Guest >::Descriptor > (arg0) } } #[unsafe + (export_name = + "wasi:filesystem/types@0.2.0#[method]descriptor.remove-directory-at")] + unsafe extern "C" fn + export_method_descriptor_remove_directory_at(arg0 : * mut u8, + arg1 : * mut u8, arg2 : usize,) -> * mut u8 { unsafe { + $($path_to_types)*:: + _export_method_descriptor_remove_directory_at_cabi::<<$ty as + $($path_to_types)*:: Guest >::Descriptor > (arg0, arg1, arg2) } } + #[unsafe (export_name = + "wasi:filesystem/types@0.2.0#[method]descriptor.rename-at")] + unsafe extern "C" fn export_method_descriptor_rename_at(arg0 : * + mut u8, arg1 : * mut u8, arg2 : usize, arg3 : i32, arg4 : * mut + u8, arg5 : usize,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_descriptor_rename_at_cabi::<<$ty as + $($path_to_types)*:: Guest >::Descriptor > (arg0, arg1, arg2, + arg3, arg4, arg5) } } #[unsafe (export_name = + "wasi:filesystem/types@0.2.0#[method]descriptor.symlink-at")] + unsafe extern "C" fn export_method_descriptor_symlink_at(arg0 : * + mut u8, arg1 : * mut u8, arg2 : usize, arg3 : * mut u8, arg4 : + usize,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_descriptor_symlink_at_cabi::<<$ty as + $($path_to_types)*:: Guest >::Descriptor > (arg0, arg1, arg2, + arg3, arg4) } } #[unsafe (export_name = + "wasi:filesystem/types@0.2.0#[method]descriptor.unlink-file-at")] + unsafe extern "C" fn export_method_descriptor_unlink_file_at(arg0 + : * mut u8, arg1 : * mut u8, arg2 : usize,) -> * mut u8 { unsafe + { $($path_to_types)*:: + _export_method_descriptor_unlink_file_at_cabi::<<$ty as + $($path_to_types)*:: Guest >::Descriptor > (arg0, arg1, arg2) } } + #[unsafe (export_name = + "wasi:filesystem/types@0.2.0#[method]descriptor.is-same-object")] + unsafe extern "C" fn export_method_descriptor_is_same_object(arg0 + : * mut u8, arg1 : i32,) -> i32 { unsafe { $($path_to_types)*:: + _export_method_descriptor_is_same_object_cabi::<<$ty as + $($path_to_types)*:: Guest >::Descriptor > (arg0, arg1) } } + #[unsafe (export_name = + "wasi:filesystem/types@0.2.0#[method]descriptor.metadata-hash")] + unsafe extern "C" fn export_method_descriptor_metadata_hash(arg0 + : * mut u8,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_descriptor_metadata_hash_cabi::<<$ty as + $($path_to_types)*:: Guest >::Descriptor > (arg0) } } #[unsafe + (export_name = + "wasi:filesystem/types@0.2.0#[method]descriptor.metadata-hash-at")] + unsafe extern "C" fn + export_method_descriptor_metadata_hash_at(arg0 : * mut u8, arg1 : + i32, arg2 : * mut u8, arg3 : usize,) -> * mut u8 { unsafe { + $($path_to_types)*:: + _export_method_descriptor_metadata_hash_at_cabi::<<$ty as + $($path_to_types)*:: Guest >::Descriptor > (arg0, arg1, arg2, + arg3) } } #[unsafe (export_name = + "wasi:filesystem/types@0.2.0#[method]directory-entry-stream.read-directory-entry")] + unsafe extern "C" fn + export_method_directory_entry_stream_read_directory_entry(arg0 : + * mut u8,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_directory_entry_stream_read_directory_entry_cabi::<<$ty + as $($path_to_types)*:: Guest >::DirectoryEntryStream > (arg0) } + } #[unsafe (export_name = + "cabi_post_wasi:filesystem/types@0.2.0#[method]directory-entry-stream.read-directory-entry")] + unsafe extern "C" fn + _post_return_method_directory_entry_stream_read_directory_entry(arg0 + : * mut u8,) { unsafe { $($path_to_types)*:: + __post_return_method_directory_entry_stream_read_directory_entry::<<$ty + as $($path_to_types)*:: Guest >::DirectoryEntryStream > (arg0) } + } #[unsafe (export_name = + "wasi:filesystem/types@0.2.0#filesystem-error-code")] unsafe + extern "C" fn export_filesystem_error_code(arg0 : i32,) -> * mut + u8 { unsafe { $($path_to_types)*:: + _export_filesystem_error_code_cabi::<$ty > (arg0) } } const _ : + () = { #[doc(hidden)] #[unsafe (export_name = + "wasi:filesystem/types@0.2.0#[dtor]descriptor")] + #[allow(non_snake_case)] unsafe extern "C" fn dtor(rep : * mut + u8) { unsafe { $($path_to_types)*:: Descriptor::dtor::< <$ty as + $($path_to_types)*:: Guest >::Descriptor > (rep) } } }; const _ : + () = { #[doc(hidden)] #[unsafe (export_name = + "wasi:filesystem/types@0.2.0#[dtor]directory-entry-stream")] + #[allow(non_snake_case)] unsafe extern "C" fn dtor(rep : * mut + u8) { unsafe { $($path_to_types)*:: DirectoryEntryStream::dtor::< + <$ty as $($path_to_types)*:: Guest >::DirectoryEntryStream > + (rep) } } }; }; + }; + } #[doc(hidden)] pub(crate) use __export_wasi_filesystem_types_0_2_0_cabi; #[repr(align(8))] struct _RetArea([::core::mem::MaybeUninit; 104]); - static mut _RET_AREA: _RetArea = - _RetArea([::core::mem::MaybeUninit::uninit(); 104]); + static mut _RET_AREA: _RetArea = _RetArea( + [::core::mem::MaybeUninit::uninit(); 104], + ); } - - #[allow(dead_code, clippy::all)] + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod preopens { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; - pub type Descriptor = - super::super::super::super::exports::wasi::filesystem::types::Descriptor; - pub type DescriptorBorrow<'a> = - super::super::super::super::exports::wasi::filesystem::types::DescriptorBorrow< - 'a, - >; + pub type Descriptor = super::super::super::super::exports::wasi::filesystem::types::Descriptor; + pub type DescriptorBorrow<'a> = super::super::super::super::exports::wasi::filesystem::types::DescriptorBorrow< + 'a, + >; #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_get_directories_cabi() -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::get_directories(); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); let vec4 = result0; let len4 = vec4.len(); - let layout4 = _rt::alloc::Layout::from_size_align_unchecked(vec4.len() * 12, 4); + let layout4 = _rt::alloc::Layout::from_size_align_unchecked( + vec4.len() * (3 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); let result4 = if layout4.size() != 0 { let ptr = _rt::alloc::alloc(layout4).cast::(); if ptr.is_null() { @@ -19840,12 +21942,11 @@ pub mod exports { } ptr } else { - { - ::core::ptr::null_mut() - } + ::core::ptr::null_mut() }; for (i, e) in vec4.into_iter().enumerate() { - let base = result4.add(i * 12); + let base = result4 + .add(i * (3 * ::core::mem::size_of::<*const u8>())); { let (t2_0, t2_1) = e; *base.add(0).cast::() = (t2_0).take_handle() as i32; @@ -19853,83 +21954,106 @@ pub mod exports { let ptr3 = vec3.as_ptr().cast::(); let len3 = vec3.len(); ::core::mem::forget(vec3); - *base.add(8).cast::() = len3; - *base.add(4).cast::<*mut u8>() = ptr3.cast_mut(); + *base + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len3; + *base + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr3.cast_mut(); } } - *ptr1.add(4).cast::() = len4; + *ptr1.add(::core::mem::size_of::<*const u8>()).cast::() = len4; *ptr1.add(0).cast::<*mut u8>() = result4; ptr1 } #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn __post_return_get_directories(arg0: *mut u8) { - let l2 = *arg0.add(0).cast::<*mut u8>(); - let l3 = *arg0.add(4).cast::(); - let base4 = l2; - let len4 = l3; + let l0 = *arg0.add(0).cast::<*mut u8>(); + let l1 = *arg0 + .add(::core::mem::size_of::<*const u8>()) + .cast::(); + let base4 = l0; + let len4 = l1; for i in 0..len4 { - let base = base4.add(i * 12); + let base = base4 + .add(i * (3 * ::core::mem::size_of::<*const u8>())); { - let l0 = *base.add(4).cast::<*mut u8>(); - let l1 = *base.add(8).cast::(); - _rt::cabi_dealloc(l0, l1, 1); + let l2 = *base + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l3 = *base + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + _rt::cabi_dealloc(l2, l3, 1); } } - _rt::cabi_dealloc(base4, len4 * 12, 4); + _rt::cabi_dealloc( + base4, + len4 * (3 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); } pub trait Guest { /// Return the set of preopened directories, and their path. fn get_directories() -> _rt::Vec<(Descriptor, _rt::String)>; } #[doc(hidden)] - - macro_rules! __export_wasi_filesystem_preopens_0_2_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "wasi:filesystem/preopens@0.2.0#get-directories"] - unsafe extern "C" fn export_get_directories() -> *mut u8 { - $($path_to_types)*::_export_get_directories_cabi::<$ty>() - } - #[export_name = "cabi_post_wasi:filesystem/preopens@0.2.0#get-directories"] - unsafe extern "C" fn _post_return_get_directories(arg0: *mut u8,) { - $($path_to_types)*::__post_return_get_directories::<$ty>(arg0) - } - };); -} + macro_rules! __export_wasi_filesystem_preopens_0_2_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "wasi:filesystem/preopens@0.2.0#get-directories")] unsafe extern + "C" fn export_get_directories() -> * mut u8 { unsafe { + $($path_to_types)*:: _export_get_directories_cabi::<$ty > () } } + #[unsafe (export_name = + "cabi_post_wasi:filesystem/preopens@0.2.0#get-directories")] + unsafe extern "C" fn _post_return_get_directories(arg0 : * mut + u8,) { unsafe { $($path_to_types)*:: + __post_return_get_directories::<$ty > (arg0) } } }; + }; + } #[doc(hidden)] pub(crate) use __export_wasi_filesystem_preopens_0_2_0_cabi; - #[repr(align(4))] - struct _RetArea([::core::mem::MaybeUninit; 8]); - static mut _RET_AREA: _RetArea = _RetArea([::core::mem::MaybeUninit::uninit(); 8]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct _RetArea( + [::core::mem::MaybeUninit< + u8, + >; 2 * ::core::mem::size_of::<*const u8>()], + ); + static mut _RET_AREA: _RetArea = _RetArea( + [::core::mem::MaybeUninit::uninit(); 2 + * ::core::mem::size_of::<*const u8>()], + ); } } - #[allow(dead_code)] pub mod http { - #[allow(dead_code, clippy::all)] + /// This interface defines all of the types and methods for implementing + /// HTTP Requests and Responses, both incoming and outgoing, as well as + /// their headers, trailers, and bodies. + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod types { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; - pub type Duration = - super::super::super::super::exports::wasi::clocks::monotonic_clock::Duration; - pub type InputStream = - super::super::super::super::exports::wasi::io::streams::InputStream; - pub type InputStreamBorrow<'a> = - super::super::super::super::exports::wasi::io::streams::InputStreamBorrow<'a>; - pub type OutputStream = - super::super::super::super::exports::wasi::io::streams::OutputStream; - pub type OutputStreamBorrow<'a> = - super::super::super::super::exports::wasi::io::streams::OutputStreamBorrow<'a>; + pub type Duration = super::super::super::super::exports::wasi::clocks::monotonic_clock::Duration; + pub type InputStream = super::super::super::super::exports::wasi::io::streams::InputStream; + pub type InputStreamBorrow<'a> = super::super::super::super::exports::wasi::io::streams::InputStreamBorrow< + 'a, + >; + pub type OutputStream = super::super::super::super::exports::wasi::io::streams::OutputStream; + pub type OutputStreamBorrow<'a> = super::super::super::super::exports::wasi::io::streams::OutputStreamBorrow< + 'a, + >; pub type IoError = super::super::super::super::exports::wasi::io::error::Error; - pub type IoErrorBorrow<'a> = - super::super::super::super::exports::wasi::io::error::ErrorBorrow<'a>; + pub type IoErrorBorrow<'a> = super::super::super::super::exports::wasi::io::error::ErrorBorrow< + 'a, + >; pub type Pollable = super::super::super::super::exports::wasi::io::poll::Pollable; - pub type PollableBorrow<'a> = - super::super::super::super::exports::wasi::io::poll::PollableBorrow<'a>; + pub type PollableBorrow<'a> = super::super::super::super::exports::wasi::io::poll::PollableBorrow< + 'a, + >; /// This type corresponds to HTTP standard Methods. #[derive(Clone)] pub enum Method { @@ -19945,7 +22069,10 @@ pub mod exports { Other(_rt::String), } impl ::core::fmt::Debug for Method { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { Method::Get => f.debug_tuple("Method::Get").finish(), Method::Head => f.debug_tuple("Method::Head").finish(), @@ -19956,7 +22083,9 @@ pub mod exports { Method::Options => f.debug_tuple("Method::Options").finish(), Method::Trace => f.debug_tuple("Method::Trace").finish(), Method::Patch => f.debug_tuple("Method::Patch").finish(), - Method::Other(e) => f.debug_tuple("Method::Other").field(e).finish(), + Method::Other(e) => { + f.debug_tuple("Method::Other").field(e).finish() + } } } } @@ -19968,11 +22097,16 @@ pub mod exports { Other(_rt::String), } impl ::core::fmt::Debug for Scheme { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { Scheme::Http => f.debug_tuple("Scheme::Http").finish(), Scheme::Https => f.debug_tuple("Scheme::Https").finish(), - Scheme::Other(e) => f.debug_tuple("Scheme::Other").field(e).finish(), + Scheme::Other(e) => { + f.debug_tuple("Scheme::Other").field(e).finish() + } } } } @@ -19983,7 +22117,10 @@ pub mod exports { pub info_code: Option, } impl ::core::fmt::Debug for DnsErrorPayload { - 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("DnsErrorPayload") .field("rcode", &self.rcode) .field("info-code", &self.info_code) @@ -19997,7 +22134,10 @@ pub mod exports { pub alert_message: Option<_rt::String>, } impl ::core::fmt::Debug for TlsAlertReceivedPayload { - 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("TlsAlertReceivedPayload") .field("alert-id", &self.alert_id) .field("alert-message", &self.alert_message) @@ -20011,7 +22151,10 @@ pub mod exports { pub field_size: Option, } impl ::core::fmt::Debug for FieldSizePayload { - 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("FieldSizePayload") .field("field-name", &self.field_name) .field("field-size", &self.field_size) @@ -20019,7 +22162,7 @@ pub mod exports { } } /// These cases are inspired by the IANA HTTP Proxy Error Types: - /// https://www.iana.org/assignments/http-proxy-status/http-proxy-status.xhtml#table-http-proxy-error-types + /// https://www.iana.org/assignments/http-proxy-status/http-proxy-status.xhtml#table-http-proxy-error-types #[derive(Clone)] pub enum ErrorCode { DnsTimeout, @@ -20068,7 +22211,10 @@ pub mod exports { InternalError(Option<_rt::String>), } impl ::core::fmt::Debug for ErrorCode { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { ErrorCode::DnsTimeout => { f.debug_tuple("ErrorCode::DnsTimeout").finish() @@ -20112,76 +22258,91 @@ pub mod exports { ErrorCode::TlsCertificateError => { f.debug_tuple("ErrorCode::TlsCertificateError").finish() } - ErrorCode::TlsAlertReceived(e) => f - .debug_tuple("ErrorCode::TlsAlertReceived") - .field(e) - .finish(), + ErrorCode::TlsAlertReceived(e) => { + f.debug_tuple("ErrorCode::TlsAlertReceived") + .field(e) + .finish() + } ErrorCode::HttpRequestDenied => { f.debug_tuple("ErrorCode::HttpRequestDenied").finish() } - ErrorCode::HttpRequestLengthRequired => f - .debug_tuple("ErrorCode::HttpRequestLengthRequired") - .finish(), - ErrorCode::HttpRequestBodySize(e) => f - .debug_tuple("ErrorCode::HttpRequestBodySize") - .field(e) - .finish(), - ErrorCode::HttpRequestMethodInvalid => f - .debug_tuple("ErrorCode::HttpRequestMethodInvalid") - .finish(), + ErrorCode::HttpRequestLengthRequired => { + f.debug_tuple("ErrorCode::HttpRequestLengthRequired") + .finish() + } + ErrorCode::HttpRequestBodySize(e) => { + f.debug_tuple("ErrorCode::HttpRequestBodySize") + .field(e) + .finish() + } + ErrorCode::HttpRequestMethodInvalid => { + f.debug_tuple("ErrorCode::HttpRequestMethodInvalid") + .finish() + } ErrorCode::HttpRequestUriInvalid => { f.debug_tuple("ErrorCode::HttpRequestUriInvalid").finish() } ErrorCode::HttpRequestUriTooLong => { f.debug_tuple("ErrorCode::HttpRequestUriTooLong").finish() } - ErrorCode::HttpRequestHeaderSectionSize(e) => f - .debug_tuple("ErrorCode::HttpRequestHeaderSectionSize") - .field(e) - .finish(), - ErrorCode::HttpRequestHeaderSize(e) => f - .debug_tuple("ErrorCode::HttpRequestHeaderSize") - .field(e) - .finish(), - ErrorCode::HttpRequestTrailerSectionSize(e) => f - .debug_tuple("ErrorCode::HttpRequestTrailerSectionSize") - .field(e) - .finish(), - ErrorCode::HttpRequestTrailerSize(e) => f - .debug_tuple("ErrorCode::HttpRequestTrailerSize") - .field(e) - .finish(), + ErrorCode::HttpRequestHeaderSectionSize(e) => { + f.debug_tuple("ErrorCode::HttpRequestHeaderSectionSize") + .field(e) + .finish() + } + ErrorCode::HttpRequestHeaderSize(e) => { + f.debug_tuple("ErrorCode::HttpRequestHeaderSize") + .field(e) + .finish() + } + ErrorCode::HttpRequestTrailerSectionSize(e) => { + f.debug_tuple("ErrorCode::HttpRequestTrailerSectionSize") + .field(e) + .finish() + } + ErrorCode::HttpRequestTrailerSize(e) => { + f.debug_tuple("ErrorCode::HttpRequestTrailerSize") + .field(e) + .finish() + } ErrorCode::HttpResponseIncomplete => { f.debug_tuple("ErrorCode::HttpResponseIncomplete").finish() } - ErrorCode::HttpResponseHeaderSectionSize(e) => f - .debug_tuple("ErrorCode::HttpResponseHeaderSectionSize") - .field(e) - .finish(), - ErrorCode::HttpResponseHeaderSize(e) => f - .debug_tuple("ErrorCode::HttpResponseHeaderSize") - .field(e) - .finish(), - ErrorCode::HttpResponseBodySize(e) => f - .debug_tuple("ErrorCode::HttpResponseBodySize") - .field(e) - .finish(), - ErrorCode::HttpResponseTrailerSectionSize(e) => f - .debug_tuple("ErrorCode::HttpResponseTrailerSectionSize") - .field(e) - .finish(), - ErrorCode::HttpResponseTrailerSize(e) => f - .debug_tuple("ErrorCode::HttpResponseTrailerSize") - .field(e) - .finish(), - ErrorCode::HttpResponseTransferCoding(e) => f - .debug_tuple("ErrorCode::HttpResponseTransferCoding") - .field(e) - .finish(), - ErrorCode::HttpResponseContentCoding(e) => f - .debug_tuple("ErrorCode::HttpResponseContentCoding") - .field(e) - .finish(), + ErrorCode::HttpResponseHeaderSectionSize(e) => { + f.debug_tuple("ErrorCode::HttpResponseHeaderSectionSize") + .field(e) + .finish() + } + ErrorCode::HttpResponseHeaderSize(e) => { + f.debug_tuple("ErrorCode::HttpResponseHeaderSize") + .field(e) + .finish() + } + ErrorCode::HttpResponseBodySize(e) => { + f.debug_tuple("ErrorCode::HttpResponseBodySize") + .field(e) + .finish() + } + ErrorCode::HttpResponseTrailerSectionSize(e) => { + f.debug_tuple("ErrorCode::HttpResponseTrailerSectionSize") + .field(e) + .finish() + } + ErrorCode::HttpResponseTrailerSize(e) => { + f.debug_tuple("ErrorCode::HttpResponseTrailerSize") + .field(e) + .finish() + } + ErrorCode::HttpResponseTransferCoding(e) => { + f.debug_tuple("ErrorCode::HttpResponseTransferCoding") + .field(e) + .finish() + } + ErrorCode::HttpResponseContentCoding(e) => { + f.debug_tuple("ErrorCode::HttpResponseContentCoding") + .field(e) + .finish() + } ErrorCode::HttpResponseTimeout => { f.debug_tuple("ErrorCode::HttpResponseTimeout").finish() } @@ -20204,11 +22365,13 @@ pub mod exports { } } impl ::core::fmt::Display for ErrorCode { - 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 ErrorCode {} /// This type enumerates the different kinds of errors that may occur when /// setting or appending to a `fields` resource. @@ -20226,7 +22389,10 @@ pub mod exports { Immutable, } impl ::core::fmt::Debug for HeaderError { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { HeaderError::InvalidSyntax => { f.debug_tuple("HeaderError::InvalidSyntax").finish() @@ -20241,11 +22407,13 @@ pub mod exports { } } impl ::core::fmt::Display for HeaderError { - 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 HeaderError {} /// Field keys are always strings. pub type FieldKey = _rt::String; @@ -20263,15 +22431,12 @@ pub mod exports { /// `incoming-request.headers`, `outgoing-request.headers`) might be be /// immutable. In an immutable fields, the `set`, `append`, and `delete` /// operations will fail with `header-error.immutable`. - #[derive(Debug)] #[repr(transparent)] pub struct Fields { handle: _rt::Resource, } - type _FieldsRep = Option; - impl Fields { /// Creates a new resource from the specified representation. /// @@ -20281,77 +22446,70 @@ pub mod exports { pub fn new(val: T) -> Self { Self::type_guard::(); let val: _FieldsRep = Some(val); - let ptr: *mut _FieldsRep = _rt::Box::into_raw(_rt::Box::new(val)); + let ptr: *mut _FieldsRep = _rt::Box::into_raw( + _rt::Box::new(val), + ); unsafe { Self::from_handle(T::_resource_new(ptr.cast())) } } - /// Gets access to the underlying `T` which represents this resource. pub fn get(&self) -> &T { let ptr = unsafe { &*self.as_ptr::() }; ptr.as_ref().unwrap() } - /// Gets mutable access to the underlying `T` which represents this /// resource. pub fn get_mut(&mut self) -> &mut T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_mut().unwrap() } - /// Consumes this resource and returns the underlying `T`. pub fn into_inner(self) -> T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.take().unwrap() } - #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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) } - - // It's theoretically possible to implement the `GuestFields` trait twice - // so guard against using it with two different types here. #[doc(hidden)] fn type_guard() { use core::any::TypeId; static mut LAST_TYPE: Option = None; unsafe { - assert!(!cfg!(target_feature = "threads")); + assert!(! cfg!(target_feature = "atomics")); let id = TypeId::of::(); match LAST_TYPE { - Some(ty) => assert!( - ty == id, - "cannot use two types with this resource type" - ), + Some(ty) => { + assert!( + ty == id, "cannot use two types with this resource type" + ) + } None => LAST_TYPE = Some(id), } } } - #[doc(hidden)] pub unsafe fn dtor(handle: *mut u8) { Self::type_guard::(); - let _ = _rt::Box::from_raw(handle as *mut _FieldsRep); + let _ = unsafe { + _rt::Box::from_raw(handle as *mut _FieldsRep) + }; } - fn as_ptr(&self) -> *mut _FieldsRep { Fields::type_guard::(); T::_resource_rep(self.handle()).cast() } } - /// A borrowed version of [`Fields`] which represents a borrowed value /// with the lifetime `'a`. #[derive(Debug)] @@ -20360,7 +22518,6 @@ pub mod exports { rep: *mut u8, _marker: core::marker::PhantomData<&'a Fields>, } - impl<'a> FieldsBorrow<'a> { #[doc(hidden)] pub unsafe fn lift(rep: usize) -> Self { @@ -20369,41 +22526,32 @@ pub mod exports { _marker: core::marker::PhantomData, } } - /// Gets access to the underlying `T` in this resource. pub fn get(&self) -> &T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_ref().unwrap() } - - // NB: mutable access is not allowed due to the component model allowing - // multiple borrows of the same resource. - fn as_ptr(&self) -> *mut _FieldsRep { Fields::type_guard::(); self.rep.cast() } } - unsafe impl _rt::WasmResource for Fields { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]fields"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - /// Headers is an alias for Fields. pub type Headers = Fields; /// Headers is an alias for Fields. @@ -20413,15 +22561,12 @@ pub mod exports { /// Trailers is an alias for Fields. pub type TrailersBorrow<'a> = FieldsBorrow<'a>; /// Represents an incoming HTTP Request. - #[derive(Debug)] #[repr(transparent)] pub struct IncomingRequest { handle: _rt::Resource, } - type _IncomingRequestRep = Option; - impl IncomingRequest { /// Creates a new resource from the specified representation. /// @@ -20431,78 +22576,72 @@ pub mod exports { pub fn new(val: T) -> Self { Self::type_guard::(); let val: _IncomingRequestRep = Some(val); - let ptr: *mut _IncomingRequestRep = - _rt::Box::into_raw(_rt::Box::new(val)); + let ptr: *mut _IncomingRequestRep = _rt::Box::into_raw( + _rt::Box::new(val), + ); unsafe { Self::from_handle(T::_resource_new(ptr.cast())) } } - /// Gets access to the underlying `T` which represents this resource. pub fn get(&self) -> &T { let ptr = unsafe { &*self.as_ptr::() }; ptr.as_ref().unwrap() } - /// Gets mutable access to the underlying `T` which represents this /// resource. pub fn get_mut(&mut self) -> &mut T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_mut().unwrap() } - /// Consumes this resource and returns the underlying `T`. pub fn into_inner(self) -> T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.take().unwrap() } - #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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) } - - // It's theoretically possible to implement the `GuestIncomingRequest` trait twice - // so guard against using it with two different types here. #[doc(hidden)] fn type_guard() { use core::any::TypeId; static mut LAST_TYPE: Option = None; unsafe { - assert!(!cfg!(target_feature = "threads")); + assert!(! cfg!(target_feature = "atomics")); let id = TypeId::of::(); match LAST_TYPE { - Some(ty) => assert!( - ty == id, - "cannot use two types with this resource type" - ), + Some(ty) => { + assert!( + ty == id, "cannot use two types with this resource type" + ) + } None => LAST_TYPE = Some(id), } } } - #[doc(hidden)] pub unsafe fn dtor(handle: *mut u8) { Self::type_guard::(); - let _ = _rt::Box::from_raw(handle as *mut _IncomingRequestRep); + let _ = unsafe { + _rt::Box::from_raw(handle as *mut _IncomingRequestRep) + }; } - - fn as_ptr(&self) -> *mut _IncomingRequestRep { + fn as_ptr( + &self, + ) -> *mut _IncomingRequestRep { IncomingRequest::type_guard::(); T::_resource_rep(self.handle()).cast() } } - /// A borrowed version of [`IncomingRequest`] which represents a borrowed value /// with the lifetime `'a`. #[derive(Debug)] @@ -20511,7 +22650,6 @@ pub mod exports { rep: *mut u8, _marker: core::marker::PhantomData<&'a IncomingRequest>, } - impl<'a> IncomingRequestBorrow<'a> { #[doc(hidden)] pub unsafe fn lift(rep: usize) -> Self { @@ -20520,51 +22658,39 @@ pub mod exports { _marker: core::marker::PhantomData, } } - /// Gets access to the underlying `T` in this resource. pub fn get(&self) -> &T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_ref().unwrap() } - - // NB: mutable access is not allowed due to the component model allowing - // multiple borrows of the same resource. - fn as_ptr(&self) -> *mut _IncomingRequestRep { IncomingRequest::type_guard::(); self.rep.cast() } } - unsafe impl _rt::WasmResource for IncomingRequest { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]incoming-request"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - /// Represents an outgoing HTTP Request. - #[derive(Debug)] #[repr(transparent)] pub struct OutgoingRequest { handle: _rt::Resource, } - type _OutgoingRequestRep = Option; - impl OutgoingRequest { /// Creates a new resource from the specified representation. /// @@ -20574,78 +22700,72 @@ pub mod exports { pub fn new(val: T) -> Self { Self::type_guard::(); let val: _OutgoingRequestRep = Some(val); - let ptr: *mut _OutgoingRequestRep = - _rt::Box::into_raw(_rt::Box::new(val)); + let ptr: *mut _OutgoingRequestRep = _rt::Box::into_raw( + _rt::Box::new(val), + ); unsafe { Self::from_handle(T::_resource_new(ptr.cast())) } } - /// Gets access to the underlying `T` which represents this resource. pub fn get(&self) -> &T { let ptr = unsafe { &*self.as_ptr::() }; ptr.as_ref().unwrap() } - /// Gets mutable access to the underlying `T` which represents this /// resource. pub fn get_mut(&mut self) -> &mut T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_mut().unwrap() } - /// Consumes this resource and returns the underlying `T`. pub fn into_inner(self) -> T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.take().unwrap() } - #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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) } - - // It's theoretically possible to implement the `GuestOutgoingRequest` trait twice - // so guard against using it with two different types here. #[doc(hidden)] fn type_guard() { use core::any::TypeId; static mut LAST_TYPE: Option = None; unsafe { - assert!(!cfg!(target_feature = "threads")); + assert!(! cfg!(target_feature = "atomics")); let id = TypeId::of::(); match LAST_TYPE { - Some(ty) => assert!( - ty == id, - "cannot use two types with this resource type" - ), + Some(ty) => { + assert!( + ty == id, "cannot use two types with this resource type" + ) + } None => LAST_TYPE = Some(id), } } } - #[doc(hidden)] pub unsafe fn dtor(handle: *mut u8) { Self::type_guard::(); - let _ = _rt::Box::from_raw(handle as *mut _OutgoingRequestRep); + let _ = unsafe { + _rt::Box::from_raw(handle as *mut _OutgoingRequestRep) + }; } - - fn as_ptr(&self) -> *mut _OutgoingRequestRep { + fn as_ptr( + &self, + ) -> *mut _OutgoingRequestRep { OutgoingRequest::type_guard::(); T::_resource_rep(self.handle()).cast() } } - /// A borrowed version of [`OutgoingRequest`] which represents a borrowed value /// with the lifetime `'a`. #[derive(Debug)] @@ -20654,7 +22774,6 @@ pub mod exports { rep: *mut u8, _marker: core::marker::PhantomData<&'a OutgoingRequest>, } - impl<'a> OutgoingRequestBorrow<'a> { #[doc(hidden)] pub unsafe fn lift(rep: usize) -> Self { @@ -20663,56 +22782,44 @@ pub mod exports { _marker: core::marker::PhantomData, } } - /// Gets access to the underlying `T` in this resource. pub fn get(&self) -> &T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_ref().unwrap() } - - // NB: mutable access is not allowed due to the component model allowing - // multiple borrows of the same resource. - fn as_ptr(&self) -> *mut _OutgoingRequestRep { OutgoingRequest::type_guard::(); self.rep.cast() } } - unsafe impl _rt::WasmResource for OutgoingRequest { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]outgoing-request"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - /// Parameters for making an HTTP Request. Each of these parameters is /// currently an optional timeout applicable to the transport layer of the /// HTTP protocol. /// /// These timeouts are separate from any the user may use to bound a /// blocking call to `wasi:io/poll.poll`. - #[derive(Debug)] #[repr(transparent)] pub struct RequestOptions { handle: _rt::Resource, } - type _RequestOptionsRep = Option; - impl RequestOptions { /// Creates a new resource from the specified representation. /// @@ -20722,78 +22829,72 @@ pub mod exports { pub fn new(val: T) -> Self { Self::type_guard::(); let val: _RequestOptionsRep = Some(val); - let ptr: *mut _RequestOptionsRep = - _rt::Box::into_raw(_rt::Box::new(val)); + let ptr: *mut _RequestOptionsRep = _rt::Box::into_raw( + _rt::Box::new(val), + ); unsafe { Self::from_handle(T::_resource_new(ptr.cast())) } } - /// Gets access to the underlying `T` which represents this resource. pub fn get(&self) -> &T { let ptr = unsafe { &*self.as_ptr::() }; ptr.as_ref().unwrap() } - /// Gets mutable access to the underlying `T` which represents this /// resource. pub fn get_mut(&mut self) -> &mut T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_mut().unwrap() } - /// Consumes this resource and returns the underlying `T`. pub fn into_inner(self) -> T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.take().unwrap() } - #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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) } - - // It's theoretically possible to implement the `GuestRequestOptions` trait twice - // so guard against using it with two different types here. #[doc(hidden)] fn type_guard() { use core::any::TypeId; static mut LAST_TYPE: Option = None; unsafe { - assert!(!cfg!(target_feature = "threads")); + assert!(! cfg!(target_feature = "atomics")); let id = TypeId::of::(); match LAST_TYPE { - Some(ty) => assert!( - ty == id, - "cannot use two types with this resource type" - ), + Some(ty) => { + assert!( + ty == id, "cannot use two types with this resource type" + ) + } None => LAST_TYPE = Some(id), } } } - #[doc(hidden)] pub unsafe fn dtor(handle: *mut u8) { Self::type_guard::(); - let _ = _rt::Box::from_raw(handle as *mut _RequestOptionsRep); + let _ = unsafe { + _rt::Box::from_raw(handle as *mut _RequestOptionsRep) + }; } - - fn as_ptr(&self) -> *mut _RequestOptionsRep { + fn as_ptr( + &self, + ) -> *mut _RequestOptionsRep { RequestOptions::type_guard::(); T::_resource_rep(self.handle()).cast() } } - /// A borrowed version of [`RequestOptions`] which represents a borrowed value /// with the lifetime `'a`. #[derive(Debug)] @@ -20802,7 +22903,6 @@ pub mod exports { rep: *mut u8, _marker: core::marker::PhantomData<&'a RequestOptions>, } - impl<'a> RequestOptionsBorrow<'a> { #[doc(hidden)] pub unsafe fn lift(rep: usize) -> Self { @@ -20811,55 +22911,43 @@ pub mod exports { _marker: core::marker::PhantomData, } } - /// Gets access to the underlying `T` in this resource. pub fn get(&self) -> &T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_ref().unwrap() } - - // NB: mutable access is not allowed due to the component model allowing - // multiple borrows of the same resource. - fn as_ptr(&self) -> *mut _RequestOptionsRep { RequestOptions::type_guard::(); self.rep.cast() } } - unsafe impl _rt::WasmResource for RequestOptions { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]request-options"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - /// Represents the ability to send an HTTP Response. /// /// This resource is used by the `wasi:http/incoming-handler` interface to /// allow a Response to be sent corresponding to the Request provided as the /// other argument to `incoming-handler.handle`. - #[derive(Debug)] #[repr(transparent)] pub struct ResponseOutparam { handle: _rt::Resource, } - type _ResponseOutparamRep = Option; - impl ResponseOutparam { /// Creates a new resource from the specified representation. /// @@ -20869,78 +22957,72 @@ pub mod exports { pub fn new(val: T) -> Self { Self::type_guard::(); let val: _ResponseOutparamRep = Some(val); - let ptr: *mut _ResponseOutparamRep = - _rt::Box::into_raw(_rt::Box::new(val)); + let ptr: *mut _ResponseOutparamRep = _rt::Box::into_raw( + _rt::Box::new(val), + ); unsafe { Self::from_handle(T::_resource_new(ptr.cast())) } } - /// Gets access to the underlying `T` which represents this resource. pub fn get(&self) -> &T { let ptr = unsafe { &*self.as_ptr::() }; ptr.as_ref().unwrap() } - /// Gets mutable access to the underlying `T` which represents this /// resource. pub fn get_mut(&mut self) -> &mut T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_mut().unwrap() } - /// Consumes this resource and returns the underlying `T`. pub fn into_inner(self) -> T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.take().unwrap() } - #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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) } - - // It's theoretically possible to implement the `GuestResponseOutparam` trait twice - // so guard against using it with two different types here. #[doc(hidden)] fn type_guard() { use core::any::TypeId; static mut LAST_TYPE: Option = None; unsafe { - assert!(!cfg!(target_feature = "threads")); + assert!(! cfg!(target_feature = "atomics")); let id = TypeId::of::(); match LAST_TYPE { - Some(ty) => assert!( - ty == id, - "cannot use two types with this resource type" - ), + Some(ty) => { + assert!( + ty == id, "cannot use two types with this resource type" + ) + } None => LAST_TYPE = Some(id), } } } - #[doc(hidden)] pub unsafe fn dtor(handle: *mut u8) { Self::type_guard::(); - let _ = _rt::Box::from_raw(handle as *mut _ResponseOutparamRep); + let _ = unsafe { + _rt::Box::from_raw(handle as *mut _ResponseOutparamRep) + }; } - - fn as_ptr(&self) -> *mut _ResponseOutparamRep { + fn as_ptr( + &self, + ) -> *mut _ResponseOutparamRep { ResponseOutparam::type_guard::(); T::_resource_rep(self.handle()).cast() } } - /// A borrowed version of [`ResponseOutparam`] which represents a borrowed value /// with the lifetime `'a`. #[derive(Debug)] @@ -20949,7 +23031,6 @@ pub mod exports { rep: *mut u8, _marker: core::marker::PhantomData<&'a ResponseOutparam>, } - impl<'a> ResponseOutparamBorrow<'a> { #[doc(hidden)] pub unsafe fn lift(rep: usize) -> Self { @@ -20958,53 +23039,41 @@ pub mod exports { _marker: core::marker::PhantomData, } } - /// Gets access to the underlying `T` in this resource. pub fn get(&self) -> &T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_ref().unwrap() } - - // NB: mutable access is not allowed due to the component model allowing - // multiple borrows of the same resource. - fn as_ptr(&self) -> *mut _ResponseOutparamRep { ResponseOutparam::type_guard::(); self.rep.cast() } } - unsafe impl _rt::WasmResource for ResponseOutparam { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]response-outparam"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - /// This type corresponds to the HTTP standard Status Code. pub type StatusCode = u16; /// Represents an incoming HTTP Response. - #[derive(Debug)] #[repr(transparent)] pub struct IncomingResponse { handle: _rt::Resource, } - type _IncomingResponseRep = Option; - impl IncomingResponse { /// Creates a new resource from the specified representation. /// @@ -21014,78 +23083,72 @@ pub mod exports { pub fn new(val: T) -> Self { Self::type_guard::(); let val: _IncomingResponseRep = Some(val); - let ptr: *mut _IncomingResponseRep = - _rt::Box::into_raw(_rt::Box::new(val)); + let ptr: *mut _IncomingResponseRep = _rt::Box::into_raw( + _rt::Box::new(val), + ); unsafe { Self::from_handle(T::_resource_new(ptr.cast())) } } - /// Gets access to the underlying `T` which represents this resource. pub fn get(&self) -> &T { let ptr = unsafe { &*self.as_ptr::() }; ptr.as_ref().unwrap() } - /// Gets mutable access to the underlying `T` which represents this /// resource. pub fn get_mut(&mut self) -> &mut T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_mut().unwrap() } - /// Consumes this resource and returns the underlying `T`. pub fn into_inner(self) -> T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.take().unwrap() } - #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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) } - - // It's theoretically possible to implement the `GuestIncomingResponse` trait twice - // so guard against using it with two different types here. #[doc(hidden)] fn type_guard() { use core::any::TypeId; static mut LAST_TYPE: Option = None; unsafe { - assert!(!cfg!(target_feature = "threads")); + assert!(! cfg!(target_feature = "atomics")); let id = TypeId::of::(); match LAST_TYPE { - Some(ty) => assert!( - ty == id, - "cannot use two types with this resource type" - ), + Some(ty) => { + assert!( + ty == id, "cannot use two types with this resource type" + ) + } None => LAST_TYPE = Some(id), } } } - #[doc(hidden)] pub unsafe fn dtor(handle: *mut u8) { Self::type_guard::(); - let _ = _rt::Box::from_raw(handle as *mut _IncomingResponseRep); + let _ = unsafe { + _rt::Box::from_raw(handle as *mut _IncomingResponseRep) + }; } - - fn as_ptr(&self) -> *mut _IncomingResponseRep { + fn as_ptr( + &self, + ) -> *mut _IncomingResponseRep { IncomingResponse::type_guard::(); T::_resource_rep(self.handle()).cast() } } - /// A borrowed version of [`IncomingResponse`] which represents a borrowed value /// with the lifetime `'a`. #[derive(Debug)] @@ -21094,7 +23157,6 @@ pub mod exports { rep: *mut u8, _marker: core::marker::PhantomData<&'a IncomingResponse>, } - impl<'a> IncomingResponseBorrow<'a> { #[doc(hidden)] pub unsafe fn lift(rep: usize) -> Self { @@ -21103,41 +23165,32 @@ pub mod exports { _marker: core::marker::PhantomData, } } - /// Gets access to the underlying `T` in this resource. pub fn get(&self) -> &T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_ref().unwrap() } - - // NB: mutable access is not allowed due to the component model allowing - // multiple borrows of the same resource. - fn as_ptr(&self) -> *mut _IncomingResponseRep { IncomingResponse::type_guard::(); self.rep.cast() } } - unsafe impl _rt::WasmResource for IncomingResponse { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]incoming-response"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - /// Represents an incoming HTTP Request or Response's Body. /// /// A body has both its contents - a stream of bytes - and a (possibly @@ -21146,15 +23199,12 @@ pub mod exports { /// an `input-stream` and the delivery of trailers as a `future-trailers`, /// and ensures that the user of this interface may only be consuming either /// the body contents or waiting on trailers at any given time. - #[derive(Debug)] #[repr(transparent)] pub struct IncomingBody { handle: _rt::Resource, } - type _IncomingBodyRep = Option; - impl IncomingBody { /// Creates a new resource from the specified representation. /// @@ -21164,77 +23214,70 @@ pub mod exports { pub fn new(val: T) -> Self { Self::type_guard::(); let val: _IncomingBodyRep = Some(val); - let ptr: *mut _IncomingBodyRep = _rt::Box::into_raw(_rt::Box::new(val)); + let ptr: *mut _IncomingBodyRep = _rt::Box::into_raw( + _rt::Box::new(val), + ); unsafe { Self::from_handle(T::_resource_new(ptr.cast())) } } - /// Gets access to the underlying `T` which represents this resource. pub fn get(&self) -> &T { let ptr = unsafe { &*self.as_ptr::() }; ptr.as_ref().unwrap() } - /// Gets mutable access to the underlying `T` which represents this /// resource. pub fn get_mut(&mut self) -> &mut T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_mut().unwrap() } - /// Consumes this resource and returns the underlying `T`. pub fn into_inner(self) -> T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.take().unwrap() } - #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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) } - - // It's theoretically possible to implement the `GuestIncomingBody` trait twice - // so guard against using it with two different types here. #[doc(hidden)] fn type_guard() { use core::any::TypeId; static mut LAST_TYPE: Option = None; unsafe { - assert!(!cfg!(target_feature = "threads")); + assert!(! cfg!(target_feature = "atomics")); let id = TypeId::of::(); match LAST_TYPE { - Some(ty) => assert!( - ty == id, - "cannot use two types with this resource type" - ), + Some(ty) => { + assert!( + ty == id, "cannot use two types with this resource type" + ) + } None => LAST_TYPE = Some(id), } } } - #[doc(hidden)] pub unsafe fn dtor(handle: *mut u8) { Self::type_guard::(); - let _ = _rt::Box::from_raw(handle as *mut _IncomingBodyRep); + let _ = unsafe { + _rt::Box::from_raw(handle as *mut _IncomingBodyRep) + }; } - fn as_ptr(&self) -> *mut _IncomingBodyRep { IncomingBody::type_guard::(); T::_resource_rep(self.handle()).cast() } } - /// A borrowed version of [`IncomingBody`] which represents a borrowed value /// with the lifetime `'a`. #[derive(Debug)] @@ -21243,7 +23286,6 @@ pub mod exports { rep: *mut u8, _marker: core::marker::PhantomData<&'a IncomingBody>, } - impl<'a> IncomingBodyBorrow<'a> { #[doc(hidden)] pub unsafe fn lift(rep: usize) -> Self { @@ -21252,55 +23294,43 @@ pub mod exports { _marker: core::marker::PhantomData, } } - /// Gets access to the underlying `T` in this resource. pub fn get(&self) -> &T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_ref().unwrap() } - - // NB: mutable access is not allowed due to the component model allowing - // multiple borrows of the same resource. - fn as_ptr(&self) -> *mut _IncomingBodyRep { IncomingBody::type_guard::(); self.rep.cast() } } - unsafe impl _rt::WasmResource for IncomingBody { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]incoming-body"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - /// Represents a future which may eventaully return trailers, or an error. /// /// In the case that the incoming HTTP Request or Response did not have any /// trailers, this future will resolve to the empty set of trailers once the /// complete Request or Response body has been received. - #[derive(Debug)] #[repr(transparent)] pub struct FutureTrailers { handle: _rt::Resource, } - type _FutureTrailersRep = Option; - impl FutureTrailers { /// Creates a new resource from the specified representation. /// @@ -21310,78 +23340,72 @@ pub mod exports { pub fn new(val: T) -> Self { Self::type_guard::(); let val: _FutureTrailersRep = Some(val); - let ptr: *mut _FutureTrailersRep = - _rt::Box::into_raw(_rt::Box::new(val)); + let ptr: *mut _FutureTrailersRep = _rt::Box::into_raw( + _rt::Box::new(val), + ); unsafe { Self::from_handle(T::_resource_new(ptr.cast())) } } - /// Gets access to the underlying `T` which represents this resource. pub fn get(&self) -> &T { let ptr = unsafe { &*self.as_ptr::() }; ptr.as_ref().unwrap() } - /// Gets mutable access to the underlying `T` which represents this /// resource. pub fn get_mut(&mut self) -> &mut T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_mut().unwrap() } - /// Consumes this resource and returns the underlying `T`. pub fn into_inner(self) -> T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.take().unwrap() } - #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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) } - - // It's theoretically possible to implement the `GuestFutureTrailers` trait twice - // so guard against using it with two different types here. #[doc(hidden)] fn type_guard() { use core::any::TypeId; static mut LAST_TYPE: Option = None; unsafe { - assert!(!cfg!(target_feature = "threads")); + assert!(! cfg!(target_feature = "atomics")); let id = TypeId::of::(); match LAST_TYPE { - Some(ty) => assert!( - ty == id, - "cannot use two types with this resource type" - ), + Some(ty) => { + assert!( + ty == id, "cannot use two types with this resource type" + ) + } None => LAST_TYPE = Some(id), } } } - #[doc(hidden)] pub unsafe fn dtor(handle: *mut u8) { Self::type_guard::(); - let _ = _rt::Box::from_raw(handle as *mut _FutureTrailersRep); + let _ = unsafe { + _rt::Box::from_raw(handle as *mut _FutureTrailersRep) + }; } - - fn as_ptr(&self) -> *mut _FutureTrailersRep { + fn as_ptr( + &self, + ) -> *mut _FutureTrailersRep { FutureTrailers::type_guard::(); T::_resource_rep(self.handle()).cast() } } - /// A borrowed version of [`FutureTrailers`] which represents a borrowed value /// with the lifetime `'a`. #[derive(Debug)] @@ -21390,7 +23414,6 @@ pub mod exports { rep: *mut u8, _marker: core::marker::PhantomData<&'a FutureTrailers>, } - impl<'a> FutureTrailersBorrow<'a> { #[doc(hidden)] pub unsafe fn lift(rep: usize) -> Self { @@ -21399,51 +23422,39 @@ pub mod exports { _marker: core::marker::PhantomData, } } - /// Gets access to the underlying `T` in this resource. pub fn get(&self) -> &T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_ref().unwrap() } - - // NB: mutable access is not allowed due to the component model allowing - // multiple borrows of the same resource. - fn as_ptr(&self) -> *mut _FutureTrailersRep { FutureTrailers::type_guard::(); self.rep.cast() } } - unsafe impl _rt::WasmResource for FutureTrailers { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]future-trailers"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - /// Represents an outgoing HTTP Response. - #[derive(Debug)] #[repr(transparent)] pub struct OutgoingResponse { handle: _rt::Resource, } - type _OutgoingResponseRep = Option; - impl OutgoingResponse { /// Creates a new resource from the specified representation. /// @@ -21453,78 +23464,72 @@ pub mod exports { pub fn new(val: T) -> Self { Self::type_guard::(); let val: _OutgoingResponseRep = Some(val); - let ptr: *mut _OutgoingResponseRep = - _rt::Box::into_raw(_rt::Box::new(val)); + let ptr: *mut _OutgoingResponseRep = _rt::Box::into_raw( + _rt::Box::new(val), + ); unsafe { Self::from_handle(T::_resource_new(ptr.cast())) } } - /// Gets access to the underlying `T` which represents this resource. pub fn get(&self) -> &T { let ptr = unsafe { &*self.as_ptr::() }; ptr.as_ref().unwrap() } - /// Gets mutable access to the underlying `T` which represents this /// resource. pub fn get_mut(&mut self) -> &mut T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_mut().unwrap() } - /// Consumes this resource and returns the underlying `T`. pub fn into_inner(self) -> T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.take().unwrap() } - #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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) } - - // It's theoretically possible to implement the `GuestOutgoingResponse` trait twice - // so guard against using it with two different types here. #[doc(hidden)] fn type_guard() { use core::any::TypeId; static mut LAST_TYPE: Option = None; unsafe { - assert!(!cfg!(target_feature = "threads")); + assert!(! cfg!(target_feature = "atomics")); let id = TypeId::of::(); match LAST_TYPE { - Some(ty) => assert!( - ty == id, - "cannot use two types with this resource type" - ), + Some(ty) => { + assert!( + ty == id, "cannot use two types with this resource type" + ) + } None => LAST_TYPE = Some(id), } } } - #[doc(hidden)] pub unsafe fn dtor(handle: *mut u8) { Self::type_guard::(); - let _ = _rt::Box::from_raw(handle as *mut _OutgoingResponseRep); + let _ = unsafe { + _rt::Box::from_raw(handle as *mut _OutgoingResponseRep) + }; } - - fn as_ptr(&self) -> *mut _OutgoingResponseRep { + fn as_ptr( + &self, + ) -> *mut _OutgoingResponseRep { OutgoingResponse::type_guard::(); T::_resource_rep(self.handle()).cast() } } - /// A borrowed version of [`OutgoingResponse`] which represents a borrowed value /// with the lifetime `'a`. #[derive(Debug)] @@ -21533,7 +23538,6 @@ pub mod exports { rep: *mut u8, _marker: core::marker::PhantomData<&'a OutgoingResponse>, } - impl<'a> OutgoingResponseBorrow<'a> { #[doc(hidden)] pub unsafe fn lift(rep: usize) -> Self { @@ -21542,41 +23546,32 @@ pub mod exports { _marker: core::marker::PhantomData, } } - /// Gets access to the underlying `T` in this resource. pub fn get(&self) -> &T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_ref().unwrap() } - - // NB: mutable access is not allowed due to the component model allowing - // multiple borrows of the same resource. - fn as_ptr(&self) -> *mut _OutgoingResponseRep { OutgoingResponse::type_guard::(); self.rep.cast() } } - unsafe impl _rt::WasmResource for OutgoingResponse { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]outgoing-response"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - /// Represents an outgoing HTTP Request or Response's Body. /// /// A body has both its contents - a stream of bytes - and a (possibly @@ -21593,15 +23588,12 @@ pub mod exports { /// error to the HTTP protocol by whatever means it has available, /// including: corrupting the body on the wire, aborting the associated /// Request, or sending a late status code for the Response. - #[derive(Debug)] #[repr(transparent)] pub struct OutgoingBody { handle: _rt::Resource, } - type _OutgoingBodyRep = Option; - impl OutgoingBody { /// Creates a new resource from the specified representation. /// @@ -21611,77 +23603,70 @@ pub mod exports { pub fn new(val: T) -> Self { Self::type_guard::(); let val: _OutgoingBodyRep = Some(val); - let ptr: *mut _OutgoingBodyRep = _rt::Box::into_raw(_rt::Box::new(val)); + let ptr: *mut _OutgoingBodyRep = _rt::Box::into_raw( + _rt::Box::new(val), + ); unsafe { Self::from_handle(T::_resource_new(ptr.cast())) } } - /// Gets access to the underlying `T` which represents this resource. pub fn get(&self) -> &T { let ptr = unsafe { &*self.as_ptr::() }; ptr.as_ref().unwrap() } - /// Gets mutable access to the underlying `T` which represents this /// resource. pub fn get_mut(&mut self) -> &mut T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_mut().unwrap() } - /// Consumes this resource and returns the underlying `T`. pub fn into_inner(self) -> T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.take().unwrap() } - #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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) } - - // It's theoretically possible to implement the `GuestOutgoingBody` trait twice - // so guard against using it with two different types here. #[doc(hidden)] fn type_guard() { use core::any::TypeId; static mut LAST_TYPE: Option = None; unsafe { - assert!(!cfg!(target_feature = "threads")); + assert!(! cfg!(target_feature = "atomics")); let id = TypeId::of::(); match LAST_TYPE { - Some(ty) => assert!( - ty == id, - "cannot use two types with this resource type" - ), + Some(ty) => { + assert!( + ty == id, "cannot use two types with this resource type" + ) + } None => LAST_TYPE = Some(id), } } } - #[doc(hidden)] pub unsafe fn dtor(handle: *mut u8) { Self::type_guard::(); - let _ = _rt::Box::from_raw(handle as *mut _OutgoingBodyRep); + let _ = unsafe { + _rt::Box::from_raw(handle as *mut _OutgoingBodyRep) + }; } - fn as_ptr(&self) -> *mut _OutgoingBodyRep { OutgoingBody::type_guard::(); T::_resource_rep(self.handle()).cast() } } - /// A borrowed version of [`OutgoingBody`] which represents a borrowed value /// with the lifetime `'a`. #[derive(Debug)] @@ -21690,7 +23675,6 @@ pub mod exports { rep: *mut u8, _marker: core::marker::PhantomData<&'a OutgoingBody>, } - impl<'a> OutgoingBodyBorrow<'a> { #[doc(hidden)] pub unsafe fn lift(rep: usize) -> Self { @@ -21699,55 +23683,43 @@ pub mod exports { _marker: core::marker::PhantomData, } } - /// Gets access to the underlying `T` in this resource. pub fn get(&self) -> &T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_ref().unwrap() } - - // NB: mutable access is not allowed due to the component model allowing - // multiple borrows of the same resource. - fn as_ptr(&self) -> *mut _OutgoingBodyRep { OutgoingBody::type_guard::(); self.rep.cast() } } - unsafe impl _rt::WasmResource for OutgoingBody { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]outgoing-body"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - /// Represents a future which may eventaully return an incoming HTTP /// Response, or an error. /// /// This resource is returned by the `wasi:http/outgoing-handler` interface to /// provide the HTTP Response corresponding to the sent Request. - #[derive(Debug)] #[repr(transparent)] pub struct FutureIncomingResponse { handle: _rt::Resource, } - type _FutureIncomingResponseRep = Option; - impl FutureIncomingResponse { /// Creates a new resource from the specified representation. /// @@ -21757,72 +23729,67 @@ pub mod exports { pub fn new(val: T) -> Self { Self::type_guard::(); let val: _FutureIncomingResponseRep = Some(val); - let ptr: *mut _FutureIncomingResponseRep = - _rt::Box::into_raw(_rt::Box::new(val)); + let ptr: *mut _FutureIncomingResponseRep = _rt::Box::into_raw( + _rt::Box::new(val), + ); unsafe { Self::from_handle(T::_resource_new(ptr.cast())) } } - /// Gets access to the underlying `T` which represents this resource. pub fn get(&self) -> &T { let ptr = unsafe { &*self.as_ptr::() }; ptr.as_ref().unwrap() } - /// Gets mutable access to the underlying `T` which represents this /// resource. pub fn get_mut(&mut self) -> &mut T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_mut().unwrap() } - /// Consumes this resource and returns the underlying `T`. pub fn into_inner(self) -> T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.take().unwrap() } - #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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) } - - // It's theoretically possible to implement the `GuestFutureIncomingResponse` trait twice - // so guard against using it with two different types here. #[doc(hidden)] fn type_guard() { use core::any::TypeId; static mut LAST_TYPE: Option = None; unsafe { - assert!(!cfg!(target_feature = "threads")); + assert!(! cfg!(target_feature = "atomics")); let id = TypeId::of::(); match LAST_TYPE { - Some(ty) => assert!( - ty == id, - "cannot use two types with this resource type" - ), + Some(ty) => { + assert!( + ty == id, "cannot use two types with this resource type" + ) + } None => LAST_TYPE = Some(id), } } } - #[doc(hidden)] pub unsafe fn dtor(handle: *mut u8) { Self::type_guard::(); - let _ = _rt::Box::from_raw(handle as *mut _FutureIncomingResponseRep); + let _ = unsafe { + _rt::Box::from_raw( + handle as *mut _FutureIncomingResponseRep, + ) + }; } - fn as_ptr( &self, ) -> *mut _FutureIncomingResponseRep { @@ -21830,7 +23797,6 @@ pub mod exports { T::_resource_rep(self.handle()).cast() } } - /// A borrowed version of [`FutureIncomingResponse`] which represents a borrowed value /// with the lifetime `'a`. #[derive(Debug)] @@ -21839,7 +23805,6 @@ pub mod exports { rep: *mut u8, _marker: core::marker::PhantomData<&'a FutureIncomingResponse>, } - impl<'a> FutureIncomingResponseBorrow<'a> { #[doc(hidden)] pub unsafe fn lift(rep: usize) -> Self { @@ -21848,48 +23813,42 @@ pub mod exports { _marker: core::marker::PhantomData, } } - /// Gets access to the underlying `T` in this resource. pub fn get(&self) -> &T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_ref().unwrap() } - - // NB: mutable access is not allowed due to the component model allowing - // multiple borrows of the same resource. - fn as_ptr(&self) -> *mut _FutureIncomingResponseRep { FutureIncomingResponse::type_guard::(); self.rep.cast() } } - unsafe impl _rt::WasmResource for FutureIncomingResponse { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]future-incoming-response"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_http_error_code_cabi(arg0: i32) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = T::http_error_code(IoErrorBorrow::lift(arg0 as u32 as usize)); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + pub unsafe fn _export_http_error_code_cabi( + arg0: i32, + ) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::http_error_code(unsafe { + IoErrorBorrow::lift(arg0 as u32 as usize) + }); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Some(e) => { *ptr1.add(0).cast::() = (1i32) as u8; @@ -21910,8 +23869,12 @@ pub mod exports { let ptr3 = vec3.as_ptr().cast::(); let len3 = vec3.len(); ::core::mem::forget(vec3); - *ptr1.add(24).cast::() = len3; - *ptr1.add(20).cast::<*mut u8>() = ptr3.cast_mut(); + *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len3; + *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr3.cast_mut(); } None => { *ptr1.add(16).cast::() = (0i32) as u8; @@ -21919,11 +23882,17 @@ pub mod exports { }; match info_code2 { Some(e) => { - *ptr1.add(28).cast::() = (1i32) as u8; - *ptr1.add(30).cast::() = (_rt::as_i32(e)) as u16; + *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; + *ptr1 + .add(18 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (_rt::as_i32(e)) as u16; } None => { - *ptr1.add(28).cast::() = (0i32) as u8; + *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } }; } @@ -21980,16 +23949,24 @@ pub mod exports { }; match alert_message4 { Some(e) => { - *ptr1.add(20).cast::() = (1i32) as u8; + *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; let vec5 = (e.into_bytes()).into_boxed_slice(); let ptr5 = vec5.as_ptr().cast::(); let len5 = vec5.len(); ::core::mem::forget(vec5); - *ptr1.add(28).cast::() = len5; - *ptr1.add(24).cast::<*mut u8>() = ptr5.cast_mut(); + *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len5; + *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr5.cast_mut(); } None => { - *ptr1.add(20).cast::() = (0i32) as u8; + *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } }; } @@ -22043,26 +24020,39 @@ pub mod exports { } = e; match field_name6 { Some(e) => { - *ptr1.add(20).cast::() = (1i32) as u8; + *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; let vec7 = (e.into_bytes()).into_boxed_slice(); let ptr7 = vec7.as_ptr().cast::(); let len7 = vec7.len(); ::core::mem::forget(vec7); - *ptr1.add(28).cast::() = len7; - *ptr1.add(24).cast::<*mut u8>() = - ptr7.cast_mut(); + *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len7; + *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr7.cast_mut(); } None => { - *ptr1.add(20).cast::() = (0i32) as u8; + *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } }; match field_size6 { Some(e) => { - *ptr1.add(32).cast::() = (1i32) as u8; - *ptr1.add(36).cast::() = _rt::as_i32(e); + *ptr1 + .add(16 + 4 * ::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; + *ptr1 + .add(20 + 4 * ::core::mem::size_of::<*const u8>()) + .cast::() = _rt::as_i32(e); } None => { - *ptr1.add(32).cast::() = (0i32) as u8; + *ptr1 + .add(16 + 4 * ::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } }; } @@ -22096,8 +24086,12 @@ pub mod exports { let ptr9 = vec9.as_ptr().cast::(); let len9 = vec9.len(); ::core::mem::forget(vec9); - *ptr1.add(24).cast::() = len9; - *ptr1.add(20).cast::<*mut u8>() = ptr9.cast_mut(); + *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len9; + *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr9.cast_mut(); } None => { *ptr1.add(16).cast::() = (0i32) as u8; @@ -22105,11 +24099,17 @@ pub mod exports { }; match field_size8 { Some(e) => { - *ptr1.add(28).cast::() = (1i32) as u8; - *ptr1.add(32).cast::() = _rt::as_i32(e); + *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; + *ptr1 + .add(20 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = _rt::as_i32(e); } None => { - *ptr1.add(28).cast::() = (0i32) as u8; + *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } }; } @@ -22141,8 +24141,12 @@ pub mod exports { let ptr11 = vec11.as_ptr().cast::(); let len11 = vec11.len(); ::core::mem::forget(vec11); - *ptr1.add(24).cast::() = len11; - *ptr1.add(20).cast::<*mut u8>() = ptr11.cast_mut(); + *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len11; + *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr11.cast_mut(); } None => { *ptr1.add(16).cast::() = (0i32) as u8; @@ -22150,11 +24154,17 @@ pub mod exports { }; match field_size10 { Some(e) => { - *ptr1.add(28).cast::() = (1i32) as u8; - *ptr1.add(32).cast::() = _rt::as_i32(e); + *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; + *ptr1 + .add(20 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = _rt::as_i32(e); } None => { - *ptr1.add(28).cast::() = (0i32) as u8; + *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } }; } @@ -22195,8 +24205,12 @@ pub mod exports { let ptr13 = vec13.as_ptr().cast::(); let len13 = vec13.len(); ::core::mem::forget(vec13); - *ptr1.add(24).cast::() = len13; - *ptr1.add(20).cast::<*mut u8>() = ptr13.cast_mut(); + *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len13; + *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr13.cast_mut(); } None => { *ptr1.add(16).cast::() = (0i32) as u8; @@ -22204,11 +24218,17 @@ pub mod exports { }; match field_size12 { Some(e) => { - *ptr1.add(28).cast::() = (1i32) as u8; - *ptr1.add(32).cast::() = _rt::as_i32(e); + *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; + *ptr1 + .add(20 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = _rt::as_i32(e); } None => { - *ptr1.add(28).cast::() = (0i32) as u8; + *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } }; } @@ -22221,8 +24241,12 @@ pub mod exports { let ptr14 = vec14.as_ptr().cast::(); let len14 = vec14.len(); ::core::mem::forget(vec14); - *ptr1.add(24).cast::() = len14; - *ptr1.add(20).cast::<*mut u8>() = ptr14.cast_mut(); + *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len14; + *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr14.cast_mut(); } None => { *ptr1.add(16).cast::() = (0i32) as u8; @@ -22238,8 +24262,12 @@ pub mod exports { let ptr15 = vec15.as_ptr().cast::(); let len15 = vec15.len(); ::core::mem::forget(vec15); - *ptr1.add(24).cast::() = len15; - *ptr1.add(20).cast::<*mut u8>() = ptr15.cast_mut(); + *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len15; + *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr15.cast_mut(); } None => { *ptr1.add(16).cast::() = (0i32) as u8; @@ -22270,8 +24298,12 @@ pub mod exports { let ptr16 = vec16.as_ptr().cast::(); let len16 = vec16.len(); ::core::mem::forget(vec16); - *ptr1.add(24).cast::() = len16; - *ptr1.add(20).cast::<*mut u8>() = ptr16.cast_mut(); + *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len16; + *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr16.cast_mut(); } None => { *ptr1.add(16).cast::() = (0i32) as u8; @@ -22291,103 +24323,135 @@ pub mod exports { pub unsafe fn __post_return_http_error_code(arg0: *mut u8) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { - 0 => (), + 0 => {} _ => { let l1 = i32::from(*arg0.add(8).cast::()); match l1 { - 0 => (), + 0 => {} 1 => { let l2 = i32::from(*arg0.add(16).cast::()); match l2 { - 0 => (), + 0 => {} _ => { - let l3 = *arg0.add(20).cast::<*mut u8>(); - let l4 = *arg0.add(24).cast::(); + let l3 = *arg0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l4 = *arg0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l3, l4, 1); } } } - 2 => (), - 3 => (), - 4 => (), - 5 => (), - 6 => (), - 7 => (), - 8 => (), - 9 => (), - 10 => (), - 11 => (), - 12 => (), - 13 => (), + 2 => {} + 3 => {} + 4 => {} + 5 => {} + 6 => {} + 7 => {} + 8 => {} + 9 => {} + 10 => {} + 11 => {} + 12 => {} + 13 => {} 14 => { - let l5 = i32::from(*arg0.add(20).cast::()); + let l5 = i32::from( + *arg0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); match l5 { - 0 => (), + 0 => {} _ => { - let l6 = *arg0.add(24).cast::<*mut u8>(); - let l7 = *arg0.add(28).cast::(); + let l6 = *arg0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l7 = *arg0 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l6, l7, 1); } } } - 15 => (), - 16 => (), - 17 => (), - 18 => (), - 19 => (), - 20 => (), - 21 => (), + 15 => {} + 16 => {} + 17 => {} + 18 => {} + 19 => {} + 20 => {} + 21 => {} 22 => { let l8 = i32::from(*arg0.add(16).cast::()); match l8 { - 0 => (), + 0 => {} _ => { - let l9 = i32::from(*arg0.add(20).cast::()); + let l9 = i32::from( + *arg0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); match l9 { - 0 => (), + 0 => {} _ => { - let l10 = *arg0.add(24).cast::<*mut u8>(); - let l11 = *arg0.add(28).cast::(); + let l10 = *arg0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l11 = *arg0 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l10, l11, 1); } } } } } - 23 => (), + 23 => {} 24 => { let l12 = i32::from(*arg0.add(16).cast::()); match l12 { - 0 => (), + 0 => {} _ => { - let l13 = *arg0.add(20).cast::<*mut u8>(); - let l14 = *arg0.add(24).cast::(); + let l13 = *arg0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l14 = *arg0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l13, l14, 1); } } } - 25 => (), - 26 => (), + 25 => {} + 26 => {} 27 => { let l15 = i32::from(*arg0.add(16).cast::()); match l15 { - 0 => (), + 0 => {} _ => { - let l16 = *arg0.add(20).cast::<*mut u8>(); - let l17 = *arg0.add(24).cast::(); + let l16 = *arg0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l17 = *arg0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l16, l17, 1); } } } - 28 => (), - 29 => (), + 28 => {} + 29 => {} 30 => { let l18 = i32::from(*arg0.add(16).cast::()); match l18 { - 0 => (), + 0 => {} _ => { - let l19 = *arg0.add(20).cast::<*mut u8>(); - let l20 = *arg0.add(24).cast::(); + let l19 = *arg0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l20 = *arg0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l19, l20, 1); } } @@ -22395,10 +24459,14 @@ pub mod exports { 31 => { let l21 = i32::from(*arg0.add(16).cast::()); match l21 { - 0 => (), + 0 => {} _ => { - let l22 = *arg0.add(20).cast::<*mut u8>(); - let l23 = *arg0.add(24).cast::(); + let l22 = *arg0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l23 = *arg0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l22, l23, 1); } } @@ -22406,26 +24474,34 @@ pub mod exports { 32 => { let l24 = i32::from(*arg0.add(16).cast::()); match l24 { - 0 => (), + 0 => {} _ => { - let l25 = *arg0.add(20).cast::<*mut u8>(); - let l26 = *arg0.add(24).cast::(); + let l25 = *arg0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l26 = *arg0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l25, l26, 1); } } } - 33 => (), - 34 => (), - 35 => (), - 36 => (), - 37 => (), + 33 => {} + 34 => {} + 35 => {} + 36 => {} + 37 => {} _ => { let l27 = i32::from(*arg0.add(16).cast::()); match l27 { - 0 => (), + 0 => {} _ => { - let l28 = *arg0.add(20).cast::<*mut u8>(); - let l29 = *arg0.add(24).cast::(); + let l28 = *arg0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l29 = *arg0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l28, l29, 1); } } @@ -22437,8 +24513,7 @@ pub mod exports { #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_constructor_fields_cabi() -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = Fields::new(T::new()); (result0).take_handle() as i32 } @@ -22448,22 +24523,27 @@ pub mod exports { arg0: *mut u8, arg1: usize, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let base6 = arg0; let len6 = arg1; let mut result6 = _rt::Vec::with_capacity(len6); for i in 0..len6 { - let base = base6.add(i * 16); + let base = base6 + .add(i * (4 * ::core::mem::size_of::<*const u8>())); let e6 = { let l0 = *base.add(0).cast::<*mut u8>(); - let l1 = *base.add(4).cast::(); + let l1 = *base + .add(::core::mem::size_of::<*const u8>()) + .cast::(); let len2 = l1; let bytes2 = _rt::Vec::from_raw_parts(l0.cast(), len2, len2); - let l3 = *base.add(8).cast::<*mut u8>(); - let l4 = *base.add(12).cast::(); + let l3 = *base + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l4 = *base + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); let len5 = l4; - ( _rt::string_lift(bytes2), _rt::Vec::from_raw_parts(l3.cast(), len5, len5), @@ -22471,9 +24551,13 @@ pub mod exports { }; result6.push(e6); } - _rt::cabi_dealloc(base6, len6 * 16, 4); + _rt::cabi_dealloc( + base6, + len6 * (4 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); let result7 = T::from_list(result6); - let ptr8 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr8 = (&raw mut _RET_AREA.0).cast::(); match result7 { Ok(e) => { *ptr8.add(0).cast::() = (0i32) as u8; @@ -22503,18 +24587,20 @@ pub mod exports { arg1: *mut u8, arg2: usize, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg2; let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0); let result1 = T::get( - FieldsBorrow::lift(arg0 as u32 as usize).get(), + unsafe { FieldsBorrow::lift(arg0 as u32 as usize) }.get(), _rt::string_lift(bytes0), ); - let ptr2 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr2 = (&raw mut _RET_AREA.0).cast::(); let vec4 = result1; let len4 = vec4.len(); - let layout4 = _rt::alloc::Layout::from_size_align_unchecked(vec4.len() * 8, 4); + let layout4 = _rt::alloc::Layout::from_size_align_unchecked( + vec4.len() * (2 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); let result4 = if layout4.size() != 0 { let ptr = _rt::alloc::alloc(layout4).cast::(); if ptr.is_null() { @@ -22522,43 +24608,55 @@ pub mod exports { } ptr } else { - { - ::core::ptr::null_mut() - } + ::core::ptr::null_mut() }; for (i, e) in vec4.into_iter().enumerate() { - let base = result4.add(i * 8); + let base = result4 + .add(i * (2 * ::core::mem::size_of::<*const u8>())); { let vec3 = (e).into_boxed_slice(); let ptr3 = vec3.as_ptr().cast::(); let len3 = vec3.len(); ::core::mem::forget(vec3); - *base.add(4).cast::() = len3; + *base + .add(::core::mem::size_of::<*const u8>()) + .cast::() = len3; *base.add(0).cast::<*mut u8>() = ptr3.cast_mut(); } } - *ptr2.add(4).cast::() = len4; + *ptr2.add(::core::mem::size_of::<*const u8>()).cast::() = len4; *ptr2.add(0).cast::<*mut u8>() = result4; ptr2 } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn __post_return_method_fields_get(arg0: *mut u8) { - let l3 = *arg0.add(0).cast::<*mut u8>(); - let l4 = *arg0.add(4).cast::(); - let base5 = l3; - let len5 = l4; + pub unsafe fn __post_return_method_fields_get( + arg0: *mut u8, + ) { + let l0 = *arg0.add(0).cast::<*mut u8>(); + let l1 = *arg0 + .add(::core::mem::size_of::<*const u8>()) + .cast::(); + let base5 = l0; + let len5 = l1; for i in 0..len5 { - let base = base5.add(i * 8); + let base = base5 + .add(i * (2 * ::core::mem::size_of::<*const u8>())); { - let l0 = *base.add(0).cast::<*mut u8>(); - let l1 = *base.add(4).cast::(); - let base2 = l0; - let len2 = l1; - _rt::cabi_dealloc(base2, len2 * 1, 1); + let l2 = *base.add(0).cast::<*mut u8>(); + let l3 = *base + .add(::core::mem::size_of::<*const u8>()) + .cast::(); + let base4 = l2; + let len4 = l3; + _rt::cabi_dealloc(base4, len4 * 1, 1); } } - _rt::cabi_dealloc(base5, len5 * 8, 4); + _rt::cabi_dealloc( + base5, + len5 * (2 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); } #[doc(hidden)] #[allow(non_snake_case)] @@ -22567,12 +24665,11 @@ pub mod exports { arg1: *mut u8, arg2: usize, ) -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg2; let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0); let result1 = T::has( - FieldsBorrow::lift(arg0 as u32 as usize).get(), + unsafe { FieldsBorrow::lift(arg0 as u32 as usize) }.get(), _rt::string_lift(bytes0), ); match result1 { @@ -22589,31 +24686,36 @@ pub mod exports { arg3: *mut u8, arg4: usize, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg2; let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0); let base4 = arg3; let len4 = arg4; let mut result4 = _rt::Vec::with_capacity(len4); for i in 0..len4 { - let base = base4.add(i * 8); + let base = base4 + .add(i * (2 * ::core::mem::size_of::<*const u8>())); let e4 = { let l1 = *base.add(0).cast::<*mut u8>(); - let l2 = *base.add(4).cast::(); + let l2 = *base + .add(::core::mem::size_of::<*const u8>()) + .cast::(); let len3 = l2; - _rt::Vec::from_raw_parts(l1.cast(), len3, len3) }; result4.push(e4); } - _rt::cabi_dealloc(base4, len4 * 8, 4); + _rt::cabi_dealloc( + base4, + len4 * (2 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); let result5 = T::set( - FieldsBorrow::lift(arg0 as u32 as usize).get(), + unsafe { FieldsBorrow::lift(arg0 as u32 as usize) }.get(), _rt::string_lift(bytes0), result4, ); - let ptr6 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr6 = (&raw mut _RET_AREA.0).cast::(); match result5 { Ok(_) => { *ptr6.add(0).cast::() = (0i32) as u8; @@ -22642,15 +24744,14 @@ pub mod exports { arg1: *mut u8, arg2: usize, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg2; let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0); let result1 = T::delete( - FieldsBorrow::lift(arg0 as u32 as usize).get(), + unsafe { FieldsBorrow::lift(arg0 as u32 as usize) }.get(), _rt::string_lift(bytes0), ); - let ptr2 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr2 = (&raw mut _RET_AREA.0).cast::(); match result1 { Ok(_) => { *ptr2.add(0).cast::() = (0i32) as u8; @@ -22681,17 +24782,16 @@ pub mod exports { arg3: *mut u8, arg4: usize, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg2; let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0); let len1 = arg4; let result2 = T::append( - FieldsBorrow::lift(arg0 as u32 as usize).get(), + unsafe { FieldsBorrow::lift(arg0 as u32 as usize) }.get(), _rt::string_lift(bytes0), _rt::Vec::from_raw_parts(arg3.cast(), len1, len1), ); - let ptr3 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr3 = (&raw mut _RET_AREA.0).cast::(); match result2 { Ok(_) => { *ptr3.add(0).cast::() = (0i32) as u8; @@ -22718,13 +24818,17 @@ pub mod exports { pub unsafe fn _export_method_fields_entries_cabi( arg0: *mut u8, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = T::entries(FieldsBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::entries( + unsafe { FieldsBorrow::lift(arg0 as u32 as usize) }.get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); let vec5 = result0; let len5 = vec5.len(); - let layout5 = _rt::alloc::Layout::from_size_align_unchecked(vec5.len() * 16, 4); + let layout5 = _rt::alloc::Layout::from_size_align_unchecked( + vec5.len() * (4 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); let result5 = if layout5.size() != 0 { let ptr = _rt::alloc::alloc(layout5).cast::(); if ptr.is_null() { @@ -22732,76 +24836,96 @@ pub mod exports { } ptr } else { - { - ::core::ptr::null_mut() - } + ::core::ptr::null_mut() }; for (i, e) in vec5.into_iter().enumerate() { - let base = result5.add(i * 16); + let base = result5 + .add(i * (4 * ::core::mem::size_of::<*const u8>())); { let (t2_0, t2_1) = e; let vec3 = (t2_0.into_bytes()).into_boxed_slice(); let ptr3 = vec3.as_ptr().cast::(); let len3 = vec3.len(); ::core::mem::forget(vec3); - *base.add(4).cast::() = len3; + *base + .add(::core::mem::size_of::<*const u8>()) + .cast::() = len3; *base.add(0).cast::<*mut u8>() = ptr3.cast_mut(); let vec4 = (t2_1).into_boxed_slice(); let ptr4 = vec4.as_ptr().cast::(); let len4 = vec4.len(); ::core::mem::forget(vec4); - *base.add(12).cast::() = len4; - *base.add(8).cast::<*mut u8>() = ptr4.cast_mut(); + *base + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len4; + *base + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr4.cast_mut(); } } - *ptr1.add(4).cast::() = len5; + *ptr1.add(::core::mem::size_of::<*const u8>()).cast::() = len5; *ptr1.add(0).cast::<*mut u8>() = result5; ptr1 } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn __post_return_method_fields_entries(arg0: *mut u8) { - let l5 = *arg0.add(0).cast::<*mut u8>(); - let l6 = *arg0.add(4).cast::(); - let base7 = l5; - let len7 = l6; + pub unsafe fn __post_return_method_fields_entries( + arg0: *mut u8, + ) { + let l0 = *arg0.add(0).cast::<*mut u8>(); + let l1 = *arg0 + .add(::core::mem::size_of::<*const u8>()) + .cast::(); + let base7 = l0; + let len7 = l1; for i in 0..len7 { - let base = base7.add(i * 16); + let base = base7 + .add(i * (4 * ::core::mem::size_of::<*const u8>())); { - let l0 = *base.add(0).cast::<*mut u8>(); - let l1 = *base.add(4).cast::(); - _rt::cabi_dealloc(l0, l1, 1); - let l2 = *base.add(8).cast::<*mut u8>(); - let l3 = *base.add(12).cast::(); - let base4 = l2; - let len4 = l3; - _rt::cabi_dealloc(base4, len4 * 1, 1); + let l2 = *base.add(0).cast::<*mut u8>(); + let l3 = *base + .add(::core::mem::size_of::<*const u8>()) + .cast::(); + _rt::cabi_dealloc(l2, l3, 1); + let l4 = *base + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l5 = *base + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let base6 = l4; + let len6 = l5; + _rt::cabi_dealloc(base6, len6 * 1, 1); } } - _rt::cabi_dealloc(base7, len7 * 16, 4); + _rt::cabi_dealloc( + base7, + len7 * (4 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); } #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_method_fields_clone_cabi( arg0: *mut u8, ) -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = T::clone(FieldsBorrow::lift(arg0 as u32 as usize).get()); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::clone( + unsafe { FieldsBorrow::lift(arg0 as u32 as usize) }.get(), + ); (result0).take_handle() as i32 } #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_method_incoming_request_method_cabi< T: GuestIncomingRequest, - >( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::method(IncomingRequestBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::method( + unsafe { IncomingRequestBorrow::lift(arg0 as u32 as usize) } + .get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Method::Get => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -22836,8 +24960,12 @@ pub mod exports { let ptr2 = vec2.as_ptr().cast::(); let len2 = vec2.len(); ::core::mem::forget(vec2); - *ptr1.add(8).cast::() = len2; - *ptr1.add(4).cast::<*mut u8>() = ptr2.cast_mut(); + *ptr1 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len2; + *ptr1 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr2.cast_mut(); } } ptr1 @@ -22846,23 +24974,25 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn __post_return_method_incoming_request_method< T: GuestIncomingRequest, - >( - arg0: *mut u8, - ) { + >(arg0: *mut u8) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { - 0 => (), - 1 => (), - 2 => (), - 3 => (), - 4 => (), - 5 => (), - 6 => (), - 7 => (), - 8 => (), + 0 => {} + 1 => {} + 2 => {} + 3 => {} + 4 => {} + 5 => {} + 6 => {} + 7 => {} + 8 => {} _ => { - let l1 = *arg0.add(4).cast::<*mut u8>(); - let l2 = *arg0.add(8).cast::(); + let l1 = *arg0 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l1, l2, 1); } } @@ -22871,14 +25001,13 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_incoming_request_path_with_query_cabi< T: GuestIncomingRequest, - >( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::path_with_query(IncomingRequestBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::path_with_query( + unsafe { IncomingRequestBorrow::lift(arg0 as u32 as usize) } + .get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Some(e) => { *ptr1.add(0).cast::() = (1i32) as u8; @@ -22886,8 +25015,12 @@ pub mod exports { let ptr2 = vec2.as_ptr().cast::(); let len2 = vec2.len(); ::core::mem::forget(vec2); - *ptr1.add(8).cast::() = len2; - *ptr1.add(4).cast::<*mut u8>() = ptr2.cast_mut(); + *ptr1 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len2; + *ptr1 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr2.cast_mut(); } None => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -22899,15 +25032,17 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn __post_return_method_incoming_request_path_with_query< T: GuestIncomingRequest, - >( - arg0: *mut u8, - ) { + >(arg0: *mut u8) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { - 0 => (), + 0 => {} _ => { - let l1 = *arg0.add(4).cast::<*mut u8>(); - let l2 = *arg0.add(8).cast::(); + let l1 = *arg0 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l1, l2, 1); } } @@ -22916,32 +25051,41 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_incoming_request_scheme_cabi< T: GuestIncomingRequest, - >( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::scheme(IncomingRequestBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::scheme( + unsafe { IncomingRequestBorrow::lift(arg0 as u32 as usize) } + .get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Some(e) => { *ptr1.add(0).cast::() = (1i32) as u8; match e { Scheme::Http => { - *ptr1.add(4).cast::() = (0i32) as u8; + *ptr1 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } Scheme::Https => { - *ptr1.add(4).cast::() = (1i32) as u8; + *ptr1 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; } Scheme::Other(e) => { - *ptr1.add(4).cast::() = (2i32) as u8; + *ptr1 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (2i32) as u8; let vec2 = (e.into_bytes()).into_boxed_slice(); let ptr2 = vec2.as_ptr().cast::(); let len2 = vec2.len(); ::core::mem::forget(vec2); - *ptr1.add(12).cast::() = len2; - *ptr1.add(8).cast::<*mut u8>() = ptr2.cast_mut(); + *ptr1 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len2; + *ptr1 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr2.cast_mut(); } } } @@ -22955,20 +25099,24 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn __post_return_method_incoming_request_scheme< T: GuestIncomingRequest, - >( - arg0: *mut u8, - ) { + >(arg0: *mut u8) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { - 0 => (), + 0 => {} _ => { - let l1 = i32::from(*arg0.add(4).cast::()); + let l1 = i32::from( + *arg0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); match l1 { - 0 => (), - 1 => (), + 0 => {} + 1 => {} _ => { - let l2 = *arg0.add(8).cast::<*mut u8>(); - let l3 = *arg0.add(12).cast::(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l3 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l2, l3, 1); } } @@ -22979,14 +25127,13 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_incoming_request_authority_cabi< T: GuestIncomingRequest, - >( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::authority(IncomingRequestBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::authority( + unsafe { IncomingRequestBorrow::lift(arg0 as u32 as usize) } + .get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Some(e) => { *ptr1.add(0).cast::() = (1i32) as u8; @@ -22994,8 +25141,12 @@ pub mod exports { let ptr2 = vec2.as_ptr().cast::(); let len2 = vec2.len(); ::core::mem::forget(vec2); - *ptr1.add(8).cast::() = len2; - *ptr1.add(4).cast::<*mut u8>() = ptr2.cast_mut(); + *ptr1 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len2; + *ptr1 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr2.cast_mut(); } None => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -23007,15 +25158,17 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn __post_return_method_incoming_request_authority< T: GuestIncomingRequest, - >( - arg0: *mut u8, - ) { + >(arg0: *mut u8) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { - 0 => (), + 0 => {} _ => { - let l1 = *arg0.add(4).cast::<*mut u8>(); - let l2 = *arg0.add(8).cast::(); + let l1 = *arg0 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l1, l2, 1); } } @@ -23024,27 +25177,25 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_incoming_request_headers_cabi< T: GuestIncomingRequest, - >( - arg0: *mut u8, - ) -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::headers(IncomingRequestBorrow::lift(arg0 as u32 as usize).get()); + >(arg0: *mut u8) -> i32 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::headers( + unsafe { IncomingRequestBorrow::lift(arg0 as u32 as usize) } + .get(), + ); (result0).take_handle() as i32 } #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_method_incoming_request_consume_cabi< T: GuestIncomingRequest, - >( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::consume(IncomingRequestBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::consume( + unsafe { IncomingRequestBorrow::lift(arg0 as u32 as usize) } + .get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -23058,23 +25209,26 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_constructor_outgoing_request_cabi( - arg0: i32, - ) -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = OutgoingRequest::new(T::new(Fields::from_handle(arg0 as u32))); + pub unsafe fn _export_constructor_outgoing_request_cabi< + T: GuestOutgoingRequest, + >(arg0: i32) -> i32 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = OutgoingRequest::new( + T::new(unsafe { Fields::from_handle(arg0 as u32) }), + ); (result0).take_handle() as i32 } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_outgoing_request_body_cabi( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = T::body(OutgoingRequestBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + pub unsafe fn _export_method_outgoing_request_body_cabi< + T: GuestOutgoingRequest, + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::body( + unsafe { OutgoingRequestBorrow::lift(arg0 as u32 as usize) } + .get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -23090,14 +25244,13 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_outgoing_request_method_cabi< T: GuestOutgoingRequest, - >( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::method(OutgoingRequestBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::method( + unsafe { OutgoingRequestBorrow::lift(arg0 as u32 as usize) } + .get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Method::Get => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -23132,8 +25285,12 @@ pub mod exports { let ptr2 = vec2.as_ptr().cast::(); let len2 = vec2.len(); ::core::mem::forget(vec2); - *ptr1.add(8).cast::() = len2; - *ptr1.add(4).cast::<*mut u8>() = ptr2.cast_mut(); + *ptr1 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len2; + *ptr1 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr2.cast_mut(); } } ptr1 @@ -23142,23 +25299,25 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn __post_return_method_outgoing_request_method< T: GuestOutgoingRequest, - >( - arg0: *mut u8, - ) { + >(arg0: *mut u8) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { - 0 => (), - 1 => (), - 2 => (), - 3 => (), - 4 => (), - 5 => (), - 6 => (), - 7 => (), - 8 => (), + 0 => {} + 1 => {} + 2 => {} + 3 => {} + 4 => {} + 5 => {} + 6 => {} + 7 => {} + 8 => {} _ => { - let l1 = *arg0.add(4).cast::<*mut u8>(); - let l2 = *arg0.add(8).cast::(); + let l1 = *arg0 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l1, l2, 1); } } @@ -23167,14 +25326,8 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_outgoing_request_set_method_cabi< T: GuestOutgoingRequest, - >( - arg0: *mut u8, - arg1: i32, - arg2: *mut u8, - arg3: usize, - ) -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + >(arg0: *mut u8, arg1: i32, arg2: *mut u8, arg3: usize) -> i32 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let v1 = match arg1 { 0 => Method::Get, 1 => Method::Head, @@ -23189,15 +25342,21 @@ pub mod exports { debug_assert_eq!(n, 9, "invalid enum discriminant"); let e1 = { let len0 = arg3; - let bytes0 = _rt::Vec::from_raw_parts(arg2.cast(), len0, len0); - + let bytes0 = _rt::Vec::from_raw_parts( + arg2.cast(), + len0, + len0, + ); _rt::string_lift(bytes0) }; Method::Other(e1) } }; - let result2 = - T::set_method(OutgoingRequestBorrow::lift(arg0 as u32 as usize).get(), v1); + let result2 = T::set_method( + unsafe { OutgoingRequestBorrow::lift(arg0 as u32 as usize) } + .get(), + v1, + ); let result3 = match result2 { Ok(_) => 0i32, Err(_) => 1i32, @@ -23208,14 +25367,13 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_outgoing_request_path_with_query_cabi< T: GuestOutgoingRequest, - >( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::path_with_query(OutgoingRequestBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::path_with_query( + unsafe { OutgoingRequestBorrow::lift(arg0 as u32 as usize) } + .get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Some(e) => { *ptr1.add(0).cast::() = (1i32) as u8; @@ -23223,8 +25381,12 @@ pub mod exports { let ptr2 = vec2.as_ptr().cast::(); let len2 = vec2.len(); ::core::mem::forget(vec2); - *ptr1.add(8).cast::() = len2; - *ptr1.add(4).cast::<*mut u8>() = ptr2.cast_mut(); + *ptr1 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len2; + *ptr1 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr2.cast_mut(); } None => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -23236,15 +25398,17 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn __post_return_method_outgoing_request_path_with_query< T: GuestOutgoingRequest, - >( - arg0: *mut u8, - ) { + >(arg0: *mut u8) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { - 0 => (), + 0 => {} _ => { - let l1 = *arg0.add(4).cast::<*mut u8>(); - let l2 = *arg0.add(8).cast::(); + let l1 = *arg0 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l1, l2, 1); } } @@ -23253,23 +25417,21 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_outgoing_request_set_path_with_query_cabi< T: GuestOutgoingRequest, - >( - arg0: *mut u8, - arg1: i32, - arg2: *mut u8, - arg3: usize, - ) -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + >(arg0: *mut u8, arg1: i32, arg2: *mut u8, arg3: usize) -> i32 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result1 = T::set_path_with_query( - OutgoingRequestBorrow::lift(arg0 as u32 as usize).get(), + unsafe { OutgoingRequestBorrow::lift(arg0 as u32 as usize) } + .get(), match arg1 { 0 => None, 1 => { let e = { let len0 = arg3; - let bytes0 = _rt::Vec::from_raw_parts(arg2.cast(), len0, len0); - + let bytes0 = _rt::Vec::from_raw_parts( + arg2.cast(), + len0, + len0, + ); _rt::string_lift(bytes0) }; Some(e) @@ -23287,32 +25449,41 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_outgoing_request_scheme_cabi< T: GuestOutgoingRequest, - >( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::scheme(OutgoingRequestBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::scheme( + unsafe { OutgoingRequestBorrow::lift(arg0 as u32 as usize) } + .get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Some(e) => { *ptr1.add(0).cast::() = (1i32) as u8; match e { Scheme::Http => { - *ptr1.add(4).cast::() = (0i32) as u8; + *ptr1 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } Scheme::Https => { - *ptr1.add(4).cast::() = (1i32) as u8; + *ptr1 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; } Scheme::Other(e) => { - *ptr1.add(4).cast::() = (2i32) as u8; + *ptr1 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (2i32) as u8; let vec2 = (e.into_bytes()).into_boxed_slice(); let ptr2 = vec2.as_ptr().cast::(); let len2 = vec2.len(); ::core::mem::forget(vec2); - *ptr1.add(12).cast::() = len2; - *ptr1.add(8).cast::<*mut u8>() = ptr2.cast_mut(); + *ptr1 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len2; + *ptr1 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr2.cast_mut(); } } } @@ -23326,20 +25497,24 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn __post_return_method_outgoing_request_scheme< T: GuestOutgoingRequest, - >( - arg0: *mut u8, - ) { + >(arg0: *mut u8) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { - 0 => (), + 0 => {} _ => { - let l1 = i32::from(*arg0.add(4).cast::()); + let l1 = i32::from( + *arg0.add(::core::mem::size_of::<*const u8>()).cast::(), + ); match l1 { - 0 => (), - 1 => (), + 0 => {} + 1 => {} _ => { - let l2 = *arg0.add(8).cast::<*mut u8>(); - let l3 = *arg0.add(12).cast::(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l3 = *arg0 + .add(3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l2, l3, 1); } } @@ -23357,10 +25532,10 @@ pub mod exports { arg3: *mut u8, arg4: usize, ) -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result2 = T::set_scheme( - OutgoingRequestBorrow::lift(arg0 as u32 as usize).get(), + unsafe { OutgoingRequestBorrow::lift(arg0 as u32 as usize) } + .get(), match arg1 { 0 => None, 1 => { @@ -23377,13 +25552,11 @@ pub mod exports { len0, len0, ); - _rt::string_lift(bytes0) }; Scheme::Other(e1) } }; - v1 }; Some(e) @@ -23401,14 +25574,13 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_outgoing_request_authority_cabi< T: GuestOutgoingRequest, - >( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::authority(OutgoingRequestBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::authority( + unsafe { OutgoingRequestBorrow::lift(arg0 as u32 as usize) } + .get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Some(e) => { *ptr1.add(0).cast::() = (1i32) as u8; @@ -23416,8 +25588,12 @@ pub mod exports { let ptr2 = vec2.as_ptr().cast::(); let len2 = vec2.len(); ::core::mem::forget(vec2); - *ptr1.add(8).cast::() = len2; - *ptr1.add(4).cast::<*mut u8>() = ptr2.cast_mut(); + *ptr1 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len2; + *ptr1 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr2.cast_mut(); } None => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -23429,15 +25605,17 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn __post_return_method_outgoing_request_authority< T: GuestOutgoingRequest, - >( - arg0: *mut u8, - ) { + >(arg0: *mut u8) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { - 0 => (), + 0 => {} _ => { - let l1 = *arg0.add(4).cast::<*mut u8>(); - let l2 = *arg0.add(8).cast::(); + let l1 = *arg0 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l1, l2, 1); } } @@ -23446,23 +25624,21 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_outgoing_request_set_authority_cabi< T: GuestOutgoingRequest, - >( - arg0: *mut u8, - arg1: i32, - arg2: *mut u8, - arg3: usize, - ) -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + >(arg0: *mut u8, arg1: i32, arg2: *mut u8, arg3: usize) -> i32 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result1 = T::set_authority( - OutgoingRequestBorrow::lift(arg0 as u32 as usize).get(), + unsafe { OutgoingRequestBorrow::lift(arg0 as u32 as usize) } + .get(), match arg1 { 0 => None, 1 => { let e = { let len0 = arg3; - let bytes0 = _rt::Vec::from_raw_parts(arg2.cast(), len0, len0); - + let bytes0 = _rt::Vec::from_raw_parts( + arg2.cast(), + len0, + len0, + ); _rt::string_lift(bytes0) }; Some(e) @@ -23480,21 +25656,20 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_outgoing_request_headers_cabi< T: GuestOutgoingRequest, - >( - arg0: *mut u8, - ) -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::headers(OutgoingRequestBorrow::lift(arg0 as u32 as usize).get()); + >(arg0: *mut u8) -> i32 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::headers( + unsafe { OutgoingRequestBorrow::lift(arg0 as u32 as usize) } + .get(), + ); (result0).take_handle() as i32 } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_constructor_request_options_cabi( - ) -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + pub unsafe fn _export_constructor_request_options_cabi< + T: GuestRequestOptions, + >() -> i32 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = RequestOptions::new(T::new()); (result0).take_handle() as i32 } @@ -23502,14 +25677,12 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_request_options_connect_timeout_cabi< T: GuestRequestOptions, - >( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::connect_timeout(RequestOptionsBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::connect_timeout( + unsafe { RequestOptionsBorrow::lift(arg0 as u32 as usize) }.get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Some(e) => { *ptr1.add(0).cast::() = (1i32) as u8; @@ -23525,15 +25698,11 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_request_options_set_connect_timeout_cabi< T: GuestRequestOptions, - >( - arg0: *mut u8, - arg1: i32, - arg2: i64, - ) -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + >(arg0: *mut u8, arg1: i32, arg2: i64) -> i32 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::set_connect_timeout( - RequestOptionsBorrow::lift(arg0 as u32 as usize).get(), + unsafe { RequestOptionsBorrow::lift(arg0 as u32 as usize) } + .get(), match arg1 { 0 => None, 1 => { @@ -23553,15 +25722,12 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_request_options_first_byte_timeout_cabi< T: GuestRequestOptions, - >( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::first_byte_timeout( - RequestOptionsBorrow::lift(arg0 as u32 as usize).get(), + unsafe { RequestOptionsBorrow::lift(arg0 as u32 as usize) }.get(), ); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Some(e) => { *ptr1.add(0).cast::() = (1i32) as u8; @@ -23577,15 +25743,11 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_request_options_set_first_byte_timeout_cabi< T: GuestRequestOptions, - >( - arg0: *mut u8, - arg1: i32, - arg2: i64, - ) -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + >(arg0: *mut u8, arg1: i32, arg2: i64) -> i32 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::set_first_byte_timeout( - RequestOptionsBorrow::lift(arg0 as u32 as usize).get(), + unsafe { RequestOptionsBorrow::lift(arg0 as u32 as usize) } + .get(), match arg1 { 0 => None, 1 => { @@ -23605,15 +25767,12 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_request_options_between_bytes_timeout_cabi< T: GuestRequestOptions, - >( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::between_bytes_timeout( - RequestOptionsBorrow::lift(arg0 as u32 as usize).get(), + unsafe { RequestOptionsBorrow::lift(arg0 as u32 as usize) }.get(), ); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Some(e) => { *ptr1.add(0).cast::() = (1i32) as u8; @@ -23629,15 +25788,11 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_request_options_set_between_bytes_timeout_cabi< T: GuestRequestOptions, - >( - arg0: *mut u8, - arg1: i32, - arg2: i64, - ) -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + >(arg0: *mut u8, arg1: i32, arg2: i64) -> i32 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::set_between_bytes_timeout( - RequestOptionsBorrow::lift(arg0 as u32 as usize).get(), + unsafe { RequestOptionsBorrow::lift(arg0 as u32 as usize) } + .get(), match arg1 { 0 => None, 1 => { @@ -23668,13 +25823,14 @@ pub mod exports { arg7: usize, arg8: i32, ) { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); T::set( - ResponseOutparam::from_handle(arg0 as u32), + unsafe { ResponseOutparam::from_handle(arg0 as u32) }, match arg1 { 0 => { - let e = OutgoingResponse::from_handle(arg2 as u32); + let e = unsafe { + OutgoingResponse::from_handle(arg2 as u32) + }; Ok(e) } 1 => { @@ -23689,14 +25845,10 @@ pub mod exports { let e = { let len0 = arg5 as usize; let bytes0 = _rt::Vec::from_raw_parts( - arg4.as_ptr() - .cast::<*mut u8>() - .read() - .cast(), + arg4.as_ptr().cast::<*mut u8>().read().cast(), len0, len0, ); - _rt::string_lift(bytes0) }; Some(e) @@ -23731,8 +25883,7 @@ pub mod exports { alert_id: match arg3 { 0 => None, 1 => { - let e = - arg4.assume_init() as i64 as i32 as u8; + let e = arg4.assume_init() as i64 as i32 as u8; Some(e) } _ => _rt::invalid_enum_discriminant(), @@ -23747,7 +25898,6 @@ pub mod exports { len1, len1, ); - _rt::string_lift(bytes1) }; Some(e) @@ -23789,20 +25939,16 @@ pub mod exports { 0 => None, 1 => { let e = FieldSizePayload { - field_name: match arg4.assume_init() as i64 - as i32 - { + field_name: match arg4.assume_init() as i64 as i32 { 0 => None, 1 => { let e = { let len2 = arg6 as usize; - let bytes2 = - _rt::Vec::from_raw_parts( - arg5.cast(), - len2, - len2, - ); - + let bytes2 = _rt::Vec::from_raw_parts( + arg5.cast(), + len2, + len2, + ); _rt::string_lift(bytes2) }; Some(e) @@ -23843,14 +25989,10 @@ pub mod exports { let e = { let len3 = arg5 as usize; let bytes3 = _rt::Vec::from_raw_parts( - arg4.as_ptr() - .cast::<*mut u8>() - .read() - .cast(), + arg4.as_ptr().cast::<*mut u8>().read().cast(), len3, len3, ); - _rt::string_lift(bytes3) }; Some(e) @@ -23888,14 +26030,10 @@ pub mod exports { let e = { let len4 = arg5 as usize; let bytes4 = _rt::Vec::from_raw_parts( - arg4.as_ptr() - .cast::<*mut u8>() - .read() - .cast(), + arg4.as_ptr().cast::<*mut u8>().read().cast(), len4, len4, ); - _rt::string_lift(bytes4) }; Some(e) @@ -23943,14 +26081,10 @@ pub mod exports { let e = { let len5 = arg5 as usize; let bytes5 = _rt::Vec::from_raw_parts( - arg4.as_ptr() - .cast::<*mut u8>() - .read() - .cast(), + arg4.as_ptr().cast::<*mut u8>().read().cast(), len5, len5, ); - _rt::string_lift(bytes5) }; Some(e) @@ -23975,14 +26109,10 @@ pub mod exports { let e = { let len6 = arg5 as usize; let bytes6 = _rt::Vec::from_raw_parts( - arg4.as_ptr() - .cast::<*mut u8>() - .read() - .cast(), + arg4.as_ptr().cast::<*mut u8>().read().cast(), len6, len6, ); - _rt::string_lift(bytes6) }; Some(e) @@ -23998,14 +26128,10 @@ pub mod exports { let e = { let len7 = arg5 as usize; let bytes7 = _rt::Vec::from_raw_parts( - arg4.as_ptr() - .cast::<*mut u8>() - .read() - .cast(), + arg4.as_ptr().cast::<*mut u8>().read().cast(), len7, len7, ); - _rt::string_lift(bytes7) }; Some(e) @@ -24027,14 +26153,10 @@ pub mod exports { let e = { let len8 = arg5 as usize; let bytes8 = _rt::Vec::from_raw_parts( - arg4.as_ptr() - .cast::<*mut u8>() - .read() - .cast(), + arg4.as_ptr().cast::<*mut u8>().read().cast(), len8, len8, ); - _rt::string_lift(bytes8) }; Some(e) @@ -24044,7 +26166,6 @@ pub mod exports { ErrorCode::InternalError(e9) } }; - v9 }; Err(e) @@ -24057,40 +26178,37 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_incoming_response_status_cabi< T: GuestIncomingResponse, - >( - arg0: *mut u8, - ) -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::status(IncomingResponseBorrow::lift(arg0 as u32 as usize).get()); + >(arg0: *mut u8) -> i32 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::status( + unsafe { IncomingResponseBorrow::lift(arg0 as u32 as usize) } + .get(), + ); _rt::as_i32(result0) } #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_method_incoming_response_headers_cabi< T: GuestIncomingResponse, - >( - arg0: *mut u8, - ) -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::headers(IncomingResponseBorrow::lift(arg0 as u32 as usize).get()); + >(arg0: *mut u8) -> i32 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::headers( + unsafe { IncomingResponseBorrow::lift(arg0 as u32 as usize) } + .get(), + ); (result0).take_handle() as i32 } #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_method_incoming_response_consume_cabi< T: GuestIncomingResponse, - >( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::consume(IncomingResponseBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::consume( + unsafe { IncomingResponseBorrow::lift(arg0 as u32 as usize) } + .get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -24104,13 +26222,14 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_incoming_body_stream_cabi( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = T::stream(IncomingBodyBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + pub unsafe fn _export_method_incoming_body_stream_cabi< + T: GuestIncomingBody, + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::stream( + unsafe { IncomingBodyBorrow::lift(arg0 as u32 as usize) }.get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -24124,36 +26243,36 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_static_incoming_body_finish_cabi( - arg0: i32, - ) -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = T::finish(IncomingBody::from_handle(arg0 as u32)); + pub unsafe fn _export_static_incoming_body_finish_cabi< + T: GuestIncomingBody, + >(arg0: i32) -> i32 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::finish(unsafe { + IncomingBody::from_handle(arg0 as u32) + }); (result0).take_handle() as i32 } #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_method_future_trailers_subscribe_cabi< T: GuestFutureTrailers, - >( - arg0: *mut u8, - ) -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::subscribe(FutureTrailersBorrow::lift(arg0 as u32 as usize).get()); + >(arg0: *mut u8) -> i32 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::subscribe( + unsafe { FutureTrailersBorrow::lift(arg0 as u32 as usize) }.get(), + ); (result0).take_handle() as i32 } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_future_trailers_get_cabi( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = T::get(FutureTrailersBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + pub unsafe fn _export_method_future_trailers_get_cabi< + T: GuestFutureTrailers, + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::get( + unsafe { FutureTrailersBorrow::lift(arg0 as u32 as usize) }.get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Some(e) => { *ptr1.add(0).cast::() = (1i32) as u8; @@ -24166,8 +26285,7 @@ pub mod exports { match e { Some(e) => { *ptr1.add(24).cast::() = (1i32) as u8; - *ptr1.add(28).cast::() = - (e).take_handle() as i32; + *ptr1.add(28).cast::() = (e).take_handle() as i32; } None => { *ptr1.add(24).cast::() = (0i32) as u8; @@ -24188,32 +26306,35 @@ pub mod exports { } = e; match rcode2 { Some(e) => { - *ptr1.add(32).cast::() = - (1i32) as u8; - let vec3 = - (e.into_bytes()).into_boxed_slice(); + *ptr1.add(32).cast::() = (1i32) as u8; + let vec3 = (e.into_bytes()).into_boxed_slice(); let ptr3 = vec3.as_ptr().cast::(); let len3 = vec3.len(); ::core::mem::forget(vec3); - *ptr1.add(40).cast::() = len3; - *ptr1.add(36).cast::<*mut u8>() = - ptr3.cast_mut(); + *ptr1 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len3; + *ptr1 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr3.cast_mut(); } None => { - *ptr1.add(32).cast::() = - (0i32) as u8; + *ptr1.add(32).cast::() = (0i32) as u8; } }; match info_code2 { Some(e) => { - *ptr1.add(44).cast::() = - (1i32) as u8; - *ptr1.add(46).cast::() = - (_rt::as_i32(e)) as u16; + *ptr1 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; + *ptr1 + .add(34 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (_rt::as_i32(e)) as u16; } None => { - *ptr1.add(44).cast::() = - (0i32) as u8; + *ptr1 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } }; } @@ -24261,32 +26382,33 @@ pub mod exports { } = e; match alert_id4 { Some(e) => { - *ptr1.add(32).cast::() = - (1i32) as u8; - *ptr1.add(33).cast::() = - (_rt::as_i32(e)) as u8; + *ptr1.add(32).cast::() = (1i32) as u8; + *ptr1.add(33).cast::() = (_rt::as_i32(e)) as u8; } None => { - *ptr1.add(32).cast::() = - (0i32) as u8; + *ptr1.add(32).cast::() = (0i32) as u8; } }; match alert_message4 { Some(e) => { - *ptr1.add(36).cast::() = - (1i32) as u8; - let vec5 = - (e.into_bytes()).into_boxed_slice(); + *ptr1 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; + let vec5 = (e.into_bytes()).into_boxed_slice(); let ptr5 = vec5.as_ptr().cast::(); let len5 = vec5.len(); ::core::mem::forget(vec5); - *ptr1.add(44).cast::() = len5; - *ptr1.add(40).cast::<*mut u8>() = - ptr5.cast_mut(); + *ptr1 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len5; + *ptr1 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr5.cast_mut(); } None => { - *ptr1.add(36).cast::() = - (0i32) as u8; + *ptr1 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } }; } @@ -24300,14 +26422,11 @@ pub mod exports { *ptr1.add(24).cast::() = (17i32) as u8; match e { Some(e) => { - *ptr1.add(32).cast::() = - (1i32) as u8; - *ptr1.add(40).cast::() = - _rt::as_i64(e); + *ptr1.add(32).cast::() = (1i32) as u8; + *ptr1.add(40).cast::() = _rt::as_i64(e); } None => { - *ptr1.add(32).cast::() = - (0i32) as u8; + *ptr1.add(32).cast::() = (0i32) as u8; } }; } @@ -24324,14 +26443,11 @@ pub mod exports { *ptr1.add(24).cast::() = (21i32) as u8; match e { Some(e) => { - *ptr1.add(32).cast::() = - (1i32) as u8; - *ptr1.add(36).cast::() = - _rt::as_i32(e); + *ptr1.add(32).cast::() = (1i32) as u8; + *ptr1.add(36).cast::() = _rt::as_i32(e); } None => { - *ptr1.add(32).cast::() = - (0i32) as u8; + *ptr1.add(32).cast::() = (0i32) as u8; } }; } @@ -24339,50 +26455,51 @@ pub mod exports { *ptr1.add(24).cast::() = (22i32) as u8; match e { Some(e) => { - *ptr1.add(32).cast::() = - (1i32) as u8; + *ptr1.add(32).cast::() = (1i32) as u8; let FieldSizePayload { field_name: field_name6, field_size: field_size6, } = e; match field_name6 { Some(e) => { - *ptr1.add(36).cast::() = - (1i32) as u8; - let vec7 = (e.into_bytes()) - .into_boxed_slice(); - let ptr7 = - vec7.as_ptr().cast::(); + *ptr1 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; + let vec7 = (e.into_bytes()).into_boxed_slice(); + let ptr7 = vec7.as_ptr().cast::(); let len7 = vec7.len(); ::core::mem::forget(vec7); - *ptr1.add(44).cast::() = - len7; *ptr1 - .add(40) - .cast::<*mut u8>() = - ptr7.cast_mut(); + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len7; + *ptr1 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr7.cast_mut(); } None => { - *ptr1.add(36).cast::() = - (0i32) as u8; + *ptr1 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } }; match field_size6 { Some(e) => { - *ptr1.add(48).cast::() = - (1i32) as u8; - *ptr1.add(52).cast::() = - _rt::as_i32(e); + *ptr1 + .add(32 + 4 * ::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; + *ptr1 + .add(36 + 4 * ::core::mem::size_of::<*const u8>()) + .cast::() = _rt::as_i32(e); } None => { - *ptr1.add(48).cast::() = - (0i32) as u8; + *ptr1 + .add(32 + 4 * ::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } }; } None => { - *ptr1.add(32).cast::() = - (0i32) as u8; + *ptr1.add(32).cast::() = (0i32) as u8; } }; } @@ -24390,14 +26507,11 @@ pub mod exports { *ptr1.add(24).cast::() = (23i32) as u8; match e { Some(e) => { - *ptr1.add(32).cast::() = - (1i32) as u8; - *ptr1.add(36).cast::() = - _rt::as_i32(e); + *ptr1.add(32).cast::() = (1i32) as u8; + *ptr1.add(36).cast::() = _rt::as_i32(e); } None => { - *ptr1.add(32).cast::() = - (0i32) as u8; + *ptr1.add(32).cast::() = (0i32) as u8; } }; } @@ -24409,32 +26523,35 @@ pub mod exports { } = e; match field_name8 { Some(e) => { - *ptr1.add(32).cast::() = - (1i32) as u8; - let vec9 = - (e.into_bytes()).into_boxed_slice(); + *ptr1.add(32).cast::() = (1i32) as u8; + let vec9 = (e.into_bytes()).into_boxed_slice(); let ptr9 = vec9.as_ptr().cast::(); let len9 = vec9.len(); ::core::mem::forget(vec9); - *ptr1.add(40).cast::() = len9; - *ptr1.add(36).cast::<*mut u8>() = - ptr9.cast_mut(); + *ptr1 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len9; + *ptr1 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr9.cast_mut(); } None => { - *ptr1.add(32).cast::() = - (0i32) as u8; + *ptr1.add(32).cast::() = (0i32) as u8; } }; match field_size8 { Some(e) => { - *ptr1.add(44).cast::() = - (1i32) as u8; - *ptr1.add(48).cast::() = - _rt::as_i32(e); + *ptr1 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; + *ptr1 + .add(36 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = _rt::as_i32(e); } None => { - *ptr1.add(44).cast::() = - (0i32) as u8; + *ptr1 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } }; } @@ -24445,14 +26562,11 @@ pub mod exports { *ptr1.add(24).cast::() = (26i32) as u8; match e { Some(e) => { - *ptr1.add(32).cast::() = - (1i32) as u8; - *ptr1.add(36).cast::() = - _rt::as_i32(e); + *ptr1.add(32).cast::() = (1i32) as u8; + *ptr1.add(36).cast::() = _rt::as_i32(e); } None => { - *ptr1.add(32).cast::() = - (0i32) as u8; + *ptr1.add(32).cast::() = (0i32) as u8; } }; } @@ -24464,32 +26578,35 @@ pub mod exports { } = e; match field_name10 { Some(e) => { - *ptr1.add(32).cast::() = - (1i32) as u8; - let vec11 = - (e.into_bytes()).into_boxed_slice(); + *ptr1.add(32).cast::() = (1i32) as u8; + let vec11 = (e.into_bytes()).into_boxed_slice(); let ptr11 = vec11.as_ptr().cast::(); let len11 = vec11.len(); ::core::mem::forget(vec11); - *ptr1.add(40).cast::() = len11; - *ptr1.add(36).cast::<*mut u8>() = - ptr11.cast_mut(); + *ptr1 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len11; + *ptr1 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr11.cast_mut(); } None => { - *ptr1.add(32).cast::() = - (0i32) as u8; + *ptr1.add(32).cast::() = (0i32) as u8; } }; match field_size10 { Some(e) => { - *ptr1.add(44).cast::() = - (1i32) as u8; - *ptr1.add(48).cast::() = - _rt::as_i32(e); + *ptr1 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; + *ptr1 + .add(36 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = _rt::as_i32(e); } None => { - *ptr1.add(44).cast::() = - (0i32) as u8; + *ptr1 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } }; } @@ -24497,14 +26614,11 @@ pub mod exports { *ptr1.add(24).cast::() = (28i32) as u8; match e { Some(e) => { - *ptr1.add(32).cast::() = - (1i32) as u8; - *ptr1.add(40).cast::() = - _rt::as_i64(e); + *ptr1.add(32).cast::() = (1i32) as u8; + *ptr1.add(40).cast::() = _rt::as_i64(e); } None => { - *ptr1.add(32).cast::() = - (0i32) as u8; + *ptr1.add(32).cast::() = (0i32) as u8; } }; } @@ -24512,14 +26626,11 @@ pub mod exports { *ptr1.add(24).cast::() = (29i32) as u8; match e { Some(e) => { - *ptr1.add(32).cast::() = - (1i32) as u8; - *ptr1.add(36).cast::() = - _rt::as_i32(e); + *ptr1.add(32).cast::() = (1i32) as u8; + *ptr1.add(36).cast::() = _rt::as_i32(e); } None => { - *ptr1.add(32).cast::() = - (0i32) as u8; + *ptr1.add(32).cast::() = (0i32) as u8; } }; } @@ -24531,32 +26642,35 @@ pub mod exports { } = e; match field_name12 { Some(e) => { - *ptr1.add(32).cast::() = - (1i32) as u8; - let vec13 = - (e.into_bytes()).into_boxed_slice(); + *ptr1.add(32).cast::() = (1i32) as u8; + let vec13 = (e.into_bytes()).into_boxed_slice(); let ptr13 = vec13.as_ptr().cast::(); let len13 = vec13.len(); ::core::mem::forget(vec13); - *ptr1.add(40).cast::() = len13; - *ptr1.add(36).cast::<*mut u8>() = - ptr13.cast_mut(); + *ptr1 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len13; + *ptr1 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr13.cast_mut(); } None => { - *ptr1.add(32).cast::() = - (0i32) as u8; + *ptr1.add(32).cast::() = (0i32) as u8; } }; match field_size12 { Some(e) => { - *ptr1.add(44).cast::() = - (1i32) as u8; - *ptr1.add(48).cast::() = - _rt::as_i32(e); + *ptr1 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; + *ptr1 + .add(36 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = _rt::as_i32(e); } None => { - *ptr1.add(44).cast::() = - (0i32) as u8; + *ptr1 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } }; } @@ -24564,20 +26678,20 @@ pub mod exports { *ptr1.add(24).cast::() = (31i32) as u8; match e { Some(e) => { - *ptr1.add(32).cast::() = - (1i32) as u8; - let vec14 = - (e.into_bytes()).into_boxed_slice(); + *ptr1.add(32).cast::() = (1i32) as u8; + let vec14 = (e.into_bytes()).into_boxed_slice(); let ptr14 = vec14.as_ptr().cast::(); let len14 = vec14.len(); ::core::mem::forget(vec14); - *ptr1.add(40).cast::() = len14; - *ptr1.add(36).cast::<*mut u8>() = - ptr14.cast_mut(); + *ptr1 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len14; + *ptr1 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr14.cast_mut(); } None => { - *ptr1.add(32).cast::() = - (0i32) as u8; + *ptr1.add(32).cast::() = (0i32) as u8; } }; } @@ -24585,20 +26699,20 @@ pub mod exports { *ptr1.add(24).cast::() = (32i32) as u8; match e { Some(e) => { - *ptr1.add(32).cast::() = - (1i32) as u8; - let vec15 = - (e.into_bytes()).into_boxed_slice(); + *ptr1.add(32).cast::() = (1i32) as u8; + let vec15 = (e.into_bytes()).into_boxed_slice(); let ptr15 = vec15.as_ptr().cast::(); let len15 = vec15.len(); ::core::mem::forget(vec15); - *ptr1.add(40).cast::() = len15; - *ptr1.add(36).cast::<*mut u8>() = - ptr15.cast_mut(); + *ptr1 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len15; + *ptr1 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr15.cast_mut(); } None => { - *ptr1.add(32).cast::() = - (0i32) as u8; + *ptr1.add(32).cast::() = (0i32) as u8; } }; } @@ -24621,20 +26735,20 @@ pub mod exports { *ptr1.add(24).cast::() = (38i32) as u8; match e { Some(e) => { - *ptr1.add(32).cast::() = - (1i32) as u8; - let vec16 = - (e.into_bytes()).into_boxed_slice(); + *ptr1.add(32).cast::() = (1i32) as u8; + let vec16 = (e.into_bytes()).into_boxed_slice(); let ptr16 = vec16.as_ptr().cast::(); let len16 = vec16.len(); ::core::mem::forget(vec16); - *ptr1.add(40).cast::() = len16; - *ptr1.add(36).cast::<*mut u8>() = - ptr16.cast_mut(); + *ptr1 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len16; + *ptr1 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr16.cast_mut(); } None => { - *ptr1.add(32).cast::() = - (0i32) as u8; + *ptr1.add(32).cast::() = (0i32) as u8; } }; } @@ -24655,82 +26769,94 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn __post_return_method_future_trailers_get( - arg0: *mut u8, - ) { + pub unsafe fn __post_return_method_future_trailers_get< + T: GuestFutureTrailers, + >(arg0: *mut u8) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { - 0 => (), + 0 => {} _ => { let l1 = i32::from(*arg0.add(8).cast::()); match l1 { 0 => { let l2 = i32::from(*arg0.add(16).cast::()); match l2 { - 0 => (), + 0 => {} _ => { let l3 = i32::from(*arg0.add(24).cast::()); match l3 { - 0 => (), + 0 => {} 1 => { let l4 = i32::from(*arg0.add(32).cast::()); match l4 { - 0 => (), + 0 => {} _ => { - let l5 = - *arg0.add(36).cast::<*mut u8>(); - let l6 = *arg0.add(40).cast::(); + let l5 = *arg0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l6 = *arg0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l5, l6, 1); } } } - 2 => (), - 3 => (), - 4 => (), - 5 => (), - 6 => (), - 7 => (), - 8 => (), - 9 => (), - 10 => (), - 11 => (), - 12 => (), - 13 => (), + 2 => {} + 3 => {} + 4 => {} + 5 => {} + 6 => {} + 7 => {} + 8 => {} + 9 => {} + 10 => {} + 11 => {} + 12 => {} + 13 => {} 14 => { - let l7 = i32::from(*arg0.add(36).cast::()); + let l7 = i32::from( + *arg0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); match l7 { - 0 => (), + 0 => {} _ => { - let l8 = - *arg0.add(40).cast::<*mut u8>(); - let l9 = *arg0.add(44).cast::(); + let l8 = *arg0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l9 = *arg0 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l8, l9, 1); } } } - 15 => (), - 16 => (), - 17 => (), - 18 => (), - 19 => (), - 20 => (), - 21 => (), + 15 => {} + 16 => {} + 17 => {} + 18 => {} + 19 => {} + 20 => {} + 21 => {} 22 => { let l10 = i32::from(*arg0.add(32).cast::()); match l10 { - 0 => (), + 0 => {} _ => { let l11 = i32::from( - *arg0.add(36).cast::(), + *arg0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(), ); match l11 { - 0 => (), + 0 => {} _ => { let l12 = *arg0 - .add(40) + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) .cast::<*mut u8>(); let l13 = *arg0 - .add(44) + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) .cast::(); _rt::cabi_dealloc(l12, l13, 1); } @@ -24738,43 +26864,52 @@ pub mod exports { } } } - 23 => (), + 23 => {} 24 => { let l14 = i32::from(*arg0.add(32).cast::()); match l14 { - 0 => (), + 0 => {} _ => { - let l15 = - *arg0.add(36).cast::<*mut u8>(); - let l16 = *arg0.add(40).cast::(); + let l15 = *arg0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l16 = *arg0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l15, l16, 1); } } } - 25 => (), - 26 => (), + 25 => {} + 26 => {} 27 => { let l17 = i32::from(*arg0.add(32).cast::()); match l17 { - 0 => (), + 0 => {} _ => { - let l18 = - *arg0.add(36).cast::<*mut u8>(); - let l19 = *arg0.add(40).cast::(); + let l18 = *arg0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l19 = *arg0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l18, l19, 1); } } } - 28 => (), - 29 => (), + 28 => {} + 29 => {} 30 => { let l20 = i32::from(*arg0.add(32).cast::()); match l20 { - 0 => (), + 0 => {} _ => { - let l21 = - *arg0.add(36).cast::<*mut u8>(); - let l22 = *arg0.add(40).cast::(); + let l21 = *arg0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l22 = *arg0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l21, l22, 1); } } @@ -24782,11 +26917,14 @@ pub mod exports { 31 => { let l23 = i32::from(*arg0.add(32).cast::()); match l23 { - 0 => (), + 0 => {} _ => { - let l24 = - *arg0.add(36).cast::<*mut u8>(); - let l25 = *arg0.add(40).cast::(); + let l24 = *arg0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l25 = *arg0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l24, l25, 1); } } @@ -24794,28 +26932,34 @@ pub mod exports { 32 => { let l26 = i32::from(*arg0.add(32).cast::()); match l26 { - 0 => (), + 0 => {} _ => { - let l27 = - *arg0.add(36).cast::<*mut u8>(); - let l28 = *arg0.add(40).cast::(); + let l27 = *arg0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l28 = *arg0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l27, l28, 1); } } } - 33 => (), - 34 => (), - 35 => (), - 36 => (), - 37 => (), + 33 => {} + 34 => {} + 35 => {} + 36 => {} + 37 => {} _ => { let l29 = i32::from(*arg0.add(32).cast::()); match l29 { - 0 => (), + 0 => {} _ => { - let l30 = - *arg0.add(36).cast::<*mut u8>(); - let l31 = *arg0.add(40).cast::(); + let l30 = *arg0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l31 = *arg0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l30, l31, 1); } } @@ -24824,7 +26968,7 @@ pub mod exports { } } } - _ => (), + _ => {} } } } @@ -24833,39 +26977,34 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_constructor_outgoing_response_cabi< T: GuestOutgoingResponse, - >( - arg0: i32, - ) -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = OutgoingResponse::new(T::new(Fields::from_handle(arg0 as u32))); + >(arg0: i32) -> i32 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = OutgoingResponse::new( + T::new(unsafe { Fields::from_handle(arg0 as u32) }), + ); (result0).take_handle() as i32 } #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_method_outgoing_response_status_code_cabi< T: GuestOutgoingResponse, - >( - arg0: *mut u8, - ) -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::status_code(OutgoingResponseBorrow::lift(arg0 as u32 as usize).get()); + >(arg0: *mut u8) -> i32 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::status_code( + unsafe { OutgoingResponseBorrow::lift(arg0 as u32 as usize) } + .get(), + ); _rt::as_i32(result0) } #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_method_outgoing_response_set_status_code_cabi< T: GuestOutgoingResponse, - >( - arg0: *mut u8, - arg1: i32, - ) -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + >(arg0: *mut u8, arg1: i32) -> i32 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::set_status_code( - OutgoingResponseBorrow::lift(arg0 as u32 as usize).get(), + unsafe { OutgoingResponseBorrow::lift(arg0 as u32 as usize) } + .get(), arg1 as u16, ); let result1 = match result0 { @@ -24878,26 +27017,25 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_outgoing_response_headers_cabi< T: GuestOutgoingResponse, - >( - arg0: *mut u8, - ) -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::headers(OutgoingResponseBorrow::lift(arg0 as u32 as usize).get()); + >(arg0: *mut u8) -> i32 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::headers( + unsafe { OutgoingResponseBorrow::lift(arg0 as u32 as usize) } + .get(), + ); (result0).take_handle() as i32 } #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_method_outgoing_response_body_cabi< T: GuestOutgoingResponse, - >( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = T::body(OutgoingResponseBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::body( + unsafe { OutgoingResponseBorrow::lift(arg0 as u32 as usize) } + .get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -24911,13 +27049,14 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_outgoing_body_write_cabi( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = T::write(OutgoingBodyBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + pub unsafe fn _export_method_outgoing_body_write_cabi< + T: GuestOutgoingBody, + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::write( + unsafe { OutgoingBodyBorrow::lift(arg0 as u32 as usize) }.get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -24931,25 +27070,22 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_static_outgoing_body_finish_cabi( - arg0: i32, - arg1: i32, - arg2: i32, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + pub unsafe fn _export_static_outgoing_body_finish_cabi< + T: GuestOutgoingBody, + >(arg0: i32, arg1: i32, arg2: i32) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::finish( - OutgoingBody::from_handle(arg0 as u32), + unsafe { OutgoingBody::from_handle(arg0 as u32) }, match arg1 { 0 => None, 1 => { - let e = Fields::from_handle(arg2 as u32); + let e = unsafe { Fields::from_handle(arg2 as u32) }; Some(e) } _ => _rt::invalid_enum_discriminant(), }, ); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(_) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -24973,8 +27109,12 @@ pub mod exports { let ptr3 = vec3.as_ptr().cast::(); let len3 = vec3.len(); ::core::mem::forget(vec3); - *ptr1.add(24).cast::() = len3; - *ptr1.add(20).cast::<*mut u8>() = ptr3.cast_mut(); + *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len3; + *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr3.cast_mut(); } None => { *ptr1.add(16).cast::() = (0i32) as u8; @@ -24982,11 +27122,17 @@ pub mod exports { }; match info_code2 { Some(e) => { - *ptr1.add(28).cast::() = (1i32) as u8; - *ptr1.add(30).cast::() = (_rt::as_i32(e)) as u16; + *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; + *ptr1 + .add(18 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (_rt::as_i32(e)) as u16; } None => { - *ptr1.add(28).cast::() = (0i32) as u8; + *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } }; } @@ -25043,16 +27189,24 @@ pub mod exports { }; match alert_message4 { Some(e) => { - *ptr1.add(20).cast::() = (1i32) as u8; + *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; let vec5 = (e.into_bytes()).into_boxed_slice(); let ptr5 = vec5.as_ptr().cast::(); let len5 = vec5.len(); ::core::mem::forget(vec5); - *ptr1.add(28).cast::() = len5; - *ptr1.add(24).cast::<*mut u8>() = ptr5.cast_mut(); + *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len5; + *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr5.cast_mut(); } None => { - *ptr1.add(20).cast::() = (0i32) as u8; + *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } }; } @@ -25106,26 +27260,39 @@ pub mod exports { } = e; match field_name6 { Some(e) => { - *ptr1.add(20).cast::() = (1i32) as u8; + *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; let vec7 = (e.into_bytes()).into_boxed_slice(); let ptr7 = vec7.as_ptr().cast::(); let len7 = vec7.len(); ::core::mem::forget(vec7); - *ptr1.add(28).cast::() = len7; - *ptr1.add(24).cast::<*mut u8>() = - ptr7.cast_mut(); + *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len7; + *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr7.cast_mut(); } None => { - *ptr1.add(20).cast::() = (0i32) as u8; + *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } }; match field_size6 { Some(e) => { - *ptr1.add(32).cast::() = (1i32) as u8; - *ptr1.add(36).cast::() = _rt::as_i32(e); + *ptr1 + .add(16 + 4 * ::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; + *ptr1 + .add(20 + 4 * ::core::mem::size_of::<*const u8>()) + .cast::() = _rt::as_i32(e); } None => { - *ptr1.add(32).cast::() = (0i32) as u8; + *ptr1 + .add(16 + 4 * ::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } }; } @@ -25159,8 +27326,12 @@ pub mod exports { let ptr9 = vec9.as_ptr().cast::(); let len9 = vec9.len(); ::core::mem::forget(vec9); - *ptr1.add(24).cast::() = len9; - *ptr1.add(20).cast::<*mut u8>() = ptr9.cast_mut(); + *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len9; + *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr9.cast_mut(); } None => { *ptr1.add(16).cast::() = (0i32) as u8; @@ -25168,11 +27339,17 @@ pub mod exports { }; match field_size8 { Some(e) => { - *ptr1.add(28).cast::() = (1i32) as u8; - *ptr1.add(32).cast::() = _rt::as_i32(e); + *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; + *ptr1 + .add(20 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = _rt::as_i32(e); } None => { - *ptr1.add(28).cast::() = (0i32) as u8; + *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } }; } @@ -25204,8 +27381,12 @@ pub mod exports { let ptr11 = vec11.as_ptr().cast::(); let len11 = vec11.len(); ::core::mem::forget(vec11); - *ptr1.add(24).cast::() = len11; - *ptr1.add(20).cast::<*mut u8>() = ptr11.cast_mut(); + *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len11; + *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr11.cast_mut(); } None => { *ptr1.add(16).cast::() = (0i32) as u8; @@ -25213,11 +27394,17 @@ pub mod exports { }; match field_size10 { Some(e) => { - *ptr1.add(28).cast::() = (1i32) as u8; - *ptr1.add(32).cast::() = _rt::as_i32(e); + *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; + *ptr1 + .add(20 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = _rt::as_i32(e); } None => { - *ptr1.add(28).cast::() = (0i32) as u8; + *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } }; } @@ -25258,8 +27445,12 @@ pub mod exports { let ptr13 = vec13.as_ptr().cast::(); let len13 = vec13.len(); ::core::mem::forget(vec13); - *ptr1.add(24).cast::() = len13; - *ptr1.add(20).cast::<*mut u8>() = ptr13.cast_mut(); + *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len13; + *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr13.cast_mut(); } None => { *ptr1.add(16).cast::() = (0i32) as u8; @@ -25267,11 +27458,17 @@ pub mod exports { }; match field_size12 { Some(e) => { - *ptr1.add(28).cast::() = (1i32) as u8; - *ptr1.add(32).cast::() = _rt::as_i32(e); + *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; + *ptr1 + .add(20 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = _rt::as_i32(e); } None => { - *ptr1.add(28).cast::() = (0i32) as u8; + *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } }; } @@ -25284,8 +27481,12 @@ pub mod exports { let ptr14 = vec14.as_ptr().cast::(); let len14 = vec14.len(); ::core::mem::forget(vec14); - *ptr1.add(24).cast::() = len14; - *ptr1.add(20).cast::<*mut u8>() = ptr14.cast_mut(); + *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len14; + *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr14.cast_mut(); } None => { *ptr1.add(16).cast::() = (0i32) as u8; @@ -25301,8 +27502,12 @@ pub mod exports { let ptr15 = vec15.as_ptr().cast::(); let len15 = vec15.len(); ::core::mem::forget(vec15); - *ptr1.add(24).cast::() = len15; - *ptr1.add(20).cast::<*mut u8>() = ptr15.cast_mut(); + *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len15; + *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr15.cast_mut(); } None => { *ptr1.add(16).cast::() = (0i32) as u8; @@ -25333,8 +27538,12 @@ pub mod exports { let ptr16 = vec16.as_ptr().cast::(); let len16 = vec16.len(); ::core::mem::forget(vec16); - *ptr1.add(24).cast::() = len16; - *ptr1.add(20).cast::<*mut u8>() = ptr16.cast_mut(); + *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len16; + *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr16.cast_mut(); } None => { *ptr1.add(16).cast::() = (0i32) as u8; @@ -25348,108 +27557,140 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn __post_return_static_outgoing_body_finish( - arg0: *mut u8, - ) { + pub unsafe fn __post_return_static_outgoing_body_finish< + T: GuestOutgoingBody, + >(arg0: *mut u8) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { - 0 => (), + 0 => {} _ => { let l1 = i32::from(*arg0.add(8).cast::()); match l1 { - 0 => (), + 0 => {} 1 => { let l2 = i32::from(*arg0.add(16).cast::()); match l2 { - 0 => (), + 0 => {} _ => { - let l3 = *arg0.add(20).cast::<*mut u8>(); - let l4 = *arg0.add(24).cast::(); + let l3 = *arg0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l4 = *arg0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l3, l4, 1); } } } - 2 => (), - 3 => (), - 4 => (), - 5 => (), - 6 => (), - 7 => (), - 8 => (), - 9 => (), - 10 => (), - 11 => (), - 12 => (), - 13 => (), + 2 => {} + 3 => {} + 4 => {} + 5 => {} + 6 => {} + 7 => {} + 8 => {} + 9 => {} + 10 => {} + 11 => {} + 12 => {} + 13 => {} 14 => { - let l5 = i32::from(*arg0.add(20).cast::()); + let l5 = i32::from( + *arg0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); match l5 { - 0 => (), + 0 => {} _ => { - let l6 = *arg0.add(24).cast::<*mut u8>(); - let l7 = *arg0.add(28).cast::(); + let l6 = *arg0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l7 = *arg0 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l6, l7, 1); } } } - 15 => (), - 16 => (), - 17 => (), - 18 => (), - 19 => (), - 20 => (), - 21 => (), + 15 => {} + 16 => {} + 17 => {} + 18 => {} + 19 => {} + 20 => {} + 21 => {} 22 => { let l8 = i32::from(*arg0.add(16).cast::()); match l8 { - 0 => (), + 0 => {} _ => { - let l9 = i32::from(*arg0.add(20).cast::()); + let l9 = i32::from( + *arg0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); match l9 { - 0 => (), + 0 => {} _ => { - let l10 = *arg0.add(24).cast::<*mut u8>(); - let l11 = *arg0.add(28).cast::(); + let l10 = *arg0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l11 = *arg0 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l10, l11, 1); } } } } } - 23 => (), + 23 => {} 24 => { let l12 = i32::from(*arg0.add(16).cast::()); match l12 { - 0 => (), + 0 => {} _ => { - let l13 = *arg0.add(20).cast::<*mut u8>(); - let l14 = *arg0.add(24).cast::(); + let l13 = *arg0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l14 = *arg0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l13, l14, 1); } } } - 25 => (), - 26 => (), + 25 => {} + 26 => {} 27 => { let l15 = i32::from(*arg0.add(16).cast::()); match l15 { - 0 => (), + 0 => {} _ => { - let l16 = *arg0.add(20).cast::<*mut u8>(); - let l17 = *arg0.add(24).cast::(); + let l16 = *arg0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l17 = *arg0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l16, l17, 1); } } } - 28 => (), - 29 => (), + 28 => {} + 29 => {} 30 => { let l18 = i32::from(*arg0.add(16).cast::()); match l18 { - 0 => (), + 0 => {} _ => { - let l19 = *arg0.add(20).cast::<*mut u8>(); - let l20 = *arg0.add(24).cast::(); + let l19 = *arg0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l20 = *arg0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l19, l20, 1); } } @@ -25457,10 +27698,14 @@ pub mod exports { 31 => { let l21 = i32::from(*arg0.add(16).cast::()); match l21 { - 0 => (), + 0 => {} _ => { - let l22 = *arg0.add(20).cast::<*mut u8>(); - let l23 = *arg0.add(24).cast::(); + let l22 = *arg0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l23 = *arg0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l22, l23, 1); } } @@ -25468,26 +27713,34 @@ pub mod exports { 32 => { let l24 = i32::from(*arg0.add(16).cast::()); match l24 { - 0 => (), + 0 => {} _ => { - let l25 = *arg0.add(20).cast::<*mut u8>(); - let l26 = *arg0.add(24).cast::(); + let l25 = *arg0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l26 = *arg0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l25, l26, 1); } } } - 33 => (), - 34 => (), - 35 => (), - 36 => (), - 37 => (), + 33 => {} + 34 => {} + 35 => {} + 36 => {} + 37 => {} _ => { let l27 = i32::from(*arg0.add(16).cast::()); match l27 { - 0 => (), + 0 => {} _ => { - let l28 = *arg0.add(20).cast::<*mut u8>(); - let l29 = *arg0.add(24).cast::(); + let l28 = *arg0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l29 = *arg0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l28, l29, 1); } } @@ -25500,13 +27753,13 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_future_incoming_response_subscribe_cabi< T: GuestFutureIncomingResponse, - >( - arg0: *mut u8, - ) -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + >(arg0: *mut u8) -> i32 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::subscribe( - FutureIncomingResponseBorrow::lift(arg0 as u32 as usize).get(), + unsafe { + FutureIncomingResponseBorrow::lift(arg0 as u32 as usize) + } + .get(), ); (result0).take_handle() as i32 } @@ -25514,14 +27767,15 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_future_incoming_response_get_cabi< T: GuestFutureIncomingResponse, - >( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::get(FutureIncomingResponseBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::get( + unsafe { + FutureIncomingResponseBorrow::lift(arg0 as u32 as usize) + } + .get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Some(e) => { *ptr1.add(0).cast::() = (1i32) as u8; @@ -25547,32 +27801,35 @@ pub mod exports { } = e; match rcode2 { Some(e) => { - *ptr1.add(32).cast::() = - (1i32) as u8; - let vec3 = - (e.into_bytes()).into_boxed_slice(); + *ptr1.add(32).cast::() = (1i32) as u8; + let vec3 = (e.into_bytes()).into_boxed_slice(); let ptr3 = vec3.as_ptr().cast::(); let len3 = vec3.len(); ::core::mem::forget(vec3); - *ptr1.add(40).cast::() = len3; - *ptr1.add(36).cast::<*mut u8>() = - ptr3.cast_mut(); + *ptr1 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len3; + *ptr1 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr3.cast_mut(); } None => { - *ptr1.add(32).cast::() = - (0i32) as u8; + *ptr1.add(32).cast::() = (0i32) as u8; } }; match info_code2 { Some(e) => { - *ptr1.add(44).cast::() = - (1i32) as u8; - *ptr1.add(46).cast::() = - (_rt::as_i32(e)) as u16; + *ptr1 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; + *ptr1 + .add(34 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (_rt::as_i32(e)) as u16; } None => { - *ptr1.add(44).cast::() = - (0i32) as u8; + *ptr1 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } }; } @@ -25620,32 +27877,33 @@ pub mod exports { } = e; match alert_id4 { Some(e) => { - *ptr1.add(32).cast::() = - (1i32) as u8; - *ptr1.add(33).cast::() = - (_rt::as_i32(e)) as u8; + *ptr1.add(32).cast::() = (1i32) as u8; + *ptr1.add(33).cast::() = (_rt::as_i32(e)) as u8; } None => { - *ptr1.add(32).cast::() = - (0i32) as u8; + *ptr1.add(32).cast::() = (0i32) as u8; } }; match alert_message4 { Some(e) => { - *ptr1.add(36).cast::() = - (1i32) as u8; - let vec5 = - (e.into_bytes()).into_boxed_slice(); + *ptr1 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; + let vec5 = (e.into_bytes()).into_boxed_slice(); let ptr5 = vec5.as_ptr().cast::(); let len5 = vec5.len(); ::core::mem::forget(vec5); - *ptr1.add(44).cast::() = len5; - *ptr1.add(40).cast::<*mut u8>() = - ptr5.cast_mut(); + *ptr1 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len5; + *ptr1 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr5.cast_mut(); } None => { - *ptr1.add(36).cast::() = - (0i32) as u8; + *ptr1 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } }; } @@ -25659,14 +27917,11 @@ pub mod exports { *ptr1.add(24).cast::() = (17i32) as u8; match e { Some(e) => { - *ptr1.add(32).cast::() = - (1i32) as u8; - *ptr1.add(40).cast::() = - _rt::as_i64(e); + *ptr1.add(32).cast::() = (1i32) as u8; + *ptr1.add(40).cast::() = _rt::as_i64(e); } None => { - *ptr1.add(32).cast::() = - (0i32) as u8; + *ptr1.add(32).cast::() = (0i32) as u8; } }; } @@ -25683,14 +27938,11 @@ pub mod exports { *ptr1.add(24).cast::() = (21i32) as u8; match e { Some(e) => { - *ptr1.add(32).cast::() = - (1i32) as u8; - *ptr1.add(36).cast::() = - _rt::as_i32(e); + *ptr1.add(32).cast::() = (1i32) as u8; + *ptr1.add(36).cast::() = _rt::as_i32(e); } None => { - *ptr1.add(32).cast::() = - (0i32) as u8; + *ptr1.add(32).cast::() = (0i32) as u8; } }; } @@ -25698,50 +27950,51 @@ pub mod exports { *ptr1.add(24).cast::() = (22i32) as u8; match e { Some(e) => { - *ptr1.add(32).cast::() = - (1i32) as u8; + *ptr1.add(32).cast::() = (1i32) as u8; let FieldSizePayload { field_name: field_name6, field_size: field_size6, } = e; match field_name6 { Some(e) => { - *ptr1.add(36).cast::() = - (1i32) as u8; - let vec7 = (e.into_bytes()) - .into_boxed_slice(); - let ptr7 = - vec7.as_ptr().cast::(); + *ptr1 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; + let vec7 = (e.into_bytes()).into_boxed_slice(); + let ptr7 = vec7.as_ptr().cast::(); let len7 = vec7.len(); ::core::mem::forget(vec7); - *ptr1.add(44).cast::() = - len7; *ptr1 - .add(40) - .cast::<*mut u8>() = - ptr7.cast_mut(); + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len7; + *ptr1 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr7.cast_mut(); } None => { - *ptr1.add(36).cast::() = - (0i32) as u8; + *ptr1 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } }; match field_size6 { Some(e) => { - *ptr1.add(48).cast::() = - (1i32) as u8; - *ptr1.add(52).cast::() = - _rt::as_i32(e); + *ptr1 + .add(32 + 4 * ::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; + *ptr1 + .add(36 + 4 * ::core::mem::size_of::<*const u8>()) + .cast::() = _rt::as_i32(e); } None => { - *ptr1.add(48).cast::() = - (0i32) as u8; + *ptr1 + .add(32 + 4 * ::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } }; } None => { - *ptr1.add(32).cast::() = - (0i32) as u8; + *ptr1.add(32).cast::() = (0i32) as u8; } }; } @@ -25749,14 +28002,11 @@ pub mod exports { *ptr1.add(24).cast::() = (23i32) as u8; match e { Some(e) => { - *ptr1.add(32).cast::() = - (1i32) as u8; - *ptr1.add(36).cast::() = - _rt::as_i32(e); + *ptr1.add(32).cast::() = (1i32) as u8; + *ptr1.add(36).cast::() = _rt::as_i32(e); } None => { - *ptr1.add(32).cast::() = - (0i32) as u8; + *ptr1.add(32).cast::() = (0i32) as u8; } }; } @@ -25768,32 +28018,35 @@ pub mod exports { } = e; match field_name8 { Some(e) => { - *ptr1.add(32).cast::() = - (1i32) as u8; - let vec9 = - (e.into_bytes()).into_boxed_slice(); + *ptr1.add(32).cast::() = (1i32) as u8; + let vec9 = (e.into_bytes()).into_boxed_slice(); let ptr9 = vec9.as_ptr().cast::(); let len9 = vec9.len(); ::core::mem::forget(vec9); - *ptr1.add(40).cast::() = len9; - *ptr1.add(36).cast::<*mut u8>() = - ptr9.cast_mut(); + *ptr1 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len9; + *ptr1 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr9.cast_mut(); } None => { - *ptr1.add(32).cast::() = - (0i32) as u8; + *ptr1.add(32).cast::() = (0i32) as u8; } }; match field_size8 { Some(e) => { - *ptr1.add(44).cast::() = - (1i32) as u8; - *ptr1.add(48).cast::() = - _rt::as_i32(e); + *ptr1 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; + *ptr1 + .add(36 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = _rt::as_i32(e); } None => { - *ptr1.add(44).cast::() = - (0i32) as u8; + *ptr1 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } }; } @@ -25804,14 +28057,11 @@ pub mod exports { *ptr1.add(24).cast::() = (26i32) as u8; match e { Some(e) => { - *ptr1.add(32).cast::() = - (1i32) as u8; - *ptr1.add(36).cast::() = - _rt::as_i32(e); + *ptr1.add(32).cast::() = (1i32) as u8; + *ptr1.add(36).cast::() = _rt::as_i32(e); } None => { - *ptr1.add(32).cast::() = - (0i32) as u8; + *ptr1.add(32).cast::() = (0i32) as u8; } }; } @@ -25823,32 +28073,35 @@ pub mod exports { } = e; match field_name10 { Some(e) => { - *ptr1.add(32).cast::() = - (1i32) as u8; - let vec11 = - (e.into_bytes()).into_boxed_slice(); + *ptr1.add(32).cast::() = (1i32) as u8; + let vec11 = (e.into_bytes()).into_boxed_slice(); let ptr11 = vec11.as_ptr().cast::(); let len11 = vec11.len(); ::core::mem::forget(vec11); - *ptr1.add(40).cast::() = len11; - *ptr1.add(36).cast::<*mut u8>() = - ptr11.cast_mut(); + *ptr1 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len11; + *ptr1 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr11.cast_mut(); } None => { - *ptr1.add(32).cast::() = - (0i32) as u8; + *ptr1.add(32).cast::() = (0i32) as u8; } }; match field_size10 { Some(e) => { - *ptr1.add(44).cast::() = - (1i32) as u8; - *ptr1.add(48).cast::() = - _rt::as_i32(e); + *ptr1 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; + *ptr1 + .add(36 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = _rt::as_i32(e); } None => { - *ptr1.add(44).cast::() = - (0i32) as u8; + *ptr1 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } }; } @@ -25856,14 +28109,11 @@ pub mod exports { *ptr1.add(24).cast::() = (28i32) as u8; match e { Some(e) => { - *ptr1.add(32).cast::() = - (1i32) as u8; - *ptr1.add(40).cast::() = - _rt::as_i64(e); + *ptr1.add(32).cast::() = (1i32) as u8; + *ptr1.add(40).cast::() = _rt::as_i64(e); } None => { - *ptr1.add(32).cast::() = - (0i32) as u8; + *ptr1.add(32).cast::() = (0i32) as u8; } }; } @@ -25871,14 +28121,11 @@ pub mod exports { *ptr1.add(24).cast::() = (29i32) as u8; match e { Some(e) => { - *ptr1.add(32).cast::() = - (1i32) as u8; - *ptr1.add(36).cast::() = - _rt::as_i32(e); + *ptr1.add(32).cast::() = (1i32) as u8; + *ptr1.add(36).cast::() = _rt::as_i32(e); } None => { - *ptr1.add(32).cast::() = - (0i32) as u8; + *ptr1.add(32).cast::() = (0i32) as u8; } }; } @@ -25890,32 +28137,35 @@ pub mod exports { } = e; match field_name12 { Some(e) => { - *ptr1.add(32).cast::() = - (1i32) as u8; - let vec13 = - (e.into_bytes()).into_boxed_slice(); + *ptr1.add(32).cast::() = (1i32) as u8; + let vec13 = (e.into_bytes()).into_boxed_slice(); let ptr13 = vec13.as_ptr().cast::(); let len13 = vec13.len(); ::core::mem::forget(vec13); - *ptr1.add(40).cast::() = len13; - *ptr1.add(36).cast::<*mut u8>() = - ptr13.cast_mut(); + *ptr1 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len13; + *ptr1 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr13.cast_mut(); } None => { - *ptr1.add(32).cast::() = - (0i32) as u8; + *ptr1.add(32).cast::() = (0i32) as u8; } }; match field_size12 { Some(e) => { - *ptr1.add(44).cast::() = - (1i32) as u8; - *ptr1.add(48).cast::() = - _rt::as_i32(e); + *ptr1 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; + *ptr1 + .add(36 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = _rt::as_i32(e); } None => { - *ptr1.add(44).cast::() = - (0i32) as u8; + *ptr1 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } }; } @@ -25923,20 +28173,20 @@ pub mod exports { *ptr1.add(24).cast::() = (31i32) as u8; match e { Some(e) => { - *ptr1.add(32).cast::() = - (1i32) as u8; - let vec14 = - (e.into_bytes()).into_boxed_slice(); + *ptr1.add(32).cast::() = (1i32) as u8; + let vec14 = (e.into_bytes()).into_boxed_slice(); let ptr14 = vec14.as_ptr().cast::(); let len14 = vec14.len(); ::core::mem::forget(vec14); - *ptr1.add(40).cast::() = len14; - *ptr1.add(36).cast::<*mut u8>() = - ptr14.cast_mut(); + *ptr1 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len14; + *ptr1 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr14.cast_mut(); } None => { - *ptr1.add(32).cast::() = - (0i32) as u8; + *ptr1.add(32).cast::() = (0i32) as u8; } }; } @@ -25944,20 +28194,20 @@ pub mod exports { *ptr1.add(24).cast::() = (32i32) as u8; match e { Some(e) => { - *ptr1.add(32).cast::() = - (1i32) as u8; - let vec15 = - (e.into_bytes()).into_boxed_slice(); + *ptr1.add(32).cast::() = (1i32) as u8; + let vec15 = (e.into_bytes()).into_boxed_slice(); let ptr15 = vec15.as_ptr().cast::(); let len15 = vec15.len(); ::core::mem::forget(vec15); - *ptr1.add(40).cast::() = len15; - *ptr1.add(36).cast::<*mut u8>() = - ptr15.cast_mut(); + *ptr1 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len15; + *ptr1 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr15.cast_mut(); } None => { - *ptr1.add(32).cast::() = - (0i32) as u8; + *ptr1.add(32).cast::() = (0i32) as u8; } }; } @@ -25980,20 +28230,20 @@ pub mod exports { *ptr1.add(24).cast::() = (38i32) as u8; match e { Some(e) => { - *ptr1.add(32).cast::() = - (1i32) as u8; - let vec16 = - (e.into_bytes()).into_boxed_slice(); + *ptr1.add(32).cast::() = (1i32) as u8; + let vec16 = (e.into_bytes()).into_boxed_slice(); let ptr16 = vec16.as_ptr().cast::(); let len16 = vec16.len(); ::core::mem::forget(vec16); - *ptr1.add(40).cast::() = len16; - *ptr1.add(36).cast::<*mut u8>() = - ptr16.cast_mut(); + *ptr1 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len16; + *ptr1 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr16.cast_mut(); } None => { - *ptr1.add(32).cast::() = - (0i32) as u8; + *ptr1.add(32).cast::() = (0i32) as u8; } }; } @@ -26016,82 +28266,92 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn __post_return_method_future_incoming_response_get< T: GuestFutureIncomingResponse, - >( - arg0: *mut u8, - ) { + >(arg0: *mut u8) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { - 0 => (), + 0 => {} _ => { let l1 = i32::from(*arg0.add(8).cast::()); match l1 { 0 => { let l2 = i32::from(*arg0.add(16).cast::()); match l2 { - 0 => (), + 0 => {} _ => { let l3 = i32::from(*arg0.add(24).cast::()); match l3 { - 0 => (), + 0 => {} 1 => { let l4 = i32::from(*arg0.add(32).cast::()); match l4 { - 0 => (), + 0 => {} _ => { - let l5 = - *arg0.add(36).cast::<*mut u8>(); - let l6 = *arg0.add(40).cast::(); + let l5 = *arg0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l6 = *arg0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l5, l6, 1); } } } - 2 => (), - 3 => (), - 4 => (), - 5 => (), - 6 => (), - 7 => (), - 8 => (), - 9 => (), - 10 => (), - 11 => (), - 12 => (), - 13 => (), + 2 => {} + 3 => {} + 4 => {} + 5 => {} + 6 => {} + 7 => {} + 8 => {} + 9 => {} + 10 => {} + 11 => {} + 12 => {} + 13 => {} 14 => { - let l7 = i32::from(*arg0.add(36).cast::()); + let l7 = i32::from( + *arg0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); match l7 { - 0 => (), + 0 => {} _ => { - let l8 = - *arg0.add(40).cast::<*mut u8>(); - let l9 = *arg0.add(44).cast::(); + let l8 = *arg0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l9 = *arg0 + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l8, l9, 1); } } } - 15 => (), - 16 => (), - 17 => (), - 18 => (), - 19 => (), - 20 => (), - 21 => (), + 15 => {} + 16 => {} + 17 => {} + 18 => {} + 19 => {} + 20 => {} + 21 => {} 22 => { let l10 = i32::from(*arg0.add(32).cast::()); match l10 { - 0 => (), + 0 => {} _ => { let l11 = i32::from( - *arg0.add(36).cast::(), + *arg0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(), ); match l11 { - 0 => (), + 0 => {} _ => { let l12 = *arg0 - .add(40) + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) .cast::<*mut u8>(); let l13 = *arg0 - .add(44) + .add(32 + 3 * ::core::mem::size_of::<*const u8>()) .cast::(); _rt::cabi_dealloc(l12, l13, 1); } @@ -26099,43 +28359,52 @@ pub mod exports { } } } - 23 => (), + 23 => {} 24 => { let l14 = i32::from(*arg0.add(32).cast::()); match l14 { - 0 => (), + 0 => {} _ => { - let l15 = - *arg0.add(36).cast::<*mut u8>(); - let l16 = *arg0.add(40).cast::(); + let l15 = *arg0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l16 = *arg0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l15, l16, 1); } } } - 25 => (), - 26 => (), + 25 => {} + 26 => {} 27 => { let l17 = i32::from(*arg0.add(32).cast::()); match l17 { - 0 => (), + 0 => {} _ => { - let l18 = - *arg0.add(36).cast::<*mut u8>(); - let l19 = *arg0.add(40).cast::(); + let l18 = *arg0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l19 = *arg0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l18, l19, 1); } } } - 28 => (), - 29 => (), + 28 => {} + 29 => {} 30 => { let l20 = i32::from(*arg0.add(32).cast::()); match l20 { - 0 => (), + 0 => {} _ => { - let l21 = - *arg0.add(36).cast::<*mut u8>(); - let l22 = *arg0.add(40).cast::(); + let l21 = *arg0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l22 = *arg0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l21, l22, 1); } } @@ -26143,11 +28412,14 @@ pub mod exports { 31 => { let l23 = i32::from(*arg0.add(32).cast::()); match l23 { - 0 => (), + 0 => {} _ => { - let l24 = - *arg0.add(36).cast::<*mut u8>(); - let l25 = *arg0.add(40).cast::(); + let l24 = *arg0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l25 = *arg0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l24, l25, 1); } } @@ -26155,28 +28427,34 @@ pub mod exports { 32 => { let l26 = i32::from(*arg0.add(32).cast::()); match l26 { - 0 => (), + 0 => {} _ => { - let l27 = - *arg0.add(36).cast::<*mut u8>(); - let l28 = *arg0.add(40).cast::(); + let l27 = *arg0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l28 = *arg0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l27, l28, 1); } } } - 33 => (), - 34 => (), - 35 => (), - 36 => (), - 37 => (), + 33 => {} + 34 => {} + 35 => {} + 36 => {} + 37 => {} _ => { let l29 = i32::from(*arg0.add(32).cast::()); match l29 { - 0 => (), + 0 => {} _ => { - let l30 = - *arg0.add(36).cast::<*mut u8>(); - let l31 = *arg0.add(40).cast::(); + let l30 = *arg0 + .add(32 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l31 = *arg0 + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l30, l31, 1); } } @@ -26185,7 +28463,7 @@ pub mod exports { } } } - _ => (), + _ => {} } } } @@ -26226,18 +28504,16 @@ pub mod exports { let _ = val; unreachable!(); } - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-new]fields"] fn new(_: *mut u8) -> u32; } - new(val) + unsafe { new(val) } } } - #[doc(hidden)] fn _resource_rep(handle: u32) -> *mut u8 where @@ -26248,18 +28524,16 @@ pub mod exports { let _ = handle; unreachable!(); } - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-rep]fields"] fn rep(_: u32) -> *mut u8; } unsafe { rep(handle) } } } - /// Construct an empty HTTP Fields. /// /// The resulting `fields` is mutable. @@ -26308,7 +28582,11 @@ pub mod exports { /// values for that key. /// /// Fails with `header-error.immutable` if the `fields` are immutable. - fn append(&self, name: FieldKey, value: FieldValue) -> Result<(), HeaderError>; + fn append( + &self, + name: FieldKey, + value: FieldValue, + ) -> Result<(), HeaderError>; /// Retrieve the full set of keys and values in the Fields. Like the /// constructor, the list represents each key-value pair. /// @@ -26332,18 +28610,16 @@ pub mod exports { let _ = val; unreachable!(); } - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-new]incoming-request"] fn new(_: *mut u8) -> u32; } - new(val) + unsafe { new(val) } } } - #[doc(hidden)] fn _resource_rep(handle: u32) -> *mut u8 where @@ -26354,18 +28630,16 @@ pub mod exports { let _ = handle; unreachable!(); } - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-rep]incoming-request"] fn rep(_: u32) -> *mut u8; } unsafe { rep(handle) } } } - /// Returns the method of the incoming request. fn method(&self) -> Method; /// Returns the path with query parameters from the request, as a string. @@ -26398,18 +28672,16 @@ pub mod exports { let _ = val; unreachable!(); } - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-new]outgoing-request"] fn new(_: *mut u8) -> u32; } - new(val) + unsafe { new(val) } } } - #[doc(hidden)] fn _resource_rep(handle: u32) -> *mut u8 where @@ -26420,18 +28692,16 @@ pub mod exports { let _ = handle; unreachable!(); } - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-rep]outgoing-request"] fn rep(_: u32) -> *mut u8; } unsafe { rep(handle) } } } - /// Construct a new `outgoing-request` with a default `method` of `GET`, and /// `none` values for `path-with-query`, `scheme`, and `authority`. /// @@ -26480,7 +28750,10 @@ pub mod exports { /// with Related Schemes which do not require an Authority. The HTTP and /// HTTPS schemes always require an authority. Fails if the string given is /// not a syntactically valid uri authority. - fn set_authority(&self, authority: Option<_rt::String>) -> Result<(), ()>; + fn set_authority( + &self, + authority: Option<_rt::String>, + ) -> Result<(), ()>; /// Get the headers associated with the Request. /// /// The returned `headers` resource is immutable: `set`, `append`, and @@ -26502,18 +28775,16 @@ pub mod exports { let _ = val; unreachable!(); } - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-new]request-options"] fn new(_: *mut u8) -> u32; } - new(val) + unsafe { new(val) } } } - #[doc(hidden)] fn _resource_rep(handle: u32) -> *mut u8 where @@ -26524,30 +28795,34 @@ pub mod exports { let _ = handle; unreachable!(); } - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-rep]request-options"] fn rep(_: u32) -> *mut u8; } unsafe { rep(handle) } } } - /// Construct a default `request-options` value. fn new() -> Self; /// The timeout for the initial connect to the HTTP Server. fn connect_timeout(&self) -> Option; /// Set the timeout for the initial connect to the HTTP Server. An error /// return value indicates that this timeout is not supported. - fn set_connect_timeout(&self, duration: Option) -> Result<(), ()>; + fn set_connect_timeout( + &self, + duration: Option, + ) -> Result<(), ()>; /// The timeout for receiving the first byte of the Response body. fn first_byte_timeout(&self) -> Option; /// Set the timeout for receiving the first byte of the Response body. An /// error return value indicates that this timeout is not supported. - fn set_first_byte_timeout(&self, duration: Option) -> Result<(), ()>; + fn set_first_byte_timeout( + &self, + duration: Option, + ) -> Result<(), ()>; /// The timeout for receiving subsequent chunks of bytes in the Response /// body stream. fn between_bytes_timeout(&self) -> Option; @@ -26570,18 +28845,16 @@ pub mod exports { let _ = val; unreachable!(); } - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-new]response-outparam"] fn new(_: *mut u8) -> u32; } - new(val) + unsafe { new(val) } } } - #[doc(hidden)] fn _resource_rep(handle: u32) -> *mut u8 where @@ -26592,18 +28865,16 @@ pub mod exports { let _ = handle; unreachable!(); } - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-rep]response-outparam"] fn rep(_: u32) -> *mut u8; } unsafe { rep(handle) } } } - /// Set the value of the `response-outparam` to either send a response, /// or indicate an error. /// @@ -26613,7 +28884,10 @@ pub mod exports { /// /// The user may provide an `error` to `response` to allow the /// implementation determine how to respond with an HTTP error response. - fn set(param: ResponseOutparam, response: Result); + fn set( + param: ResponseOutparam, + response: Result, + ) -> (); } pub trait GuestIncomingResponse: 'static { #[doc(hidden)] @@ -26626,18 +28900,16 @@ pub mod exports { let _ = val; unreachable!(); } - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-new]incoming-response"] fn new(_: *mut u8) -> u32; } - new(val) + unsafe { new(val) } } } - #[doc(hidden)] fn _resource_rep(handle: u32) -> *mut u8 where @@ -26648,18 +28920,16 @@ pub mod exports { let _ = handle; unreachable!(); } - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-rep]incoming-response"] fn rep(_: u32) -> *mut u8; } unsafe { rep(handle) } } } - /// Returns the status code from the incoming response. fn status(&self) -> StatusCode; /// Returns the headers from the incoming response. @@ -26685,18 +28955,16 @@ pub mod exports { let _ = val; unreachable!(); } - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-new]incoming-body"] fn new(_: *mut u8) -> u32; } - new(val) + unsafe { new(val) } } } - #[doc(hidden)] fn _resource_rep(handle: u32) -> *mut u8 where @@ -26707,18 +28975,16 @@ pub mod exports { let _ = handle; unreachable!(); } - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-rep]incoming-body"] fn rep(_: u32) -> *mut u8; } unsafe { rep(handle) } } } - /// Returns the contents of the body, as a stream of bytes. /// /// Returns success on first call: the stream representing the contents @@ -26750,18 +29016,16 @@ pub mod exports { let _ = val; unreachable!(); } - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-new]future-trailers"] fn new(_: *mut u8) -> u32; } - new(val) + unsafe { new(val) } } } - #[doc(hidden)] fn _resource_rep(handle: u32) -> *mut u8 where @@ -26772,18 +29036,16 @@ pub mod exports { let _ = handle; unreachable!(); } - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-rep]future-trailers"] fn rep(_: u32) -> *mut u8; } unsafe { rep(handle) } } } - /// Returns a pollable which becomes ready when either the trailers have /// been received, or an error has occured. When this pollable is ready, /// the `get` method will return `some`. @@ -26807,7 +29069,9 @@ pub mod exports { /// resource is immutable, and a child. Use of the `set`, `append`, or /// `delete` methods will return an error, and the resource must be /// dropped before the parent `future-trailers` is dropped. - fn get(&self) -> Option, ErrorCode>, ()>>; + fn get( + &self, + ) -> Option, ErrorCode>, ()>>; } pub trait GuestOutgoingResponse: 'static { #[doc(hidden)] @@ -26820,18 +29084,16 @@ pub mod exports { let _ = val; unreachable!(); } - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-new]outgoing-response"] fn new(_: *mut u8) -> u32; } - new(val) + unsafe { new(val) } } } - #[doc(hidden)] fn _resource_rep(handle: u32) -> *mut u8 where @@ -26842,18 +29104,16 @@ pub mod exports { let _ = handle; unreachable!(); } - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-rep]outgoing-response"] fn rep(_: u32) -> *mut u8; } unsafe { rep(handle) } } } - /// Construct an `outgoing-response`, with a default `status-code` of `200`. /// If a different `status-code` is needed, it must be set via the /// `set-status-code` method. @@ -26892,18 +29152,16 @@ pub mod exports { let _ = val; unreachable!(); } - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-new]outgoing-body"] fn new(_: *mut u8) -> u32; } - new(val) + unsafe { new(val) } } } - #[doc(hidden)] fn _resource_rep(handle: u32) -> *mut u8 where @@ -26914,18 +29172,16 @@ pub mod exports { let _ = handle; unreachable!(); } - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-rep]outgoing-body"] fn rep(_: u32) -> *mut u8; } unsafe { rep(handle) } } } - /// Returns a stream for writing the body contents. /// /// The returned `output-stream` is a child resource: it must be dropped @@ -26961,18 +29217,16 @@ pub mod exports { let _ = val; unreachable!(); } - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-new]future-incoming-response"] fn new(_: *mut u8) -> u32; } - new(val) + unsafe { new(val) } } } - #[doc(hidden)] fn _resource_rep(handle: u32) -> *mut u8 where @@ -26983,18 +29237,16 @@ pub mod exports { let _ = handle; unreachable!(); } - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:http/types@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-rep]future-incoming-response"] fn rep(_: u32) -> *mut u8; } unsafe { rep(handle) } } } - /// Returns a pollable which becomes ready when either the Response has /// been received, or an error has occured. When this pollable is ready, /// the `get` method will return `some`. @@ -27013,439 +29265,520 @@ pub mod exports { /// occured. Errors may also occur while consuming the response body, /// but those will be reported by the `incoming-body` and its /// `output-stream` child. - fn get(&self) -> Option, ()>>; + fn get( + &self, + ) -> Option, ()>>; } #[doc(hidden)] - - macro_rules! __export_wasi_http_types_0_2_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "wasi:http/types@0.2.0#http-error-code"] - unsafe extern "C" fn export_http_error_code(arg0: i32,) -> *mut u8 { - $($path_to_types)*::_export_http_error_code_cabi::<$ty>(arg0) - } - #[export_name = "cabi_post_wasi:http/types@0.2.0#http-error-code"] - unsafe extern "C" fn _post_return_http_error_code(arg0: *mut u8,) { - $($path_to_types)*::__post_return_http_error_code::<$ty>(arg0) - } - #[export_name = "wasi:http/types@0.2.0#[constructor]fields"] - unsafe extern "C" fn export_constructor_fields() -> i32 { - $($path_to_types)*::_export_constructor_fields_cabi::<<$ty as $($path_to_types)*::Guest>::Fields>() - } - #[export_name = "wasi:http/types@0.2.0#[static]fields.from-list"] - unsafe extern "C" fn export_static_fields_from_list(arg0: *mut u8,arg1: usize,) -> *mut u8 { - $($path_to_types)*::_export_static_fields_from_list_cabi::<<$ty as $($path_to_types)*::Guest>::Fields>(arg0, arg1) - } - #[export_name = "wasi:http/types@0.2.0#[method]fields.get"] - unsafe extern "C" fn export_method_fields_get(arg0: *mut u8,arg1: *mut u8,arg2: usize,) -> *mut u8 { - $($path_to_types)*::_export_method_fields_get_cabi::<<$ty as $($path_to_types)*::Guest>::Fields>(arg0, arg1, arg2) - } - #[export_name = "cabi_post_wasi:http/types@0.2.0#[method]fields.get"] - unsafe extern "C" fn _post_return_method_fields_get(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_fields_get::<<$ty as $($path_to_types)*::Guest>::Fields>(arg0) - } - #[export_name = "wasi:http/types@0.2.0#[method]fields.has"] - unsafe extern "C" fn export_method_fields_has(arg0: *mut u8,arg1: *mut u8,arg2: usize,) -> i32 { - $($path_to_types)*::_export_method_fields_has_cabi::<<$ty as $($path_to_types)*::Guest>::Fields>(arg0, arg1, arg2) - } - #[export_name = "wasi:http/types@0.2.0#[method]fields.set"] - unsafe extern "C" fn export_method_fields_set(arg0: *mut u8,arg1: *mut u8,arg2: usize,arg3: *mut u8,arg4: usize,) -> *mut u8 { - $($path_to_types)*::_export_method_fields_set_cabi::<<$ty as $($path_to_types)*::Guest>::Fields>(arg0, arg1, arg2, arg3, arg4) - } - #[export_name = "wasi:http/types@0.2.0#[method]fields.delete"] - unsafe extern "C" fn export_method_fields_delete(arg0: *mut u8,arg1: *mut u8,arg2: usize,) -> *mut u8 { - $($path_to_types)*::_export_method_fields_delete_cabi::<<$ty as $($path_to_types)*::Guest>::Fields>(arg0, arg1, arg2) - } - #[export_name = "wasi:http/types@0.2.0#[method]fields.append"] - unsafe extern "C" fn export_method_fields_append(arg0: *mut u8,arg1: *mut u8,arg2: usize,arg3: *mut u8,arg4: usize,) -> *mut u8 { - $($path_to_types)*::_export_method_fields_append_cabi::<<$ty as $($path_to_types)*::Guest>::Fields>(arg0, arg1, arg2, arg3, arg4) - } - #[export_name = "wasi:http/types@0.2.0#[method]fields.entries"] - unsafe extern "C" fn export_method_fields_entries(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_fields_entries_cabi::<<$ty as $($path_to_types)*::Guest>::Fields>(arg0) - } - #[export_name = "cabi_post_wasi:http/types@0.2.0#[method]fields.entries"] - unsafe extern "C" fn _post_return_method_fields_entries(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_fields_entries::<<$ty as $($path_to_types)*::Guest>::Fields>(arg0) - } - #[export_name = "wasi:http/types@0.2.0#[method]fields.clone"] - unsafe extern "C" fn export_method_fields_clone(arg0: *mut u8,) -> i32 { - $($path_to_types)*::_export_method_fields_clone_cabi::<<$ty as $($path_to_types)*::Guest>::Fields>(arg0) - } - #[export_name = "wasi:http/types@0.2.0#[method]incoming-request.method"] - unsafe extern "C" fn export_method_incoming_request_method(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_incoming_request_method_cabi::<<$ty as $($path_to_types)*::Guest>::IncomingRequest>(arg0) - } - #[export_name = "cabi_post_wasi:http/types@0.2.0#[method]incoming-request.method"] - unsafe extern "C" fn _post_return_method_incoming_request_method(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_incoming_request_method::<<$ty as $($path_to_types)*::Guest>::IncomingRequest>(arg0) - } - #[export_name = "wasi:http/types@0.2.0#[method]incoming-request.path-with-query"] - unsafe extern "C" fn export_method_incoming_request_path_with_query(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_incoming_request_path_with_query_cabi::<<$ty as $($path_to_types)*::Guest>::IncomingRequest>(arg0) - } - #[export_name = "cabi_post_wasi:http/types@0.2.0#[method]incoming-request.path-with-query"] - unsafe extern "C" fn _post_return_method_incoming_request_path_with_query(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_incoming_request_path_with_query::<<$ty as $($path_to_types)*::Guest>::IncomingRequest>(arg0) - } - #[export_name = "wasi:http/types@0.2.0#[method]incoming-request.scheme"] - unsafe extern "C" fn export_method_incoming_request_scheme(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_incoming_request_scheme_cabi::<<$ty as $($path_to_types)*::Guest>::IncomingRequest>(arg0) - } - #[export_name = "cabi_post_wasi:http/types@0.2.0#[method]incoming-request.scheme"] - unsafe extern "C" fn _post_return_method_incoming_request_scheme(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_incoming_request_scheme::<<$ty as $($path_to_types)*::Guest>::IncomingRequest>(arg0) - } - #[export_name = "wasi:http/types@0.2.0#[method]incoming-request.authority"] - unsafe extern "C" fn export_method_incoming_request_authority(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_incoming_request_authority_cabi::<<$ty as $($path_to_types)*::Guest>::IncomingRequest>(arg0) - } - #[export_name = "cabi_post_wasi:http/types@0.2.0#[method]incoming-request.authority"] - unsafe extern "C" fn _post_return_method_incoming_request_authority(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_incoming_request_authority::<<$ty as $($path_to_types)*::Guest>::IncomingRequest>(arg0) - } - #[export_name = "wasi:http/types@0.2.0#[method]incoming-request.headers"] - unsafe extern "C" fn export_method_incoming_request_headers(arg0: *mut u8,) -> i32 { - $($path_to_types)*::_export_method_incoming_request_headers_cabi::<<$ty as $($path_to_types)*::Guest>::IncomingRequest>(arg0) - } - #[export_name = "wasi:http/types@0.2.0#[method]incoming-request.consume"] - unsafe extern "C" fn export_method_incoming_request_consume(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_incoming_request_consume_cabi::<<$ty as $($path_to_types)*::Guest>::IncomingRequest>(arg0) - } - #[export_name = "wasi:http/types@0.2.0#[constructor]outgoing-request"] - unsafe extern "C" fn export_constructor_outgoing_request(arg0: i32,) -> i32 { - $($path_to_types)*::_export_constructor_outgoing_request_cabi::<<$ty as $($path_to_types)*::Guest>::OutgoingRequest>(arg0) - } - #[export_name = "wasi:http/types@0.2.0#[method]outgoing-request.body"] - unsafe extern "C" fn export_method_outgoing_request_body(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_outgoing_request_body_cabi::<<$ty as $($path_to_types)*::Guest>::OutgoingRequest>(arg0) - } - #[export_name = "wasi:http/types@0.2.0#[method]outgoing-request.method"] - unsafe extern "C" fn export_method_outgoing_request_method(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_outgoing_request_method_cabi::<<$ty as $($path_to_types)*::Guest>::OutgoingRequest>(arg0) - } - #[export_name = "cabi_post_wasi:http/types@0.2.0#[method]outgoing-request.method"] - unsafe extern "C" fn _post_return_method_outgoing_request_method(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_outgoing_request_method::<<$ty as $($path_to_types)*::Guest>::OutgoingRequest>(arg0) - } - #[export_name = "wasi:http/types@0.2.0#[method]outgoing-request.set-method"] - unsafe extern "C" fn export_method_outgoing_request_set_method(arg0: *mut u8,arg1: i32,arg2: *mut u8,arg3: usize,) -> i32 { - $($path_to_types)*::_export_method_outgoing_request_set_method_cabi::<<$ty as $($path_to_types)*::Guest>::OutgoingRequest>(arg0, arg1, arg2, arg3) - } - #[export_name = "wasi:http/types@0.2.0#[method]outgoing-request.path-with-query"] - unsafe extern "C" fn export_method_outgoing_request_path_with_query(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_outgoing_request_path_with_query_cabi::<<$ty as $($path_to_types)*::Guest>::OutgoingRequest>(arg0) - } - #[export_name = "cabi_post_wasi:http/types@0.2.0#[method]outgoing-request.path-with-query"] - unsafe extern "C" fn _post_return_method_outgoing_request_path_with_query(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_outgoing_request_path_with_query::<<$ty as $($path_to_types)*::Guest>::OutgoingRequest>(arg0) - } - #[export_name = "wasi:http/types@0.2.0#[method]outgoing-request.set-path-with-query"] - unsafe extern "C" fn export_method_outgoing_request_set_path_with_query(arg0: *mut u8,arg1: i32,arg2: *mut u8,arg3: usize,) -> i32 { - $($path_to_types)*::_export_method_outgoing_request_set_path_with_query_cabi::<<$ty as $($path_to_types)*::Guest>::OutgoingRequest>(arg0, arg1, arg2, arg3) - } - #[export_name = "wasi:http/types@0.2.0#[method]outgoing-request.scheme"] - unsafe extern "C" fn export_method_outgoing_request_scheme(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_outgoing_request_scheme_cabi::<<$ty as $($path_to_types)*::Guest>::OutgoingRequest>(arg0) - } - #[export_name = "cabi_post_wasi:http/types@0.2.0#[method]outgoing-request.scheme"] - unsafe extern "C" fn _post_return_method_outgoing_request_scheme(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_outgoing_request_scheme::<<$ty as $($path_to_types)*::Guest>::OutgoingRequest>(arg0) - } - #[export_name = "wasi:http/types@0.2.0#[method]outgoing-request.set-scheme"] - unsafe extern "C" fn export_method_outgoing_request_set_scheme(arg0: *mut u8,arg1: i32,arg2: i32,arg3: *mut u8,arg4: usize,) -> i32 { - $($path_to_types)*::_export_method_outgoing_request_set_scheme_cabi::<<$ty as $($path_to_types)*::Guest>::OutgoingRequest>(arg0, arg1, arg2, arg3, arg4) - } - #[export_name = "wasi:http/types@0.2.0#[method]outgoing-request.authority"] - unsafe extern "C" fn export_method_outgoing_request_authority(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_outgoing_request_authority_cabi::<<$ty as $($path_to_types)*::Guest>::OutgoingRequest>(arg0) - } - #[export_name = "cabi_post_wasi:http/types@0.2.0#[method]outgoing-request.authority"] - unsafe extern "C" fn _post_return_method_outgoing_request_authority(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_outgoing_request_authority::<<$ty as $($path_to_types)*::Guest>::OutgoingRequest>(arg0) - } - #[export_name = "wasi:http/types@0.2.0#[method]outgoing-request.set-authority"] - unsafe extern "C" fn export_method_outgoing_request_set_authority(arg0: *mut u8,arg1: i32,arg2: *mut u8,arg3: usize,) -> i32 { - $($path_to_types)*::_export_method_outgoing_request_set_authority_cabi::<<$ty as $($path_to_types)*::Guest>::OutgoingRequest>(arg0, arg1, arg2, arg3) - } - #[export_name = "wasi:http/types@0.2.0#[method]outgoing-request.headers"] - unsafe extern "C" fn export_method_outgoing_request_headers(arg0: *mut u8,) -> i32 { - $($path_to_types)*::_export_method_outgoing_request_headers_cabi::<<$ty as $($path_to_types)*::Guest>::OutgoingRequest>(arg0) - } - #[export_name = "wasi:http/types@0.2.0#[constructor]request-options"] - unsafe extern "C" fn export_constructor_request_options() -> i32 { - $($path_to_types)*::_export_constructor_request_options_cabi::<<$ty as $($path_to_types)*::Guest>::RequestOptions>() - } - #[export_name = "wasi:http/types@0.2.0#[method]request-options.connect-timeout"] - unsafe extern "C" fn export_method_request_options_connect_timeout(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_request_options_connect_timeout_cabi::<<$ty as $($path_to_types)*::Guest>::RequestOptions>(arg0) - } - #[export_name = "wasi:http/types@0.2.0#[method]request-options.set-connect-timeout"] - unsafe extern "C" fn export_method_request_options_set_connect_timeout(arg0: *mut u8,arg1: i32,arg2: i64,) -> i32 { - $($path_to_types)*::_export_method_request_options_set_connect_timeout_cabi::<<$ty as $($path_to_types)*::Guest>::RequestOptions>(arg0, arg1, arg2) - } - #[export_name = "wasi:http/types@0.2.0#[method]request-options.first-byte-timeout"] - unsafe extern "C" fn export_method_request_options_first_byte_timeout(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_request_options_first_byte_timeout_cabi::<<$ty as $($path_to_types)*::Guest>::RequestOptions>(arg0) - } - #[export_name = "wasi:http/types@0.2.0#[method]request-options.set-first-byte-timeout"] - unsafe extern "C" fn export_method_request_options_set_first_byte_timeout(arg0: *mut u8,arg1: i32,arg2: i64,) -> i32 { - $($path_to_types)*::_export_method_request_options_set_first_byte_timeout_cabi::<<$ty as $($path_to_types)*::Guest>::RequestOptions>(arg0, arg1, arg2) - } - #[export_name = "wasi:http/types@0.2.0#[method]request-options.between-bytes-timeout"] - unsafe extern "C" fn export_method_request_options_between_bytes_timeout(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_request_options_between_bytes_timeout_cabi::<<$ty as $($path_to_types)*::Guest>::RequestOptions>(arg0) - } - #[export_name = "wasi:http/types@0.2.0#[method]request-options.set-between-bytes-timeout"] - unsafe extern "C" fn export_method_request_options_set_between_bytes_timeout(arg0: *mut u8,arg1: i32,arg2: i64,) -> i32 { - $($path_to_types)*::_export_method_request_options_set_between_bytes_timeout_cabi::<<$ty as $($path_to_types)*::Guest>::RequestOptions>(arg0, arg1, arg2) - } - #[export_name = "wasi:http/types@0.2.0#[static]response-outparam.set"] - unsafe extern "C" fn export_static_response_outparam_set(arg0: i32,arg1: i32,arg2: i32,arg3: i32,arg4: ::core::mem::MaybeUninit::,arg5: *mut u8,arg6: *mut u8,arg7: usize,arg8: i32,) { - $($path_to_types)*::_export_static_response_outparam_set_cabi::<<$ty as $($path_to_types)*::Guest>::ResponseOutparam>(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) - } - #[export_name = "wasi:http/types@0.2.0#[method]incoming-response.status"] - unsafe extern "C" fn export_method_incoming_response_status(arg0: *mut u8,) -> i32 { - $($path_to_types)*::_export_method_incoming_response_status_cabi::<<$ty as $($path_to_types)*::Guest>::IncomingResponse>(arg0) - } - #[export_name = "wasi:http/types@0.2.0#[method]incoming-response.headers"] - unsafe extern "C" fn export_method_incoming_response_headers(arg0: *mut u8,) -> i32 { - $($path_to_types)*::_export_method_incoming_response_headers_cabi::<<$ty as $($path_to_types)*::Guest>::IncomingResponse>(arg0) - } - #[export_name = "wasi:http/types@0.2.0#[method]incoming-response.consume"] - unsafe extern "C" fn export_method_incoming_response_consume(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_incoming_response_consume_cabi::<<$ty as $($path_to_types)*::Guest>::IncomingResponse>(arg0) - } - #[export_name = "wasi:http/types@0.2.0#[method]incoming-body.stream"] - unsafe extern "C" fn export_method_incoming_body_stream(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_incoming_body_stream_cabi::<<$ty as $($path_to_types)*::Guest>::IncomingBody>(arg0) - } - #[export_name = "wasi:http/types@0.2.0#[static]incoming-body.finish"] - unsafe extern "C" fn export_static_incoming_body_finish(arg0: i32,) -> i32 { - $($path_to_types)*::_export_static_incoming_body_finish_cabi::<<$ty as $($path_to_types)*::Guest>::IncomingBody>(arg0) - } - #[export_name = "wasi:http/types@0.2.0#[method]future-trailers.subscribe"] - unsafe extern "C" fn export_method_future_trailers_subscribe(arg0: *mut u8,) -> i32 { - $($path_to_types)*::_export_method_future_trailers_subscribe_cabi::<<$ty as $($path_to_types)*::Guest>::FutureTrailers>(arg0) - } - #[export_name = "wasi:http/types@0.2.0#[method]future-trailers.get"] - unsafe extern "C" fn export_method_future_trailers_get(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_future_trailers_get_cabi::<<$ty as $($path_to_types)*::Guest>::FutureTrailers>(arg0) - } - #[export_name = "cabi_post_wasi:http/types@0.2.0#[method]future-trailers.get"] - unsafe extern "C" fn _post_return_method_future_trailers_get(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_future_trailers_get::<<$ty as $($path_to_types)*::Guest>::FutureTrailers>(arg0) - } - #[export_name = "wasi:http/types@0.2.0#[constructor]outgoing-response"] - unsafe extern "C" fn export_constructor_outgoing_response(arg0: i32,) -> i32 { - $($path_to_types)*::_export_constructor_outgoing_response_cabi::<<$ty as $($path_to_types)*::Guest>::OutgoingResponse>(arg0) - } - #[export_name = "wasi:http/types@0.2.0#[method]outgoing-response.status-code"] - unsafe extern "C" fn export_method_outgoing_response_status_code(arg0: *mut u8,) -> i32 { - $($path_to_types)*::_export_method_outgoing_response_status_code_cabi::<<$ty as $($path_to_types)*::Guest>::OutgoingResponse>(arg0) - } - #[export_name = "wasi:http/types@0.2.0#[method]outgoing-response.set-status-code"] - unsafe extern "C" fn export_method_outgoing_response_set_status_code(arg0: *mut u8,arg1: i32,) -> i32 { - $($path_to_types)*::_export_method_outgoing_response_set_status_code_cabi::<<$ty as $($path_to_types)*::Guest>::OutgoingResponse>(arg0, arg1) - } - #[export_name = "wasi:http/types@0.2.0#[method]outgoing-response.headers"] - unsafe extern "C" fn export_method_outgoing_response_headers(arg0: *mut u8,) -> i32 { - $($path_to_types)*::_export_method_outgoing_response_headers_cabi::<<$ty as $($path_to_types)*::Guest>::OutgoingResponse>(arg0) - } - #[export_name = "wasi:http/types@0.2.0#[method]outgoing-response.body"] - unsafe extern "C" fn export_method_outgoing_response_body(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_outgoing_response_body_cabi::<<$ty as $($path_to_types)*::Guest>::OutgoingResponse>(arg0) - } - #[export_name = "wasi:http/types@0.2.0#[method]outgoing-body.write"] - unsafe extern "C" fn export_method_outgoing_body_write(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_outgoing_body_write_cabi::<<$ty as $($path_to_types)*::Guest>::OutgoingBody>(arg0) - } - #[export_name = "wasi:http/types@0.2.0#[static]outgoing-body.finish"] - unsafe extern "C" fn export_static_outgoing_body_finish(arg0: i32,arg1: i32,arg2: i32,) -> *mut u8 { - $($path_to_types)*::_export_static_outgoing_body_finish_cabi::<<$ty as $($path_to_types)*::Guest>::OutgoingBody>(arg0, arg1, arg2) - } - #[export_name = "cabi_post_wasi:http/types@0.2.0#[static]outgoing-body.finish"] - unsafe extern "C" fn _post_return_static_outgoing_body_finish(arg0: *mut u8,) { - $($path_to_types)*::__post_return_static_outgoing_body_finish::<<$ty as $($path_to_types)*::Guest>::OutgoingBody>(arg0) - } - #[export_name = "wasi:http/types@0.2.0#[method]future-incoming-response.subscribe"] - unsafe extern "C" fn export_method_future_incoming_response_subscribe(arg0: *mut u8,) -> i32 { - $($path_to_types)*::_export_method_future_incoming_response_subscribe_cabi::<<$ty as $($path_to_types)*::Guest>::FutureIncomingResponse>(arg0) - } - #[export_name = "wasi:http/types@0.2.0#[method]future-incoming-response.get"] - unsafe extern "C" fn export_method_future_incoming_response_get(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_future_incoming_response_get_cabi::<<$ty as $($path_to_types)*::Guest>::FutureIncomingResponse>(arg0) - } - #[export_name = "cabi_post_wasi:http/types@0.2.0#[method]future-incoming-response.get"] - unsafe extern "C" fn _post_return_method_future_incoming_response_get(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_future_incoming_response_get::<<$ty as $($path_to_types)*::Guest>::FutureIncomingResponse>(arg0) - } - - const _: () = { - #[doc(hidden)] - #[export_name = "wasi:http/types@0.2.0#[dtor]fields"] - #[allow(non_snake_case)] - unsafe extern "C" fn dtor(rep: *mut u8) { - $($path_to_types)*::Fields::dtor::< - <$ty as $($path_to_types)*::Guest>::Fields - >(rep) - } - }; - - - const _: () = { - #[doc(hidden)] - #[export_name = "wasi:http/types@0.2.0#[dtor]incoming-request"] - #[allow(non_snake_case)] - unsafe extern "C" fn dtor(rep: *mut u8) { - $($path_to_types)*::IncomingRequest::dtor::< - <$ty as $($path_to_types)*::Guest>::IncomingRequest - >(rep) - } - }; - - - const _: () = { - #[doc(hidden)] - #[export_name = "wasi:http/types@0.2.0#[dtor]outgoing-request"] - #[allow(non_snake_case)] - unsafe extern "C" fn dtor(rep: *mut u8) { - $($path_to_types)*::OutgoingRequest::dtor::< - <$ty as $($path_to_types)*::Guest>::OutgoingRequest - >(rep) - } - }; - - - const _: () = { - #[doc(hidden)] - #[export_name = "wasi:http/types@0.2.0#[dtor]request-options"] - #[allow(non_snake_case)] - unsafe extern "C" fn dtor(rep: *mut u8) { - $($path_to_types)*::RequestOptions::dtor::< - <$ty as $($path_to_types)*::Guest>::RequestOptions - >(rep) - } - }; - - - const _: () = { - #[doc(hidden)] - #[export_name = "wasi:http/types@0.2.0#[dtor]response-outparam"] - #[allow(non_snake_case)] - unsafe extern "C" fn dtor(rep: *mut u8) { - $($path_to_types)*::ResponseOutparam::dtor::< - <$ty as $($path_to_types)*::Guest>::ResponseOutparam - >(rep) - } - }; - - - const _: () = { - #[doc(hidden)] - #[export_name = "wasi:http/types@0.2.0#[dtor]incoming-response"] - #[allow(non_snake_case)] - unsafe extern "C" fn dtor(rep: *mut u8) { - $($path_to_types)*::IncomingResponse::dtor::< - <$ty as $($path_to_types)*::Guest>::IncomingResponse - >(rep) - } - }; - - - const _: () = { - #[doc(hidden)] - #[export_name = "wasi:http/types@0.2.0#[dtor]incoming-body"] - #[allow(non_snake_case)] - unsafe extern "C" fn dtor(rep: *mut u8) { - $($path_to_types)*::IncomingBody::dtor::< - <$ty as $($path_to_types)*::Guest>::IncomingBody - >(rep) - } - }; - - - const _: () = { - #[doc(hidden)] - #[export_name = "wasi:http/types@0.2.0#[dtor]future-trailers"] - #[allow(non_snake_case)] - unsafe extern "C" fn dtor(rep: *mut u8) { - $($path_to_types)*::FutureTrailers::dtor::< - <$ty as $($path_to_types)*::Guest>::FutureTrailers - >(rep) - } - }; - - - const _: () = { - #[doc(hidden)] - #[export_name = "wasi:http/types@0.2.0#[dtor]outgoing-response"] - #[allow(non_snake_case)] - unsafe extern "C" fn dtor(rep: *mut u8) { - $($path_to_types)*::OutgoingResponse::dtor::< - <$ty as $($path_to_types)*::Guest>::OutgoingResponse - >(rep) - } - }; - - - const _: () = { - #[doc(hidden)] - #[export_name = "wasi:http/types@0.2.0#[dtor]outgoing-body"] - #[allow(non_snake_case)] - unsafe extern "C" fn dtor(rep: *mut u8) { - $($path_to_types)*::OutgoingBody::dtor::< - <$ty as $($path_to_types)*::Guest>::OutgoingBody - >(rep) - } - }; - - - const _: () = { - #[doc(hidden)] - #[export_name = "wasi:http/types@0.2.0#[dtor]future-incoming-response"] - #[allow(non_snake_case)] - unsafe extern "C" fn dtor(rep: *mut u8) { - $($path_to_types)*::FutureIncomingResponse::dtor::< - <$ty as $($path_to_types)*::Guest>::FutureIncomingResponse - >(rep) - } - }; - - };); - } + macro_rules! __export_wasi_http_types_0_2_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "wasi:http/types@0.2.0#http-error-code")] unsafe extern "C" fn + export_http_error_code(arg0 : i32,) -> * mut u8 { unsafe { + $($path_to_types)*:: _export_http_error_code_cabi::<$ty > (arg0) + } } #[unsafe (export_name = + "cabi_post_wasi:http/types@0.2.0#http-error-code")] unsafe extern + "C" fn _post_return_http_error_code(arg0 : * mut u8,) { unsafe { + $($path_to_types)*:: __post_return_http_error_code::<$ty > (arg0) + } } #[unsafe (export_name = + "wasi:http/types@0.2.0#[constructor]fields")] unsafe extern "C" + fn export_constructor_fields() -> i32 { unsafe { + $($path_to_types)*:: _export_constructor_fields_cabi::<<$ty as + $($path_to_types)*:: Guest >::Fields > () } } #[unsafe + (export_name = "wasi:http/types@0.2.0#[static]fields.from-list")] + unsafe extern "C" fn export_static_fields_from_list(arg0 : * mut + u8, arg1 : usize,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_static_fields_from_list_cabi::<<$ty as + $($path_to_types)*:: Guest >::Fields > (arg0, arg1) } } #[unsafe + (export_name = "wasi:http/types@0.2.0#[method]fields.get")] + unsafe extern "C" fn export_method_fields_get(arg0 : * mut u8, + arg1 : * mut u8, arg2 : usize,) -> * mut u8 { unsafe { + $($path_to_types)*:: _export_method_fields_get_cabi::<<$ty as + $($path_to_types)*:: Guest >::Fields > (arg0, arg1, arg2) } } + #[unsafe (export_name = + "cabi_post_wasi:http/types@0.2.0#[method]fields.get")] unsafe + extern "C" fn _post_return_method_fields_get(arg0 : * mut u8,) { + unsafe { $($path_to_types)*:: + __post_return_method_fields_get::<<$ty as $($path_to_types)*:: + Guest >::Fields > (arg0) } } #[unsafe (export_name = + "wasi:http/types@0.2.0#[method]fields.has")] unsafe extern "C" fn + export_method_fields_has(arg0 : * mut u8, arg1 : * mut u8, arg2 : + usize,) -> i32 { unsafe { $($path_to_types)*:: + _export_method_fields_has_cabi::<<$ty as $($path_to_types)*:: + Guest >::Fields > (arg0, arg1, arg2) } } #[unsafe (export_name = + "wasi:http/types@0.2.0#[method]fields.set")] unsafe extern "C" fn + export_method_fields_set(arg0 : * mut u8, arg1 : * mut u8, arg2 : + usize, arg3 : * mut u8, arg4 : usize,) -> * mut u8 { unsafe { + $($path_to_types)*:: _export_method_fields_set_cabi::<<$ty as + $($path_to_types)*:: Guest >::Fields > (arg0, arg1, arg2, arg3, + arg4) } } #[unsafe (export_name = + "wasi:http/types@0.2.0#[method]fields.delete")] unsafe extern "C" + fn export_method_fields_delete(arg0 : * mut u8, arg1 : * mut u8, + arg2 : usize,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_fields_delete_cabi::<<$ty as $($path_to_types)*:: + Guest >::Fields > (arg0, arg1, arg2) } } #[unsafe (export_name = + "wasi:http/types@0.2.0#[method]fields.append")] unsafe extern "C" + fn export_method_fields_append(arg0 : * mut u8, arg1 : * mut u8, + arg2 : usize, arg3 : * mut u8, arg4 : usize,) -> * mut u8 { + unsafe { $($path_to_types)*:: + _export_method_fields_append_cabi::<<$ty as $($path_to_types)*:: + Guest >::Fields > (arg0, arg1, arg2, arg3, arg4) } } #[unsafe + (export_name = "wasi:http/types@0.2.0#[method]fields.entries")] + unsafe extern "C" fn export_method_fields_entries(arg0 : * mut + u8,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_fields_entries_cabi::<<$ty as $($path_to_types)*:: + Guest >::Fields > (arg0) } } #[unsafe (export_name = + "cabi_post_wasi:http/types@0.2.0#[method]fields.entries")] unsafe + extern "C" fn _post_return_method_fields_entries(arg0 : * mut + u8,) { unsafe { $($path_to_types)*:: + __post_return_method_fields_entries::<<$ty as + $($path_to_types)*:: Guest >::Fields > (arg0) } } #[unsafe + (export_name = "wasi:http/types@0.2.0#[method]fields.clone")] + unsafe extern "C" fn export_method_fields_clone(arg0 : * mut u8,) + -> i32 { unsafe { $($path_to_types)*:: + _export_method_fields_clone_cabi::<<$ty as $($path_to_types)*:: + Guest >::Fields > (arg0) } } #[unsafe (export_name = + "wasi:http/types@0.2.0#[method]incoming-request.method")] unsafe + extern "C" fn export_method_incoming_request_method(arg0 : * mut + u8,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_incoming_request_method_cabi::<<$ty as + $($path_to_types)*:: Guest >::IncomingRequest > (arg0) } } + #[unsafe (export_name = + "cabi_post_wasi:http/types@0.2.0#[method]incoming-request.method")] + unsafe extern "C" fn + _post_return_method_incoming_request_method(arg0 : * mut u8,) { + unsafe { $($path_to_types)*:: + __post_return_method_incoming_request_method::<<$ty as + $($path_to_types)*:: Guest >::IncomingRequest > (arg0) } } + #[unsafe (export_name = + "wasi:http/types@0.2.0#[method]incoming-request.path-with-query")] + unsafe extern "C" fn + export_method_incoming_request_path_with_query(arg0 : * mut u8,) + -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_incoming_request_path_with_query_cabi::<<$ty as + $($path_to_types)*:: Guest >::IncomingRequest > (arg0) } } + #[unsafe (export_name = + "cabi_post_wasi:http/types@0.2.0#[method]incoming-request.path-with-query")] + unsafe extern "C" fn + _post_return_method_incoming_request_path_with_query(arg0 : * mut + u8,) { unsafe { $($path_to_types)*:: + __post_return_method_incoming_request_path_with_query::<<$ty as + $($path_to_types)*:: Guest >::IncomingRequest > (arg0) } } + #[unsafe (export_name = + "wasi:http/types@0.2.0#[method]incoming-request.scheme")] unsafe + extern "C" fn export_method_incoming_request_scheme(arg0 : * mut + u8,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_incoming_request_scheme_cabi::<<$ty as + $($path_to_types)*:: Guest >::IncomingRequest > (arg0) } } + #[unsafe (export_name = + "cabi_post_wasi:http/types@0.2.0#[method]incoming-request.scheme")] + unsafe extern "C" fn + _post_return_method_incoming_request_scheme(arg0 : * mut u8,) { + unsafe { $($path_to_types)*:: + __post_return_method_incoming_request_scheme::<<$ty as + $($path_to_types)*:: Guest >::IncomingRequest > (arg0) } } + #[unsafe (export_name = + "wasi:http/types@0.2.0#[method]incoming-request.authority")] + unsafe extern "C" fn + export_method_incoming_request_authority(arg0 : * mut u8,) -> * + mut u8 { unsafe { $($path_to_types)*:: + _export_method_incoming_request_authority_cabi::<<$ty as + $($path_to_types)*:: Guest >::IncomingRequest > (arg0) } } + #[unsafe (export_name = + "cabi_post_wasi:http/types@0.2.0#[method]incoming-request.authority")] + unsafe extern "C" fn + _post_return_method_incoming_request_authority(arg0 : * mut u8,) + { unsafe { $($path_to_types)*:: + __post_return_method_incoming_request_authority::<<$ty as + $($path_to_types)*:: Guest >::IncomingRequest > (arg0) } } + #[unsafe (export_name = + "wasi:http/types@0.2.0#[method]incoming-request.headers")] unsafe + extern "C" fn export_method_incoming_request_headers(arg0 : * mut + u8,) -> i32 { unsafe { $($path_to_types)*:: + _export_method_incoming_request_headers_cabi::<<$ty as + $($path_to_types)*:: Guest >::IncomingRequest > (arg0) } } + #[unsafe (export_name = + "wasi:http/types@0.2.0#[method]incoming-request.consume")] unsafe + extern "C" fn export_method_incoming_request_consume(arg0 : * mut + u8,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_incoming_request_consume_cabi::<<$ty as + $($path_to_types)*:: Guest >::IncomingRequest > (arg0) } } + #[unsafe (export_name = + "wasi:http/types@0.2.0#[constructor]outgoing-request")] unsafe + extern "C" fn export_constructor_outgoing_request(arg0 : i32,) -> + i32 { unsafe { $($path_to_types)*:: + _export_constructor_outgoing_request_cabi::<<$ty as + $($path_to_types)*:: Guest >::OutgoingRequest > (arg0) } } + #[unsafe (export_name = + "wasi:http/types@0.2.0#[method]outgoing-request.body")] unsafe + extern "C" fn export_method_outgoing_request_body(arg0 : * mut + u8,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_outgoing_request_body_cabi::<<$ty as + $($path_to_types)*:: Guest >::OutgoingRequest > (arg0) } } + #[unsafe (export_name = + "wasi:http/types@0.2.0#[method]outgoing-request.method")] unsafe + extern "C" fn export_method_outgoing_request_method(arg0 : * mut + u8,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_outgoing_request_method_cabi::<<$ty as + $($path_to_types)*:: Guest >::OutgoingRequest > (arg0) } } + #[unsafe (export_name = + "cabi_post_wasi:http/types@0.2.0#[method]outgoing-request.method")] + unsafe extern "C" fn + _post_return_method_outgoing_request_method(arg0 : * mut u8,) { + unsafe { $($path_to_types)*:: + __post_return_method_outgoing_request_method::<<$ty as + $($path_to_types)*:: Guest >::OutgoingRequest > (arg0) } } + #[unsafe (export_name = + "wasi:http/types@0.2.0#[method]outgoing-request.set-method")] + unsafe extern "C" fn + export_method_outgoing_request_set_method(arg0 : * mut u8, arg1 : + i32, arg2 : * mut u8, arg3 : usize,) -> i32 { unsafe { + $($path_to_types)*:: + _export_method_outgoing_request_set_method_cabi::<<$ty as + $($path_to_types)*:: Guest >::OutgoingRequest > (arg0, arg1, + arg2, arg3) } } #[unsafe (export_name = + "wasi:http/types@0.2.0#[method]outgoing-request.path-with-query")] + unsafe extern "C" fn + export_method_outgoing_request_path_with_query(arg0 : * mut u8,) + -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_outgoing_request_path_with_query_cabi::<<$ty as + $($path_to_types)*:: Guest >::OutgoingRequest > (arg0) } } + #[unsafe (export_name = + "cabi_post_wasi:http/types@0.2.0#[method]outgoing-request.path-with-query")] + unsafe extern "C" fn + _post_return_method_outgoing_request_path_with_query(arg0 : * mut + u8,) { unsafe { $($path_to_types)*:: + __post_return_method_outgoing_request_path_with_query::<<$ty as + $($path_to_types)*:: Guest >::OutgoingRequest > (arg0) } } + #[unsafe (export_name = + "wasi:http/types@0.2.0#[method]outgoing-request.set-path-with-query")] + unsafe extern "C" fn + export_method_outgoing_request_set_path_with_query(arg0 : * mut + u8, arg1 : i32, arg2 : * mut u8, arg3 : usize,) -> i32 { unsafe { + $($path_to_types)*:: + _export_method_outgoing_request_set_path_with_query_cabi::<<$ty + as $($path_to_types)*:: Guest >::OutgoingRequest > (arg0, arg1, + arg2, arg3) } } #[unsafe (export_name = + "wasi:http/types@0.2.0#[method]outgoing-request.scheme")] unsafe + extern "C" fn export_method_outgoing_request_scheme(arg0 : * mut + u8,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_outgoing_request_scheme_cabi::<<$ty as + $($path_to_types)*:: Guest >::OutgoingRequest > (arg0) } } + #[unsafe (export_name = + "cabi_post_wasi:http/types@0.2.0#[method]outgoing-request.scheme")] + unsafe extern "C" fn + _post_return_method_outgoing_request_scheme(arg0 : * mut u8,) { + unsafe { $($path_to_types)*:: + __post_return_method_outgoing_request_scheme::<<$ty as + $($path_to_types)*:: Guest >::OutgoingRequest > (arg0) } } + #[unsafe (export_name = + "wasi:http/types@0.2.0#[method]outgoing-request.set-scheme")] + unsafe extern "C" fn + export_method_outgoing_request_set_scheme(arg0 : * mut u8, arg1 : + i32, arg2 : i32, arg3 : * mut u8, arg4 : usize,) -> i32 { unsafe + { $($path_to_types)*:: + _export_method_outgoing_request_set_scheme_cabi::<<$ty as + $($path_to_types)*:: Guest >::OutgoingRequest > (arg0, arg1, + arg2, arg3, arg4) } } #[unsafe (export_name = + "wasi:http/types@0.2.0#[method]outgoing-request.authority")] + unsafe extern "C" fn + export_method_outgoing_request_authority(arg0 : * mut u8,) -> * + mut u8 { unsafe { $($path_to_types)*:: + _export_method_outgoing_request_authority_cabi::<<$ty as + $($path_to_types)*:: Guest >::OutgoingRequest > (arg0) } } + #[unsafe (export_name = + "cabi_post_wasi:http/types@0.2.0#[method]outgoing-request.authority")] + unsafe extern "C" fn + _post_return_method_outgoing_request_authority(arg0 : * mut u8,) + { unsafe { $($path_to_types)*:: + __post_return_method_outgoing_request_authority::<<$ty as + $($path_to_types)*:: Guest >::OutgoingRequest > (arg0) } } + #[unsafe (export_name = + "wasi:http/types@0.2.0#[method]outgoing-request.set-authority")] + unsafe extern "C" fn + export_method_outgoing_request_set_authority(arg0 : * mut u8, + arg1 : i32, arg2 : * mut u8, arg3 : usize,) -> i32 { unsafe { + $($path_to_types)*:: + _export_method_outgoing_request_set_authority_cabi::<<$ty as + $($path_to_types)*:: Guest >::OutgoingRequest > (arg0, arg1, + arg2, arg3) } } #[unsafe (export_name = + "wasi:http/types@0.2.0#[method]outgoing-request.headers")] unsafe + extern "C" fn export_method_outgoing_request_headers(arg0 : * mut + u8,) -> i32 { unsafe { $($path_to_types)*:: + _export_method_outgoing_request_headers_cabi::<<$ty as + $($path_to_types)*:: Guest >::OutgoingRequest > (arg0) } } + #[unsafe (export_name = + "wasi:http/types@0.2.0#[constructor]request-options")] unsafe + extern "C" fn export_constructor_request_options() -> i32 { + unsafe { $($path_to_types)*:: + _export_constructor_request_options_cabi::<<$ty as + $($path_to_types)*:: Guest >::RequestOptions > () } } #[unsafe + (export_name = + "wasi:http/types@0.2.0#[method]request-options.connect-timeout")] + unsafe extern "C" fn + export_method_request_options_connect_timeout(arg0 : * mut u8,) + -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_request_options_connect_timeout_cabi::<<$ty as + $($path_to_types)*:: Guest >::RequestOptions > (arg0) } } + #[unsafe (export_name = + "wasi:http/types@0.2.0#[method]request-options.set-connect-timeout")] + unsafe extern "C" fn + export_method_request_options_set_connect_timeout(arg0 : * mut + u8, arg1 : i32, arg2 : i64,) -> i32 { unsafe { + $($path_to_types)*:: + _export_method_request_options_set_connect_timeout_cabi::<<$ty as + $($path_to_types)*:: Guest >::RequestOptions > (arg0, arg1, arg2) + } } #[unsafe (export_name = + "wasi:http/types@0.2.0#[method]request-options.first-byte-timeout")] + unsafe extern "C" fn + export_method_request_options_first_byte_timeout(arg0 : * mut + u8,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_request_options_first_byte_timeout_cabi::<<$ty as + $($path_to_types)*:: Guest >::RequestOptions > (arg0) } } + #[unsafe (export_name = + "wasi:http/types@0.2.0#[method]request-options.set-first-byte-timeout")] + unsafe extern "C" fn + export_method_request_options_set_first_byte_timeout(arg0 : * mut + u8, arg1 : i32, arg2 : i64,) -> i32 { unsafe { + $($path_to_types)*:: + _export_method_request_options_set_first_byte_timeout_cabi::<<$ty + as $($path_to_types)*:: Guest >::RequestOptions > (arg0, arg1, + arg2) } } #[unsafe (export_name = + "wasi:http/types@0.2.0#[method]request-options.between-bytes-timeout")] + unsafe extern "C" fn + export_method_request_options_between_bytes_timeout(arg0 : * mut + u8,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_request_options_between_bytes_timeout_cabi::<<$ty + as $($path_to_types)*:: Guest >::RequestOptions > (arg0) } } + #[unsafe (export_name = + "wasi:http/types@0.2.0#[method]request-options.set-between-bytes-timeout")] + unsafe extern "C" fn + export_method_request_options_set_between_bytes_timeout(arg0 : * + mut u8, arg1 : i32, arg2 : i64,) -> i32 { unsafe { + $($path_to_types)*:: + _export_method_request_options_set_between_bytes_timeout_cabi::<<$ty + as $($path_to_types)*:: Guest >::RequestOptions > (arg0, arg1, + arg2) } } #[unsafe (export_name = + "wasi:http/types@0.2.0#[static]response-outparam.set")] unsafe + extern "C" fn export_static_response_outparam_set(arg0 : i32, + arg1 : i32, arg2 : i32, arg3 : i32, arg4 : + ::core::mem::MaybeUninit::< u64 >, arg5 : * mut u8, arg6 : * mut + u8, arg7 : usize, arg8 : i32,) { unsafe { $($path_to_types)*:: + _export_static_response_outparam_set_cabi::<<$ty as + $($path_to_types)*:: Guest >::ResponseOutparam > (arg0, arg1, + arg2, arg3, arg4, arg5, arg6, arg7, arg8) } } #[unsafe + (export_name = + "wasi:http/types@0.2.0#[method]incoming-response.status")] unsafe + extern "C" fn export_method_incoming_response_status(arg0 : * mut + u8,) -> i32 { unsafe { $($path_to_types)*:: + _export_method_incoming_response_status_cabi::<<$ty as + $($path_to_types)*:: Guest >::IncomingResponse > (arg0) } } + #[unsafe (export_name = + "wasi:http/types@0.2.0#[method]incoming-response.headers")] + unsafe extern "C" fn export_method_incoming_response_headers(arg0 + : * mut u8,) -> i32 { unsafe { $($path_to_types)*:: + _export_method_incoming_response_headers_cabi::<<$ty as + $($path_to_types)*:: Guest >::IncomingResponse > (arg0) } } + #[unsafe (export_name = + "wasi:http/types@0.2.0#[method]incoming-response.consume")] + unsafe extern "C" fn export_method_incoming_response_consume(arg0 + : * mut u8,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_incoming_response_consume_cabi::<<$ty as + $($path_to_types)*:: Guest >::IncomingResponse > (arg0) } } + #[unsafe (export_name = + "wasi:http/types@0.2.0#[method]incoming-body.stream")] unsafe + extern "C" fn export_method_incoming_body_stream(arg0 : * mut + u8,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_incoming_body_stream_cabi::<<$ty as + $($path_to_types)*:: Guest >::IncomingBody > (arg0) } } #[unsafe + (export_name = + "wasi:http/types@0.2.0#[static]incoming-body.finish")] unsafe + extern "C" fn export_static_incoming_body_finish(arg0 : i32,) -> + i32 { unsafe { $($path_to_types)*:: + _export_static_incoming_body_finish_cabi::<<$ty as + $($path_to_types)*:: Guest >::IncomingBody > (arg0) } } #[unsafe + (export_name = + "wasi:http/types@0.2.0#[method]future-trailers.subscribe")] + unsafe extern "C" fn export_method_future_trailers_subscribe(arg0 + : * mut u8,) -> i32 { unsafe { $($path_to_types)*:: + _export_method_future_trailers_subscribe_cabi::<<$ty as + $($path_to_types)*:: Guest >::FutureTrailers > (arg0) } } + #[unsafe (export_name = + "wasi:http/types@0.2.0#[method]future-trailers.get")] unsafe + extern "C" fn export_method_future_trailers_get(arg0 : * mut u8,) + -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_future_trailers_get_cabi::<<$ty as + $($path_to_types)*:: Guest >::FutureTrailers > (arg0) } } + #[unsafe (export_name = + "cabi_post_wasi:http/types@0.2.0#[method]future-trailers.get")] + unsafe extern "C" fn _post_return_method_future_trailers_get(arg0 + : * mut u8,) { unsafe { $($path_to_types)*:: + __post_return_method_future_trailers_get::<<$ty as + $($path_to_types)*:: Guest >::FutureTrailers > (arg0) } } + #[unsafe (export_name = + "wasi:http/types@0.2.0#[constructor]outgoing-response")] unsafe + extern "C" fn export_constructor_outgoing_response(arg0 : i32,) + -> i32 { unsafe { $($path_to_types)*:: + _export_constructor_outgoing_response_cabi::<<$ty as + $($path_to_types)*:: Guest >::OutgoingResponse > (arg0) } } + #[unsafe (export_name = + "wasi:http/types@0.2.0#[method]outgoing-response.status-code")] + unsafe extern "C" fn + export_method_outgoing_response_status_code(arg0 : * mut u8,) -> + i32 { unsafe { $($path_to_types)*:: + _export_method_outgoing_response_status_code_cabi::<<$ty as + $($path_to_types)*:: Guest >::OutgoingResponse > (arg0) } } + #[unsafe (export_name = + "wasi:http/types@0.2.0#[method]outgoing-response.set-status-code")] + unsafe extern "C" fn + export_method_outgoing_response_set_status_code(arg0 : * mut u8, + arg1 : i32,) -> i32 { unsafe { $($path_to_types)*:: + _export_method_outgoing_response_set_status_code_cabi::<<$ty as + $($path_to_types)*:: Guest >::OutgoingResponse > (arg0, arg1) } } + #[unsafe (export_name = + "wasi:http/types@0.2.0#[method]outgoing-response.headers")] + unsafe extern "C" fn export_method_outgoing_response_headers(arg0 + : * mut u8,) -> i32 { unsafe { $($path_to_types)*:: + _export_method_outgoing_response_headers_cabi::<<$ty as + $($path_to_types)*:: Guest >::OutgoingResponse > (arg0) } } + #[unsafe (export_name = + "wasi:http/types@0.2.0#[method]outgoing-response.body")] unsafe + extern "C" fn export_method_outgoing_response_body(arg0 : * mut + u8,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_outgoing_response_body_cabi::<<$ty as + $($path_to_types)*:: Guest >::OutgoingResponse > (arg0) } } + #[unsafe (export_name = + "wasi:http/types@0.2.0#[method]outgoing-body.write")] unsafe + extern "C" fn export_method_outgoing_body_write(arg0 : * mut u8,) + -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_outgoing_body_write_cabi::<<$ty as + $($path_to_types)*:: Guest >::OutgoingBody > (arg0) } } #[unsafe + (export_name = + "wasi:http/types@0.2.0#[static]outgoing-body.finish")] unsafe + extern "C" fn export_static_outgoing_body_finish(arg0 : i32, arg1 + : i32, arg2 : i32,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_static_outgoing_body_finish_cabi::<<$ty as + $($path_to_types)*:: Guest >::OutgoingBody > (arg0, arg1, arg2) } + } #[unsafe (export_name = + "cabi_post_wasi:http/types@0.2.0#[static]outgoing-body.finish")] + unsafe extern "C" fn + _post_return_static_outgoing_body_finish(arg0 : * mut u8,) { + unsafe { $($path_to_types)*:: + __post_return_static_outgoing_body_finish::<<$ty as + $($path_to_types)*:: Guest >::OutgoingBody > (arg0) } } #[unsafe + (export_name = + "wasi:http/types@0.2.0#[method]future-incoming-response.subscribe")] + unsafe extern "C" fn + export_method_future_incoming_response_subscribe(arg0 : * mut + u8,) -> i32 { unsafe { $($path_to_types)*:: + _export_method_future_incoming_response_subscribe_cabi::<<$ty as + $($path_to_types)*:: Guest >::FutureIncomingResponse > (arg0) } } + #[unsafe (export_name = + "wasi:http/types@0.2.0#[method]future-incoming-response.get")] + unsafe extern "C" fn + export_method_future_incoming_response_get(arg0 : * mut u8,) -> * + mut u8 { unsafe { $($path_to_types)*:: + _export_method_future_incoming_response_get_cabi::<<$ty as + $($path_to_types)*:: Guest >::FutureIncomingResponse > (arg0) } } + #[unsafe (export_name = + "cabi_post_wasi:http/types@0.2.0#[method]future-incoming-response.get")] + unsafe extern "C" fn + _post_return_method_future_incoming_response_get(arg0 : * mut + u8,) { unsafe { $($path_to_types)*:: + __post_return_method_future_incoming_response_get::<<$ty as + $($path_to_types)*:: Guest >::FutureIncomingResponse > (arg0) } } + const _ : () = { #[doc(hidden)] #[unsafe (export_name = + "wasi:http/types@0.2.0#[dtor]fields")] #[allow(non_snake_case)] + unsafe extern "C" fn dtor(rep : * mut u8) { unsafe { + $($path_to_types)*:: Fields::dtor::< <$ty as $($path_to_types)*:: + Guest >::Fields > (rep) } } }; const _ : () = { #[doc(hidden)] + #[unsafe (export_name = + "wasi:http/types@0.2.0#[dtor]incoming-request")] + #[allow(non_snake_case)] unsafe extern "C" fn dtor(rep : * mut + u8) { unsafe { $($path_to_types)*:: IncomingRequest::dtor::< <$ty + as $($path_to_types)*:: Guest >::IncomingRequest > (rep) } } }; + const _ : () = { #[doc(hidden)] #[unsafe (export_name = + "wasi:http/types@0.2.0#[dtor]outgoing-request")] + #[allow(non_snake_case)] unsafe extern "C" fn dtor(rep : * mut + u8) { unsafe { $($path_to_types)*:: OutgoingRequest::dtor::< <$ty + as $($path_to_types)*:: Guest >::OutgoingRequest > (rep) } } }; + const _ : () = { #[doc(hidden)] #[unsafe (export_name = + "wasi:http/types@0.2.0#[dtor]request-options")] + #[allow(non_snake_case)] unsafe extern "C" fn dtor(rep : * mut + u8) { unsafe { $($path_to_types)*:: RequestOptions::dtor::< <$ty + as $($path_to_types)*:: Guest >::RequestOptions > (rep) } } }; + const _ : () = { #[doc(hidden)] #[unsafe (export_name = + "wasi:http/types@0.2.0#[dtor]response-outparam")] + #[allow(non_snake_case)] unsafe extern "C" fn dtor(rep : * mut + u8) { unsafe { $($path_to_types)*:: ResponseOutparam::dtor::< + <$ty as $($path_to_types)*:: Guest >::ResponseOutparam > (rep) } + } }; const _ : () = { #[doc(hidden)] #[unsafe (export_name = + "wasi:http/types@0.2.0#[dtor]incoming-response")] + #[allow(non_snake_case)] unsafe extern "C" fn dtor(rep : * mut + u8) { unsafe { $($path_to_types)*:: IncomingResponse::dtor::< + <$ty as $($path_to_types)*:: Guest >::IncomingResponse > (rep) } + } }; const _ : () = { #[doc(hidden)] #[unsafe (export_name = + "wasi:http/types@0.2.0#[dtor]incoming-body")] + #[allow(non_snake_case)] unsafe extern "C" fn dtor(rep : * mut + u8) { unsafe { $($path_to_types)*:: IncomingBody::dtor::< <$ty as + $($path_to_types)*:: Guest >::IncomingBody > (rep) } } }; const _ + : () = { #[doc(hidden)] #[unsafe (export_name = + "wasi:http/types@0.2.0#[dtor]future-trailers")] + #[allow(non_snake_case)] unsafe extern "C" fn dtor(rep : * mut + u8) { unsafe { $($path_to_types)*:: FutureTrailers::dtor::< <$ty + as $($path_to_types)*:: Guest >::FutureTrailers > (rep) } } }; + const _ : () = { #[doc(hidden)] #[unsafe (export_name = + "wasi:http/types@0.2.0#[dtor]outgoing-response")] + #[allow(non_snake_case)] unsafe extern "C" fn dtor(rep : * mut + u8) { unsafe { $($path_to_types)*:: OutgoingResponse::dtor::< + <$ty as $($path_to_types)*:: Guest >::OutgoingResponse > (rep) } + } }; const _ : () = { #[doc(hidden)] #[unsafe (export_name = + "wasi:http/types@0.2.0#[dtor]outgoing-body")] + #[allow(non_snake_case)] unsafe extern "C" fn dtor(rep : * mut + u8) { unsafe { $($path_to_types)*:: OutgoingBody::dtor::< <$ty as + $($path_to_types)*:: Guest >::OutgoingBody > (rep) } } }; const _ + : () = { #[doc(hidden)] #[unsafe (export_name = + "wasi:http/types@0.2.0#[dtor]future-incoming-response")] + #[allow(non_snake_case)] unsafe extern "C" fn dtor(rep : * mut + u8) { unsafe { $($path_to_types)*:: + FutureIncomingResponse::dtor::< <$ty as $($path_to_types)*:: + Guest >::FutureIncomingResponse > (rep) } } }; }; + }; + } #[doc(hidden)] pub(crate) use __export_wasi_http_types_0_2_0_cabi; #[repr(align(8))] - struct _RetArea([::core::mem::MaybeUninit; 56]); - static mut _RET_AREA: _RetArea = _RetArea([::core::mem::MaybeUninit::uninit(); 56]); + struct _RetArea( + [::core::mem::MaybeUninit< + u8, + >; 40 + 4 * ::core::mem::size_of::<*const u8>()], + ); + static mut _RET_AREA: _RetArea = _RetArea( + [::core::mem::MaybeUninit::uninit(); 40 + + 4 * ::core::mem::size_of::<*const u8>()], + ); } - - #[allow(dead_code, clippy::all)] + /// This interface defines a handler of outgoing HTTP Requests. It should be + /// imported by components which wish to make HTTP Requests. + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod outgoing_handler { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; - pub type OutgoingRequest = - super::super::super::super::exports::wasi::http::types::OutgoingRequest; - pub type OutgoingRequestBorrow<'a> = - super::super::super::super::exports::wasi::http::types::OutgoingRequestBorrow< - 'a, - >; - pub type RequestOptions = - super::super::super::super::exports::wasi::http::types::RequestOptions; - pub type RequestOptionsBorrow<'a> = - super::super::super::super::exports::wasi::http::types::RequestOptionsBorrow< - 'a, - >; - pub type FutureIncomingResponse = - super::super::super::super::exports::wasi::http::types::FutureIncomingResponse; - pub type FutureIncomingResponseBorrow<'a> = super::super::super::super::exports::wasi::http::types::FutureIncomingResponseBorrow<'a>; - pub type ErrorCode = - super::super::super::super::exports::wasi::http::types::ErrorCode; + pub type OutgoingRequest = super::super::super::super::exports::wasi::http::types::OutgoingRequest; + pub type OutgoingRequestBorrow<'a> = super::super::super::super::exports::wasi::http::types::OutgoingRequestBorrow< + 'a, + >; + pub type RequestOptions = super::super::super::super::exports::wasi::http::types::RequestOptions; + pub type RequestOptionsBorrow<'a> = super::super::super::super::exports::wasi::http::types::RequestOptionsBorrow< + 'a, + >; + pub type FutureIncomingResponse = super::super::super::super::exports::wasi::http::types::FutureIncomingResponse; + pub type FutureIncomingResponseBorrow<'a> = super::super::super::super::exports::wasi::http::types::FutureIncomingResponseBorrow< + 'a, + >; + pub type ErrorCode = super::super::super::super::exports::wasi::http::types::ErrorCode; #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_handle_cabi( @@ -27453,17 +29786,27 @@ pub mod exports { arg1: i32, arg2: i32, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = T::handle(super::super::super::super::exports::wasi::http::types::OutgoingRequest::from_handle(arg0 as u32), match arg1 { - 0 => None, - 1 => { - let e = super::super::super::super::exports::wasi::http::types::RequestOptions::from_handle(arg2 as u32); - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::handle( + unsafe { + super::super::super::super::exports::wasi::http::types::OutgoingRequest::from_handle( + arg0 as u32, + ) + }, + match arg1 { + 0 => None, + 1 => { + let e = unsafe { + super::super::super::super::exports::wasi::http::types::RequestOptions::from_handle( + arg2 as u32, + ) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -27478,7 +29821,10 @@ pub mod exports { } V17::DnsError(e) => { *ptr1.add(8).cast::() = (1i32) as u8; - let super::super::super::super::exports::wasi::http::types::DnsErrorPayload{ rcode:rcode2, info_code:info_code2, } = e; + let super::super::super::super::exports::wasi::http::types::DnsErrorPayload { + rcode: rcode2, + info_code: info_code2, + } = e; match rcode2 { Some(e) => { *ptr1.add(16).cast::() = (1i32) as u8; @@ -27486,8 +29832,12 @@ pub mod exports { let ptr3 = vec3.as_ptr().cast::(); let len3 = vec3.len(); ::core::mem::forget(vec3); - *ptr1.add(24).cast::() = len3; - *ptr1.add(20).cast::<*mut u8>() = ptr3.cast_mut(); + *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len3; + *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr3.cast_mut(); } None => { *ptr1.add(16).cast::() = (0i32) as u8; @@ -27495,11 +29845,17 @@ pub mod exports { }; match info_code2 { Some(e) => { - *ptr1.add(28).cast::() = (1i32) as u8; - *ptr1.add(30).cast::() = (_rt::as_i32(e)) as u16; + *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; + *ptr1 + .add(18 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (_rt::as_i32(e)) as u16; } None => { - *ptr1.add(28).cast::() = (0i32) as u8; + *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } }; } @@ -27541,7 +29897,10 @@ pub mod exports { } V17::TlsAlertReceived(e) => { *ptr1.add(8).cast::() = (14i32) as u8; - let super::super::super::super::exports::wasi::http::types::TlsAlertReceivedPayload{ alert_id:alert_id4, alert_message:alert_message4, } = e; + let super::super::super::super::exports::wasi::http::types::TlsAlertReceivedPayload { + alert_id: alert_id4, + alert_message: alert_message4, + } = e; match alert_id4 { Some(e) => { *ptr1.add(16).cast::() = (1i32) as u8; @@ -27553,16 +29912,24 @@ pub mod exports { }; match alert_message4 { Some(e) => { - *ptr1.add(20).cast::() = (1i32) as u8; + *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; let vec5 = (e.into_bytes()).into_boxed_slice(); let ptr5 = vec5.as_ptr().cast::(); let len5 = vec5.len(); ::core::mem::forget(vec5); - *ptr1.add(28).cast::() = len5; - *ptr1.add(24).cast::<*mut u8>() = ptr5.cast_mut(); + *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len5; + *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr5.cast_mut(); } None => { - *ptr1.add(20).cast::() = (0i32) as u8; + *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } }; } @@ -27610,29 +29977,45 @@ pub mod exports { match e { Some(e) => { *ptr1.add(16).cast::() = (1i32) as u8; - let super::super::super::super::exports::wasi::http::types::FieldSizePayload{ field_name:field_name6, field_size:field_size6, } = e; + let super::super::super::super::exports::wasi::http::types::FieldSizePayload { + field_name: field_name6, + field_size: field_size6, + } = e; match field_name6 { Some(e) => { - *ptr1.add(20).cast::() = (1i32) as u8; + *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; let vec7 = (e.into_bytes()).into_boxed_slice(); let ptr7 = vec7.as_ptr().cast::(); let len7 = vec7.len(); ::core::mem::forget(vec7); - *ptr1.add(28).cast::() = len7; - *ptr1.add(24).cast::<*mut u8>() = - ptr7.cast_mut(); + *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = len7; + *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr7.cast_mut(); } None => { - *ptr1.add(20).cast::() = (0i32) as u8; + *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } }; match field_size6 { Some(e) => { - *ptr1.add(32).cast::() = (1i32) as u8; - *ptr1.add(36).cast::() = _rt::as_i32(e); + *ptr1 + .add(16 + 4 * ::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; + *ptr1 + .add(20 + 4 * ::core::mem::size_of::<*const u8>()) + .cast::() = _rt::as_i32(e); } None => { - *ptr1.add(32).cast::() = (0i32) as u8; + *ptr1 + .add(16 + 4 * ::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } }; } @@ -27655,7 +30038,10 @@ pub mod exports { } V17::HttpRequestTrailerSize(e) => { *ptr1.add(8).cast::() = (24i32) as u8; - let super::super::super::super::exports::wasi::http::types::FieldSizePayload{ field_name:field_name8, field_size:field_size8, } = e; + let super::super::super::super::exports::wasi::http::types::FieldSizePayload { + field_name: field_name8, + field_size: field_size8, + } = e; match field_name8 { Some(e) => { *ptr1.add(16).cast::() = (1i32) as u8; @@ -27663,8 +30049,12 @@ pub mod exports { let ptr9 = vec9.as_ptr().cast::(); let len9 = vec9.len(); ::core::mem::forget(vec9); - *ptr1.add(24).cast::() = len9; - *ptr1.add(20).cast::<*mut u8>() = ptr9.cast_mut(); + *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len9; + *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr9.cast_mut(); } None => { *ptr1.add(16).cast::() = (0i32) as u8; @@ -27672,11 +30062,17 @@ pub mod exports { }; match field_size8 { Some(e) => { - *ptr1.add(28).cast::() = (1i32) as u8; - *ptr1.add(32).cast::() = _rt::as_i32(e); + *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; + *ptr1 + .add(20 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = _rt::as_i32(e); } None => { - *ptr1.add(28).cast::() = (0i32) as u8; + *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } }; } @@ -27697,7 +30093,10 @@ pub mod exports { } V17::HttpResponseHeaderSize(e) => { *ptr1.add(8).cast::() = (27i32) as u8; - let super::super::super::super::exports::wasi::http::types::FieldSizePayload{ field_name:field_name10, field_size:field_size10, } = e; + let super::super::super::super::exports::wasi::http::types::FieldSizePayload { + field_name: field_name10, + field_size: field_size10, + } = e; match field_name10 { Some(e) => { *ptr1.add(16).cast::() = (1i32) as u8; @@ -27705,8 +30104,12 @@ pub mod exports { let ptr11 = vec11.as_ptr().cast::(); let len11 = vec11.len(); ::core::mem::forget(vec11); - *ptr1.add(24).cast::() = len11; - *ptr1.add(20).cast::<*mut u8>() = ptr11.cast_mut(); + *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len11; + *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr11.cast_mut(); } None => { *ptr1.add(16).cast::() = (0i32) as u8; @@ -27714,11 +30117,17 @@ pub mod exports { }; match field_size10 { Some(e) => { - *ptr1.add(28).cast::() = (1i32) as u8; - *ptr1.add(32).cast::() = _rt::as_i32(e); + *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; + *ptr1 + .add(20 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = _rt::as_i32(e); } None => { - *ptr1.add(28).cast::() = (0i32) as u8; + *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } }; } @@ -27748,7 +30157,10 @@ pub mod exports { } V17::HttpResponseTrailerSize(e) => { *ptr1.add(8).cast::() = (30i32) as u8; - let super::super::super::super::exports::wasi::http::types::FieldSizePayload{ field_name:field_name12, field_size:field_size12, } = e; + let super::super::super::super::exports::wasi::http::types::FieldSizePayload { + field_name: field_name12, + field_size: field_size12, + } = e; match field_name12 { Some(e) => { *ptr1.add(16).cast::() = (1i32) as u8; @@ -27756,8 +30168,12 @@ pub mod exports { let ptr13 = vec13.as_ptr().cast::(); let len13 = vec13.len(); ::core::mem::forget(vec13); - *ptr1.add(24).cast::() = len13; - *ptr1.add(20).cast::<*mut u8>() = ptr13.cast_mut(); + *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len13; + *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr13.cast_mut(); } None => { *ptr1.add(16).cast::() = (0i32) as u8; @@ -27765,11 +30181,17 @@ pub mod exports { }; match field_size12 { Some(e) => { - *ptr1.add(28).cast::() = (1i32) as u8; - *ptr1.add(32).cast::() = _rt::as_i32(e); + *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; + *ptr1 + .add(20 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = _rt::as_i32(e); } None => { - *ptr1.add(28).cast::() = (0i32) as u8; + *ptr1 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; } }; } @@ -27782,8 +30204,12 @@ pub mod exports { let ptr14 = vec14.as_ptr().cast::(); let len14 = vec14.len(); ::core::mem::forget(vec14); - *ptr1.add(24).cast::() = len14; - *ptr1.add(20).cast::<*mut u8>() = ptr14.cast_mut(); + *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len14; + *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr14.cast_mut(); } None => { *ptr1.add(16).cast::() = (0i32) as u8; @@ -27799,8 +30225,12 @@ pub mod exports { let ptr15 = vec15.as_ptr().cast::(); let len15 = vec15.len(); ::core::mem::forget(vec15); - *ptr1.add(24).cast::() = len15; - *ptr1.add(20).cast::<*mut u8>() = ptr15.cast_mut(); + *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len15; + *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr15.cast_mut(); } None => { *ptr1.add(16).cast::() = (0i32) as u8; @@ -27831,8 +30261,12 @@ pub mod exports { let ptr16 = vec16.as_ptr().cast::(); let len16 = vec16.len(); ::core::mem::forget(vec16); - *ptr1.add(24).cast::() = len16; - *ptr1.add(20).cast::<*mut u8>() = ptr16.cast_mut(); + *ptr1 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len16; + *ptr1 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr16.cast_mut(); } None => { *ptr1.add(16).cast::() = (0i32) as u8; @@ -27849,103 +30283,135 @@ pub mod exports { pub unsafe fn __post_return_handle(arg0: *mut u8) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { - 0 => (), + 0 => {} _ => { let l1 = i32::from(*arg0.add(8).cast::()); match l1 { - 0 => (), + 0 => {} 1 => { let l2 = i32::from(*arg0.add(16).cast::()); match l2 { - 0 => (), + 0 => {} _ => { - let l3 = *arg0.add(20).cast::<*mut u8>(); - let l4 = *arg0.add(24).cast::(); + let l3 = *arg0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l4 = *arg0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l3, l4, 1); } } } - 2 => (), - 3 => (), - 4 => (), - 5 => (), - 6 => (), - 7 => (), - 8 => (), - 9 => (), - 10 => (), - 11 => (), - 12 => (), - 13 => (), + 2 => {} + 3 => {} + 4 => {} + 5 => {} + 6 => {} + 7 => {} + 8 => {} + 9 => {} + 10 => {} + 11 => {} + 12 => {} + 13 => {} 14 => { - let l5 = i32::from(*arg0.add(20).cast::()); + let l5 = i32::from( + *arg0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); match l5 { - 0 => (), + 0 => {} _ => { - let l6 = *arg0.add(24).cast::<*mut u8>(); - let l7 = *arg0.add(28).cast::(); + let l6 = *arg0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l7 = *arg0 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l6, l7, 1); } } } - 15 => (), - 16 => (), - 17 => (), - 18 => (), - 19 => (), - 20 => (), - 21 => (), + 15 => {} + 16 => {} + 17 => {} + 18 => {} + 19 => {} + 20 => {} + 21 => {} 22 => { let l8 = i32::from(*arg0.add(16).cast::()); match l8 { - 0 => (), + 0 => {} _ => { - let l9 = i32::from(*arg0.add(20).cast::()); + let l9 = i32::from( + *arg0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); match l9 { - 0 => (), + 0 => {} _ => { - let l10 = *arg0.add(24).cast::<*mut u8>(); - let l11 = *arg0.add(28).cast::(); + let l10 = *arg0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l11 = *arg0 + .add(16 + 3 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l10, l11, 1); } } } } } - 23 => (), + 23 => {} 24 => { let l12 = i32::from(*arg0.add(16).cast::()); match l12 { - 0 => (), + 0 => {} _ => { - let l13 = *arg0.add(20).cast::<*mut u8>(); - let l14 = *arg0.add(24).cast::(); + let l13 = *arg0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l14 = *arg0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l13, l14, 1); } } } - 25 => (), - 26 => (), + 25 => {} + 26 => {} 27 => { let l15 = i32::from(*arg0.add(16).cast::()); match l15 { - 0 => (), + 0 => {} _ => { - let l16 = *arg0.add(20).cast::<*mut u8>(); - let l17 = *arg0.add(24).cast::(); + let l16 = *arg0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l17 = *arg0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l16, l17, 1); } } } - 28 => (), - 29 => (), + 28 => {} + 29 => {} 30 => { let l18 = i32::from(*arg0.add(16).cast::()); match l18 { - 0 => (), + 0 => {} _ => { - let l19 = *arg0.add(20).cast::<*mut u8>(); - let l20 = *arg0.add(24).cast::(); + let l19 = *arg0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l20 = *arg0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l19, l20, 1); } } @@ -27953,10 +30419,14 @@ pub mod exports { 31 => { let l21 = i32::from(*arg0.add(16).cast::()); match l21 { - 0 => (), + 0 => {} _ => { - let l22 = *arg0.add(20).cast::<*mut u8>(); - let l23 = *arg0.add(24).cast::(); + let l22 = *arg0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l23 = *arg0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l22, l23, 1); } } @@ -27964,26 +30434,34 @@ pub mod exports { 32 => { let l24 = i32::from(*arg0.add(16).cast::()); match l24 { - 0 => (), + 0 => {} _ => { - let l25 = *arg0.add(20).cast::<*mut u8>(); - let l26 = *arg0.add(24).cast::(); + let l25 = *arg0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l26 = *arg0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l25, l26, 1); } } } - 33 => (), - 34 => (), - 35 => (), - 36 => (), - 37 => (), + 33 => {} + 34 => {} + 35 => {} + 36 => {} + 37 => {} _ => { let l27 = i32::from(*arg0.add(16).cast::()); match l27 { - 0 => (), + 0 => {} _ => { - let l28 = *arg0.add(20).cast::<*mut u8>(); - let l29 = *arg0.add(24).cast::(); + let l28 = *arg0 + .add(16 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l29 = *arg0 + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l28, l29, 1); } } @@ -28009,47 +30487,48 @@ pub mod exports { ) -> Result; } #[doc(hidden)] - - macro_rules! __export_wasi_http_outgoing_handler_0_2_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "wasi:http/outgoing-handler@0.2.0#handle"] - unsafe extern "C" fn export_handle(arg0: i32,arg1: i32,arg2: i32,) -> *mut u8 { - $($path_to_types)*::_export_handle_cabi::<$ty>(arg0, arg1, arg2) - } - #[export_name = "cabi_post_wasi:http/outgoing-handler@0.2.0#handle"] - unsafe extern "C" fn _post_return_handle(arg0: *mut u8,) { - $($path_to_types)*::__post_return_handle::<$ty>(arg0) - } - };); - } + macro_rules! __export_wasi_http_outgoing_handler_0_2_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "wasi:http/outgoing-handler@0.2.0#handle")] unsafe extern "C" fn + export_handle(arg0 : i32, arg1 : i32, arg2 : i32,) -> * mut u8 { + unsafe { $($path_to_types)*:: _export_handle_cabi::<$ty > (arg0, + arg1, arg2) } } #[unsafe (export_name = + "cabi_post_wasi:http/outgoing-handler@0.2.0#handle")] unsafe + extern "C" fn _post_return_handle(arg0 : * mut u8,) { unsafe { + $($path_to_types)*:: __post_return_handle::<$ty > (arg0) } } }; + }; + } #[doc(hidden)] pub(crate) use __export_wasi_http_outgoing_handler_0_2_0_cabi; #[repr(align(8))] - struct _RetArea([::core::mem::MaybeUninit; 40]); - static mut _RET_AREA: _RetArea = _RetArea([::core::mem::MaybeUninit::uninit(); 40]); + struct _RetArea( + [::core::mem::MaybeUninit< + u8, + >; 24 + 4 * ::core::mem::size_of::<*const u8>()], + ); + static mut _RET_AREA: _RetArea = _RetArea( + [::core::mem::MaybeUninit::uninit(); 24 + + 4 * ::core::mem::size_of::<*const u8>()], + ); } } - #[allow(dead_code)] pub mod io { - #[allow(dead_code, clippy::all)] + /// A poll API intended to let users wait for I/O events on multiple handles + /// at once. + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod poll { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; /// `pollable` represents a single I/O event which may be ready, or not. - #[derive(Debug)] #[repr(transparent)] pub struct Pollable { handle: _rt::Resource, } - type _PollableRep = Option; - impl Pollable { /// Creates a new resource from the specified representation. /// @@ -28059,77 +30538,70 @@ pub mod exports { pub fn new(val: T) -> Self { Self::type_guard::(); let val: _PollableRep = Some(val); - let ptr: *mut _PollableRep = _rt::Box::into_raw(_rt::Box::new(val)); + let ptr: *mut _PollableRep = _rt::Box::into_raw( + _rt::Box::new(val), + ); unsafe { Self::from_handle(T::_resource_new(ptr.cast())) } } - /// Gets access to the underlying `T` which represents this resource. pub fn get(&self) -> &T { let ptr = unsafe { &*self.as_ptr::() }; ptr.as_ref().unwrap() } - /// Gets mutable access to the underlying `T` which represents this /// resource. pub fn get_mut(&mut self) -> &mut T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_mut().unwrap() } - /// Consumes this resource and returns the underlying `T`. pub fn into_inner(self) -> T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.take().unwrap() } - #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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) } - - // It's theoretically possible to implement the `GuestPollable` trait twice - // so guard against using it with two different types here. #[doc(hidden)] fn type_guard() { use core::any::TypeId; static mut LAST_TYPE: Option = None; unsafe { - assert!(!cfg!(target_feature = "threads")); + assert!(! cfg!(target_feature = "atomics")); let id = TypeId::of::(); match LAST_TYPE { - Some(ty) => assert!( - ty == id, - "cannot use two types with this resource type" - ), + Some(ty) => { + assert!( + ty == id, "cannot use two types with this resource type" + ) + } None => LAST_TYPE = Some(id), } } } - #[doc(hidden)] pub unsafe fn dtor(handle: *mut u8) { Self::type_guard::(); - let _ = _rt::Box::from_raw(handle as *mut _PollableRep); + let _ = unsafe { + _rt::Box::from_raw(handle as *mut _PollableRep) + }; } - fn as_ptr(&self) -> *mut _PollableRep { Pollable::type_guard::(); T::_resource_rep(self.handle()).cast() } } - /// A borrowed version of [`Pollable`] which represents a borrowed value /// with the lifetime `'a`. #[derive(Debug)] @@ -28138,7 +30610,6 @@ pub mod exports { rep: *mut u8, _marker: core::marker::PhantomData<&'a Pollable>, } - impl<'a> PollableBorrow<'a> { #[doc(hidden)] pub unsafe fn lift(rep: usize) -> Self { @@ -28147,49 +30618,41 @@ pub mod exports { _marker: core::marker::PhantomData, } } - /// Gets access to the underlying `T` in this resource. pub fn get(&self) -> &T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_ref().unwrap() } - - // NB: mutable access is not allowed due to the component model allowing - // multiple borrows of the same resource. - fn as_ptr(&self) -> *mut _PollableRep { Pollable::type_guard::(); self.rep.cast() } } - 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 = "[export]wasi:io/poll@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]pollable"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_method_pollable_ready_cabi( arg0: *mut u8, ) -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = T::ready(PollableBorrow::lift(arg0 as u32 as usize).get()); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::ready( + unsafe { PollableBorrow::lift(arg0 as u32 as usize) }.get(), + ); match result0 { true => 1, false => 0, @@ -28197,16 +30660,21 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_pollable_block_cabi(arg0: *mut u8) { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - T::block(PollableBorrow::lift(arg0 as u32 as usize).get()); + pub unsafe fn _export_method_pollable_block_cabi( + arg0: *mut u8, + ) { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + T::block( + unsafe { PollableBorrow::lift(arg0 as u32 as usize) }.get(), + ); } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_poll_cabi(arg0: *mut u8, arg1: usize) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + pub unsafe fn _export_poll_cabi( + arg0: *mut u8, + arg1: usize, + ) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let base1 = arg0; let len1 = arg1; let mut result1 = _rt::Vec::with_capacity(len1); @@ -28214,19 +30682,18 @@ pub mod exports { let base = base1.add(i * 4); let e1 = { let l0 = *base.add(0).cast::(); - - PollableBorrow::lift(l0 as u32 as usize) + unsafe { PollableBorrow::lift(l0 as u32 as usize) } }; result1.push(e1); } _rt::cabi_dealloc(base1, len1 * 4, 4); let result2 = T::poll(result1); - let ptr3 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr3 = (&raw mut _RET_AREA.0).cast::(); let vec4 = (result2).into_boxed_slice(); let ptr4 = vec4.as_ptr().cast::(); let len4 = vec4.len(); ::core::mem::forget(vec4); - *ptr3.add(4).cast::() = len4; + *ptr3.add(::core::mem::size_of::<*const u8>()).cast::() = len4; *ptr3.add(0).cast::<*mut u8>() = ptr4.cast_mut(); ptr3 } @@ -28234,7 +30701,9 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn __post_return_poll(arg0: *mut u8) { let l0 = *arg0.add(0).cast::<*mut u8>(); - let l1 = *arg0.add(4).cast::(); + let l1 = *arg0 + .add(::core::mem::size_of::<*const u8>()) + .cast::(); let base2 = l0; let len2 = l1; _rt::cabi_dealloc(base2, len2 * 4, 4); @@ -28272,18 +30741,16 @@ pub mod exports { let _ = val; unreachable!(); } - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:io/poll@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-new]pollable"] fn new(_: *mut u8) -> u32; } - new(val) + unsafe { new(val) } } } - #[doc(hidden)] fn _resource_rep(handle: u32) -> *mut u8 where @@ -28294,18 +30761,16 @@ pub mod exports { let _ = handle; unreachable!(); } - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:io/poll@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-rep]pollable"] fn rep(_: u32) -> *mut u8; } unsafe { rep(handle) } } } - /// Return the readiness of a pollable. This function never blocks. /// /// Returns `true` when the pollable is ready, and `false` otherwise. @@ -28315,57 +30780,53 @@ pub mod exports { /// /// This function is equivalent to calling `poll.poll` on a list /// containing only this pollable. - fn block(&self); + fn block(&self) -> (); } #[doc(hidden)] - - macro_rules! __export_wasi_io_poll_0_2_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "wasi:io/poll@0.2.0#[method]pollable.ready"] - unsafe extern "C" fn export_method_pollable_ready(arg0: *mut u8,) -> i32 { - $($path_to_types)*::_export_method_pollable_ready_cabi::<<$ty as $($path_to_types)*::Guest>::Pollable>(arg0) - } - #[export_name = "wasi:io/poll@0.2.0#[method]pollable.block"] - unsafe extern "C" fn export_method_pollable_block(arg0: *mut u8,) { - $($path_to_types)*::_export_method_pollable_block_cabi::<<$ty as $($path_to_types)*::Guest>::Pollable>(arg0) - } - #[export_name = "wasi:io/poll@0.2.0#poll"] - unsafe extern "C" fn export_poll(arg0: *mut u8,arg1: usize,) -> *mut u8 { - $($path_to_types)*::_export_poll_cabi::<$ty>(arg0, arg1) - } - #[export_name = "cabi_post_wasi:io/poll@0.2.0#poll"] - unsafe extern "C" fn _post_return_poll(arg0: *mut u8,) { - $($path_to_types)*::__post_return_poll::<$ty>(arg0) - } - - const _: () = { - #[doc(hidden)] - #[export_name = "wasi:io/poll@0.2.0#[dtor]pollable"] - #[allow(non_snake_case)] - unsafe extern "C" fn dtor(rep: *mut u8) { - $($path_to_types)*::Pollable::dtor::< - <$ty as $($path_to_types)*::Guest>::Pollable - >(rep) - } - }; - - };); - } + macro_rules! __export_wasi_io_poll_0_2_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "wasi:io/poll@0.2.0#[method]pollable.ready")] unsafe extern "C" + fn export_method_pollable_ready(arg0 : * mut u8,) -> i32 { unsafe + { $($path_to_types)*:: _export_method_pollable_ready_cabi::<<$ty + as $($path_to_types)*:: Guest >::Pollable > (arg0) } } #[unsafe + (export_name = "wasi:io/poll@0.2.0#[method]pollable.block")] + unsafe extern "C" fn export_method_pollable_block(arg0 : * mut + u8,) { unsafe { $($path_to_types)*:: + _export_method_pollable_block_cabi::<<$ty as $($path_to_types)*:: + Guest >::Pollable > (arg0) } } #[unsafe (export_name = + "wasi:io/poll@0.2.0#poll")] unsafe extern "C" fn export_poll(arg0 + : * mut u8, arg1 : usize,) -> * mut u8 { unsafe { + $($path_to_types)*:: _export_poll_cabi::<$ty > (arg0, arg1) } } + #[unsafe (export_name = "cabi_post_wasi:io/poll@0.2.0#poll")] + unsafe extern "C" fn _post_return_poll(arg0 : * mut u8,) { unsafe + { $($path_to_types)*:: __post_return_poll::<$ty > (arg0) } } + const _ : () = { #[doc(hidden)] #[unsafe (export_name = + "wasi:io/poll@0.2.0#[dtor]pollable")] #[allow(non_snake_case)] + unsafe extern "C" fn dtor(rep : * mut u8) { unsafe { + $($path_to_types)*:: Pollable::dtor::< <$ty as + $($path_to_types)*:: Guest >::Pollable > (rep) } } }; }; + }; + } #[doc(hidden)] pub(crate) use __export_wasi_io_poll_0_2_0_cabi; - #[repr(align(4))] - struct _RetArea([::core::mem::MaybeUninit; 8]); - static mut _RET_AREA: _RetArea = _RetArea([::core::mem::MaybeUninit::uninit(); 8]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct _RetArea( + [::core::mem::MaybeUninit< + u8, + >; 2 * ::core::mem::size_of::<*const u8>()], + ); + static mut _RET_AREA: _RetArea = _RetArea( + [::core::mem::MaybeUninit::uninit(); 2 + * ::core::mem::size_of::<*const u8>()], + ); } - - #[allow(dead_code, clippy::all)] + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod error { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; /// A resource which represents some error information. /// @@ -28386,15 +30847,12 @@ pub mod exports { /// /// The set of functions which can "downcast" an `error` into a more /// concrete type is open. - #[derive(Debug)] #[repr(transparent)] pub struct Error { handle: _rt::Resource, } - type _ErrorRep = Option; - impl Error { /// Creates a new resource from the specified representation. /// @@ -28404,77 +30862,70 @@ pub mod exports { pub fn new(val: T) -> Self { Self::type_guard::(); let val: _ErrorRep = Some(val); - let ptr: *mut _ErrorRep = _rt::Box::into_raw(_rt::Box::new(val)); + let ptr: *mut _ErrorRep = _rt::Box::into_raw( + _rt::Box::new(val), + ); unsafe { Self::from_handle(T::_resource_new(ptr.cast())) } } - /// Gets access to the underlying `T` which represents this resource. pub fn get(&self) -> &T { let ptr = unsafe { &*self.as_ptr::() }; ptr.as_ref().unwrap() } - /// Gets mutable access to the underlying `T` which represents this /// resource. pub fn get_mut(&mut self) -> &mut T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_mut().unwrap() } - /// Consumes this resource and returns the underlying `T`. pub fn into_inner(self) -> T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.take().unwrap() } - #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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) } - - // It's theoretically possible to implement the `GuestError` trait twice - // so guard against using it with two different types here. #[doc(hidden)] fn type_guard() { use core::any::TypeId; static mut LAST_TYPE: Option = None; unsafe { - assert!(!cfg!(target_feature = "threads")); + assert!(! cfg!(target_feature = "atomics")); let id = TypeId::of::(); match LAST_TYPE { - Some(ty) => assert!( - ty == id, - "cannot use two types with this resource type" - ), + Some(ty) => { + assert!( + ty == id, "cannot use two types with this resource type" + ) + } None => LAST_TYPE = Some(id), } } } - #[doc(hidden)] pub unsafe fn dtor(handle: *mut u8) { Self::type_guard::(); - let _ = _rt::Box::from_raw(handle as *mut _ErrorRep); + let _ = unsafe { + _rt::Box::from_raw(handle as *mut _ErrorRep) + }; } - fn as_ptr(&self) -> *mut _ErrorRep { Error::type_guard::(); T::_resource_rep(self.handle()).cast() } } - /// A borrowed version of [`Error`] which represents a borrowed value /// with the lifetime `'a`. #[derive(Debug)] @@ -28483,7 +30934,6 @@ pub mod exports { rep: *mut u8, _marker: core::marker::PhantomData<&'a Error>, } - impl<'a> ErrorBorrow<'a> { #[doc(hidden)] pub unsafe fn lift(rep: usize) -> Self { @@ -28492,55 +30942,47 @@ pub mod exports { _marker: core::marker::PhantomData, } } - /// Gets access to the underlying `T` in this resource. pub fn get(&self) -> &T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_ref().unwrap() } - - // NB: mutable access is not allowed due to the component model allowing - // multiple borrows of the same resource. - fn as_ptr(&self) -> *mut _ErrorRep { Error::type_guard::(); self.rep.cast() } } - unsafe impl _rt::WasmResource for Error { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:io/error@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]error"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_method_error_to_debug_string_cabi( arg0: *mut u8, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = T::to_debug_string(ErrorBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::to_debug_string( + unsafe { ErrorBorrow::lift(arg0 as u32 as usize) }.get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); let vec2 = (result0.into_bytes()).into_boxed_slice(); let ptr2 = vec2.as_ptr().cast::(); let len2 = vec2.len(); ::core::mem::forget(vec2); - *ptr1.add(4).cast::() = len2; + *ptr1.add(::core::mem::size_of::<*const u8>()).cast::() = len2; *ptr1.add(0).cast::<*mut u8>() = ptr2.cast_mut(); ptr1 } @@ -28550,7 +30992,9 @@ pub mod exports { arg0: *mut u8, ) { let l0 = *arg0.add(0).cast::<*mut u8>(); - let l1 = *arg0.add(4).cast::(); + let l1 = *arg0 + .add(::core::mem::size_of::<*const u8>()) + .cast::(); _rt::cabi_dealloc(l0, l1, 1); } pub trait Guest { @@ -28567,18 +31011,16 @@ pub mod exports { let _ = val; unreachable!(); } - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:io/error@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-new]error"] fn new(_: *mut u8) -> u32; } - new(val) + unsafe { new(val) } } } - #[doc(hidden)] fn _resource_rep(handle: u32) -> *mut u8 where @@ -28589,18 +31031,16 @@ pub mod exports { let _ = handle; unreachable!(); } - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:io/error@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-rep]error"] fn rep(_: u32) -> *mut u8; } unsafe { rep(handle) } } } - /// Returns a string that is suitable to assist humans in debugging /// this error. /// @@ -28611,53 +31051,61 @@ pub mod exports { fn to_debug_string(&self) -> _rt::String; } #[doc(hidden)] - - macro_rules! __export_wasi_io_error_0_2_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "wasi:io/error@0.2.0#[method]error.to-debug-string"] - unsafe extern "C" fn export_method_error_to_debug_string(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_error_to_debug_string_cabi::<<$ty as $($path_to_types)*::Guest>::Error>(arg0) - } - #[export_name = "cabi_post_wasi:io/error@0.2.0#[method]error.to-debug-string"] - unsafe extern "C" fn _post_return_method_error_to_debug_string(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_error_to_debug_string::<<$ty as $($path_to_types)*::Guest>::Error>(arg0) - } - - const _: () = { - #[doc(hidden)] - #[export_name = "wasi:io/error@0.2.0#[dtor]error"] - #[allow(non_snake_case)] - unsafe extern "C" fn dtor(rep: *mut u8) { - $($path_to_types)*::Error::dtor::< - <$ty as $($path_to_types)*::Guest>::Error - >(rep) - } - }; - - };); - } + macro_rules! __export_wasi_io_error_0_2_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "wasi:io/error@0.2.0#[method]error.to-debug-string")] unsafe + extern "C" fn export_method_error_to_debug_string(arg0 : * mut + u8,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_error_to_debug_string_cabi::<<$ty as + $($path_to_types)*:: Guest >::Error > (arg0) } } #[unsafe + (export_name = + "cabi_post_wasi:io/error@0.2.0#[method]error.to-debug-string")] + unsafe extern "C" fn + _post_return_method_error_to_debug_string(arg0 : * mut u8,) { + unsafe { $($path_to_types)*:: + __post_return_method_error_to_debug_string::<<$ty as + $($path_to_types)*:: Guest >::Error > (arg0) } } const _ : () = { + #[doc(hidden)] #[unsafe (export_name = + "wasi:io/error@0.2.0#[dtor]error")] #[allow(non_snake_case)] + unsafe extern "C" fn dtor(rep : * mut u8) { unsafe { + $($path_to_types)*:: Error::dtor::< <$ty as $($path_to_types)*:: + Guest >::Error > (rep) } } }; }; + }; + } #[doc(hidden)] pub(crate) use __export_wasi_io_error_0_2_0_cabi; - #[repr(align(4))] - struct _RetArea([::core::mem::MaybeUninit; 8]); - static mut _RET_AREA: _RetArea = _RetArea([::core::mem::MaybeUninit::uninit(); 8]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct _RetArea( + [::core::mem::MaybeUninit< + u8, + >; 2 * ::core::mem::size_of::<*const u8>()], + ); + static mut _RET_AREA: _RetArea = _RetArea( + [::core::mem::MaybeUninit::uninit(); 2 + * ::core::mem::size_of::<*const u8>()], + ); } - - #[allow(dead_code, clippy::all)] + /// WASI I/O is an I/O abstraction API which is currently focused on providing + /// stream types. + /// + /// In the future, the component model is expected to add built-in stream types; + /// when it does, they are expected to subsume this API. + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod streams { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; pub type Error = super::super::super::super::exports::wasi::io::error::Error; - pub type ErrorBorrow<'a> = - super::super::super::super::exports::wasi::io::error::ErrorBorrow<'a>; + pub type ErrorBorrow<'a> = super::super::super::super::exports::wasi::io::error::ErrorBorrow< + 'a, + >; pub type Pollable = super::super::super::super::exports::wasi::io::poll::Pollable; - pub type PollableBorrow<'a> = - super::super::super::super::exports::wasi::io::poll::PollableBorrow<'a>; + pub type PollableBorrow<'a> = super::super::super::super::exports::wasi::io::poll::PollableBorrow< + 'a, + >; /// An error for input-stream and output-stream operations. pub enum StreamError { /// The last operation (a write or flush) failed before completion. @@ -28670,22 +31118,30 @@ pub mod exports { Closed, } impl ::core::fmt::Debug for StreamError { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { - StreamError::LastOperationFailed(e) => f - .debug_tuple("StreamError::LastOperationFailed") - .field(e) - .finish(), - StreamError::Closed => f.debug_tuple("StreamError::Closed").finish(), + StreamError::LastOperationFailed(e) => { + f.debug_tuple("StreamError::LastOperationFailed") + .field(e) + .finish() + } + StreamError::Closed => { + f.debug_tuple("StreamError::Closed").finish() + } } } } impl ::core::fmt::Display for StreamError { - 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 StreamError {} /// An input bytestream. /// @@ -28695,15 +31151,12 @@ pub mod exports { /// available, which could even be zero. To wait for data to be available, /// use the `subscribe` function to obtain a `pollable` which can be polled /// for using `wasi:io/poll`. - #[derive(Debug)] #[repr(transparent)] pub struct InputStream { handle: _rt::Resource, } - type _InputStreamRep = Option; - impl InputStream { /// Creates a new resource from the specified representation. /// @@ -28713,77 +31166,70 @@ pub mod exports { pub fn new(val: T) -> Self { Self::type_guard::(); let val: _InputStreamRep = Some(val); - let ptr: *mut _InputStreamRep = _rt::Box::into_raw(_rt::Box::new(val)); + let ptr: *mut _InputStreamRep = _rt::Box::into_raw( + _rt::Box::new(val), + ); unsafe { Self::from_handle(T::_resource_new(ptr.cast())) } } - /// Gets access to the underlying `T` which represents this resource. pub fn get(&self) -> &T { let ptr = unsafe { &*self.as_ptr::() }; ptr.as_ref().unwrap() } - /// Gets mutable access to the underlying `T` which represents this /// resource. pub fn get_mut(&mut self) -> &mut T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_mut().unwrap() } - /// Consumes this resource and returns the underlying `T`. pub fn into_inner(self) -> T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.take().unwrap() } - #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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) } - - // It's theoretically possible to implement the `GuestInputStream` trait twice - // so guard against using it with two different types here. #[doc(hidden)] fn type_guard() { use core::any::TypeId; static mut LAST_TYPE: Option = None; unsafe { - assert!(!cfg!(target_feature = "threads")); + assert!(! cfg!(target_feature = "atomics")); let id = TypeId::of::(); match LAST_TYPE { - Some(ty) => assert!( - ty == id, - "cannot use two types with this resource type" - ), + Some(ty) => { + assert!( + ty == id, "cannot use two types with this resource type" + ) + } None => LAST_TYPE = Some(id), } } } - #[doc(hidden)] pub unsafe fn dtor(handle: *mut u8) { Self::type_guard::(); - let _ = _rt::Box::from_raw(handle as *mut _InputStreamRep); + let _ = unsafe { + _rt::Box::from_raw(handle as *mut _InputStreamRep) + }; } - fn as_ptr(&self) -> *mut _InputStreamRep { InputStream::type_guard::(); T::_resource_rep(self.handle()).cast() } } - /// A borrowed version of [`InputStream`] which represents a borrowed value /// with the lifetime `'a`. #[derive(Debug)] @@ -28792,7 +31238,6 @@ pub mod exports { rep: *mut u8, _marker: core::marker::PhantomData<&'a InputStream>, } - impl<'a> InputStreamBorrow<'a> { #[doc(hidden)] pub unsafe fn lift(rep: usize) -> Self { @@ -28801,41 +31246,32 @@ pub mod exports { _marker: core::marker::PhantomData, } } - /// Gets access to the underlying `T` in this resource. pub fn get(&self) -> &T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_ref().unwrap() } - - // NB: mutable access is not allowed due to the component model allowing - // multiple borrows of the same resource. - fn as_ptr(&self) -> *mut _InputStreamRep { InputStream::type_guard::(); self.rep.cast() } } - unsafe impl _rt::WasmResource for InputStream { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:io/streams@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]input-stream"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - /// An output bytestream. /// /// `output-stream`s are *non-blocking* to the extent practical on @@ -28844,15 +31280,12 @@ pub mod exports { /// promptly, which could even be zero. To wait for the stream to be ready to /// accept data, the `subscribe` function to obtain a `pollable` which can be /// polled for using `wasi:io/poll`. - #[derive(Debug)] #[repr(transparent)] pub struct OutputStream { handle: _rt::Resource, } - type _OutputStreamRep = Option; - impl OutputStream { /// Creates a new resource from the specified representation. /// @@ -28862,77 +31295,70 @@ pub mod exports { pub fn new(val: T) -> Self { Self::type_guard::(); let val: _OutputStreamRep = Some(val); - let ptr: *mut _OutputStreamRep = _rt::Box::into_raw(_rt::Box::new(val)); + let ptr: *mut _OutputStreamRep = _rt::Box::into_raw( + _rt::Box::new(val), + ); unsafe { Self::from_handle(T::_resource_new(ptr.cast())) } } - /// Gets access to the underlying `T` which represents this resource. pub fn get(&self) -> &T { let ptr = unsafe { &*self.as_ptr::() }; ptr.as_ref().unwrap() } - /// Gets mutable access to the underlying `T` which represents this /// resource. pub fn get_mut(&mut self) -> &mut T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_mut().unwrap() } - /// Consumes this resource and returns the underlying `T`. pub fn into_inner(self) -> T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.take().unwrap() } - #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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) } - - // It's theoretically possible to implement the `GuestOutputStream` trait twice - // so guard against using it with two different types here. #[doc(hidden)] fn type_guard() { use core::any::TypeId; static mut LAST_TYPE: Option = None; unsafe { - assert!(!cfg!(target_feature = "threads")); + assert!(! cfg!(target_feature = "atomics")); let id = TypeId::of::(); match LAST_TYPE { - Some(ty) => assert!( - ty == id, - "cannot use two types with this resource type" - ), + Some(ty) => { + assert!( + ty == id, "cannot use two types with this resource type" + ) + } None => LAST_TYPE = Some(id), } } } - #[doc(hidden)] pub unsafe fn dtor(handle: *mut u8) { Self::type_guard::(); - let _ = _rt::Box::from_raw(handle as *mut _OutputStreamRep); + let _ = unsafe { + _rt::Box::from_raw(handle as *mut _OutputStreamRep) + }; } - fn as_ptr(&self) -> *mut _OutputStreamRep { OutputStream::type_guard::(); T::_resource_rep(self.handle()).cast() } } - /// A borrowed version of [`OutputStream`] which represents a borrowed value /// with the lifetime `'a`. #[derive(Debug)] @@ -28941,7 +31367,6 @@ pub mod exports { rep: *mut u8, _marker: core::marker::PhantomData<&'a OutputStream>, } - impl<'a> OutputStreamBorrow<'a> { #[doc(hidden)] pub unsafe fn lift(rep: usize) -> Self { @@ -28950,54 +31375,44 @@ pub mod exports { _marker: core::marker::PhantomData, } } - /// Gets access to the underlying `T` in this resource. pub fn get(&self) -> &T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_ref().unwrap() } - - // NB: mutable access is not allowed due to the component model allowing - // multiple borrows of the same resource. - fn as_ptr(&self) -> *mut _OutputStreamRep { OutputStream::type_guard::(); self.rep.cast() } } - unsafe impl _rt::WasmResource for OutputStream { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:io/streams@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]output-stream"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_method_input_stream_read_cabi( arg0: *mut u8, arg1: i64, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::read( - InputStreamBorrow::lift(arg0 as u32 as usize).get(), + unsafe { InputStreamBorrow::lift(arg0 as u32 as usize) }.get(), arg1 as u64, ); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -29005,18 +31420,28 @@ pub mod exports { let ptr2 = vec2.as_ptr().cast::(); let len2 = vec2.len(); ::core::mem::forget(vec2); - *ptr1.add(8).cast::() = len2; - *ptr1.add(4).cast::<*mut u8>() = ptr2.cast_mut(); + *ptr1 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len2; + *ptr1 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr2.cast_mut(); } Err(e) => { *ptr1.add(0).cast::() = (1i32) as u8; match e { StreamError::LastOperationFailed(e) => { - *ptr1.add(4).cast::() = (0i32) as u8; - *ptr1.add(8).cast::() = (e).take_handle() as i32; + *ptr1 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; + *ptr1 + .add(4 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::() = (e).take_handle() as i32; } StreamError::Closed => { - *ptr1.add(4).cast::() = (1i32) as u8; + *ptr1 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; } } } @@ -29025,36 +31450,36 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn __post_return_method_input_stream_read( - arg0: *mut u8, - ) { + pub unsafe fn __post_return_method_input_stream_read< + T: GuestInputStream, + >(arg0: *mut u8) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { 0 => { - let l1 = *arg0.add(4).cast::<*mut u8>(); - let l2 = *arg0.add(8).cast::(); + let l1 = *arg0 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); let base3 = l1; let len3 = l2; _rt::cabi_dealloc(base3, len3 * 1, 1); } - _ => (), + _ => {} } } #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_method_input_stream_blocking_read_cabi< T: GuestInputStream, - >( - arg0: *mut u8, - arg1: i64, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + >(arg0: *mut u8, arg1: i64) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::blocking_read( - InputStreamBorrow::lift(arg0 as u32 as usize).get(), + unsafe { InputStreamBorrow::lift(arg0 as u32 as usize) }.get(), arg1 as u64, ); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -29062,18 +31487,28 @@ pub mod exports { let ptr2 = vec2.as_ptr().cast::(); let len2 = vec2.len(); ::core::mem::forget(vec2); - *ptr1.add(8).cast::() = len2; - *ptr1.add(4).cast::<*mut u8>() = ptr2.cast_mut(); + *ptr1 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len2; + *ptr1 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = ptr2.cast_mut(); } Err(e) => { *ptr1.add(0).cast::() = (1i32) as u8; match e { StreamError::LastOperationFailed(e) => { - *ptr1.add(4).cast::() = (0i32) as u8; - *ptr1.add(8).cast::() = (e).take_handle() as i32; + *ptr1 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; + *ptr1 + .add(4 + 1 * ::core::mem::size_of::<*const u8>()) + .cast::() = (e).take_handle() as i32; } StreamError::Closed => { - *ptr1.add(4).cast::() = (1i32) as u8; + *ptr1 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; } } } @@ -29084,19 +31519,21 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn __post_return_method_input_stream_blocking_read< T: GuestInputStream, - >( - arg0: *mut u8, - ) { + >(arg0: *mut u8) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { 0 => { - let l1 = *arg0.add(4).cast::<*mut u8>(); - let l2 = *arg0.add(8).cast::(); + let l1 = *arg0 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); let base3 = l1; let len3 = l2; _rt::cabi_dealloc(base3, len3 * 1, 1); } - _ => (), + _ => {} } } #[doc(hidden)] @@ -29105,13 +31542,12 @@ pub mod exports { arg0: *mut u8, arg1: i64, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::skip( - InputStreamBorrow::lift(arg0 as u32 as usize).get(), + unsafe { InputStreamBorrow::lift(arg0 as u32 as usize) }.get(), arg1 as u64, ); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -29136,17 +31572,13 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_input_stream_blocking_skip_cabi< T: GuestInputStream, - >( - arg0: *mut u8, - arg1: i64, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + >(arg0: *mut u8, arg1: i64) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::blocking_skip( - InputStreamBorrow::lift(arg0 as u32 as usize).get(), + unsafe { InputStreamBorrow::lift(arg0 as u32 as usize) }.get(), arg1 as u64, ); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -29169,26 +31601,25 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_input_stream_subscribe_cabi( - arg0: *mut u8, - ) -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = T::subscribe(InputStreamBorrow::lift(arg0 as u32 as usize).get()); + pub unsafe fn _export_method_input_stream_subscribe_cabi< + T: GuestInputStream, + >(arg0: *mut u8) -> i32 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::subscribe( + unsafe { InputStreamBorrow::lift(arg0 as u32 as usize) }.get(), + ); (result0).take_handle() as i32 } #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_method_output_stream_check_write_cabi< T: GuestOutputStream, - >( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::check_write(OutputStreamBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::check_write( + unsafe { OutputStreamBorrow::lift(arg0 as u32 as usize) }.get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -29211,19 +31642,16 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_output_stream_write_cabi( - arg0: *mut u8, - arg1: *mut u8, - arg2: usize, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + pub unsafe fn _export_method_output_stream_write_cabi< + T: GuestOutputStream, + >(arg0: *mut u8, arg1: *mut u8, arg2: usize) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg2; let result1 = T::write( - OutputStreamBorrow::lift(arg0 as u32 as usize).get(), + unsafe { OutputStreamBorrow::lift(arg0 as u32 as usize) }.get(), _rt::Vec::from_raw_parts(arg1.cast(), len0, len0), ); - let ptr2 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr2 = (&raw mut _RET_AREA.0).cast::(); match result1 { Ok(_) => { *ptr2.add(0).cast::() = (0i32) as u8; @@ -29247,19 +31675,14 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_output_stream_blocking_write_and_flush_cabi< T: GuestOutputStream, - >( - arg0: *mut u8, - arg1: *mut u8, - arg2: usize, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + >(arg0: *mut u8, arg1: *mut u8, arg2: usize) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg2; let result1 = T::blocking_write_and_flush( - OutputStreamBorrow::lift(arg0 as u32 as usize).get(), + unsafe { OutputStreamBorrow::lift(arg0 as u32 as usize) }.get(), _rt::Vec::from_raw_parts(arg1.cast(), len0, len0), ); - let ptr2 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr2 = (&raw mut _RET_AREA.0).cast::(); match result1 { Ok(_) => { *ptr2.add(0).cast::() = (0i32) as u8; @@ -29281,13 +31704,14 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_output_stream_flush_cabi( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = T::flush(OutputStreamBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + pub unsafe fn _export_method_output_stream_flush_cabi< + T: GuestOutputStream, + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::flush( + unsafe { OutputStreamBorrow::lift(arg0 as u32 as usize) }.get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(_) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -29311,14 +31735,12 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_output_stream_blocking_flush_cabi< T: GuestOutputStream, - >( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::blocking_flush(OutputStreamBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::blocking_flush( + unsafe { OutputStreamBorrow::lift(arg0 as u32 as usize) }.get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(_) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -29340,30 +31762,26 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_output_stream_subscribe_cabi( - arg0: *mut u8, - ) -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::subscribe(OutputStreamBorrow::lift(arg0 as u32 as usize).get()); + pub unsafe fn _export_method_output_stream_subscribe_cabi< + T: GuestOutputStream, + >(arg0: *mut u8) -> i32 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::subscribe( + unsafe { OutputStreamBorrow::lift(arg0 as u32 as usize) }.get(), + ); (result0).take_handle() as i32 } #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_method_output_stream_write_zeroes_cabi< T: GuestOutputStream, - >( - arg0: *mut u8, - arg1: i64, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + >(arg0: *mut u8, arg1: i64) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::write_zeroes( - OutputStreamBorrow::lift(arg0 as u32 as usize).get(), + unsafe { OutputStreamBorrow::lift(arg0 as u32 as usize) }.get(), arg1 as u64, ); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(_) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -29387,17 +31805,13 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_output_stream_blocking_write_zeroes_and_flush_cabi< T: GuestOutputStream, - >( - arg0: *mut u8, - arg1: i64, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + >(arg0: *mut u8, arg1: i64) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::blocking_write_zeroes_and_flush( - OutputStreamBorrow::lift(arg0 as u32 as usize).get(), + unsafe { OutputStreamBorrow::lift(arg0 as u32 as usize) }.get(), arg1 as u64, ); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(_) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -29419,19 +31833,16 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_output_stream_splice_cabi( - arg0: *mut u8, - arg1: i32, - arg2: i64, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + pub unsafe fn _export_method_output_stream_splice_cabi< + T: GuestOutputStream, + >(arg0: *mut u8, arg1: i32, arg2: i64) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::splice( - OutputStreamBorrow::lift(arg0 as u32 as usize).get(), - InputStreamBorrow::lift(arg1 as u32 as usize), + unsafe { OutputStreamBorrow::lift(arg0 as u32 as usize) }.get(), + unsafe { InputStreamBorrow::lift(arg1 as u32 as usize) }, arg2 as u64, ); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -29456,19 +31867,14 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_output_stream_blocking_splice_cabi< T: GuestOutputStream, - >( - arg0: *mut u8, - arg1: i32, - arg2: i64, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + >(arg0: *mut u8, arg1: i32, arg2: i64) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::blocking_splice( - OutputStreamBorrow::lift(arg0 as u32 as usize).get(), - InputStreamBorrow::lift(arg1 as u32 as usize), + unsafe { OutputStreamBorrow::lift(arg0 as u32 as usize) }.get(), + unsafe { InputStreamBorrow::lift(arg1 as u32 as usize) }, arg2 as u64, ); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -29504,18 +31910,16 @@ pub mod exports { let _ = val; unreachable!(); } - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:io/streams@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-new]input-stream"] fn new(_: *mut u8) -> u32; } - new(val) + unsafe { new(val) } } } - #[doc(hidden)] fn _resource_rep(handle: u32) -> *mut u8 where @@ -29526,18 +31930,16 @@ pub mod exports { let _ = handle; unreachable!(); } - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:io/streams@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-rep]input-stream"] fn rep(_: u32) -> *mut u8; } unsafe { rep(handle) } } } - /// Perform a non-blocking read from the stream. /// /// When the source of a `read` is binary data, the bytes from the source @@ -29567,7 +31969,10 @@ pub mod exports { fn read(&self, len: u64) -> Result<_rt::Vec, StreamError>; /// Read bytes from a stream, after blocking until at least one byte can /// be read. Except for blocking, behavior is identical to `read`. - fn blocking_read(&self, len: u64) -> Result<_rt::Vec, StreamError>; + fn blocking_read( + &self, + len: u64, + ) -> Result<_rt::Vec, StreamError>; /// Skip bytes from a stream. Returns number of bytes skipped. /// /// Behaves identical to `read`, except instead of returning a list @@ -29595,18 +32000,16 @@ pub mod exports { let _ = val; unreachable!(); } - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:io/streams@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-new]output-stream"] fn new(_: *mut u8) -> u32; } - new(val) + unsafe { new(val) } } } - #[doc(hidden)] fn _resource_rep(handle: u32) -> *mut u8 where @@ -29617,18 +32020,16 @@ pub mod exports { let _ = handle; unreachable!(); } - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "[export]wasi:io/streams@0.2.0")] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-rep]output-stream"] fn rep(_: u32) -> *mut u8; } unsafe { rep(handle) } } } - /// Check readiness for writing. This function never blocks. /// /// Returns the number of bytes permitted for the next call to `write`, @@ -29663,13 +32064,13 @@ pub mod exports { /// ```text /// let pollable = this.subscribe(); /// while !contents.is_empty() { - /// // Wait for the stream to become writable - /// pollable.block(); - /// let Ok(n) = this.check-write(); // eliding error handling - /// let len = min(n, contents.len()); - /// let (chunk, rest) = contents.split_at(len); - /// this.write(chunk ); // eliding error handling - /// contents = rest; + /// // Wait for the stream to become writable + /// pollable.block(); + /// let Ok(n) = this.check-write(); // eliding error handling + /// let len = min(n, contents.len()); + /// let (chunk, rest) = contents.split_at(len); + /// this.write(chunk ); // eliding error handling + /// contents = rest; /// } /// this.flush(); /// // Wait for completion of `flush` @@ -29724,12 +32125,12 @@ pub mod exports { /// ```text /// let pollable = this.subscribe(); /// while num_zeroes != 0 { - /// // Wait for the stream to become writable - /// pollable.block(); - /// let Ok(n) = this.check-write(); // eliding error handling - /// let len = min(n, num_zeroes); - /// this.write-zeroes(len); // eliding error handling - /// num_zeroes -= len; + /// // Wait for the stream to become writable + /// pollable.block(); + /// let Ok(n) = this.check-write(); // eliding error handling + /// let len = min(n, num_zeroes); + /// this.write-zeroes(len); // eliding error handling + /// num_zeroes -= len; /// } /// this.flush(); /// // Wait for completion of `flush` @@ -29737,7 +32138,10 @@ pub mod exports { /// // Check for any errors that arose during `flush` /// let _ = this.check-write(); // eliding error handling /// ``` - fn blocking_write_zeroes_and_flush(&self, len: u64) -> Result<(), StreamError>; + fn blocking_write_zeroes_and_flush( + &self, + len: u64, + ) -> Result<(), StreamError>; /// Read from one stream and write to another. /// /// The behavior of splice is equivelant to: @@ -29768,133 +32172,172 @@ pub mod exports { ) -> Result; } #[doc(hidden)] - - macro_rules! __export_wasi_io_streams_0_2_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "wasi:io/streams@0.2.0#[method]input-stream.read"] - unsafe extern "C" fn export_method_input_stream_read(arg0: *mut u8,arg1: i64,) -> *mut u8 { - $($path_to_types)*::_export_method_input_stream_read_cabi::<<$ty as $($path_to_types)*::Guest>::InputStream>(arg0, arg1) - } - #[export_name = "cabi_post_wasi:io/streams@0.2.0#[method]input-stream.read"] - unsafe extern "C" fn _post_return_method_input_stream_read(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_input_stream_read::<<$ty as $($path_to_types)*::Guest>::InputStream>(arg0) - } - #[export_name = "wasi:io/streams@0.2.0#[method]input-stream.blocking-read"] - unsafe extern "C" fn export_method_input_stream_blocking_read(arg0: *mut u8,arg1: i64,) -> *mut u8 { - $($path_to_types)*::_export_method_input_stream_blocking_read_cabi::<<$ty as $($path_to_types)*::Guest>::InputStream>(arg0, arg1) - } - #[export_name = "cabi_post_wasi:io/streams@0.2.0#[method]input-stream.blocking-read"] - unsafe extern "C" fn _post_return_method_input_stream_blocking_read(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_input_stream_blocking_read::<<$ty as $($path_to_types)*::Guest>::InputStream>(arg0) - } - #[export_name = "wasi:io/streams@0.2.0#[method]input-stream.skip"] - unsafe extern "C" fn export_method_input_stream_skip(arg0: *mut u8,arg1: i64,) -> *mut u8 { - $($path_to_types)*::_export_method_input_stream_skip_cabi::<<$ty as $($path_to_types)*::Guest>::InputStream>(arg0, arg1) - } - #[export_name = "wasi:io/streams@0.2.0#[method]input-stream.blocking-skip"] - unsafe extern "C" fn export_method_input_stream_blocking_skip(arg0: *mut u8,arg1: i64,) -> *mut u8 { - $($path_to_types)*::_export_method_input_stream_blocking_skip_cabi::<<$ty as $($path_to_types)*::Guest>::InputStream>(arg0, arg1) - } - #[export_name = "wasi:io/streams@0.2.0#[method]input-stream.subscribe"] - unsafe extern "C" fn export_method_input_stream_subscribe(arg0: *mut u8,) -> i32 { - $($path_to_types)*::_export_method_input_stream_subscribe_cabi::<<$ty as $($path_to_types)*::Guest>::InputStream>(arg0) - } - #[export_name = "wasi:io/streams@0.2.0#[method]output-stream.check-write"] - unsafe extern "C" fn export_method_output_stream_check_write(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_output_stream_check_write_cabi::<<$ty as $($path_to_types)*::Guest>::OutputStream>(arg0) - } - #[export_name = "wasi:io/streams@0.2.0#[method]output-stream.write"] - unsafe extern "C" fn export_method_output_stream_write(arg0: *mut u8,arg1: *mut u8,arg2: usize,) -> *mut u8 { - $($path_to_types)*::_export_method_output_stream_write_cabi::<<$ty as $($path_to_types)*::Guest>::OutputStream>(arg0, arg1, arg2) - } - #[export_name = "wasi:io/streams@0.2.0#[method]output-stream.blocking-write-and-flush"] - unsafe extern "C" fn export_method_output_stream_blocking_write_and_flush(arg0: *mut u8,arg1: *mut u8,arg2: usize,) -> *mut u8 { - $($path_to_types)*::_export_method_output_stream_blocking_write_and_flush_cabi::<<$ty as $($path_to_types)*::Guest>::OutputStream>(arg0, arg1, arg2) - } - #[export_name = "wasi:io/streams@0.2.0#[method]output-stream.flush"] - unsafe extern "C" fn export_method_output_stream_flush(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_output_stream_flush_cabi::<<$ty as $($path_to_types)*::Guest>::OutputStream>(arg0) - } - #[export_name = "wasi:io/streams@0.2.0#[method]output-stream.blocking-flush"] - unsafe extern "C" fn export_method_output_stream_blocking_flush(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_output_stream_blocking_flush_cabi::<<$ty as $($path_to_types)*::Guest>::OutputStream>(arg0) - } - #[export_name = "wasi:io/streams@0.2.0#[method]output-stream.subscribe"] - unsafe extern "C" fn export_method_output_stream_subscribe(arg0: *mut u8,) -> i32 { - $($path_to_types)*::_export_method_output_stream_subscribe_cabi::<<$ty as $($path_to_types)*::Guest>::OutputStream>(arg0) - } - #[export_name = "wasi:io/streams@0.2.0#[method]output-stream.write-zeroes"] - unsafe extern "C" fn export_method_output_stream_write_zeroes(arg0: *mut u8,arg1: i64,) -> *mut u8 { - $($path_to_types)*::_export_method_output_stream_write_zeroes_cabi::<<$ty as $($path_to_types)*::Guest>::OutputStream>(arg0, arg1) - } - #[export_name = "wasi:io/streams@0.2.0#[method]output-stream.blocking-write-zeroes-and-flush"] - unsafe extern "C" fn export_method_output_stream_blocking_write_zeroes_and_flush(arg0: *mut u8,arg1: i64,) -> *mut u8 { - $($path_to_types)*::_export_method_output_stream_blocking_write_zeroes_and_flush_cabi::<<$ty as $($path_to_types)*::Guest>::OutputStream>(arg0, arg1) - } - #[export_name = "wasi:io/streams@0.2.0#[method]output-stream.splice"] - unsafe extern "C" fn export_method_output_stream_splice(arg0: *mut u8,arg1: i32,arg2: i64,) -> *mut u8 { - $($path_to_types)*::_export_method_output_stream_splice_cabi::<<$ty as $($path_to_types)*::Guest>::OutputStream>(arg0, arg1, arg2) - } - #[export_name = "wasi:io/streams@0.2.0#[method]output-stream.blocking-splice"] - unsafe extern "C" fn export_method_output_stream_blocking_splice(arg0: *mut u8,arg1: i32,arg2: i64,) -> *mut u8 { - $($path_to_types)*::_export_method_output_stream_blocking_splice_cabi::<<$ty as $($path_to_types)*::Guest>::OutputStream>(arg0, arg1, arg2) - } - - const _: () = { - #[doc(hidden)] - #[export_name = "wasi:io/streams@0.2.0#[dtor]input-stream"] - #[allow(non_snake_case)] - unsafe extern "C" fn dtor(rep: *mut u8) { - $($path_to_types)*::InputStream::dtor::< - <$ty as $($path_to_types)*::Guest>::InputStream - >(rep) - } - }; - - - const _: () = { - #[doc(hidden)] - #[export_name = "wasi:io/streams@0.2.0#[dtor]output-stream"] - #[allow(non_snake_case)] - unsafe extern "C" fn dtor(rep: *mut u8) { - $($path_to_types)*::OutputStream::dtor::< - <$ty as $($path_to_types)*::Guest>::OutputStream - >(rep) - } - }; - - };); - } + macro_rules! __export_wasi_io_streams_0_2_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "wasi:io/streams@0.2.0#[method]input-stream.read")] unsafe extern + "C" fn export_method_input_stream_read(arg0 : * mut u8, arg1 : + i64,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_input_stream_read_cabi::<<$ty as + $($path_to_types)*:: Guest >::InputStream > (arg0, arg1) } } + #[unsafe (export_name = + "cabi_post_wasi:io/streams@0.2.0#[method]input-stream.read")] + unsafe extern "C" fn _post_return_method_input_stream_read(arg0 : + * mut u8,) { unsafe { $($path_to_types)*:: + __post_return_method_input_stream_read::<<$ty as + $($path_to_types)*:: Guest >::InputStream > (arg0) } } #[unsafe + (export_name = + "wasi:io/streams@0.2.0#[method]input-stream.blocking-read")] + unsafe extern "C" fn + export_method_input_stream_blocking_read(arg0 : * mut u8, arg1 : + i64,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_input_stream_blocking_read_cabi::<<$ty as + $($path_to_types)*:: Guest >::InputStream > (arg0, arg1) } } + #[unsafe (export_name = + "cabi_post_wasi:io/streams@0.2.0#[method]input-stream.blocking-read")] + unsafe extern "C" fn + _post_return_method_input_stream_blocking_read(arg0 : * mut u8,) + { unsafe { $($path_to_types)*:: + __post_return_method_input_stream_blocking_read::<<$ty as + $($path_to_types)*:: Guest >::InputStream > (arg0) } } #[unsafe + (export_name = + "wasi:io/streams@0.2.0#[method]input-stream.skip")] unsafe extern + "C" fn export_method_input_stream_skip(arg0 : * mut u8, arg1 : + i64,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_input_stream_skip_cabi::<<$ty as + $($path_to_types)*:: Guest >::InputStream > (arg0, arg1) } } + #[unsafe (export_name = + "wasi:io/streams@0.2.0#[method]input-stream.blocking-skip")] + unsafe extern "C" fn + export_method_input_stream_blocking_skip(arg0 : * mut u8, arg1 : + i64,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_input_stream_blocking_skip_cabi::<<$ty as + $($path_to_types)*:: Guest >::InputStream > (arg0, arg1) } } + #[unsafe (export_name = + "wasi:io/streams@0.2.0#[method]input-stream.subscribe")] unsafe + extern "C" fn export_method_input_stream_subscribe(arg0 : * mut + u8,) -> i32 { unsafe { $($path_to_types)*:: + _export_method_input_stream_subscribe_cabi::<<$ty as + $($path_to_types)*:: Guest >::InputStream > (arg0) } } #[unsafe + (export_name = + "wasi:io/streams@0.2.0#[method]output-stream.check-write")] + unsafe extern "C" fn export_method_output_stream_check_write(arg0 + : * mut u8,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_output_stream_check_write_cabi::<<$ty as + $($path_to_types)*:: Guest >::OutputStream > (arg0) } } #[unsafe + (export_name = + "wasi:io/streams@0.2.0#[method]output-stream.write")] unsafe + extern "C" fn export_method_output_stream_write(arg0 : * mut u8, + arg1 : * mut u8, arg2 : usize,) -> * mut u8 { unsafe { + $($path_to_types)*:: + _export_method_output_stream_write_cabi::<<$ty as + $($path_to_types)*:: Guest >::OutputStream > (arg0, arg1, arg2) } + } #[unsafe (export_name = + "wasi:io/streams@0.2.0#[method]output-stream.blocking-write-and-flush")] + unsafe extern "C" fn + export_method_output_stream_blocking_write_and_flush(arg0 : * mut + u8, arg1 : * mut u8, arg2 : usize,) -> * mut u8 { unsafe { + $($path_to_types)*:: + _export_method_output_stream_blocking_write_and_flush_cabi::<<$ty + as $($path_to_types)*:: Guest >::OutputStream > (arg0, arg1, + arg2) } } #[unsafe (export_name = + "wasi:io/streams@0.2.0#[method]output-stream.flush")] unsafe + extern "C" fn export_method_output_stream_flush(arg0 : * mut u8,) + -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_output_stream_flush_cabi::<<$ty as + $($path_to_types)*:: Guest >::OutputStream > (arg0) } } #[unsafe + (export_name = + "wasi:io/streams@0.2.0#[method]output-stream.blocking-flush")] + unsafe extern "C" fn + export_method_output_stream_blocking_flush(arg0 : * mut u8,) -> * + mut u8 { unsafe { $($path_to_types)*:: + _export_method_output_stream_blocking_flush_cabi::<<$ty as + $($path_to_types)*:: Guest >::OutputStream > (arg0) } } #[unsafe + (export_name = + "wasi:io/streams@0.2.0#[method]output-stream.subscribe")] unsafe + extern "C" fn export_method_output_stream_subscribe(arg0 : * mut + u8,) -> i32 { unsafe { $($path_to_types)*:: + _export_method_output_stream_subscribe_cabi::<<$ty as + $($path_to_types)*:: Guest >::OutputStream > (arg0) } } #[unsafe + (export_name = + "wasi:io/streams@0.2.0#[method]output-stream.write-zeroes")] + unsafe extern "C" fn + export_method_output_stream_write_zeroes(arg0 : * mut u8, arg1 : + i64,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_output_stream_write_zeroes_cabi::<<$ty as + $($path_to_types)*:: Guest >::OutputStream > (arg0, arg1) } } + #[unsafe (export_name = + "wasi:io/streams@0.2.0#[method]output-stream.blocking-write-zeroes-and-flush")] + unsafe extern "C" fn + export_method_output_stream_blocking_write_zeroes_and_flush(arg0 + : * mut u8, arg1 : i64,) -> * mut u8 { unsafe { + $($path_to_types)*:: + _export_method_output_stream_blocking_write_zeroes_and_flush_cabi::<<$ty + as $($path_to_types)*:: Guest >::OutputStream > (arg0, arg1) } } + #[unsafe (export_name = + "wasi:io/streams@0.2.0#[method]output-stream.splice")] unsafe + extern "C" fn export_method_output_stream_splice(arg0 : * mut u8, + arg1 : i32, arg2 : i64,) -> * mut u8 { unsafe { + $($path_to_types)*:: + _export_method_output_stream_splice_cabi::<<$ty as + $($path_to_types)*:: Guest >::OutputStream > (arg0, arg1, arg2) } + } #[unsafe (export_name = + "wasi:io/streams@0.2.0#[method]output-stream.blocking-splice")] + unsafe extern "C" fn + export_method_output_stream_blocking_splice(arg0 : * mut u8, arg1 + : i32, arg2 : i64,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_output_stream_blocking_splice_cabi::<<$ty as + $($path_to_types)*:: Guest >::OutputStream > (arg0, arg1, arg2) } + } const _ : () = { #[doc(hidden)] #[unsafe (export_name = + "wasi:io/streams@0.2.0#[dtor]input-stream")] + #[allow(non_snake_case)] unsafe extern "C" fn dtor(rep : * mut + u8) { unsafe { $($path_to_types)*:: InputStream::dtor::< <$ty as + $($path_to_types)*:: Guest >::InputStream > (rep) } } }; const _ + : () = { #[doc(hidden)] #[unsafe (export_name = + "wasi:io/streams@0.2.0#[dtor]output-stream")] + #[allow(non_snake_case)] unsafe extern "C" fn dtor(rep : * mut + u8) { unsafe { $($path_to_types)*:: OutputStream::dtor::< <$ty as + $($path_to_types)*:: Guest >::OutputStream > (rep) } } }; }; + }; + } #[doc(hidden)] pub(crate) use __export_wasi_io_streams_0_2_0_cabi; #[repr(align(8))] - struct _RetArea([::core::mem::MaybeUninit; 16]); - static mut _RET_AREA: _RetArea = _RetArea([::core::mem::MaybeUninit::uninit(); 16]); + struct _RetArea( + [::core::mem::MaybeUninit< + u8, + >; 8 + 2 * ::core::mem::size_of::<*const u8>()], + ); + static mut _RET_AREA: _RetArea = _RetArea( + [::core::mem::MaybeUninit::uninit(); 8 + + 2 * ::core::mem::size_of::<*const u8>()], + ); } } - #[allow(dead_code)] pub mod random { - #[allow(dead_code, clippy::all)] + /// WASI Random is a random data API. + /// + /// It is intended to be portable at least between Unix-family platforms and + /// Windows. + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod random { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_get_random_bytes_cabi(arg0: i64) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + pub unsafe fn _export_get_random_bytes_cabi( + arg0: i64, + ) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::get_random_bytes(arg0 as u64); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); let vec2 = (result0).into_boxed_slice(); let ptr2 = vec2.as_ptr().cast::(); let len2 = vec2.len(); ::core::mem::forget(vec2); - *ptr1.add(4).cast::() = len2; + *ptr1.add(::core::mem::size_of::<*const u8>()).cast::() = len2; *ptr1.add(0).cast::<*mut u8>() = ptr2.cast_mut(); ptr1 } @@ -29902,7 +32345,9 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn __post_return_get_random_bytes(arg0: *mut u8) { let l0 = *arg0.add(0).cast::<*mut u8>(); - let l1 = *arg0.add(4).cast::(); + let l1 = *arg0 + .add(::core::mem::size_of::<*const u8>()) + .cast::(); let base2 = l0; let len2 = l1; _rt::cabi_dealloc(base2, len2 * 1, 1); @@ -29910,8 +32355,7 @@ pub mod exports { #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_get_random_u64_cabi() -> i64 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::get_random_u64(); _rt::as_i64(result0) } @@ -29936,61 +32380,72 @@ pub mod exports { fn get_random_u64() -> u64; } #[doc(hidden)] - - macro_rules! __export_wasi_random_random_0_2_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "wasi:random/random@0.2.0#get-random-bytes"] - unsafe extern "C" fn export_get_random_bytes(arg0: i64,) -> *mut u8 { - $($path_to_types)*::_export_get_random_bytes_cabi::<$ty>(arg0) - } - #[export_name = "cabi_post_wasi:random/random@0.2.0#get-random-bytes"] - unsafe extern "C" fn _post_return_get_random_bytes(arg0: *mut u8,) { - $($path_to_types)*::__post_return_get_random_bytes::<$ty>(arg0) - } - #[export_name = "wasi:random/random@0.2.0#get-random-u64"] - unsafe extern "C" fn export_get_random_u64() -> i64 { - $($path_to_types)*::_export_get_random_u64_cabi::<$ty>() - } - };); - } + macro_rules! __export_wasi_random_random_0_2_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "wasi:random/random@0.2.0#get-random-bytes")] unsafe extern "C" + fn export_get_random_bytes(arg0 : i64,) -> * mut u8 { unsafe { + $($path_to_types)*:: _export_get_random_bytes_cabi::<$ty > (arg0) + } } #[unsafe (export_name = + "cabi_post_wasi:random/random@0.2.0#get-random-bytes")] unsafe + extern "C" fn _post_return_get_random_bytes(arg0 : * mut u8,) { + unsafe { $($path_to_types)*:: + __post_return_get_random_bytes::<$ty > (arg0) } } #[unsafe + (export_name = "wasi:random/random@0.2.0#get-random-u64")] unsafe + extern "C" fn export_get_random_u64() -> i64 { unsafe { + $($path_to_types)*:: _export_get_random_u64_cabi::<$ty > () } } + }; + }; + } #[doc(hidden)] pub(crate) use __export_wasi_random_random_0_2_0_cabi; - #[repr(align(4))] - struct _RetArea([::core::mem::MaybeUninit; 8]); - static mut _RET_AREA: _RetArea = _RetArea([::core::mem::MaybeUninit::uninit(); 8]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct _RetArea( + [::core::mem::MaybeUninit< + u8, + >; 2 * ::core::mem::size_of::<*const u8>()], + ); + static mut _RET_AREA: _RetArea = _RetArea( + [::core::mem::MaybeUninit::uninit(); 2 + * ::core::mem::size_of::<*const u8>()], + ); } - - #[allow(dead_code, clippy::all)] + /// The insecure interface for insecure pseudo-random numbers. + /// + /// It is intended to be portable at least between Unix-family platforms and + /// Windows. + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod insecure { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_get_insecure_random_bytes_cabi( arg0: i64, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::get_insecure_random_bytes(arg0 as u64); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); let vec2 = (result0).into_boxed_slice(); let ptr2 = vec2.as_ptr().cast::(); let len2 = vec2.len(); ::core::mem::forget(vec2); - *ptr1.add(4).cast::() = len2; + *ptr1.add(::core::mem::size_of::<*const u8>()).cast::() = len2; *ptr1.add(0).cast::<*mut u8>() = ptr2.cast_mut(); ptr1 } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn __post_return_get_insecure_random_bytes(arg0: *mut u8) { + pub unsafe fn __post_return_get_insecure_random_bytes( + arg0: *mut u8, + ) { let l0 = *arg0.add(0).cast::<*mut u8>(); - let l1 = *arg0.add(4).cast::(); + let l1 = *arg0 + .add(::core::mem::size_of::<*const u8>()) + .cast::(); let base2 = l0; let len2 = l1; _rt::cabi_dealloc(base2, len2 * 1, 1); @@ -29998,8 +32453,7 @@ pub mod exports { #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_get_insecure_random_u64_cabi() -> i64 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::get_insecure_random_u64(); _rt::as_i64(result0) } @@ -30020,46 +32474,55 @@ pub mod exports { fn get_insecure_random_u64() -> u64; } #[doc(hidden)] - - macro_rules! __export_wasi_random_insecure_0_2_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "wasi:random/insecure@0.2.0#get-insecure-random-bytes"] - unsafe extern "C" fn export_get_insecure_random_bytes(arg0: i64,) -> *mut u8 { - $($path_to_types)*::_export_get_insecure_random_bytes_cabi::<$ty>(arg0) - } - #[export_name = "cabi_post_wasi:random/insecure@0.2.0#get-insecure-random-bytes"] - unsafe extern "C" fn _post_return_get_insecure_random_bytes(arg0: *mut u8,) { - $($path_to_types)*::__post_return_get_insecure_random_bytes::<$ty>(arg0) - } - #[export_name = "wasi:random/insecure@0.2.0#get-insecure-random-u64"] - unsafe extern "C" fn export_get_insecure_random_u64() -> i64 { - $($path_to_types)*::_export_get_insecure_random_u64_cabi::<$ty>() - } - };); - } + macro_rules! __export_wasi_random_insecure_0_2_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "wasi:random/insecure@0.2.0#get-insecure-random-bytes")] unsafe + extern "C" fn export_get_insecure_random_bytes(arg0 : i64,) -> * + mut u8 { unsafe { $($path_to_types)*:: + _export_get_insecure_random_bytes_cabi::<$ty > (arg0) } } + #[unsafe (export_name = + "cabi_post_wasi:random/insecure@0.2.0#get-insecure-random-bytes")] + unsafe extern "C" fn _post_return_get_insecure_random_bytes(arg0 + : * mut u8,) { unsafe { $($path_to_types)*:: + __post_return_get_insecure_random_bytes::<$ty > (arg0) } } + #[unsafe (export_name = + "wasi:random/insecure@0.2.0#get-insecure-random-u64")] unsafe + extern "C" fn export_get_insecure_random_u64() -> i64 { unsafe { + $($path_to_types)*:: _export_get_insecure_random_u64_cabi::<$ty > + () } } }; + }; + } #[doc(hidden)] pub(crate) use __export_wasi_random_insecure_0_2_0_cabi; - #[repr(align(4))] - struct _RetArea([::core::mem::MaybeUninit; 8]); - static mut _RET_AREA: _RetArea = _RetArea([::core::mem::MaybeUninit::uninit(); 8]); + #[cfg_attr(target_pointer_width = "64", repr(align(8)))] + #[cfg_attr(target_pointer_width = "32", repr(align(4)))] + struct _RetArea( + [::core::mem::MaybeUninit< + u8, + >; 2 * ::core::mem::size_of::<*const u8>()], + ); + static mut _RET_AREA: _RetArea = _RetArea( + [::core::mem::MaybeUninit::uninit(); 2 + * ::core::mem::size_of::<*const u8>()], + ); } - - #[allow(dead_code, clippy::all)] + /// The insecure-seed interface for seeding hash-map DoS resistance. + /// + /// It is intended to be portable at least between Unix-family platforms and + /// Windows. + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod insecure_seed { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_insecure_seed_cabi() -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::insecure_seed(); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); let (t2_0, t2_1) = result0; *ptr1.add(0).cast::() = _rt::as_i64(t2_0); *ptr1.add(8).cast::() = _rt::as_i64(t2_1); @@ -30086,45 +32549,39 @@ pub mod exports { fn insecure_seed() -> (u64, u64); } #[doc(hidden)] - - macro_rules! __export_wasi_random_insecure_seed_0_2_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "wasi:random/insecure-seed@0.2.0#insecure-seed"] - unsafe extern "C" fn export_insecure_seed() -> *mut u8 { - $($path_to_types)*::_export_insecure_seed_cabi::<$ty>() - } - };); - } + macro_rules! __export_wasi_random_insecure_seed_0_2_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "wasi:random/insecure-seed@0.2.0#insecure-seed")] unsafe extern + "C" fn export_insecure_seed() -> * mut u8 { unsafe { + $($path_to_types)*:: _export_insecure_seed_cabi::<$ty > () } } }; + }; + } #[doc(hidden)] pub(crate) use __export_wasi_random_insecure_seed_0_2_0_cabi; #[repr(align(8))] struct _RetArea([::core::mem::MaybeUninit; 16]); - static mut _RET_AREA: _RetArea = _RetArea([::core::mem::MaybeUninit::uninit(); 16]); + static mut _RET_AREA: _RetArea = _RetArea( + [::core::mem::MaybeUninit::uninit(); 16], + ); } } - #[allow(dead_code)] pub mod sockets { - #[allow(dead_code, clippy::all)] + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod network { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; /// An opaque resource that represents access to (a subset of) the network. /// This enables context-based security for networking. /// There is no need for this to map 1:1 to a physical network interface. - #[derive(Debug)] #[repr(transparent)] pub struct Network { handle: _rt::Resource, } - type _NetworkRep = Option; - impl Network { /// Creates a new resource from the specified representation. /// @@ -30134,77 +32591,70 @@ pub mod exports { pub fn new(val: T) -> Self { Self::type_guard::(); let val: _NetworkRep = Some(val); - let ptr: *mut _NetworkRep = _rt::Box::into_raw(_rt::Box::new(val)); + let ptr: *mut _NetworkRep = _rt::Box::into_raw( + _rt::Box::new(val), + ); unsafe { Self::from_handle(T::_resource_new(ptr.cast())) } } - /// Gets access to the underlying `T` which represents this resource. pub fn get(&self) -> &T { let ptr = unsafe { &*self.as_ptr::() }; ptr.as_ref().unwrap() } - /// Gets mutable access to the underlying `T` which represents this /// resource. pub fn get_mut(&mut self) -> &mut T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_mut().unwrap() } - /// Consumes this resource and returns the underlying `T`. pub fn into_inner(self) -> T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.take().unwrap() } - #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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) } - - // It's theoretically possible to implement the `GuestNetwork` trait twice - // so guard against using it with two different types here. #[doc(hidden)] fn type_guard() { use core::any::TypeId; static mut LAST_TYPE: Option = None; unsafe { - assert!(!cfg!(target_feature = "threads")); + assert!(! cfg!(target_feature = "atomics")); let id = TypeId::of::(); match LAST_TYPE { - Some(ty) => assert!( - ty == id, - "cannot use two types with this resource type" - ), + Some(ty) => { + assert!( + ty == id, "cannot use two types with this resource type" + ) + } None => LAST_TYPE = Some(id), } } } - #[doc(hidden)] pub unsafe fn dtor(handle: *mut u8) { Self::type_guard::(); - let _ = _rt::Box::from_raw(handle as *mut _NetworkRep); + let _ = unsafe { + _rt::Box::from_raw(handle as *mut _NetworkRep) + }; } - fn as_ptr(&self) -> *mut _NetworkRep { Network::type_guard::(); T::_resource_rep(self.handle()).cast() } } - /// A borrowed version of [`Network`] which represents a borrowed value /// with the lifetime `'a`. #[derive(Debug)] @@ -30213,7 +32663,6 @@ pub mod exports { rep: *mut u8, _marker: core::marker::PhantomData<&'a Network>, } - impl<'a> NetworkBorrow<'a> { #[doc(hidden)] pub unsafe fn lift(rep: usize) -> Self { @@ -30222,41 +32671,34 @@ pub mod exports { _marker: core::marker::PhantomData, } } - /// Gets access to the underlying `T` in this resource. pub fn get(&self) -> &T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_ref().unwrap() } - - // NB: mutable access is not allowed due to the component model allowing - // multiple borrows of the same resource. - fn as_ptr(&self) -> *mut _NetworkRep { Network::type_guard::(); self.rep.cast() } } - unsafe impl _rt::WasmResource for Network { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]wasi:sockets/network@0.2.0")] - extern "C" { + #[link( + wasm_import_module = "[export]wasi:sockets/network@0.2.0" + )] + unsafe extern "C" { #[link_name = "[resource-drop]network"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - /// Error codes. /// /// In theory, every API can return any error code. @@ -30270,7 +32712,7 @@ pub mod exports { /// /// See each individual API for what the POSIX equivalents are. They sometimes differ per API. #[repr(u8)] - #[derive(Clone, Copy, Eq, PartialEq)] + #[derive(Clone, Copy, Eq, Ord, PartialEq, PartialOrd)] pub enum ErrorCode { /// Unknown error Unknown, @@ -30354,55 +32796,100 @@ pub mod exports { ErrorCode::ConnectionAborted => "connection-aborted", ErrorCode::DatagramTooLarge => "datagram-too-large", ErrorCode::NameUnresolvable => "name-unresolvable", - ErrorCode::TemporaryResolverFailure => "temporary-resolver-failure", - ErrorCode::PermanentResolverFailure => "permanent-resolver-failure", + ErrorCode::TemporaryResolverFailure => { + "temporary-resolver-failure" + } + ErrorCode::PermanentResolverFailure => { + "permanent-resolver-failure" + } } } pub fn message(&self) -> &'static str { match self { - ErrorCode::Unknown => "Unknown error", - ErrorCode::AccessDenied => "Access denied. + ErrorCode::Unknown => "Unknown error", + ErrorCode::AccessDenied => { + "Access denied. - POSIX equivalent: EACCES, EPERM", - ErrorCode::NotSupported => "The operation is not supported. + POSIX equivalent: EACCES, EPERM" + } + ErrorCode::NotSupported => { + "The operation is not supported. - POSIX equivalent: EOPNOTSUPP", - ErrorCode::InvalidArgument => "One of the arguments is invalid. + POSIX equivalent: EOPNOTSUPP" + } + ErrorCode::InvalidArgument => { + "One of the arguments is invalid. - POSIX equivalent: EINVAL", - ErrorCode::OutOfMemory => "Not enough memory to complete the operation. + POSIX equivalent: EINVAL" + } + ErrorCode::OutOfMemory => { + "Not enough memory to complete the operation. - POSIX equivalent: ENOMEM, ENOBUFS, EAI_MEMORY", - ErrorCode::Timeout => "The operation timed out before it could finish completely.", - ErrorCode::ConcurrencyConflict => "This operation is incompatible with another asynchronous operation that is already in progress. + POSIX equivalent: ENOMEM, ENOBUFS, EAI_MEMORY" + } + ErrorCode::Timeout => { + "The operation timed out before it could finish completely." + } + ErrorCode::ConcurrencyConflict => { + "This operation is incompatible with another asynchronous operation that is already in progress. - POSIX equivalent: EALREADY", - ErrorCode::NotInProgress => "Trying to finish an asynchronous operation that: + POSIX equivalent: EALREADY" + } + ErrorCode::NotInProgress => { + "Trying to finish an asynchronous operation that: - has not been started yet, or: - was already finished by a previous `finish-*` call. - Note: this is scheduled to be removed when `future`s are natively supported.", - ErrorCode::WouldBlock => "The operation has been aborted because it could not be completed immediately. + Note: this is scheduled to be removed when `future`s are natively supported." + } + ErrorCode::WouldBlock => { + "The operation has been aborted because it could not be completed immediately. - Note: this is scheduled to be removed when `future`s are natively supported.", - ErrorCode::InvalidState => "The operation is not valid in the socket's current state.", - ErrorCode::NewSocketLimit => "A new socket resource could not be created because of a system limit.", - ErrorCode::AddressNotBindable => "A bind operation failed because the provided address is not an address that the `network` can bind to.", - ErrorCode::AddressInUse => "A bind operation failed because the provided address is already in use or because there are no ephemeral ports available.", - ErrorCode::RemoteUnreachable => "The remote address is not reachable", - ErrorCode::ConnectionRefused => "The TCP connection was forcefully rejected", - ErrorCode::ConnectionReset => "The TCP connection was reset.", - ErrorCode::ConnectionAborted => "A TCP connection was aborted.", - ErrorCode::DatagramTooLarge => "The size of a datagram sent to a UDP socket exceeded the maximum - supported size.", - ErrorCode::NameUnresolvable => "Name does not exist or has no suitable associated IP addresses.", - ErrorCode::TemporaryResolverFailure => "A temporary failure in name resolution occurred.", - ErrorCode::PermanentResolverFailure => "A permanent failure in name resolution occurred.", - } + Note: this is scheduled to be removed when `future`s are natively supported." + } + ErrorCode::InvalidState => { + "The operation is not valid in the socket's current state." + } + ErrorCode::NewSocketLimit => { + "A new socket resource could not be created because of a system limit." + } + ErrorCode::AddressNotBindable => { + "A bind operation failed because the provided address is not an address that the `network` can bind to." + } + ErrorCode::AddressInUse => { + "A bind operation failed because the provided address is already in use or because there are no ephemeral ports available." + } + ErrorCode::RemoteUnreachable => { + "The remote address is not reachable" + } + ErrorCode::ConnectionRefused => { + "The TCP connection was forcefully rejected" + } + ErrorCode::ConnectionReset => "The TCP connection was reset.", + ErrorCode::ConnectionAborted => { + "A TCP connection was aborted." + } + ErrorCode::DatagramTooLarge => { + "The size of a datagram sent to a UDP socket exceeded the maximum + supported size." + } + ErrorCode::NameUnresolvable => { + "Name does not exist or has no suitable associated IP addresses." + } + ErrorCode::TemporaryResolverFailure => { + "A temporary failure in name resolution occurred." + } + ErrorCode::PermanentResolverFailure => { + "A permanent failure in name resolution occurred." + } + } } } impl ::core::fmt::Debug for ErrorCode { - 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("ErrorCode") .field("code", &(*self as i32)) .field("name", &self.name()) @@ -30411,20 +32898,20 @@ pub mod exports { } } impl ::core::fmt::Display for ErrorCode { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - write!(f, "{} (error {})", self.name(), *self as i32) + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { + write!(f, "{} (error {})", self.name(), * self as i32) } } - impl std::error::Error for ErrorCode {} - impl ErrorCode { #[doc(hidden)] pub unsafe fn _lift(val: u8) -> ErrorCode { if !cfg!(debug_assertions) { return ::core::mem::transmute(val); } - match val { 0 => ErrorCode::Unknown, 1 => ErrorCode::AccessDenied, @@ -30447,14 +32934,12 @@ pub mod exports { 18 => ErrorCode::NameUnresolvable, 19 => ErrorCode::TemporaryResolverFailure, 20 => ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), } } } - #[repr(u8)] - #[derive(Clone, Copy, Eq, PartialEq)] + #[derive(Clone, Copy, Eq, Ord, PartialEq, PartialOrd)] pub enum IpAddressFamily { /// Similar to `AF_INET` in POSIX. Ipv4, @@ -30462,7 +32947,10 @@ pub mod exports { Ipv6, } impl ::core::fmt::Debug for IpAddressFamily { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { IpAddressFamily::Ipv4 => { f.debug_tuple("IpAddressFamily::Ipv4").finish() @@ -30473,23 +32961,19 @@ pub mod exports { } } } - impl IpAddressFamily { #[doc(hidden)] pub unsafe fn _lift(val: u8) -> IpAddressFamily { if !cfg!(debug_assertions) { return ::core::mem::transmute(val); } - match val { 0 => IpAddressFamily::Ipv4, 1 => IpAddressFamily::Ipv6, - _ => panic!("invalid enum discriminant"), } } } - pub type Ipv4Address = (u8, u8, u8, u8); pub type Ipv6Address = (u16, u16, u16, u16, u16, u16, u16, u16); #[derive(Clone, Copy)] @@ -30498,7 +32982,10 @@ pub mod exports { Ipv6(Ipv6Address), } impl ::core::fmt::Debug for IpAddress { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { IpAddress::Ipv4(e) => { f.debug_tuple("IpAddress::Ipv4").field(e).finish() @@ -30518,7 +33005,10 @@ pub mod exports { pub address: Ipv4Address, } impl ::core::fmt::Debug for Ipv4SocketAddress { - 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("Ipv4SocketAddress") .field("port", &self.port) .field("address", &self.address) @@ -30538,7 +33028,10 @@ pub mod exports { pub scope_id: u32, } impl ::core::fmt::Debug for Ipv6SocketAddress { - 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("Ipv6SocketAddress") .field("port", &self.port) .field("flow-info", &self.flow_info) @@ -30553,7 +33046,10 @@ pub mod exports { Ipv6(Ipv6SocketAddress), } impl ::core::fmt::Debug for IpSocketAddress { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { IpSocketAddress::Ipv4(e) => { f.debug_tuple("IpSocketAddress::Ipv4").field(e).finish() @@ -30578,18 +33074,18 @@ pub mod exports { let _ = val; unreachable!(); } - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]wasi:sockets/network@0.2.0")] - extern "C" { + #[link( + wasm_import_module = "[export]wasi:sockets/network@0.2.0" + )] + unsafe extern "C" { #[link_name = "[resource-new]network"] fn new(_: *mut u8) -> u32; } - new(val) + unsafe { new(val) } } } - #[doc(hidden)] fn _resource_rep(handle: u32) -> *mut u8 where @@ -30600,11 +33096,12 @@ pub mod exports { let _ = handle; unreachable!(); } - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]wasi:sockets/network@0.2.0")] - extern "C" { + #[link( + wasm_import_module = "[export]wasi:sockets/network@0.2.0" + )] + unsafe extern "C" { #[link_name = "[resource-rep]network"] fn rep(_: u32) -> *mut u8; } @@ -30613,45 +33110,33 @@ pub mod exports { } } #[doc(hidden)] - - macro_rules! __export_wasi_sockets_network_0_2_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - - const _: () = { - #[doc(hidden)] - #[export_name = "wasi:sockets/network@0.2.0#[dtor]network"] - #[allow(non_snake_case)] - unsafe extern "C" fn dtor(rep: *mut u8) { - $($path_to_types)*::Network::dtor::< - <$ty as $($path_to_types)*::Guest>::Network - >(rep) - } - }; - - };); - } + macro_rules! __export_wasi_sockets_network_0_2_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { const _ : () = { #[doc(hidden)] #[unsafe + (export_name = "wasi:sockets/network@0.2.0#[dtor]network")] + #[allow(non_snake_case)] unsafe extern "C" fn dtor(rep : * mut + u8) { unsafe { $($path_to_types)*:: Network::dtor::< <$ty as + $($path_to_types)*:: Guest >::Network > (rep) } } }; }; + }; + } #[doc(hidden)] pub(crate) use __export_wasi_sockets_network_0_2_0_cabi; } - - #[allow(dead_code, clippy::all)] + /// This interface provides a value-export of the default network handle.. + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod instance_network { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; - pub type Network = - super::super::super::super::exports::wasi::sockets::network::Network; - pub type NetworkBorrow<'a> = - super::super::super::super::exports::wasi::sockets::network::NetworkBorrow<'a>; + pub type Network = super::super::super::super::exports::wasi::sockets::network::Network; + pub type NetworkBorrow<'a> = super::super::super::super::exports::wasi::sockets::network::NetworkBorrow< + 'a, + >; #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_instance_network_cabi() -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::instance_network(); (result0).take_handle() as i32 } @@ -30660,41 +33145,35 @@ pub mod exports { fn instance_network() -> Network; } #[doc(hidden)] - - macro_rules! __export_wasi_sockets_instance_network_0_2_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "wasi:sockets/instance-network@0.2.0#instance-network"] - unsafe extern "C" fn export_instance_network() -> i32 { - $($path_to_types)*::_export_instance_network_cabi::<$ty>() - } - };); - } + macro_rules! __export_wasi_sockets_instance_network_0_2_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "wasi:sockets/instance-network@0.2.0#instance-network")] unsafe + extern "C" fn export_instance_network() -> i32 { unsafe { + $($path_to_types)*:: _export_instance_network_cabi::<$ty > () } } + }; + }; + } #[doc(hidden)] pub(crate) use __export_wasi_sockets_instance_network_0_2_0_cabi; } - - #[allow(dead_code, clippy::all)] + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod udp { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; pub type Pollable = super::super::super::super::exports::wasi::io::poll::Pollable; - pub type PollableBorrow<'a> = - super::super::super::super::exports::wasi::io::poll::PollableBorrow<'a>; - pub type Network = - super::super::super::super::exports::wasi::sockets::network::Network; - pub type NetworkBorrow<'a> = - super::super::super::super::exports::wasi::sockets::network::NetworkBorrow<'a>; - pub type ErrorCode = - super::super::super::super::exports::wasi::sockets::network::ErrorCode; - pub type IpSocketAddress = - super::super::super::super::exports::wasi::sockets::network::IpSocketAddress; - pub type IpAddressFamily = - super::super::super::super::exports::wasi::sockets::network::IpAddressFamily; + pub type PollableBorrow<'a> = super::super::super::super::exports::wasi::io::poll::PollableBorrow< + 'a, + >; + pub type Network = super::super::super::super::exports::wasi::sockets::network::Network; + pub type NetworkBorrow<'a> = super::super::super::super::exports::wasi::sockets::network::NetworkBorrow< + 'a, + >; + pub type ErrorCode = super::super::super::super::exports::wasi::sockets::network::ErrorCode; + pub type IpSocketAddress = super::super::super::super::exports::wasi::sockets::network::IpSocketAddress; + pub type IpAddressFamily = super::super::super::super::exports::wasi::sockets::network::IpAddressFamily; /// A received datagram. #[derive(Clone)] pub struct IncomingDatagram { @@ -30710,7 +33189,10 @@ pub mod exports { pub remote_address: IpSocketAddress, } impl ::core::fmt::Debug for IncomingDatagram { - 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("IncomingDatagram") .field("data", &self.data) .field("remote-address", &self.remote_address) @@ -30732,7 +33214,10 @@ pub mod exports { pub remote_address: Option, } impl ::core::fmt::Debug for OutgoingDatagram { - 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("OutgoingDatagram") .field("data", &self.data) .field("remote-address", &self.remote_address) @@ -30740,15 +33225,12 @@ pub mod exports { } } /// A UDP socket handle. - #[derive(Debug)] #[repr(transparent)] pub struct UdpSocket { handle: _rt::Resource, } - type _UdpSocketRep = Option; - impl UdpSocket { /// Creates a new resource from the specified representation. /// @@ -30758,77 +33240,70 @@ pub mod exports { pub fn new(val: T) -> Self { Self::type_guard::(); let val: _UdpSocketRep = Some(val); - let ptr: *mut _UdpSocketRep = _rt::Box::into_raw(_rt::Box::new(val)); + let ptr: *mut _UdpSocketRep = _rt::Box::into_raw( + _rt::Box::new(val), + ); unsafe { Self::from_handle(T::_resource_new(ptr.cast())) } } - /// Gets access to the underlying `T` which represents this resource. pub fn get(&self) -> &T { let ptr = unsafe { &*self.as_ptr::() }; ptr.as_ref().unwrap() } - /// Gets mutable access to the underlying `T` which represents this /// resource. pub fn get_mut(&mut self) -> &mut T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_mut().unwrap() } - /// Consumes this resource and returns the underlying `T`. pub fn into_inner(self) -> T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.take().unwrap() } - #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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) } - - // It's theoretically possible to implement the `GuestUdpSocket` trait twice - // so guard against using it with two different types here. #[doc(hidden)] fn type_guard() { use core::any::TypeId; static mut LAST_TYPE: Option = None; unsafe { - assert!(!cfg!(target_feature = "threads")); + assert!(! cfg!(target_feature = "atomics")); let id = TypeId::of::(); match LAST_TYPE { - Some(ty) => assert!( - ty == id, - "cannot use two types with this resource type" - ), + Some(ty) => { + assert!( + ty == id, "cannot use two types with this resource type" + ) + } None => LAST_TYPE = Some(id), } } } - #[doc(hidden)] pub unsafe fn dtor(handle: *mut u8) { Self::type_guard::(); - let _ = _rt::Box::from_raw(handle as *mut _UdpSocketRep); + let _ = unsafe { + _rt::Box::from_raw(handle as *mut _UdpSocketRep) + }; } - fn as_ptr(&self) -> *mut _UdpSocketRep { UdpSocket::type_guard::(); T::_resource_rep(self.handle()).cast() } } - /// A borrowed version of [`UdpSocket`] which represents a borrowed value /// with the lifetime `'a`. #[derive(Debug)] @@ -30837,7 +33312,6 @@ pub mod exports { rep: *mut u8, _marker: core::marker::PhantomData<&'a UdpSocket>, } - impl<'a> UdpSocketBorrow<'a> { #[doc(hidden)] pub unsafe fn lift(rep: usize) -> Self { @@ -30846,49 +33320,40 @@ pub mod exports { _marker: core::marker::PhantomData, } } - /// Gets access to the underlying `T` in this resource. pub fn get(&self) -> &T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_ref().unwrap() } - - // NB: mutable access is not allowed due to the component model allowing - // multiple borrows of the same resource. - fn as_ptr(&self) -> *mut _UdpSocketRep { UdpSocket::type_guard::(); self.rep.cast() } } - unsafe impl _rt::WasmResource for UdpSocket { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]wasi:sockets/udp@0.2.0")] - extern "C" { + #[link( + wasm_import_module = "[export]wasi:sockets/udp@0.2.0" + )] + unsafe extern "C" { #[link_name = "[resource-drop]udp-socket"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - #[derive(Debug)] #[repr(transparent)] pub struct IncomingDatagramStream { handle: _rt::Resource, } - type _IncomingDatagramStreamRep = Option; - impl IncomingDatagramStream { /// Creates a new resource from the specified representation. /// @@ -30898,72 +33363,67 @@ pub mod exports { pub fn new(val: T) -> Self { Self::type_guard::(); let val: _IncomingDatagramStreamRep = Some(val); - let ptr: *mut _IncomingDatagramStreamRep = - _rt::Box::into_raw(_rt::Box::new(val)); + let ptr: *mut _IncomingDatagramStreamRep = _rt::Box::into_raw( + _rt::Box::new(val), + ); unsafe { Self::from_handle(T::_resource_new(ptr.cast())) } } - /// Gets access to the underlying `T` which represents this resource. pub fn get(&self) -> &T { let ptr = unsafe { &*self.as_ptr::() }; ptr.as_ref().unwrap() } - /// Gets mutable access to the underlying `T` which represents this /// resource. pub fn get_mut(&mut self) -> &mut T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_mut().unwrap() } - /// Consumes this resource and returns the underlying `T`. pub fn into_inner(self) -> T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.take().unwrap() } - #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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) } - - // It's theoretically possible to implement the `GuestIncomingDatagramStream` trait twice - // so guard against using it with two different types here. #[doc(hidden)] fn type_guard() { use core::any::TypeId; static mut LAST_TYPE: Option = None; unsafe { - assert!(!cfg!(target_feature = "threads")); + assert!(! cfg!(target_feature = "atomics")); let id = TypeId::of::(); match LAST_TYPE { - Some(ty) => assert!( - ty == id, - "cannot use two types with this resource type" - ), + Some(ty) => { + assert!( + ty == id, "cannot use two types with this resource type" + ) + } None => LAST_TYPE = Some(id), } } } - #[doc(hidden)] pub unsafe fn dtor(handle: *mut u8) { Self::type_guard::(); - let _ = _rt::Box::from_raw(handle as *mut _IncomingDatagramStreamRep); + let _ = unsafe { + _rt::Box::from_raw( + handle as *mut _IncomingDatagramStreamRep, + ) + }; } - fn as_ptr( &self, ) -> *mut _IncomingDatagramStreamRep { @@ -30971,7 +33431,6 @@ pub mod exports { T::_resource_rep(self.handle()).cast() } } - /// A borrowed version of [`IncomingDatagramStream`] which represents a borrowed value /// with the lifetime `'a`. #[derive(Debug)] @@ -30980,7 +33439,6 @@ pub mod exports { rep: *mut u8, _marker: core::marker::PhantomData<&'a IncomingDatagramStream>, } - impl<'a> IncomingDatagramStreamBorrow<'a> { #[doc(hidden)] pub unsafe fn lift(rep: usize) -> Self { @@ -30989,49 +33447,40 @@ pub mod exports { _marker: core::marker::PhantomData, } } - /// Gets access to the underlying `T` in this resource. pub fn get(&self) -> &T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_ref().unwrap() } - - // NB: mutable access is not allowed due to the component model allowing - // multiple borrows of the same resource. - fn as_ptr(&self) -> *mut _IncomingDatagramStreamRep { IncomingDatagramStream::type_guard::(); self.rep.cast() } } - unsafe impl _rt::WasmResource for IncomingDatagramStream { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]wasi:sockets/udp@0.2.0")] - extern "C" { + #[link( + wasm_import_module = "[export]wasi:sockets/udp@0.2.0" + )] + unsafe extern "C" { #[link_name = "[resource-drop]incoming-datagram-stream"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - #[derive(Debug)] #[repr(transparent)] pub struct OutgoingDatagramStream { handle: _rt::Resource, } - type _OutgoingDatagramStreamRep = Option; - impl OutgoingDatagramStream { /// Creates a new resource from the specified representation. /// @@ -31041,72 +33490,67 @@ pub mod exports { pub fn new(val: T) -> Self { Self::type_guard::(); let val: _OutgoingDatagramStreamRep = Some(val); - let ptr: *mut _OutgoingDatagramStreamRep = - _rt::Box::into_raw(_rt::Box::new(val)); + let ptr: *mut _OutgoingDatagramStreamRep = _rt::Box::into_raw( + _rt::Box::new(val), + ); unsafe { Self::from_handle(T::_resource_new(ptr.cast())) } } - /// Gets access to the underlying `T` which represents this resource. pub fn get(&self) -> &T { let ptr = unsafe { &*self.as_ptr::() }; ptr.as_ref().unwrap() } - /// Gets mutable access to the underlying `T` which represents this /// resource. pub fn get_mut(&mut self) -> &mut T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_mut().unwrap() } - /// Consumes this resource and returns the underlying `T`. pub fn into_inner(self) -> T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.take().unwrap() } - #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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) } - - // It's theoretically possible to implement the `GuestOutgoingDatagramStream` trait twice - // so guard against using it with two different types here. #[doc(hidden)] fn type_guard() { use core::any::TypeId; static mut LAST_TYPE: Option = None; unsafe { - assert!(!cfg!(target_feature = "threads")); + assert!(! cfg!(target_feature = "atomics")); let id = TypeId::of::(); match LAST_TYPE { - Some(ty) => assert!( - ty == id, - "cannot use two types with this resource type" - ), + Some(ty) => { + assert!( + ty == id, "cannot use two types with this resource type" + ) + } None => LAST_TYPE = Some(id), } } } - #[doc(hidden)] pub unsafe fn dtor(handle: *mut u8) { Self::type_guard::(); - let _ = _rt::Box::from_raw(handle as *mut _OutgoingDatagramStreamRep); + let _ = unsafe { + _rt::Box::from_raw( + handle as *mut _OutgoingDatagramStreamRep, + ) + }; } - fn as_ptr( &self, ) -> *mut _OutgoingDatagramStreamRep { @@ -31114,7 +33558,6 @@ pub mod exports { T::_resource_rep(self.handle()).cast() } } - /// A borrowed version of [`OutgoingDatagramStream`] which represents a borrowed value /// with the lifetime `'a`. #[derive(Debug)] @@ -31123,7 +33566,6 @@ pub mod exports { rep: *mut u8, _marker: core::marker::PhantomData<&'a OutgoingDatagramStream>, } - impl<'a> OutgoingDatagramStreamBorrow<'a> { #[doc(hidden)] pub unsafe fn lift(rep: usize) -> Self { @@ -31132,44 +33574,39 @@ pub mod exports { _marker: core::marker::PhantomData, } } - /// Gets access to the underlying `T` in this resource. pub fn get(&self) -> &T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_ref().unwrap() } - - // NB: mutable access is not allowed due to the component model allowing - // multiple borrows of the same resource. - fn as_ptr(&self) -> *mut _OutgoingDatagramStreamRep { OutgoingDatagramStream::type_guard::(); self.rep.cast() } } - unsafe impl _rt::WasmResource for OutgoingDatagramStream { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]wasi:sockets/udp@0.2.0")] - extern "C" { + #[link( + wasm_import_module = "[export]wasi:sockets/udp@0.2.0" + )] + unsafe extern "C" { #[link_name = "[resource-drop]outgoing-datagram-stream"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_udp_socket_start_bind_cabi( + pub unsafe fn _export_method_udp_socket_start_bind_cabi< + T: GuestUdpSocket, + >( arg0: *mut u8, arg1: i32, arg2: i32, @@ -31185,34 +33622,42 @@ pub mod exports { arg12: i32, arg13: i32, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); use super::super::super::super::exports::wasi::sockets::network::IpSocketAddress as V0; let v0 = match arg2 { 0 => { - let e0 = super::super::super::super::exports::wasi::sockets::network::Ipv4SocketAddress{ - port: arg3 as u16, - address: (arg4 as u8, arg5 as u8, arg6 as u8, arg7 as u8), - }; + let e0 = super::super::super::super::exports::wasi::sockets::network::Ipv4SocketAddress { + port: arg3 as u16, + address: (arg4 as u8, arg5 as u8, arg6 as u8, arg7 as u8), + }; V0::Ipv4(e0) } n => { debug_assert_eq!(n, 1, "invalid enum discriminant"); - let e0 = super::super::super::super::exports::wasi::sockets::network::Ipv6SocketAddress{ - port: arg3 as u16, - flow_info: arg4 as u32, - address: (arg5 as u16, arg6 as u16, arg7 as u16, arg8 as u16, arg9 as u16, arg10 as u16, arg11 as u16, arg12 as u16), - scope_id: arg13 as u32, - }; + let e0 = super::super::super::super::exports::wasi::sockets::network::Ipv6SocketAddress { + port: arg3 as u16, + flow_info: arg4 as u32, + address: ( + arg5 as u16, + arg6 as u16, + arg7 as u16, + arg8 as u16, + arg9 as u16, + arg10 as u16, + arg11 as u16, + arg12 as u16, + ), + scope_id: arg13 as u32, + }; V0::Ipv6(e0) } }; let result1 = T::start_bind( - UdpSocketBorrow::lift(arg0 as u32 as usize).get(), - NetworkBorrow::lift(arg1 as u32 as usize), + unsafe { UdpSocketBorrow::lift(arg0 as u32 as usize) }.get(), + unsafe { NetworkBorrow::lift(arg1 as u32 as usize) }, v0, ); - let ptr2 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr2 = (&raw mut _RET_AREA.0).cast::(); match result1 { Ok(_) => { *ptr2.add(0).cast::() = (0i32) as u8; @@ -31226,13 +33671,14 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_udp_socket_finish_bind_cabi( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = T::finish_bind(UdpSocketBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + pub unsafe fn _export_method_udp_socket_finish_bind_cabi< + T: GuestUdpSocket, + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::finish_bind( + unsafe { UdpSocketBorrow::lift(arg0 as u32 as usize) }.get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(_) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -31262,10 +33708,9 @@ pub mod exports { arg12: i32, arg13: i32, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result1 = T::stream( - UdpSocketBorrow::lift(arg0 as u32 as usize).get(), + unsafe { UdpSocketBorrow::lift(arg0 as u32 as usize) }.get(), match arg1 { 0 => None, 1 => { @@ -31273,24 +33718,32 @@ pub mod exports { use super::super::super::super::exports::wasi::sockets::network::IpSocketAddress as V0; let v0 = match arg2 { 0 => { - let e0 = super::super::super::super::exports::wasi::sockets::network::Ipv4SocketAddress{ - port: arg3 as u16, - address: (arg4 as u8, arg5 as u8, arg6 as u8, arg7 as u8), - }; + let e0 = super::super::super::super::exports::wasi::sockets::network::Ipv4SocketAddress { + port: arg3 as u16, + address: (arg4 as u8, arg5 as u8, arg6 as u8, arg7 as u8), + }; V0::Ipv4(e0) } n => { debug_assert_eq!(n, 1, "invalid enum discriminant"); - let e0 = super::super::super::super::exports::wasi::sockets::network::Ipv6SocketAddress{ - port: arg3 as u16, - flow_info: arg4 as u32, - address: (arg5 as u16, arg6 as u16, arg7 as u16, arg8 as u16, arg9 as u16, arg10 as u16, arg11 as u16, arg12 as u16), - scope_id: arg13 as u32, - }; + let e0 = super::super::super::super::exports::wasi::sockets::network::Ipv6SocketAddress { + port: arg3 as u16, + flow_info: arg4 as u32, + address: ( + arg5 as u16, + arg6 as u16, + arg7 as u16, + arg8 as u16, + arg9 as u16, + arg10 as u16, + arg11 as u16, + arg12 as u16, + ), + scope_id: arg13 as u32, + }; V0::Ipv6(e0) } }; - v0 }; Some(e) @@ -31298,7 +33751,7 @@ pub mod exports { _ => _rt::invalid_enum_discriminant(), }, ); - let ptr2 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr2 = (&raw mut _RET_AREA.0).cast::(); match result1 { Ok(e) => { *ptr2.add(0).cast::() = (0i32) as u8; @@ -31315,14 +33768,14 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_udp_socket_local_address_cabi( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::local_address(UdpSocketBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + pub unsafe fn _export_method_udp_socket_local_address_cabi< + T: GuestUdpSocket, + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::local_address( + unsafe { UdpSocketBorrow::lift(arg0 as u32 as usize) }.get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -31330,7 +33783,10 @@ pub mod exports { match e { V6::Ipv4(e) => { *ptr1.add(4).cast::() = (0i32) as u8; - let super::super::super::super::exports::wasi::sockets::network::Ipv4SocketAddress{ port:port2, address:address2, } = e; + let super::super::super::super::exports::wasi::sockets::network::Ipv4SocketAddress { + port: port2, + address: address2, + } = e; *ptr1.add(8).cast::() = (_rt::as_i32(port2)) as u16; let (t3_0, t3_1, t3_2, t3_3) = address2; *ptr1.add(10).cast::() = (_rt::as_i32(t3_0)) as u8; @@ -31340,7 +33796,12 @@ pub mod exports { } V6::Ipv6(e) => { *ptr1.add(4).cast::() = (1i32) as u8; - let super::super::super::super::exports::wasi::sockets::network::Ipv6SocketAddress{ port:port4, flow_info:flow_info4, address:address4, scope_id:scope_id4, } = e; + let super::super::super::super::exports::wasi::sockets::network::Ipv6SocketAddress { + port: port4, + flow_info: flow_info4, + address: address4, + scope_id: scope_id4, + } = e; *ptr1.add(8).cast::() = (_rt::as_i32(port4)) as u16; *ptr1.add(12).cast::() = _rt::as_i32(flow_info4); let (t5_0, t5_1, t5_2, t5_3, t5_4, t5_5, t5_6, t5_7) = address4; @@ -31365,14 +33826,14 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_udp_socket_remote_address_cabi( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::remote_address(UdpSocketBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + pub unsafe fn _export_method_udp_socket_remote_address_cabi< + T: GuestUdpSocket, + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::remote_address( + unsafe { UdpSocketBorrow::lift(arg0 as u32 as usize) }.get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -31380,7 +33841,10 @@ pub mod exports { match e { V6::Ipv4(e) => { *ptr1.add(4).cast::() = (0i32) as u8; - let super::super::super::super::exports::wasi::sockets::network::Ipv4SocketAddress{ port:port2, address:address2, } = e; + let super::super::super::super::exports::wasi::sockets::network::Ipv4SocketAddress { + port: port2, + address: address2, + } = e; *ptr1.add(8).cast::() = (_rt::as_i32(port2)) as u16; let (t3_0, t3_1, t3_2, t3_3) = address2; *ptr1.add(10).cast::() = (_rt::as_i32(t3_0)) as u8; @@ -31390,7 +33854,12 @@ pub mod exports { } V6::Ipv6(e) => { *ptr1.add(4).cast::() = (1i32) as u8; - let super::super::super::super::exports::wasi::sockets::network::Ipv6SocketAddress{ port:port4, flow_info:flow_info4, address:address4, scope_id:scope_id4, } = e; + let super::super::super::super::exports::wasi::sockets::network::Ipv6SocketAddress { + port: port4, + flow_info: flow_info4, + address: address4, + scope_id: scope_id4, + } = e; *ptr1.add(8).cast::() = (_rt::as_i32(port4)) as u16; *ptr1.add(12).cast::() = _rt::as_i32(flow_info4); let (t5_0, t5_1, t5_2, t5_3, t5_4, t5_5, t5_6, t5_7) = address4; @@ -31415,27 +33884,25 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_udp_socket_address_family_cabi( - arg0: *mut u8, - ) -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::address_family(UdpSocketBorrow::lift(arg0 as u32 as usize).get()); + pub unsafe fn _export_method_udp_socket_address_family_cabi< + T: GuestUdpSocket, + >(arg0: *mut u8) -> i32 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::address_family( + unsafe { UdpSocketBorrow::lift(arg0 as u32 as usize) }.get(), + ); result0.clone() as i32 } #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_method_udp_socket_unicast_hop_limit_cabi< T: GuestUdpSocket, - >( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::unicast_hop_limit(UdpSocketBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::unicast_hop_limit( + unsafe { UdpSocketBorrow::lift(arg0 as u32 as usize) }.get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -31452,17 +33919,13 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_udp_socket_set_unicast_hop_limit_cabi< T: GuestUdpSocket, - >( - arg0: *mut u8, - arg1: i32, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + >(arg0: *mut u8, arg1: i32) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::set_unicast_hop_limit( - UdpSocketBorrow::lift(arg0 as u32 as usize).get(), + unsafe { UdpSocketBorrow::lift(arg0 as u32 as usize) }.get(), arg1 as u8, ); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(_) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -31478,14 +33941,12 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_udp_socket_receive_buffer_size_cabi< T: GuestUdpSocket, - >( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::receive_buffer_size(UdpSocketBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::receive_buffer_size( + unsafe { UdpSocketBorrow::lift(arg0 as u32 as usize) }.get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -31502,17 +33963,13 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_udp_socket_set_receive_buffer_size_cabi< T: GuestUdpSocket, - >( - arg0: *mut u8, - arg1: i64, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + >(arg0: *mut u8, arg1: i64) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::set_receive_buffer_size( - UdpSocketBorrow::lift(arg0 as u32 as usize).get(), + unsafe { UdpSocketBorrow::lift(arg0 as u32 as usize) }.get(), arg1 as u64, ); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(_) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -31526,14 +33983,14 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_udp_socket_send_buffer_size_cabi( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::send_buffer_size(UdpSocketBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + pub unsafe fn _export_method_udp_socket_send_buffer_size_cabi< + T: GuestUdpSocket, + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::send_buffer_size( + unsafe { UdpSocketBorrow::lift(arg0 as u32 as usize) }.get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -31550,17 +34007,13 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_udp_socket_set_send_buffer_size_cabi< T: GuestUdpSocket, - >( - arg0: *mut u8, - arg1: i64, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + >(arg0: *mut u8, arg1: i64) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::set_send_buffer_size( - UdpSocketBorrow::lift(arg0 as u32 as usize).get(), + unsafe { UdpSocketBorrow::lift(arg0 as u32 as usize) }.get(), arg1 as u64, ); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(_) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -31574,36 +34027,38 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_udp_socket_subscribe_cabi( - arg0: *mut u8, - ) -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = T::subscribe(UdpSocketBorrow::lift(arg0 as u32 as usize).get()); + pub unsafe fn _export_method_udp_socket_subscribe_cabi< + T: GuestUdpSocket, + >(arg0: *mut u8) -> i32 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::subscribe( + unsafe { UdpSocketBorrow::lift(arg0 as u32 as usize) }.get(), + ); (result0).take_handle() as i32 } - #[doc(hidden)] - #[allow(non_snake_case)] - pub unsafe fn _export_method_incoming_datagram_stream_receive_cabi< - T: GuestIncomingDatagramStream, - >( - arg0: *mut u8, - arg1: i64, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[doc(hidden)] + #[allow(non_snake_case)] + pub unsafe fn _export_method_incoming_datagram_stream_receive_cabi< + T: GuestIncomingDatagramStream, + >(arg0: *mut u8, arg1: i64) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::receive( - IncomingDatagramStreamBorrow::lift(arg0 as u32 as usize).get(), + unsafe { + IncomingDatagramStreamBorrow::lift(arg0 as u32 as usize) + } + .get(), arg1 as u64, ); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; let vec9 = e; let len9 = vec9.len(); - let layout9 = - _rt::alloc::Layout::from_size_align_unchecked(vec9.len() * 40, 4); + let layout9 = _rt::alloc::Layout::from_size_align_unchecked( + vec9.len() * (32 + 2 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); let result9 = if layout9.size() != 0 { let ptr = _rt::alloc::alloc(layout9).cast::(); if ptr.is_null() { @@ -31611,12 +34066,11 @@ pub mod exports { } ptr } else { - { - ::core::ptr::null_mut() - } + ::core::ptr::null_mut() }; for (i, e) in vec9.into_iter().enumerate() { - let base = result9.add(i * 40); + let base = result9 + .add(i * (32 + 2 * ::core::mem::size_of::<*const u8>())); { let IncomingDatagram { data: data2, @@ -31626,56 +34080,97 @@ pub mod exports { let ptr3 = vec3.as_ptr().cast::(); let len3 = vec3.len(); ::core::mem::forget(vec3); - *base.add(4).cast::() = len3; + *base + .add(::core::mem::size_of::<*const u8>()) + .cast::() = len3; *base.add(0).cast::<*mut u8>() = ptr3.cast_mut(); use super::super::super::super::exports::wasi::sockets::network::IpSocketAddress as V8; match remote_address2 { V8::Ipv4(e) => { - *base.add(8).cast::() = (0i32) as u8; - let super::super::super::super::exports::wasi::sockets::network::Ipv4SocketAddress{ port:port4, address:address4, } = e; - *base.add(12).cast::() = - (_rt::as_i32(port4)) as u16; + *base + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::() = (0i32) as u8; + let super::super::super::super::exports::wasi::sockets::network::Ipv4SocketAddress { + port: port4, + address: address4, + } = e; + *base + .add(4 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = (_rt::as_i32(port4)) as u16; let (t5_0, t5_1, t5_2, t5_3) = address4; - *base.add(14).cast::() = (_rt::as_i32(t5_0)) as u8; - *base.add(15).cast::() = (_rt::as_i32(t5_1)) as u8; - *base.add(16).cast::() = (_rt::as_i32(t5_2)) as u8; - *base.add(17).cast::() = (_rt::as_i32(t5_3)) as u8; + *base + .add(6 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = (_rt::as_i32(t5_0)) as u8; + *base + .add(7 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = (_rt::as_i32(t5_1)) as u8; + *base + .add(8 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = (_rt::as_i32(t5_2)) as u8; + *base + .add(9 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = (_rt::as_i32(t5_3)) as u8; } V8::Ipv6(e) => { - *base.add(8).cast::() = (1i32) as u8; - let super::super::super::super::exports::wasi::sockets::network::Ipv6SocketAddress{ port:port6, flow_info:flow_info6, address:address6, scope_id:scope_id6, } = e; - *base.add(12).cast::() = - (_rt::as_i32(port6)) as u16; - *base.add(16).cast::() = _rt::as_i32(flow_info6); - let (t7_0, t7_1, t7_2, t7_3, t7_4, t7_5, t7_6, t7_7) = - address6; - *base.add(20).cast::() = - (_rt::as_i32(t7_0)) as u16; - *base.add(22).cast::() = - (_rt::as_i32(t7_1)) as u16; - *base.add(24).cast::() = - (_rt::as_i32(t7_2)) as u16; - *base.add(26).cast::() = - (_rt::as_i32(t7_3)) as u16; - *base.add(28).cast::() = - (_rt::as_i32(t7_4)) as u16; - *base.add(30).cast::() = - (_rt::as_i32(t7_5)) as u16; - *base.add(32).cast::() = - (_rt::as_i32(t7_6)) as u16; - *base.add(34).cast::() = - (_rt::as_i32(t7_7)) as u16; - *base.add(36).cast::() = _rt::as_i32(scope_id6); + *base + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::() = (1i32) as u8; + let super::super::super::super::exports::wasi::sockets::network::Ipv6SocketAddress { + port: port6, + flow_info: flow_info6, + address: address6, + scope_id: scope_id6, + } = e; + *base + .add(4 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = (_rt::as_i32(port6)) as u16; + *base + .add(8 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = _rt::as_i32(flow_info6); + let (t7_0, t7_1, t7_2, t7_3, t7_4, t7_5, t7_6, t7_7) = address6; + *base + .add(12 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = (_rt::as_i32(t7_0)) as u16; + *base + .add(14 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = (_rt::as_i32(t7_1)) as u16; + *base + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = (_rt::as_i32(t7_2)) as u16; + *base + .add(18 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = (_rt::as_i32(t7_3)) as u16; + *base + .add(20 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = (_rt::as_i32(t7_4)) as u16; + *base + .add(22 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = (_rt::as_i32(t7_5)) as u16; + *base + .add(24 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = (_rt::as_i32(t7_6)) as u16; + *base + .add(26 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = (_rt::as_i32(t7_7)) as u16; + *base + .add(28 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::() = _rt::as_i32(scope_id6); } } } } - *ptr1.add(8).cast::() = len9; - *ptr1.add(4).cast::<*mut u8>() = result9; + *ptr1 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::() = len9; + *ptr1 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>() = result9; } Err(e) => { *ptr1.add(0).cast::() = (1i32) as u8; - *ptr1.add(4).cast::() = (e.clone() as i32) as u8; + *ptr1 + .add(::core::mem::size_of::<*const u8>()) + .cast::() = (e.clone() as i32) as u8; } }; ptr1 @@ -31684,42 +34179,51 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn __post_return_method_incoming_datagram_stream_receive< T: GuestIncomingDatagramStream, - >( - arg0: *mut u8, - ) { + >(arg0: *mut u8) { let l0 = i32::from(*arg0.add(0).cast::()); match l0 { 0 => { - let l4 = *arg0.add(4).cast::<*mut u8>(); - let l5 = *arg0.add(8).cast::(); - let base6 = l4; - let len6 = l5; + let l1 = *arg0 + .add(::core::mem::size_of::<*const u8>()) + .cast::<*mut u8>(); + let l2 = *arg0 + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let base6 = l1; + let len6 = l2; for i in 0..len6 { - let base = base6.add(i * 40); + let base = base6 + .add(i * (32 + 2 * ::core::mem::size_of::<*const u8>())); { - let l1 = *base.add(0).cast::<*mut u8>(); - let l2 = *base.add(4).cast::(); - let base3 = l1; - let len3 = l2; - _rt::cabi_dealloc(base3, len3 * 1, 1); - } - } - _rt::cabi_dealloc(base6, len6 * 40, 4); + let l3 = *base.add(0).cast::<*mut u8>(); + let l4 = *base + .add(::core::mem::size_of::<*const u8>()) + .cast::(); + let base5 = l3; + let len5 = l4; + _rt::cabi_dealloc(base5, len5 * 1, 1); + } + } + _rt::cabi_dealloc( + base6, + len6 * (32 + 2 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); } - _ => (), + _ => {} } } #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_method_incoming_datagram_stream_subscribe_cabi< T: GuestIncomingDatagramStream, - >( - arg0: *mut u8, - ) -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + >(arg0: *mut u8) -> i32 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::subscribe( - IncomingDatagramStreamBorrow::lift(arg0 as u32 as usize).get(), + unsafe { + IncomingDatagramStreamBorrow::lift(arg0 as u32 as usize) + } + .get(), ); (result0).take_handle() as i32 } @@ -31727,15 +34231,15 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_outgoing_datagram_stream_check_send_cabi< T: GuestOutgoingDatagramStream, - >( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::check_send( - OutgoingDatagramStreamBorrow::lift(arg0 as u32 as usize).get(), + unsafe { + OutgoingDatagramStreamBorrow::lift(arg0 as u32 as usize) + } + .get(), ); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -31752,91 +34256,145 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_outgoing_datagram_stream_send_cabi< T: GuestOutgoingDatagramStream, - >( - arg0: *mut u8, - arg1: *mut u8, - arg2: usize, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + >(arg0: *mut u8, arg1: *mut u8, arg2: usize) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let base22 = arg1; let len22 = arg2; let mut result22 = _rt::Vec::with_capacity(len22); for i in 0..len22 { - let base = base22.add(i * 44); + let base = base22 + .add(i * (32 + 3 * ::core::mem::size_of::<*const u8>())); let e22 = { let l0 = *base.add(0).cast::<*mut u8>(); - let l1 = *base.add(4).cast::(); + let l1 = *base + .add(::core::mem::size_of::<*const u8>()) + .cast::(); let len2 = l1; - let l3 = i32::from(*base.add(8).cast::()); - + let l3 = i32::from( + *base + .add(2 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); OutgoingDatagram { data: _rt::Vec::from_raw_parts(l0.cast(), len2, len2), remote_address: match l3 { 0 => None, 1 => { let e = { - let l4 = i32::from(*base.add(12).cast::()); + let l4 = i32::from( + *base + .add(4 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); use super::super::super::super::exports::wasi::sockets::network::IpSocketAddress as V21; let v21 = match l4 { 0 => { let e21 = { - let l5 = - i32::from(*base.add(16).cast::()); - let l6 = - i32::from(*base.add(18).cast::()); - let l7 = - i32::from(*base.add(19).cast::()); - let l8 = - i32::from(*base.add(20).cast::()); - let l9 = - i32::from(*base.add(21).cast::()); - - super::super::super::super::exports::wasi::sockets::network::Ipv4SocketAddress{ - port: l5 as u16, - address: (l6 as u8, l7 as u8, l8 as u8, l9 as u8), - } + let l5 = i32::from( + *base + .add(8 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + let l6 = i32::from( + *base + .add(10 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + let l7 = i32::from( + *base + .add(11 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + let l8 = i32::from( + *base + .add(12 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + let l9 = i32::from( + *base + .add(13 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + super::super::super::super::exports::wasi::sockets::network::Ipv4SocketAddress { + port: l5 as u16, + address: (l6 as u8, l7 as u8, l8 as u8, l9 as u8), + } }; V21::Ipv4(e21) } n => { - debug_assert_eq!( - n, 1, - "invalid enum discriminant" - ); + debug_assert_eq!(n, 1, "invalid enum discriminant"); let e21 = { - let l10 = - i32::from(*base.add(16).cast::()); - let l11 = *base.add(20).cast::(); - let l12 = - i32::from(*base.add(24).cast::()); - let l13 = - i32::from(*base.add(26).cast::()); - let l14 = - i32::from(*base.add(28).cast::()); - let l15 = - i32::from(*base.add(30).cast::()); - let l16 = - i32::from(*base.add(32).cast::()); - let l17 = - i32::from(*base.add(34).cast::()); - let l18 = - i32::from(*base.add(36).cast::()); - let l19 = - i32::from(*base.add(38).cast::()); - let l20 = *base.add(40).cast::(); - - super::super::super::super::exports::wasi::sockets::network::Ipv6SocketAddress{ - port: l10 as u16, - flow_info: l11 as u32, - address: (l12 as u16, l13 as u16, l14 as u16, l15 as u16, l16 as u16, l17 as u16, l18 as u16, l19 as u16), - scope_id: l20 as u32, - } + let l10 = i32::from( + *base + .add(8 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + let l11 = *base + .add(12 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + let l12 = i32::from( + *base + .add(16 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + let l13 = i32::from( + *base + .add(18 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + let l14 = i32::from( + *base + .add(20 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + let l15 = i32::from( + *base + .add(22 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + let l16 = i32::from( + *base + .add(24 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + let l17 = i32::from( + *base + .add(26 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + let l18 = i32::from( + *base + .add(28 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + let l19 = i32::from( + *base + .add(30 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(), + ); + let l20 = *base + .add(32 + 2 * ::core::mem::size_of::<*const u8>()) + .cast::(); + super::super::super::super::exports::wasi::sockets::network::Ipv6SocketAddress { + port: l10 as u16, + flow_info: l11 as u32, + address: ( + l12 as u16, + l13 as u16, + l14 as u16, + l15 as u16, + l16 as u16, + l17 as u16, + l18 as u16, + l19 as u16, + ), + scope_id: l20 as u32, + } }; V21::Ipv6(e21) } }; - v21 }; Some(e) @@ -31847,12 +34405,19 @@ pub mod exports { }; result22.push(e22); } - _rt::cabi_dealloc(base22, len22 * 44, 4); + _rt::cabi_dealloc( + base22, + len22 * (32 + 3 * ::core::mem::size_of::<*const u8>()), + ::core::mem::size_of::<*const u8>(), + ); let result23 = T::send( - OutgoingDatagramStreamBorrow::lift(arg0 as u32 as usize).get(), + unsafe { + OutgoingDatagramStreamBorrow::lift(arg0 as u32 as usize) + } + .get(), result22, ); - let ptr24 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr24 = (&raw mut _RET_AREA.0).cast::(); match result23 { Ok(e) => { *ptr24.add(0).cast::() = (0i32) as u8; @@ -31869,13 +34434,13 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_outgoing_datagram_stream_subscribe_cabi< T: GuestOutgoingDatagramStream, - >( - arg0: *mut u8, - ) -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + >(arg0: *mut u8) -> i32 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::subscribe( - OutgoingDatagramStreamBorrow::lift(arg0 as u32 as usize).get(), + unsafe { + OutgoingDatagramStreamBorrow::lift(arg0 as u32 as usize) + } + .get(), ); (result0).take_handle() as i32 } @@ -31895,18 +34460,18 @@ pub mod exports { let _ = val; unreachable!(); } - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]wasi:sockets/udp@0.2.0")] - extern "C" { + #[link( + wasm_import_module = "[export]wasi:sockets/udp@0.2.0" + )] + unsafe extern "C" { #[link_name = "[resource-new]udp-socket"] fn new(_: *mut u8) -> u32; } - new(val) + unsafe { new(val) } } } - #[doc(hidden)] fn _resource_rep(handle: u32) -> *mut u8 where @@ -31917,18 +34482,18 @@ pub mod exports { let _ = handle; unreachable!(); } - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]wasi:sockets/udp@0.2.0")] - extern "C" { + #[link( + wasm_import_module = "[export]wasi:sockets/udp@0.2.0" + )] + unsafe extern "C" { #[link_name = "[resource-rep]udp-socket"] fn rep(_: u32) -> *mut u8; } unsafe { rep(handle) } } } - /// Bind the socket to a specific network on the provided IP address and port. /// /// If the IP address is zero (`0.0.0.0` in IPv4, `::` in IPv6), it is left to the implementation to decide which @@ -31978,10 +34543,10 @@ pub mod exports { /// The POSIX equivalent in pseudo-code is: /// ```text /// if (was previously connected) { - /// connect(s, AF_UNSPEC) + /// connect(s, AF_UNSPEC) /// } /// if (remote_address is Some) { - /// connect(s, remote_address) + /// connect(s, remote_address) /// } /// ``` /// @@ -32004,7 +34569,10 @@ pub mod exports { fn stream( &self, remote_address: Option, - ) -> Result<(IncomingDatagramStream, OutgoingDatagramStream), ErrorCode>; + ) -> Result< + (IncomingDatagramStream, OutgoingDatagramStream), + ErrorCode, + >; /// Get the current bound address. /// /// POSIX mentions: @@ -32056,7 +34624,10 @@ pub mod exports { /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. fn receive_buffer_size(&self) -> Result; - fn set_receive_buffer_size(&self, value: u64) -> Result<(), ErrorCode>; + fn set_receive_buffer_size( + &self, + value: u64, + ) -> Result<(), ErrorCode>; fn send_buffer_size(&self) -> Result; fn set_send_buffer_size(&self, value: u64) -> Result<(), ErrorCode>; /// Create a `pollable` which will resolve once the socket is ready for I/O. @@ -32076,18 +34647,18 @@ pub mod exports { let _ = val; unreachable!(); } - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]wasi:sockets/udp@0.2.0")] - extern "C" { + #[link( + wasm_import_module = "[export]wasi:sockets/udp@0.2.0" + )] + unsafe extern "C" { #[link_name = "[resource-new]incoming-datagram-stream"] fn new(_: *mut u8) -> u32; } - new(val) + unsafe { new(val) } } } - #[doc(hidden)] fn _resource_rep(handle: u32) -> *mut u8 where @@ -32098,18 +34669,18 @@ pub mod exports { let _ = handle; unreachable!(); } - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]wasi:sockets/udp@0.2.0")] - extern "C" { + #[link( + wasm_import_module = "[export]wasi:sockets/udp@0.2.0" + )] + unsafe extern "C" { #[link_name = "[resource-rep]incoming-datagram-stream"] fn rep(_: u32) -> *mut u8; } unsafe { rep(handle) } } } - /// Receive messages on the socket. /// /// This function attempts to receive up to `max-results` datagrams on the socket without blocking. @@ -32154,18 +34725,18 @@ pub mod exports { let _ = val; unreachable!(); } - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]wasi:sockets/udp@0.2.0")] - extern "C" { + #[link( + wasm_import_module = "[export]wasi:sockets/udp@0.2.0" + )] + unsafe extern "C" { #[link_name = "[resource-new]outgoing-datagram-stream"] fn new(_: *mut u8) -> u32; } - new(val) + unsafe { new(val) } } } - #[doc(hidden)] fn _resource_rep(handle: u32) -> *mut u8 where @@ -32176,18 +34747,18 @@ pub mod exports { let _ = handle; unreachable!(); } - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]wasi:sockets/udp@0.2.0")] - extern "C" { + #[link( + wasm_import_module = "[export]wasi:sockets/udp@0.2.0" + )] + unsafe extern "C" { #[link_name = "[resource-rep]outgoing-datagram-stream"] fn rep(_: u32) -> *mut u8; } unsafe { rep(handle) } } } - /// Check readiness for sending. This function never blocks. /// /// Returns the number of datagrams permitted for the next call to `send`, @@ -32234,8 +34805,10 @@ pub mod exports { /// - /// - /// - - fn send(&self, datagrams: _rt::Vec) - -> Result; + fn send( + &self, + datagrams: _rt::Vec, + ) -> Result; /// Create a `pollable` which will resolve once the stream is ready to send again. /// /// Note: this function is here for WASI Preview2 only. @@ -32243,156 +34816,196 @@ pub mod exports { fn subscribe(&self) -> Pollable; } #[doc(hidden)] - - macro_rules! __export_wasi_sockets_udp_0_2_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "wasi:sockets/udp@0.2.0#[method]udp-socket.start-bind"] - unsafe extern "C" fn export_method_udp_socket_start_bind(arg0: *mut u8,arg1: i32,arg2: i32,arg3: i32,arg4: i32,arg5: i32,arg6: i32,arg7: i32,arg8: i32,arg9: i32,arg10: i32,arg11: i32,arg12: i32,arg13: i32,) -> *mut u8 { - $($path_to_types)*::_export_method_udp_socket_start_bind_cabi::<<$ty as $($path_to_types)*::Guest>::UdpSocket>(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13) - } - #[export_name = "wasi:sockets/udp@0.2.0#[method]udp-socket.finish-bind"] - unsafe extern "C" fn export_method_udp_socket_finish_bind(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_udp_socket_finish_bind_cabi::<<$ty as $($path_to_types)*::Guest>::UdpSocket>(arg0) - } - #[export_name = "wasi:sockets/udp@0.2.0#[method]udp-socket.stream"] - unsafe extern "C" fn export_method_udp_socket_stream(arg0: *mut u8,arg1: i32,arg2: i32,arg3: i32,arg4: i32,arg5: i32,arg6: i32,arg7: i32,arg8: i32,arg9: i32,arg10: i32,arg11: i32,arg12: i32,arg13: i32,) -> *mut u8 { - $($path_to_types)*::_export_method_udp_socket_stream_cabi::<<$ty as $($path_to_types)*::Guest>::UdpSocket>(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13) - } - #[export_name = "wasi:sockets/udp@0.2.0#[method]udp-socket.local-address"] - unsafe extern "C" fn export_method_udp_socket_local_address(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_udp_socket_local_address_cabi::<<$ty as $($path_to_types)*::Guest>::UdpSocket>(arg0) - } - #[export_name = "wasi:sockets/udp@0.2.0#[method]udp-socket.remote-address"] - unsafe extern "C" fn export_method_udp_socket_remote_address(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_udp_socket_remote_address_cabi::<<$ty as $($path_to_types)*::Guest>::UdpSocket>(arg0) - } - #[export_name = "wasi:sockets/udp@0.2.0#[method]udp-socket.address-family"] - unsafe extern "C" fn export_method_udp_socket_address_family(arg0: *mut u8,) -> i32 { - $($path_to_types)*::_export_method_udp_socket_address_family_cabi::<<$ty as $($path_to_types)*::Guest>::UdpSocket>(arg0) - } - #[export_name = "wasi:sockets/udp@0.2.0#[method]udp-socket.unicast-hop-limit"] - unsafe extern "C" fn export_method_udp_socket_unicast_hop_limit(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_udp_socket_unicast_hop_limit_cabi::<<$ty as $($path_to_types)*::Guest>::UdpSocket>(arg0) - } - #[export_name = "wasi:sockets/udp@0.2.0#[method]udp-socket.set-unicast-hop-limit"] - unsafe extern "C" fn export_method_udp_socket_set_unicast_hop_limit(arg0: *mut u8,arg1: i32,) -> *mut u8 { - $($path_to_types)*::_export_method_udp_socket_set_unicast_hop_limit_cabi::<<$ty as $($path_to_types)*::Guest>::UdpSocket>(arg0, arg1) - } - #[export_name = "wasi:sockets/udp@0.2.0#[method]udp-socket.receive-buffer-size"] - unsafe extern "C" fn export_method_udp_socket_receive_buffer_size(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_udp_socket_receive_buffer_size_cabi::<<$ty as $($path_to_types)*::Guest>::UdpSocket>(arg0) - } - #[export_name = "wasi:sockets/udp@0.2.0#[method]udp-socket.set-receive-buffer-size"] - unsafe extern "C" fn export_method_udp_socket_set_receive_buffer_size(arg0: *mut u8,arg1: i64,) -> *mut u8 { - $($path_to_types)*::_export_method_udp_socket_set_receive_buffer_size_cabi::<<$ty as $($path_to_types)*::Guest>::UdpSocket>(arg0, arg1) - } - #[export_name = "wasi:sockets/udp@0.2.0#[method]udp-socket.send-buffer-size"] - unsafe extern "C" fn export_method_udp_socket_send_buffer_size(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_udp_socket_send_buffer_size_cabi::<<$ty as $($path_to_types)*::Guest>::UdpSocket>(arg0) - } - #[export_name = "wasi:sockets/udp@0.2.0#[method]udp-socket.set-send-buffer-size"] - unsafe extern "C" fn export_method_udp_socket_set_send_buffer_size(arg0: *mut u8,arg1: i64,) -> *mut u8 { - $($path_to_types)*::_export_method_udp_socket_set_send_buffer_size_cabi::<<$ty as $($path_to_types)*::Guest>::UdpSocket>(arg0, arg1) - } - #[export_name = "wasi:sockets/udp@0.2.0#[method]udp-socket.subscribe"] - unsafe extern "C" fn export_method_udp_socket_subscribe(arg0: *mut u8,) -> i32 { - $($path_to_types)*::_export_method_udp_socket_subscribe_cabi::<<$ty as $($path_to_types)*::Guest>::UdpSocket>(arg0) - } - #[export_name = "wasi:sockets/udp@0.2.0#[method]incoming-datagram-stream.receive"] - unsafe extern "C" fn export_method_incoming_datagram_stream_receive(arg0: *mut u8,arg1: i64,) -> *mut u8 { - $($path_to_types)*::_export_method_incoming_datagram_stream_receive_cabi::<<$ty as $($path_to_types)*::Guest>::IncomingDatagramStream>(arg0, arg1) - } - #[export_name = "cabi_post_wasi:sockets/udp@0.2.0#[method]incoming-datagram-stream.receive"] - unsafe extern "C" fn _post_return_method_incoming_datagram_stream_receive(arg0: *mut u8,) { - $($path_to_types)*::__post_return_method_incoming_datagram_stream_receive::<<$ty as $($path_to_types)*::Guest>::IncomingDatagramStream>(arg0) - } - #[export_name = "wasi:sockets/udp@0.2.0#[method]incoming-datagram-stream.subscribe"] - unsafe extern "C" fn export_method_incoming_datagram_stream_subscribe(arg0: *mut u8,) -> i32 { - $($path_to_types)*::_export_method_incoming_datagram_stream_subscribe_cabi::<<$ty as $($path_to_types)*::Guest>::IncomingDatagramStream>(arg0) - } - #[export_name = "wasi:sockets/udp@0.2.0#[method]outgoing-datagram-stream.check-send"] - unsafe extern "C" fn export_method_outgoing_datagram_stream_check_send(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_outgoing_datagram_stream_check_send_cabi::<<$ty as $($path_to_types)*::Guest>::OutgoingDatagramStream>(arg0) - } - #[export_name = "wasi:sockets/udp@0.2.0#[method]outgoing-datagram-stream.send"] - unsafe extern "C" fn export_method_outgoing_datagram_stream_send(arg0: *mut u8,arg1: *mut u8,arg2: usize,) -> *mut u8 { - $($path_to_types)*::_export_method_outgoing_datagram_stream_send_cabi::<<$ty as $($path_to_types)*::Guest>::OutgoingDatagramStream>(arg0, arg1, arg2) - } - #[export_name = "wasi:sockets/udp@0.2.0#[method]outgoing-datagram-stream.subscribe"] - unsafe extern "C" fn export_method_outgoing_datagram_stream_subscribe(arg0: *mut u8,) -> i32 { - $($path_to_types)*::_export_method_outgoing_datagram_stream_subscribe_cabi::<<$ty as $($path_to_types)*::Guest>::OutgoingDatagramStream>(arg0) - } - - const _: () = { - #[doc(hidden)] - #[export_name = "wasi:sockets/udp@0.2.0#[dtor]udp-socket"] - #[allow(non_snake_case)] - unsafe extern "C" fn dtor(rep: *mut u8) { - $($path_to_types)*::UdpSocket::dtor::< - <$ty as $($path_to_types)*::Guest>::UdpSocket - >(rep) - } - }; - - - const _: () = { - #[doc(hidden)] - #[export_name = "wasi:sockets/udp@0.2.0#[dtor]incoming-datagram-stream"] - #[allow(non_snake_case)] - unsafe extern "C" fn dtor(rep: *mut u8) { - $($path_to_types)*::IncomingDatagramStream::dtor::< - <$ty as $($path_to_types)*::Guest>::IncomingDatagramStream - >(rep) - } - }; - - - const _: () = { - #[doc(hidden)] - #[export_name = "wasi:sockets/udp@0.2.0#[dtor]outgoing-datagram-stream"] - #[allow(non_snake_case)] - unsafe extern "C" fn dtor(rep: *mut u8) { - $($path_to_types)*::OutgoingDatagramStream::dtor::< - <$ty as $($path_to_types)*::Guest>::OutgoingDatagramStream - >(rep) - } - }; - - };); - } + macro_rules! __export_wasi_sockets_udp_0_2_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "wasi:sockets/udp@0.2.0#[method]udp-socket.start-bind")] unsafe + extern "C" fn export_method_udp_socket_start_bind(arg0 : * mut + u8, arg1 : i32, arg2 : i32, arg3 : i32, arg4 : i32, arg5 : i32, + arg6 : i32, arg7 : i32, arg8 : i32, arg9 : i32, arg10 : i32, + arg11 : i32, arg12 : i32, arg13 : i32,) -> * mut u8 { unsafe { + $($path_to_types)*:: + _export_method_udp_socket_start_bind_cabi::<<$ty as + $($path_to_types)*:: Guest >::UdpSocket > (arg0, arg1, arg2, + arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, + arg13) } } #[unsafe (export_name = + "wasi:sockets/udp@0.2.0#[method]udp-socket.finish-bind")] unsafe + extern "C" fn export_method_udp_socket_finish_bind(arg0 : * mut + u8,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_udp_socket_finish_bind_cabi::<<$ty as + $($path_to_types)*:: Guest >::UdpSocket > (arg0) } } #[unsafe + (export_name = + "wasi:sockets/udp@0.2.0#[method]udp-socket.stream")] unsafe + extern "C" fn export_method_udp_socket_stream(arg0 : * mut u8, + arg1 : i32, arg2 : i32, arg3 : i32, arg4 : i32, arg5 : i32, arg6 + : i32, arg7 : i32, arg8 : i32, arg9 : i32, arg10 : i32, arg11 : + i32, arg12 : i32, arg13 : i32,) -> * mut u8 { unsafe { + $($path_to_types)*:: _export_method_udp_socket_stream_cabi::<<$ty + as $($path_to_types)*:: Guest >::UdpSocket > (arg0, arg1, arg2, + arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, + arg13) } } #[unsafe (export_name = + "wasi:sockets/udp@0.2.0#[method]udp-socket.local-address")] + unsafe extern "C" fn export_method_udp_socket_local_address(arg0 + : * mut u8,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_udp_socket_local_address_cabi::<<$ty as + $($path_to_types)*:: Guest >::UdpSocket > (arg0) } } #[unsafe + (export_name = + "wasi:sockets/udp@0.2.0#[method]udp-socket.remote-address")] + unsafe extern "C" fn export_method_udp_socket_remote_address(arg0 + : * mut u8,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_udp_socket_remote_address_cabi::<<$ty as + $($path_to_types)*:: Guest >::UdpSocket > (arg0) } } #[unsafe + (export_name = + "wasi:sockets/udp@0.2.0#[method]udp-socket.address-family")] + unsafe extern "C" fn export_method_udp_socket_address_family(arg0 + : * mut u8,) -> i32 { unsafe { $($path_to_types)*:: + _export_method_udp_socket_address_family_cabi::<<$ty as + $($path_to_types)*:: Guest >::UdpSocket > (arg0) } } #[unsafe + (export_name = + "wasi:sockets/udp@0.2.0#[method]udp-socket.unicast-hop-limit")] + unsafe extern "C" fn + export_method_udp_socket_unicast_hop_limit(arg0 : * mut u8,) -> * + mut u8 { unsafe { $($path_to_types)*:: + _export_method_udp_socket_unicast_hop_limit_cabi::<<$ty as + $($path_to_types)*:: Guest >::UdpSocket > (arg0) } } #[unsafe + (export_name = + "wasi:sockets/udp@0.2.0#[method]udp-socket.set-unicast-hop-limit")] + unsafe extern "C" fn + export_method_udp_socket_set_unicast_hop_limit(arg0 : * mut u8, + arg1 : i32,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_udp_socket_set_unicast_hop_limit_cabi::<<$ty as + $($path_to_types)*:: Guest >::UdpSocket > (arg0, arg1) } } + #[unsafe (export_name = + "wasi:sockets/udp@0.2.0#[method]udp-socket.receive-buffer-size")] + unsafe extern "C" fn + export_method_udp_socket_receive_buffer_size(arg0 : * mut u8,) -> + * mut u8 { unsafe { $($path_to_types)*:: + _export_method_udp_socket_receive_buffer_size_cabi::<<$ty as + $($path_to_types)*:: Guest >::UdpSocket > (arg0) } } #[unsafe + (export_name = + "wasi:sockets/udp@0.2.0#[method]udp-socket.set-receive-buffer-size")] + unsafe extern "C" fn + export_method_udp_socket_set_receive_buffer_size(arg0 : * mut u8, + arg1 : i64,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_udp_socket_set_receive_buffer_size_cabi::<<$ty as + $($path_to_types)*:: Guest >::UdpSocket > (arg0, arg1) } } + #[unsafe (export_name = + "wasi:sockets/udp@0.2.0#[method]udp-socket.send-buffer-size")] + unsafe extern "C" fn + export_method_udp_socket_send_buffer_size(arg0 : * mut u8,) -> * + mut u8 { unsafe { $($path_to_types)*:: + _export_method_udp_socket_send_buffer_size_cabi::<<$ty as + $($path_to_types)*:: Guest >::UdpSocket > (arg0) } } #[unsafe + (export_name = + "wasi:sockets/udp@0.2.0#[method]udp-socket.set-send-buffer-size")] + unsafe extern "C" fn + export_method_udp_socket_set_send_buffer_size(arg0 : * mut u8, + arg1 : i64,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_udp_socket_set_send_buffer_size_cabi::<<$ty as + $($path_to_types)*:: Guest >::UdpSocket > (arg0, arg1) } } + #[unsafe (export_name = + "wasi:sockets/udp@0.2.0#[method]udp-socket.subscribe")] unsafe + extern "C" fn export_method_udp_socket_subscribe(arg0 : * mut + u8,) -> i32 { unsafe { $($path_to_types)*:: + _export_method_udp_socket_subscribe_cabi::<<$ty as + $($path_to_types)*:: Guest >::UdpSocket > (arg0) } } #[unsafe + (export_name = + "wasi:sockets/udp@0.2.0#[method]incoming-datagram-stream.receive")] + unsafe extern "C" fn + export_method_incoming_datagram_stream_receive(arg0 : * mut u8, + arg1 : i64,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_incoming_datagram_stream_receive_cabi::<<$ty as + $($path_to_types)*:: Guest >::IncomingDatagramStream > (arg0, + arg1) } } #[unsafe (export_name = + "cabi_post_wasi:sockets/udp@0.2.0#[method]incoming-datagram-stream.receive")] + unsafe extern "C" fn + _post_return_method_incoming_datagram_stream_receive(arg0 : * mut + u8,) { unsafe { $($path_to_types)*:: + __post_return_method_incoming_datagram_stream_receive::<<$ty as + $($path_to_types)*:: Guest >::IncomingDatagramStream > (arg0) } } + #[unsafe (export_name = + "wasi:sockets/udp@0.2.0#[method]incoming-datagram-stream.subscribe")] + unsafe extern "C" fn + export_method_incoming_datagram_stream_subscribe(arg0 : * mut + u8,) -> i32 { unsafe { $($path_to_types)*:: + _export_method_incoming_datagram_stream_subscribe_cabi::<<$ty as + $($path_to_types)*:: Guest >::IncomingDatagramStream > (arg0) } } + #[unsafe (export_name = + "wasi:sockets/udp@0.2.0#[method]outgoing-datagram-stream.check-send")] + unsafe extern "C" fn + export_method_outgoing_datagram_stream_check_send(arg0 : * mut + u8,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_outgoing_datagram_stream_check_send_cabi::<<$ty as + $($path_to_types)*:: Guest >::OutgoingDatagramStream > (arg0) } } + #[unsafe (export_name = + "wasi:sockets/udp@0.2.0#[method]outgoing-datagram-stream.send")] + unsafe extern "C" fn + export_method_outgoing_datagram_stream_send(arg0 : * mut u8, arg1 + : * mut u8, arg2 : usize,) -> * mut u8 { unsafe { + $($path_to_types)*:: + _export_method_outgoing_datagram_stream_send_cabi::<<$ty as + $($path_to_types)*:: Guest >::OutgoingDatagramStream > (arg0, + arg1, arg2) } } #[unsafe (export_name = + "wasi:sockets/udp@0.2.0#[method]outgoing-datagram-stream.subscribe")] + unsafe extern "C" fn + export_method_outgoing_datagram_stream_subscribe(arg0 : * mut + u8,) -> i32 { unsafe { $($path_to_types)*:: + _export_method_outgoing_datagram_stream_subscribe_cabi::<<$ty as + $($path_to_types)*:: Guest >::OutgoingDatagramStream > (arg0) } } + const _ : () = { #[doc(hidden)] #[unsafe (export_name = + "wasi:sockets/udp@0.2.0#[dtor]udp-socket")] + #[allow(non_snake_case)] unsafe extern "C" fn dtor(rep : * mut + u8) { unsafe { $($path_to_types)*:: UdpSocket::dtor::< <$ty as + $($path_to_types)*:: Guest >::UdpSocket > (rep) } } }; const _ : + () = { #[doc(hidden)] #[unsafe (export_name = + "wasi:sockets/udp@0.2.0#[dtor]incoming-datagram-stream")] + #[allow(non_snake_case)] unsafe extern "C" fn dtor(rep : * mut + u8) { unsafe { $($path_to_types)*:: + IncomingDatagramStream::dtor::< <$ty as $($path_to_types)*:: + Guest >::IncomingDatagramStream > (rep) } } }; const _ : () = { + #[doc(hidden)] #[unsafe (export_name = + "wasi:sockets/udp@0.2.0#[dtor]outgoing-datagram-stream")] + #[allow(non_snake_case)] unsafe extern "C" fn dtor(rep : * mut + u8) { unsafe { $($path_to_types)*:: + OutgoingDatagramStream::dtor::< <$ty as $($path_to_types)*:: + Guest >::OutgoingDatagramStream > (rep) } } }; }; + }; + } #[doc(hidden)] pub(crate) use __export_wasi_sockets_udp_0_2_0_cabi; #[repr(align(8))] struct _RetArea([::core::mem::MaybeUninit; 36]); - static mut _RET_AREA: _RetArea = _RetArea([::core::mem::MaybeUninit::uninit(); 36]); + static mut _RET_AREA: _RetArea = _RetArea( + [::core::mem::MaybeUninit::uninit(); 36], + ); } - - #[allow(dead_code, clippy::all)] + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod udp_create_socket { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; - pub type NetworkBorrow<'a> = - super::super::super::super::exports::wasi::sockets::network::NetworkBorrow<'a>; - pub type ErrorCode = - super::super::super::super::exports::wasi::sockets::network::ErrorCode; - pub type IpAddressFamily = - super::super::super::super::exports::wasi::sockets::network::IpAddressFamily; - pub type UdpSocket = - super::super::super::super::exports::wasi::sockets::udp::UdpSocket; - pub type UdpSocketBorrow<'a> = - super::super::super::super::exports::wasi::sockets::udp::UdpSocketBorrow<'a>; - #[doc(hidden)] - #[allow(non_snake_case)] - pub unsafe fn _export_create_udp_socket_cabi(arg0: i32) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = T::create_udp_socket(super::super::super::super::exports::wasi::sockets::network::IpAddressFamily::_lift(arg0 as u8)); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + pub type NetworkBorrow<'a> = super::super::super::super::exports::wasi::sockets::network::NetworkBorrow< + 'a, + >; + pub type ErrorCode = super::super::super::super::exports::wasi::sockets::network::ErrorCode; + pub type IpAddressFamily = super::super::super::super::exports::wasi::sockets::network::IpAddressFamily; + pub type UdpSocket = super::super::super::super::exports::wasi::sockets::udp::UdpSocket; + pub type UdpSocketBorrow<'a> = super::super::super::super::exports::wasi::sockets::udp::UdpSocketBorrow< + 'a, + >; + #[doc(hidden)] + #[allow(non_snake_case)] + pub unsafe fn _export_create_udp_socket_cabi( + arg0: i32, + ) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::create_udp_socket( + super::super::super::super::exports::wasi::sockets::network::IpAddressFamily::_lift( + arg0 as u8, + ), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -32431,56 +35044,51 @@ pub mod exports { ) -> Result; } #[doc(hidden)] - - macro_rules! __export_wasi_sockets_udp_create_socket_0_2_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "wasi:sockets/udp-create-socket@0.2.0#create-udp-socket"] - unsafe extern "C" fn export_create_udp_socket(arg0: i32,) -> *mut u8 { - $($path_to_types)*::_export_create_udp_socket_cabi::<$ty>(arg0) - } - };); - } + macro_rules! __export_wasi_sockets_udp_create_socket_0_2_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "wasi:sockets/udp-create-socket@0.2.0#create-udp-socket")] unsafe + extern "C" fn export_create_udp_socket(arg0 : i32,) -> * mut u8 { + unsafe { $($path_to_types)*:: + _export_create_udp_socket_cabi::<$ty > (arg0) } } }; + }; + } #[doc(hidden)] pub(crate) use __export_wasi_sockets_udp_create_socket_0_2_0_cabi; #[repr(align(4))] struct _RetArea([::core::mem::MaybeUninit; 8]); - static mut _RET_AREA: _RetArea = _RetArea([::core::mem::MaybeUninit::uninit(); 8]); + static mut _RET_AREA: _RetArea = _RetArea( + [::core::mem::MaybeUninit::uninit(); 8], + ); } - - #[allow(dead_code, clippy::all)] + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod tcp { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; - pub type InputStream = - super::super::super::super::exports::wasi::io::streams::InputStream; - pub type InputStreamBorrow<'a> = - super::super::super::super::exports::wasi::io::streams::InputStreamBorrow<'a>; - pub type OutputStream = - super::super::super::super::exports::wasi::io::streams::OutputStream; - pub type OutputStreamBorrow<'a> = - super::super::super::super::exports::wasi::io::streams::OutputStreamBorrow<'a>; + pub type InputStream = super::super::super::super::exports::wasi::io::streams::InputStream; + pub type InputStreamBorrow<'a> = super::super::super::super::exports::wasi::io::streams::InputStreamBorrow< + 'a, + >; + pub type OutputStream = super::super::super::super::exports::wasi::io::streams::OutputStream; + pub type OutputStreamBorrow<'a> = super::super::super::super::exports::wasi::io::streams::OutputStreamBorrow< + 'a, + >; pub type Pollable = super::super::super::super::exports::wasi::io::poll::Pollable; - pub type PollableBorrow<'a> = - super::super::super::super::exports::wasi::io::poll::PollableBorrow<'a>; - pub type Duration = - super::super::super::super::exports::wasi::clocks::monotonic_clock::Duration; - pub type Network = - super::super::super::super::exports::wasi::sockets::network::Network; - pub type NetworkBorrow<'a> = - super::super::super::super::exports::wasi::sockets::network::NetworkBorrow<'a>; - pub type ErrorCode = - super::super::super::super::exports::wasi::sockets::network::ErrorCode; - pub type IpSocketAddress = - super::super::super::super::exports::wasi::sockets::network::IpSocketAddress; - pub type IpAddressFamily = - super::super::super::super::exports::wasi::sockets::network::IpAddressFamily; + pub type PollableBorrow<'a> = super::super::super::super::exports::wasi::io::poll::PollableBorrow< + 'a, + >; + pub type Duration = super::super::super::super::exports::wasi::clocks::monotonic_clock::Duration; + pub type Network = super::super::super::super::exports::wasi::sockets::network::Network; + pub type NetworkBorrow<'a> = super::super::super::super::exports::wasi::sockets::network::NetworkBorrow< + 'a, + >; + pub type ErrorCode = super::super::super::super::exports::wasi::sockets::network::ErrorCode; + pub type IpSocketAddress = super::super::super::super::exports::wasi::sockets::network::IpSocketAddress; + pub type IpAddressFamily = super::super::super::super::exports::wasi::sockets::network::IpAddressFamily; #[repr(u8)] - #[derive(Clone, Copy, Eq, PartialEq)] + #[derive(Clone, Copy, Eq, Ord, PartialEq, PartialOrd)] pub enum ShutdownType { /// Similar to `SHUT_RD` in POSIX. Receive, @@ -32490,34 +35098,37 @@ pub mod exports { Both, } impl ::core::fmt::Debug for ShutdownType { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { ShutdownType::Receive => { f.debug_tuple("ShutdownType::Receive").finish() } - ShutdownType::Send => f.debug_tuple("ShutdownType::Send").finish(), - ShutdownType::Both => f.debug_tuple("ShutdownType::Both").finish(), + ShutdownType::Send => { + f.debug_tuple("ShutdownType::Send").finish() + } + ShutdownType::Both => { + f.debug_tuple("ShutdownType::Both").finish() + } } } } - impl ShutdownType { #[doc(hidden)] pub unsafe fn _lift(val: u8) -> ShutdownType { if !cfg!(debug_assertions) { return ::core::mem::transmute(val); } - match val { 0 => ShutdownType::Receive, 1 => ShutdownType::Send, 2 => ShutdownType::Both, - _ => panic!("invalid enum discriminant"), } } } - /// A TCP socket resource. /// /// The socket can be in one of the following states: @@ -32539,15 +35150,12 @@ pub mod exports { /// In addition to the general error codes documented on the /// `network::error-code` type, TCP socket methods may always return /// `error(invalid-state)` when in the `closed` state. - #[derive(Debug)] #[repr(transparent)] pub struct TcpSocket { handle: _rt::Resource, } - type _TcpSocketRep = Option; - impl TcpSocket { /// Creates a new resource from the specified representation. /// @@ -32557,77 +35165,70 @@ pub mod exports { pub fn new(val: T) -> Self { Self::type_guard::(); let val: _TcpSocketRep = Some(val); - let ptr: *mut _TcpSocketRep = _rt::Box::into_raw(_rt::Box::new(val)); + let ptr: *mut _TcpSocketRep = _rt::Box::into_raw( + _rt::Box::new(val), + ); unsafe { Self::from_handle(T::_resource_new(ptr.cast())) } } - /// Gets access to the underlying `T` which represents this resource. pub fn get(&self) -> &T { let ptr = unsafe { &*self.as_ptr::() }; ptr.as_ref().unwrap() } - /// Gets mutable access to the underlying `T` which represents this /// resource. pub fn get_mut(&mut self) -> &mut T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_mut().unwrap() } - /// Consumes this resource and returns the underlying `T`. pub fn into_inner(self) -> T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.take().unwrap() } - #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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) } - - // It's theoretically possible to implement the `GuestTcpSocket` trait twice - // so guard against using it with two different types here. #[doc(hidden)] fn type_guard() { use core::any::TypeId; static mut LAST_TYPE: Option = None; unsafe { - assert!(!cfg!(target_feature = "threads")); + assert!(! cfg!(target_feature = "atomics")); let id = TypeId::of::(); match LAST_TYPE { - Some(ty) => assert!( - ty == id, - "cannot use two types with this resource type" - ), + Some(ty) => { + assert!( + ty == id, "cannot use two types with this resource type" + ) + } None => LAST_TYPE = Some(id), } } } - #[doc(hidden)] pub unsafe fn dtor(handle: *mut u8) { Self::type_guard::(); - let _ = _rt::Box::from_raw(handle as *mut _TcpSocketRep); + let _ = unsafe { + _rt::Box::from_raw(handle as *mut _TcpSocketRep) + }; } - fn as_ptr(&self) -> *mut _TcpSocketRep { TcpSocket::type_guard::(); T::_resource_rep(self.handle()).cast() } } - /// A borrowed version of [`TcpSocket`] which represents a borrowed value /// with the lifetime `'a`. #[derive(Debug)] @@ -32636,7 +35237,6 @@ pub mod exports { rep: *mut u8, _marker: core::marker::PhantomData<&'a TcpSocket>, } - impl<'a> TcpSocketBorrow<'a> { #[doc(hidden)] pub unsafe fn lift(rep: usize) -> Self { @@ -32645,44 +35245,39 @@ pub mod exports { _marker: core::marker::PhantomData, } } - /// Gets access to the underlying `T` in this resource. pub fn get(&self) -> &T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_ref().unwrap() } - - // NB: mutable access is not allowed due to the component model allowing - // multiple borrows of the same resource. - fn as_ptr(&self) -> *mut _TcpSocketRep { TcpSocket::type_guard::(); self.rep.cast() } } - unsafe impl _rt::WasmResource for TcpSocket { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]wasi:sockets/tcp@0.2.0")] - extern "C" { + #[link( + wasm_import_module = "[export]wasi:sockets/tcp@0.2.0" + )] + unsafe extern "C" { #[link_name = "[resource-drop]tcp-socket"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_tcp_socket_start_bind_cabi( + pub unsafe fn _export_method_tcp_socket_start_bind_cabi< + T: GuestTcpSocket, + >( arg0: *mut u8, arg1: i32, arg2: i32, @@ -32698,34 +35293,42 @@ pub mod exports { arg12: i32, arg13: i32, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); use super::super::super::super::exports::wasi::sockets::network::IpSocketAddress as V0; let v0 = match arg2 { 0 => { - let e0 = super::super::super::super::exports::wasi::sockets::network::Ipv4SocketAddress{ - port: arg3 as u16, - address: (arg4 as u8, arg5 as u8, arg6 as u8, arg7 as u8), - }; + let e0 = super::super::super::super::exports::wasi::sockets::network::Ipv4SocketAddress { + port: arg3 as u16, + address: (arg4 as u8, arg5 as u8, arg6 as u8, arg7 as u8), + }; V0::Ipv4(e0) } n => { debug_assert_eq!(n, 1, "invalid enum discriminant"); - let e0 = super::super::super::super::exports::wasi::sockets::network::Ipv6SocketAddress{ - port: arg3 as u16, - flow_info: arg4 as u32, - address: (arg5 as u16, arg6 as u16, arg7 as u16, arg8 as u16, arg9 as u16, arg10 as u16, arg11 as u16, arg12 as u16), - scope_id: arg13 as u32, - }; + let e0 = super::super::super::super::exports::wasi::sockets::network::Ipv6SocketAddress { + port: arg3 as u16, + flow_info: arg4 as u32, + address: ( + arg5 as u16, + arg6 as u16, + arg7 as u16, + arg8 as u16, + arg9 as u16, + arg10 as u16, + arg11 as u16, + arg12 as u16, + ), + scope_id: arg13 as u32, + }; V0::Ipv6(e0) } }; let result1 = T::start_bind( - TcpSocketBorrow::lift(arg0 as u32 as usize).get(), - NetworkBorrow::lift(arg1 as u32 as usize), + unsafe { TcpSocketBorrow::lift(arg0 as u32 as usize) }.get(), + unsafe { NetworkBorrow::lift(arg1 as u32 as usize) }, v0, ); - let ptr2 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr2 = (&raw mut _RET_AREA.0).cast::(); match result1 { Ok(_) => { *ptr2.add(0).cast::() = (0i32) as u8; @@ -32739,13 +35342,14 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_tcp_socket_finish_bind_cabi( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = T::finish_bind(TcpSocketBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + pub unsafe fn _export_method_tcp_socket_finish_bind_cabi< + T: GuestTcpSocket, + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::finish_bind( + unsafe { TcpSocketBorrow::lift(arg0 as u32 as usize) }.get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(_) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -32759,7 +35363,9 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_tcp_socket_start_connect_cabi( + pub unsafe fn _export_method_tcp_socket_start_connect_cabi< + T: GuestTcpSocket, + >( arg0: *mut u8, arg1: i32, arg2: i32, @@ -32775,34 +35381,42 @@ pub mod exports { arg12: i32, arg13: i32, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); use super::super::super::super::exports::wasi::sockets::network::IpSocketAddress as V0; let v0 = match arg2 { 0 => { - let e0 = super::super::super::super::exports::wasi::sockets::network::Ipv4SocketAddress{ - port: arg3 as u16, - address: (arg4 as u8, arg5 as u8, arg6 as u8, arg7 as u8), + let e0 = super::super::super::super::exports::wasi::sockets::network::Ipv4SocketAddress { + port: arg3 as u16, + address: (arg4 as u8, arg5 as u8, arg6 as u8, arg7 as u8), }; V0::Ipv4(e0) } n => { debug_assert_eq!(n, 1, "invalid enum discriminant"); - let e0 = super::super::super::super::exports::wasi::sockets::network::Ipv6SocketAddress{ - port: arg3 as u16, - flow_info: arg4 as u32, - address: (arg5 as u16, arg6 as u16, arg7 as u16, arg8 as u16, arg9 as u16, arg10 as u16, arg11 as u16, arg12 as u16), - scope_id: arg13 as u32, + let e0 = super::super::super::super::exports::wasi::sockets::network::Ipv6SocketAddress { + port: arg3 as u16, + flow_info: arg4 as u32, + address: ( + arg5 as u16, + arg6 as u16, + arg7 as u16, + arg8 as u16, + arg9 as u16, + arg10 as u16, + arg11 as u16, + arg12 as u16, + ), + scope_id: arg13 as u32, }; V0::Ipv6(e0) } }; let result1 = T::start_connect( - TcpSocketBorrow::lift(arg0 as u32 as usize).get(), - NetworkBorrow::lift(arg1 as u32 as usize), + unsafe { TcpSocketBorrow::lift(arg0 as u32 as usize) }.get(), + unsafe { NetworkBorrow::lift(arg1 as u32 as usize) }, v0, ); - let ptr2 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr2 = (&raw mut _RET_AREA.0).cast::(); match result1 { Ok(_) => { *ptr2.add(0).cast::() = (0i32) as u8; @@ -32816,14 +35430,14 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_tcp_socket_finish_connect_cabi( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::finish_connect(TcpSocketBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + pub unsafe fn _export_method_tcp_socket_finish_connect_cabi< + T: GuestTcpSocket, + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::finish_connect( + unsafe { TcpSocketBorrow::lift(arg0 as u32 as usize) }.get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -32840,14 +35454,14 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_tcp_socket_start_listen_cabi( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::start_listen(TcpSocketBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + pub unsafe fn _export_method_tcp_socket_start_listen_cabi< + T: GuestTcpSocket, + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::start_listen( + unsafe { TcpSocketBorrow::lift(arg0 as u32 as usize) }.get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(_) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -32861,14 +35475,14 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_tcp_socket_finish_listen_cabi( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::finish_listen(TcpSocketBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + pub unsafe fn _export_method_tcp_socket_finish_listen_cabi< + T: GuestTcpSocket, + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::finish_listen( + unsafe { TcpSocketBorrow::lift(arg0 as u32 as usize) }.get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(_) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -32885,10 +35499,11 @@ pub mod exports { pub unsafe fn _export_method_tcp_socket_accept_cabi( arg0: *mut u8, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = T::accept(TcpSocketBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::accept( + unsafe { TcpSocketBorrow::lift(arg0 as u32 as usize) }.get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -32906,14 +35521,14 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_tcp_socket_local_address_cabi( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::local_address(TcpSocketBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + pub unsafe fn _export_method_tcp_socket_local_address_cabi< + T: GuestTcpSocket, + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::local_address( + unsafe { TcpSocketBorrow::lift(arg0 as u32 as usize) }.get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -32921,7 +35536,10 @@ pub mod exports { match e { V6::Ipv4(e) => { *ptr1.add(4).cast::() = (0i32) as u8; - let super::super::super::super::exports::wasi::sockets::network::Ipv4SocketAddress{ port:port2, address:address2, } = e; + let super::super::super::super::exports::wasi::sockets::network::Ipv4SocketAddress { + port: port2, + address: address2, + } = e; *ptr1.add(8).cast::() = (_rt::as_i32(port2)) as u16; let (t3_0, t3_1, t3_2, t3_3) = address2; *ptr1.add(10).cast::() = (_rt::as_i32(t3_0)) as u8; @@ -32931,7 +35549,12 @@ pub mod exports { } V6::Ipv6(e) => { *ptr1.add(4).cast::() = (1i32) as u8; - let super::super::super::super::exports::wasi::sockets::network::Ipv6SocketAddress{ port:port4, flow_info:flow_info4, address:address4, scope_id:scope_id4, } = e; + let super::super::super::super::exports::wasi::sockets::network::Ipv6SocketAddress { + port: port4, + flow_info: flow_info4, + address: address4, + scope_id: scope_id4, + } = e; *ptr1.add(8).cast::() = (_rt::as_i32(port4)) as u16; *ptr1.add(12).cast::() = _rt::as_i32(flow_info4); let (t5_0, t5_1, t5_2, t5_3, t5_4, t5_5, t5_6, t5_7) = address4; @@ -32956,14 +35579,14 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_tcp_socket_remote_address_cabi( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::remote_address(TcpSocketBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + pub unsafe fn _export_method_tcp_socket_remote_address_cabi< + T: GuestTcpSocket, + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::remote_address( + unsafe { TcpSocketBorrow::lift(arg0 as u32 as usize) }.get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -32971,7 +35594,10 @@ pub mod exports { match e { V6::Ipv4(e) => { *ptr1.add(4).cast::() = (0i32) as u8; - let super::super::super::super::exports::wasi::sockets::network::Ipv4SocketAddress{ port:port2, address:address2, } = e; + let super::super::super::super::exports::wasi::sockets::network::Ipv4SocketAddress { + port: port2, + address: address2, + } = e; *ptr1.add(8).cast::() = (_rt::as_i32(port2)) as u16; let (t3_0, t3_1, t3_2, t3_3) = address2; *ptr1.add(10).cast::() = (_rt::as_i32(t3_0)) as u8; @@ -32981,7 +35607,12 @@ pub mod exports { } V6::Ipv6(e) => { *ptr1.add(4).cast::() = (1i32) as u8; - let super::super::super::super::exports::wasi::sockets::network::Ipv6SocketAddress{ port:port4, flow_info:flow_info4, address:address4, scope_id:scope_id4, } = e; + let super::super::super::super::exports::wasi::sockets::network::Ipv6SocketAddress { + port: port4, + flow_info: flow_info4, + address: address4, + scope_id: scope_id4, + } = e; *ptr1.add(8).cast::() = (_rt::as_i32(port4)) as u16; *ptr1.add(12).cast::() = _rt::as_i32(flow_info4); let (t5_0, t5_1, t5_2, t5_3, t5_4, t5_5, t5_6, t5_7) = address4; @@ -33006,13 +35637,13 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_tcp_socket_is_listening_cabi( - arg0: *mut u8, - ) -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::is_listening(TcpSocketBorrow::lift(arg0 as u32 as usize).get()); + pub unsafe fn _export_method_tcp_socket_is_listening_cabi< + T: GuestTcpSocket, + >(arg0: *mut u8) -> i32 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::is_listening( + unsafe { TcpSocketBorrow::lift(arg0 as u32 as usize) }.get(), + ); match result0 { true => 1, false => 0, @@ -33020,30 +35651,26 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_tcp_socket_address_family_cabi( - arg0: *mut u8, - ) -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::address_family(TcpSocketBorrow::lift(arg0 as u32 as usize).get()); + pub unsafe fn _export_method_tcp_socket_address_family_cabi< + T: GuestTcpSocket, + >(arg0: *mut u8) -> i32 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::address_family( + unsafe { TcpSocketBorrow::lift(arg0 as u32 as usize) }.get(), + ); result0.clone() as i32 } #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_method_tcp_socket_set_listen_backlog_size_cabi< T: GuestTcpSocket, - >( - arg0: *mut u8, - arg1: i64, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + >(arg0: *mut u8, arg1: i64) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::set_listen_backlog_size( - TcpSocketBorrow::lift(arg0 as u32 as usize).get(), + unsafe { TcpSocketBorrow::lift(arg0 as u32 as usize) }.get(), arg1 as u64, ); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(_) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -33059,14 +35686,12 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_tcp_socket_keep_alive_enabled_cabi< T: GuestTcpSocket, - >( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::keep_alive_enabled(TcpSocketBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::keep_alive_enabled( + unsafe { TcpSocketBorrow::lift(arg0 as u32 as usize) }.get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -33086,17 +35711,13 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_tcp_socket_set_keep_alive_enabled_cabi< T: GuestTcpSocket, - >( - arg0: *mut u8, - arg1: i32, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + >(arg0: *mut u8, arg1: i32) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::set_keep_alive_enabled( - TcpSocketBorrow::lift(arg0 as u32 as usize).get(), + unsafe { TcpSocketBorrow::lift(arg0 as u32 as usize) }.get(), _rt::bool_lift(arg1 as u8), ); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(_) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -33112,14 +35733,12 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_tcp_socket_keep_alive_idle_time_cabi< T: GuestTcpSocket, - >( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::keep_alive_idle_time(TcpSocketBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::keep_alive_idle_time( + unsafe { TcpSocketBorrow::lift(arg0 as u32 as usize) }.get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -33136,17 +35755,13 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_tcp_socket_set_keep_alive_idle_time_cabi< T: GuestTcpSocket, - >( - arg0: *mut u8, - arg1: i64, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + >(arg0: *mut u8, arg1: i64) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::set_keep_alive_idle_time( - TcpSocketBorrow::lift(arg0 as u32 as usize).get(), + unsafe { TcpSocketBorrow::lift(arg0 as u32 as usize) }.get(), arg1 as u64, ); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(_) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -33162,14 +35777,12 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_tcp_socket_keep_alive_interval_cabi< T: GuestTcpSocket, - >( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::keep_alive_interval(TcpSocketBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::keep_alive_interval( + unsafe { TcpSocketBorrow::lift(arg0 as u32 as usize) }.get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -33185,18 +35798,14 @@ pub mod exports { #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_method_tcp_socket_set_keep_alive_interval_cabi< - T: GuestTcpSocket, - >( - arg0: *mut u8, - arg1: i64, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + T: GuestTcpSocket, + >(arg0: *mut u8, arg1: i64) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::set_keep_alive_interval( - TcpSocketBorrow::lift(arg0 as u32 as usize).get(), + unsafe { TcpSocketBorrow::lift(arg0 as u32 as usize) }.get(), arg1 as u64, ); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(_) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -33210,14 +35819,14 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_tcp_socket_keep_alive_count_cabi( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::keep_alive_count(TcpSocketBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + pub unsafe fn _export_method_tcp_socket_keep_alive_count_cabi< + T: GuestTcpSocket, + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::keep_alive_count( + unsafe { TcpSocketBorrow::lift(arg0 as u32 as usize) }.get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -33234,17 +35843,13 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_tcp_socket_set_keep_alive_count_cabi< T: GuestTcpSocket, - >( - arg0: *mut u8, - arg1: i32, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + >(arg0: *mut u8, arg1: i32) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::set_keep_alive_count( - TcpSocketBorrow::lift(arg0 as u32 as usize).get(), + unsafe { TcpSocketBorrow::lift(arg0 as u32 as usize) }.get(), arg1 as u32, ); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(_) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -33258,13 +35863,14 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_tcp_socket_hop_limit_cabi( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = T::hop_limit(TcpSocketBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + pub unsafe fn _export_method_tcp_socket_hop_limit_cabi< + T: GuestTcpSocket, + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::hop_limit( + unsafe { TcpSocketBorrow::lift(arg0 as u32 as usize) }.get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -33279,17 +35885,15 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_tcp_socket_set_hop_limit_cabi( - arg0: *mut u8, - arg1: i32, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + pub unsafe fn _export_method_tcp_socket_set_hop_limit_cabi< + T: GuestTcpSocket, + >(arg0: *mut u8, arg1: i32) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::set_hop_limit( - TcpSocketBorrow::lift(arg0 as u32 as usize).get(), + unsafe { TcpSocketBorrow::lift(arg0 as u32 as usize) }.get(), arg1 as u8, ); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(_) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -33305,14 +35909,12 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_tcp_socket_receive_buffer_size_cabi< T: GuestTcpSocket, - >( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::receive_buffer_size(TcpSocketBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::receive_buffer_size( + unsafe { TcpSocketBorrow::lift(arg0 as u32 as usize) }.get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -33329,17 +35931,13 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_tcp_socket_set_receive_buffer_size_cabi< T: GuestTcpSocket, - >( - arg0: *mut u8, - arg1: i64, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + >(arg0: *mut u8, arg1: i64) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::set_receive_buffer_size( - TcpSocketBorrow::lift(arg0 as u32 as usize).get(), + unsafe { TcpSocketBorrow::lift(arg0 as u32 as usize) }.get(), arg1 as u64, ); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(_) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -33353,14 +35951,14 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_tcp_socket_send_buffer_size_cabi( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::send_buffer_size(TcpSocketBorrow::lift(arg0 as u32 as usize).get()); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + pub unsafe fn _export_method_tcp_socket_send_buffer_size_cabi< + T: GuestTcpSocket, + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::send_buffer_size( + unsafe { TcpSocketBorrow::lift(arg0 as u32 as usize) }.get(), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -33377,17 +35975,13 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_tcp_socket_set_send_buffer_size_cabi< T: GuestTcpSocket, - >( - arg0: *mut u8, - arg1: i64, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + >(arg0: *mut u8, arg1: i64) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::set_send_buffer_size( - TcpSocketBorrow::lift(arg0 as u32 as usize).get(), + unsafe { TcpSocketBorrow::lift(arg0 as u32 as usize) }.get(), arg1 as u64, ); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(_) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -33401,12 +35995,13 @@ pub mod exports { } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_method_tcp_socket_subscribe_cabi( - arg0: *mut u8, - ) -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = T::subscribe(TcpSocketBorrow::lift(arg0 as u32 as usize).get()); + pub unsafe fn _export_method_tcp_socket_subscribe_cabi< + T: GuestTcpSocket, + >(arg0: *mut u8) -> i32 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::subscribe( + unsafe { TcpSocketBorrow::lift(arg0 as u32 as usize) }.get(), + ); (result0).take_handle() as i32 } #[doc(hidden)] @@ -33415,13 +36010,12 @@ pub mod exports { arg0: *mut u8, arg1: i32, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::shutdown( - TcpSocketBorrow::lift(arg0 as u32 as usize).get(), + unsafe { TcpSocketBorrow::lift(arg0 as u32 as usize) }.get(), ShutdownType::_lift(arg1 as u8), ); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(_) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -33447,18 +36041,18 @@ pub mod exports { let _ = val; unreachable!(); } - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]wasi:sockets/tcp@0.2.0")] - extern "C" { + #[link( + wasm_import_module = "[export]wasi:sockets/tcp@0.2.0" + )] + unsafe extern "C" { #[link_name = "[resource-new]tcp-socket"] fn new(_: *mut u8) -> u32; } - new(val) + unsafe { new(val) } } } - #[doc(hidden)] fn _resource_rep(handle: u32) -> *mut u8 where @@ -33469,18 +36063,18 @@ pub mod exports { let _ = handle; unreachable!(); } - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "[export]wasi:sockets/tcp@0.2.0")] - extern "C" { + #[link( + wasm_import_module = "[export]wasi:sockets/tcp@0.2.0" + )] + unsafe extern "C" { #[link_name = "[resource-rep]tcp-socket"] fn rep(_: u32) -> *mut u8; } unsafe { rep(handle) } } } - /// Bind the socket to a specific network on the provided IP address and port. /// /// If the IP address is zero (`0.0.0.0` in IPv4, `::` in IPv6), it is left to the implementation to decide which @@ -33572,7 +36166,9 @@ pub mod exports { network: NetworkBorrow<'_>, remote_address: IpSocketAddress, ) -> Result<(), ErrorCode>; - fn finish_connect(&self) -> Result<(InputStream, OutputStream), ErrorCode>; + fn finish_connect( + &self, + ) -> Result<(InputStream, OutputStream), ErrorCode>; /// Start listening for new connections. /// /// Transitions the socket into the `listening` state. @@ -33626,7 +36222,9 @@ pub mod exports { /// - /// - /// - - fn accept(&self) -> Result<(TcpSocket, InputStream, OutputStream), ErrorCode>; + fn accept( + &self, + ) -> Result<(TcpSocket, InputStream, OutputStream), ErrorCode>; /// Get the bound local address. /// /// POSIX mentions: @@ -33672,7 +36270,10 @@ pub mod exports { /// - `not-supported`: (set) The platform does not support changing the backlog size after the initial listen. /// - `invalid-argument`: (set) The provided value was 0. /// - `invalid-state`: (set) The socket is in the `connect-in-progress` or `connected` state. - fn set_listen_backlog_size(&self, value: u64) -> Result<(), ErrorCode>; + fn set_listen_backlog_size( + &self, + value: u64, + ) -> Result<(), ErrorCode>; /// Enables or disables keepalive. /// /// The keepalive behavior can be adjusted using: @@ -33683,7 +36284,10 @@ pub mod exports { /// /// Equivalent to the SO_KEEPALIVE socket option. fn keep_alive_enabled(&self) -> Result; - fn set_keep_alive_enabled(&self, value: bool) -> Result<(), ErrorCode>; + fn set_keep_alive_enabled( + &self, + value: bool, + ) -> Result<(), ErrorCode>; /// Amount of time the connection has to be idle before TCP starts sending keepalive packets. /// /// If the provided value is 0, an `invalid-argument` error is returned. @@ -33695,7 +36299,10 @@ pub mod exports { /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. fn keep_alive_idle_time(&self) -> Result; - fn set_keep_alive_idle_time(&self, value: Duration) -> Result<(), ErrorCode>; + fn set_keep_alive_idle_time( + &self, + value: Duration, + ) -> Result<(), ErrorCode>; /// The time between keepalive packets. /// /// If the provided value is 0, an `invalid-argument` error is returned. @@ -33707,7 +36314,10 @@ pub mod exports { /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. fn keep_alive_interval(&self) -> Result; - fn set_keep_alive_interval(&self, value: Duration) -> Result<(), ErrorCode>; + fn set_keep_alive_interval( + &self, + value: Duration, + ) -> Result<(), ErrorCode>; /// The maximum amount of keepalive packets TCP should send before aborting the connection. /// /// If the provided value is 0, an `invalid-argument` error is returned. @@ -33739,7 +36349,10 @@ pub mod exports { /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. fn receive_buffer_size(&self) -> Result; - fn set_receive_buffer_size(&self, value: u64) -> Result<(), ErrorCode>; + fn set_receive_buffer_size( + &self, + value: u64, + ) -> Result<(), ErrorCode>; fn send_buffer_size(&self) -> Result; fn set_send_buffer_size(&self, value: u64) -> Result<(), ErrorCode>; /// Create a `pollable` which can be used to poll for, or block on, @@ -33763,11 +36376,11 @@ pub mod exports { /// Initiate a graceful shutdown. /// /// - `receive`: The socket is not expecting to receive any data from - /// the peer. The `input-stream` associated with this socket will be - /// closed. Any data still in the receive queue at time of calling - /// this method will be discarded. + /// the peer. The `input-stream` associated with this socket will be + /// closed. Any data still in the receive queue at time of calling + /// this method will be discarded. /// - `send`: The socket has no more data to send to the peer. The `output-stream` - /// associated with this socket will be closed and a FIN packet will be sent. + /// associated with this socket will be closed and a FIN packet will be sent. /// - `both`: Same effect as `receive` & `send` combined. /// /// This function is idempotent. Shutting a down a direction more than once @@ -33783,171 +36396,246 @@ pub mod exports { /// - /// - /// - - fn shutdown(&self, shutdown_type: ShutdownType) -> Result<(), ErrorCode>; + fn shutdown( + &self, + shutdown_type: ShutdownType, + ) -> Result<(), ErrorCode>; } #[doc(hidden)] - - macro_rules! __export_wasi_sockets_tcp_0_2_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "wasi:sockets/tcp@0.2.0#[method]tcp-socket.start-bind"] - unsafe extern "C" fn export_method_tcp_socket_start_bind(arg0: *mut u8,arg1: i32,arg2: i32,arg3: i32,arg4: i32,arg5: i32,arg6: i32,arg7: i32,arg8: i32,arg9: i32,arg10: i32,arg11: i32,arg12: i32,arg13: i32,) -> *mut u8 { - $($path_to_types)*::_export_method_tcp_socket_start_bind_cabi::<<$ty as $($path_to_types)*::Guest>::TcpSocket>(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13) - } - #[export_name = "wasi:sockets/tcp@0.2.0#[method]tcp-socket.finish-bind"] - unsafe extern "C" fn export_method_tcp_socket_finish_bind(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_tcp_socket_finish_bind_cabi::<<$ty as $($path_to_types)*::Guest>::TcpSocket>(arg0) - } - #[export_name = "wasi:sockets/tcp@0.2.0#[method]tcp-socket.start-connect"] - unsafe extern "C" fn export_method_tcp_socket_start_connect(arg0: *mut u8,arg1: i32,arg2: i32,arg3: i32,arg4: i32,arg5: i32,arg6: i32,arg7: i32,arg8: i32,arg9: i32,arg10: i32,arg11: i32,arg12: i32,arg13: i32,) -> *mut u8 { - $($path_to_types)*::_export_method_tcp_socket_start_connect_cabi::<<$ty as $($path_to_types)*::Guest>::TcpSocket>(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13) - } - #[export_name = "wasi:sockets/tcp@0.2.0#[method]tcp-socket.finish-connect"] - unsafe extern "C" fn export_method_tcp_socket_finish_connect(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_tcp_socket_finish_connect_cabi::<<$ty as $($path_to_types)*::Guest>::TcpSocket>(arg0) - } - #[export_name = "wasi:sockets/tcp@0.2.0#[method]tcp-socket.start-listen"] - unsafe extern "C" fn export_method_tcp_socket_start_listen(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_tcp_socket_start_listen_cabi::<<$ty as $($path_to_types)*::Guest>::TcpSocket>(arg0) - } - #[export_name = "wasi:sockets/tcp@0.2.0#[method]tcp-socket.finish-listen"] - unsafe extern "C" fn export_method_tcp_socket_finish_listen(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_tcp_socket_finish_listen_cabi::<<$ty as $($path_to_types)*::Guest>::TcpSocket>(arg0) - } - #[export_name = "wasi:sockets/tcp@0.2.0#[method]tcp-socket.accept"] - unsafe extern "C" fn export_method_tcp_socket_accept(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_tcp_socket_accept_cabi::<<$ty as $($path_to_types)*::Guest>::TcpSocket>(arg0) - } - #[export_name = "wasi:sockets/tcp@0.2.0#[method]tcp-socket.local-address"] - unsafe extern "C" fn export_method_tcp_socket_local_address(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_tcp_socket_local_address_cabi::<<$ty as $($path_to_types)*::Guest>::TcpSocket>(arg0) - } - #[export_name = "wasi:sockets/tcp@0.2.0#[method]tcp-socket.remote-address"] - unsafe extern "C" fn export_method_tcp_socket_remote_address(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_tcp_socket_remote_address_cabi::<<$ty as $($path_to_types)*::Guest>::TcpSocket>(arg0) - } - #[export_name = "wasi:sockets/tcp@0.2.0#[method]tcp-socket.is-listening"] - unsafe extern "C" fn export_method_tcp_socket_is_listening(arg0: *mut u8,) -> i32 { - $($path_to_types)*::_export_method_tcp_socket_is_listening_cabi::<<$ty as $($path_to_types)*::Guest>::TcpSocket>(arg0) - } - #[export_name = "wasi:sockets/tcp@0.2.0#[method]tcp-socket.address-family"] - unsafe extern "C" fn export_method_tcp_socket_address_family(arg0: *mut u8,) -> i32 { - $($path_to_types)*::_export_method_tcp_socket_address_family_cabi::<<$ty as $($path_to_types)*::Guest>::TcpSocket>(arg0) - } - #[export_name = "wasi:sockets/tcp@0.2.0#[method]tcp-socket.set-listen-backlog-size"] - unsafe extern "C" fn export_method_tcp_socket_set_listen_backlog_size(arg0: *mut u8,arg1: i64,) -> *mut u8 { - $($path_to_types)*::_export_method_tcp_socket_set_listen_backlog_size_cabi::<<$ty as $($path_to_types)*::Guest>::TcpSocket>(arg0, arg1) - } - #[export_name = "wasi:sockets/tcp@0.2.0#[method]tcp-socket.keep-alive-enabled"] - unsafe extern "C" fn export_method_tcp_socket_keep_alive_enabled(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_tcp_socket_keep_alive_enabled_cabi::<<$ty as $($path_to_types)*::Guest>::TcpSocket>(arg0) - } - #[export_name = "wasi:sockets/tcp@0.2.0#[method]tcp-socket.set-keep-alive-enabled"] - unsafe extern "C" fn export_method_tcp_socket_set_keep_alive_enabled(arg0: *mut u8,arg1: i32,) -> *mut u8 { - $($path_to_types)*::_export_method_tcp_socket_set_keep_alive_enabled_cabi::<<$ty as $($path_to_types)*::Guest>::TcpSocket>(arg0, arg1) - } - #[export_name = "wasi:sockets/tcp@0.2.0#[method]tcp-socket.keep-alive-idle-time"] - unsafe extern "C" fn export_method_tcp_socket_keep_alive_idle_time(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_tcp_socket_keep_alive_idle_time_cabi::<<$ty as $($path_to_types)*::Guest>::TcpSocket>(arg0) - } - #[export_name = "wasi:sockets/tcp@0.2.0#[method]tcp-socket.set-keep-alive-idle-time"] - unsafe extern "C" fn export_method_tcp_socket_set_keep_alive_idle_time(arg0: *mut u8,arg1: i64,) -> *mut u8 { - $($path_to_types)*::_export_method_tcp_socket_set_keep_alive_idle_time_cabi::<<$ty as $($path_to_types)*::Guest>::TcpSocket>(arg0, arg1) - } - #[export_name = "wasi:sockets/tcp@0.2.0#[method]tcp-socket.keep-alive-interval"] - unsafe extern "C" fn export_method_tcp_socket_keep_alive_interval(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_tcp_socket_keep_alive_interval_cabi::<<$ty as $($path_to_types)*::Guest>::TcpSocket>(arg0) - } - #[export_name = "wasi:sockets/tcp@0.2.0#[method]tcp-socket.set-keep-alive-interval"] - unsafe extern "C" fn export_method_tcp_socket_set_keep_alive_interval(arg0: *mut u8,arg1: i64,) -> *mut u8 { - $($path_to_types)*::_export_method_tcp_socket_set_keep_alive_interval_cabi::<<$ty as $($path_to_types)*::Guest>::TcpSocket>(arg0, arg1) - } - #[export_name = "wasi:sockets/tcp@0.2.0#[method]tcp-socket.keep-alive-count"] - unsafe extern "C" fn export_method_tcp_socket_keep_alive_count(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_tcp_socket_keep_alive_count_cabi::<<$ty as $($path_to_types)*::Guest>::TcpSocket>(arg0) - } - #[export_name = "wasi:sockets/tcp@0.2.0#[method]tcp-socket.set-keep-alive-count"] - unsafe extern "C" fn export_method_tcp_socket_set_keep_alive_count(arg0: *mut u8,arg1: i32,) -> *mut u8 { - $($path_to_types)*::_export_method_tcp_socket_set_keep_alive_count_cabi::<<$ty as $($path_to_types)*::Guest>::TcpSocket>(arg0, arg1) - } - #[export_name = "wasi:sockets/tcp@0.2.0#[method]tcp-socket.hop-limit"] - unsafe extern "C" fn export_method_tcp_socket_hop_limit(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_tcp_socket_hop_limit_cabi::<<$ty as $($path_to_types)*::Guest>::TcpSocket>(arg0) - } - #[export_name = "wasi:sockets/tcp@0.2.0#[method]tcp-socket.set-hop-limit"] - unsafe extern "C" fn export_method_tcp_socket_set_hop_limit(arg0: *mut u8,arg1: i32,) -> *mut u8 { - $($path_to_types)*::_export_method_tcp_socket_set_hop_limit_cabi::<<$ty as $($path_to_types)*::Guest>::TcpSocket>(arg0, arg1) - } - #[export_name = "wasi:sockets/tcp@0.2.0#[method]tcp-socket.receive-buffer-size"] - unsafe extern "C" fn export_method_tcp_socket_receive_buffer_size(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_tcp_socket_receive_buffer_size_cabi::<<$ty as $($path_to_types)*::Guest>::TcpSocket>(arg0) - } - #[export_name = "wasi:sockets/tcp@0.2.0#[method]tcp-socket.set-receive-buffer-size"] - unsafe extern "C" fn export_method_tcp_socket_set_receive_buffer_size(arg0: *mut u8,arg1: i64,) -> *mut u8 { - $($path_to_types)*::_export_method_tcp_socket_set_receive_buffer_size_cabi::<<$ty as $($path_to_types)*::Guest>::TcpSocket>(arg0, arg1) - } - #[export_name = "wasi:sockets/tcp@0.2.0#[method]tcp-socket.send-buffer-size"] - unsafe extern "C" fn export_method_tcp_socket_send_buffer_size(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_tcp_socket_send_buffer_size_cabi::<<$ty as $($path_to_types)*::Guest>::TcpSocket>(arg0) - } - #[export_name = "wasi:sockets/tcp@0.2.0#[method]tcp-socket.set-send-buffer-size"] - unsafe extern "C" fn export_method_tcp_socket_set_send_buffer_size(arg0: *mut u8,arg1: i64,) -> *mut u8 { - $($path_to_types)*::_export_method_tcp_socket_set_send_buffer_size_cabi::<<$ty as $($path_to_types)*::Guest>::TcpSocket>(arg0, arg1) - } - #[export_name = "wasi:sockets/tcp@0.2.0#[method]tcp-socket.subscribe"] - unsafe extern "C" fn export_method_tcp_socket_subscribe(arg0: *mut u8,) -> i32 { - $($path_to_types)*::_export_method_tcp_socket_subscribe_cabi::<<$ty as $($path_to_types)*::Guest>::TcpSocket>(arg0) - } - #[export_name = "wasi:sockets/tcp@0.2.0#[method]tcp-socket.shutdown"] - unsafe extern "C" fn export_method_tcp_socket_shutdown(arg0: *mut u8,arg1: i32,) -> *mut u8 { - $($path_to_types)*::_export_method_tcp_socket_shutdown_cabi::<<$ty as $($path_to_types)*::Guest>::TcpSocket>(arg0, arg1) - } - - const _: () = { - #[doc(hidden)] - #[export_name = "wasi:sockets/tcp@0.2.0#[dtor]tcp-socket"] - #[allow(non_snake_case)] - unsafe extern "C" fn dtor(rep: *mut u8) { - $($path_to_types)*::TcpSocket::dtor::< - <$ty as $($path_to_types)*::Guest>::TcpSocket - >(rep) - } - }; - - };); -} + macro_rules! __export_wasi_sockets_tcp_0_2_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "wasi:sockets/tcp@0.2.0#[method]tcp-socket.start-bind")] unsafe + extern "C" fn export_method_tcp_socket_start_bind(arg0 : * mut + u8, arg1 : i32, arg2 : i32, arg3 : i32, arg4 : i32, arg5 : i32, + arg6 : i32, arg7 : i32, arg8 : i32, arg9 : i32, arg10 : i32, + arg11 : i32, arg12 : i32, arg13 : i32,) -> * mut u8 { unsafe { + $($path_to_types)*:: + _export_method_tcp_socket_start_bind_cabi::<<$ty as + $($path_to_types)*:: Guest >::TcpSocket > (arg0, arg1, arg2, + arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, + arg13) } } #[unsafe (export_name = + "wasi:sockets/tcp@0.2.0#[method]tcp-socket.finish-bind")] unsafe + extern "C" fn export_method_tcp_socket_finish_bind(arg0 : * mut + u8,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_tcp_socket_finish_bind_cabi::<<$ty as + $($path_to_types)*:: Guest >::TcpSocket > (arg0) } } #[unsafe + (export_name = + "wasi:sockets/tcp@0.2.0#[method]tcp-socket.start-connect")] + unsafe extern "C" fn export_method_tcp_socket_start_connect(arg0 + : * mut u8, arg1 : i32, arg2 : i32, arg3 : i32, arg4 : i32, arg5 + : i32, arg6 : i32, arg7 : i32, arg8 : i32, arg9 : i32, arg10 : + i32, arg11 : i32, arg12 : i32, arg13 : i32,) -> * mut u8 { unsafe + { $($path_to_types)*:: + _export_method_tcp_socket_start_connect_cabi::<<$ty as + $($path_to_types)*:: Guest >::TcpSocket > (arg0, arg1, arg2, + arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, + arg13) } } #[unsafe (export_name = + "wasi:sockets/tcp@0.2.0#[method]tcp-socket.finish-connect")] + unsafe extern "C" fn export_method_tcp_socket_finish_connect(arg0 + : * mut u8,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_tcp_socket_finish_connect_cabi::<<$ty as + $($path_to_types)*:: Guest >::TcpSocket > (arg0) } } #[unsafe + (export_name = + "wasi:sockets/tcp@0.2.0#[method]tcp-socket.start-listen")] unsafe + extern "C" fn export_method_tcp_socket_start_listen(arg0 : * mut + u8,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_tcp_socket_start_listen_cabi::<<$ty as + $($path_to_types)*:: Guest >::TcpSocket > (arg0) } } #[unsafe + (export_name = + "wasi:sockets/tcp@0.2.0#[method]tcp-socket.finish-listen")] + unsafe extern "C" fn export_method_tcp_socket_finish_listen(arg0 + : * mut u8,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_tcp_socket_finish_listen_cabi::<<$ty as + $($path_to_types)*:: Guest >::TcpSocket > (arg0) } } #[unsafe + (export_name = + "wasi:sockets/tcp@0.2.0#[method]tcp-socket.accept")] unsafe + extern "C" fn export_method_tcp_socket_accept(arg0 : * mut u8,) + -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_tcp_socket_accept_cabi::<<$ty as + $($path_to_types)*:: Guest >::TcpSocket > (arg0) } } #[unsafe + (export_name = + "wasi:sockets/tcp@0.2.0#[method]tcp-socket.local-address")] + unsafe extern "C" fn export_method_tcp_socket_local_address(arg0 + : * mut u8,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_tcp_socket_local_address_cabi::<<$ty as + $($path_to_types)*:: Guest >::TcpSocket > (arg0) } } #[unsafe + (export_name = + "wasi:sockets/tcp@0.2.0#[method]tcp-socket.remote-address")] + unsafe extern "C" fn export_method_tcp_socket_remote_address(arg0 + : * mut u8,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_tcp_socket_remote_address_cabi::<<$ty as + $($path_to_types)*:: Guest >::TcpSocket > (arg0) } } #[unsafe + (export_name = + "wasi:sockets/tcp@0.2.0#[method]tcp-socket.is-listening")] unsafe + extern "C" fn export_method_tcp_socket_is_listening(arg0 : * mut + u8,) -> i32 { unsafe { $($path_to_types)*:: + _export_method_tcp_socket_is_listening_cabi::<<$ty as + $($path_to_types)*:: Guest >::TcpSocket > (arg0) } } #[unsafe + (export_name = + "wasi:sockets/tcp@0.2.0#[method]tcp-socket.address-family")] + unsafe extern "C" fn export_method_tcp_socket_address_family(arg0 + : * mut u8,) -> i32 { unsafe { $($path_to_types)*:: + _export_method_tcp_socket_address_family_cabi::<<$ty as + $($path_to_types)*:: Guest >::TcpSocket > (arg0) } } #[unsafe + (export_name = + "wasi:sockets/tcp@0.2.0#[method]tcp-socket.set-listen-backlog-size")] + unsafe extern "C" fn + export_method_tcp_socket_set_listen_backlog_size(arg0 : * mut u8, + arg1 : i64,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_tcp_socket_set_listen_backlog_size_cabi::<<$ty as + $($path_to_types)*:: Guest >::TcpSocket > (arg0, arg1) } } + #[unsafe (export_name = + "wasi:sockets/tcp@0.2.0#[method]tcp-socket.keep-alive-enabled")] + unsafe extern "C" fn + export_method_tcp_socket_keep_alive_enabled(arg0 : * mut u8,) -> + * mut u8 { unsafe { $($path_to_types)*:: + _export_method_tcp_socket_keep_alive_enabled_cabi::<<$ty as + $($path_to_types)*:: Guest >::TcpSocket > (arg0) } } #[unsafe + (export_name = + "wasi:sockets/tcp@0.2.0#[method]tcp-socket.set-keep-alive-enabled")] + unsafe extern "C" fn + export_method_tcp_socket_set_keep_alive_enabled(arg0 : * mut u8, + arg1 : i32,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_tcp_socket_set_keep_alive_enabled_cabi::<<$ty as + $($path_to_types)*:: Guest >::TcpSocket > (arg0, arg1) } } + #[unsafe (export_name = + "wasi:sockets/tcp@0.2.0#[method]tcp-socket.keep-alive-idle-time")] + unsafe extern "C" fn + export_method_tcp_socket_keep_alive_idle_time(arg0 : * mut u8,) + -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_tcp_socket_keep_alive_idle_time_cabi::<<$ty as + $($path_to_types)*:: Guest >::TcpSocket > (arg0) } } #[unsafe + (export_name = + "wasi:sockets/tcp@0.2.0#[method]tcp-socket.set-keep-alive-idle-time")] + unsafe extern "C" fn + export_method_tcp_socket_set_keep_alive_idle_time(arg0 : * mut + u8, arg1 : i64,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_tcp_socket_set_keep_alive_idle_time_cabi::<<$ty as + $($path_to_types)*:: Guest >::TcpSocket > (arg0, arg1) } } + #[unsafe (export_name = + "wasi:sockets/tcp@0.2.0#[method]tcp-socket.keep-alive-interval")] + unsafe extern "C" fn + export_method_tcp_socket_keep_alive_interval(arg0 : * mut u8,) -> + * mut u8 { unsafe { $($path_to_types)*:: + _export_method_tcp_socket_keep_alive_interval_cabi::<<$ty as + $($path_to_types)*:: Guest >::TcpSocket > (arg0) } } #[unsafe + (export_name = + "wasi:sockets/tcp@0.2.0#[method]tcp-socket.set-keep-alive-interval")] + unsafe extern "C" fn + export_method_tcp_socket_set_keep_alive_interval(arg0 : * mut u8, + arg1 : i64,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_tcp_socket_set_keep_alive_interval_cabi::<<$ty as + $($path_to_types)*:: Guest >::TcpSocket > (arg0, arg1) } } + #[unsafe (export_name = + "wasi:sockets/tcp@0.2.0#[method]tcp-socket.keep-alive-count")] + unsafe extern "C" fn + export_method_tcp_socket_keep_alive_count(arg0 : * mut u8,) -> * + mut u8 { unsafe { $($path_to_types)*:: + _export_method_tcp_socket_keep_alive_count_cabi::<<$ty as + $($path_to_types)*:: Guest >::TcpSocket > (arg0) } } #[unsafe + (export_name = + "wasi:sockets/tcp@0.2.0#[method]tcp-socket.set-keep-alive-count")] + unsafe extern "C" fn + export_method_tcp_socket_set_keep_alive_count(arg0 : * mut u8, + arg1 : i32,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_tcp_socket_set_keep_alive_count_cabi::<<$ty as + $($path_to_types)*:: Guest >::TcpSocket > (arg0, arg1) } } + #[unsafe (export_name = + "wasi:sockets/tcp@0.2.0#[method]tcp-socket.hop-limit")] unsafe + extern "C" fn export_method_tcp_socket_hop_limit(arg0 : * mut + u8,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_tcp_socket_hop_limit_cabi::<<$ty as + $($path_to_types)*:: Guest >::TcpSocket > (arg0) } } #[unsafe + (export_name = + "wasi:sockets/tcp@0.2.0#[method]tcp-socket.set-hop-limit")] + unsafe extern "C" fn export_method_tcp_socket_set_hop_limit(arg0 + : * mut u8, arg1 : i32,) -> * mut u8 { unsafe { + $($path_to_types)*:: + _export_method_tcp_socket_set_hop_limit_cabi::<<$ty as + $($path_to_types)*:: Guest >::TcpSocket > (arg0, arg1) } } + #[unsafe (export_name = + "wasi:sockets/tcp@0.2.0#[method]tcp-socket.receive-buffer-size")] + unsafe extern "C" fn + export_method_tcp_socket_receive_buffer_size(arg0 : * mut u8,) -> + * mut u8 { unsafe { $($path_to_types)*:: + _export_method_tcp_socket_receive_buffer_size_cabi::<<$ty as + $($path_to_types)*:: Guest >::TcpSocket > (arg0) } } #[unsafe + (export_name = + "wasi:sockets/tcp@0.2.0#[method]tcp-socket.set-receive-buffer-size")] + unsafe extern "C" fn + export_method_tcp_socket_set_receive_buffer_size(arg0 : * mut u8, + arg1 : i64,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_tcp_socket_set_receive_buffer_size_cabi::<<$ty as + $($path_to_types)*:: Guest >::TcpSocket > (arg0, arg1) } } + #[unsafe (export_name = + "wasi:sockets/tcp@0.2.0#[method]tcp-socket.send-buffer-size")] + unsafe extern "C" fn + export_method_tcp_socket_send_buffer_size(arg0 : * mut u8,) -> * + mut u8 { unsafe { $($path_to_types)*:: + _export_method_tcp_socket_send_buffer_size_cabi::<<$ty as + $($path_to_types)*:: Guest >::TcpSocket > (arg0) } } #[unsafe + (export_name = + "wasi:sockets/tcp@0.2.0#[method]tcp-socket.set-send-buffer-size")] + unsafe extern "C" fn + export_method_tcp_socket_set_send_buffer_size(arg0 : * mut u8, + arg1 : i64,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_tcp_socket_set_send_buffer_size_cabi::<<$ty as + $($path_to_types)*:: Guest >::TcpSocket > (arg0, arg1) } } + #[unsafe (export_name = + "wasi:sockets/tcp@0.2.0#[method]tcp-socket.subscribe")] unsafe + extern "C" fn export_method_tcp_socket_subscribe(arg0 : * mut + u8,) -> i32 { unsafe { $($path_to_types)*:: + _export_method_tcp_socket_subscribe_cabi::<<$ty as + $($path_to_types)*:: Guest >::TcpSocket > (arg0) } } #[unsafe + (export_name = + "wasi:sockets/tcp@0.2.0#[method]tcp-socket.shutdown")] unsafe + extern "C" fn export_method_tcp_socket_shutdown(arg0 : * mut u8, + arg1 : i32,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_tcp_socket_shutdown_cabi::<<$ty as + $($path_to_types)*:: Guest >::TcpSocket > (arg0, arg1) } } const + _ : () = { #[doc(hidden)] #[unsafe (export_name = + "wasi:sockets/tcp@0.2.0#[dtor]tcp-socket")] + #[allow(non_snake_case)] unsafe extern "C" fn dtor(rep : * mut + u8) { unsafe { $($path_to_types)*:: TcpSocket::dtor::< <$ty as + $($path_to_types)*:: Guest >::TcpSocket > (rep) } } }; }; + }; + } #[doc(hidden)] pub(crate) use __export_wasi_sockets_tcp_0_2_0_cabi; #[repr(align(8))] struct _RetArea([::core::mem::MaybeUninit; 36]); - static mut _RET_AREA: _RetArea = _RetArea([::core::mem::MaybeUninit::uninit(); 36]); + static mut _RET_AREA: _RetArea = _RetArea( + [::core::mem::MaybeUninit::uninit(); 36], + ); } - - #[allow(dead_code, clippy::all)] + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod tcp_create_socket { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; - pub type NetworkBorrow<'a> = - super::super::super::super::exports::wasi::sockets::network::NetworkBorrow<'a>; - pub type ErrorCode = - super::super::super::super::exports::wasi::sockets::network::ErrorCode; - pub type IpAddressFamily = - super::super::super::super::exports::wasi::sockets::network::IpAddressFamily; - pub type TcpSocket = - super::super::super::super::exports::wasi::sockets::tcp::TcpSocket; - pub type TcpSocketBorrow<'a> = - super::super::super::super::exports::wasi::sockets::tcp::TcpSocketBorrow<'a>; - #[doc(hidden)] - #[allow(non_snake_case)] - pub unsafe fn _export_create_tcp_socket_cabi(arg0: i32) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = T::create_tcp_socket(super::super::super::super::exports::wasi::sockets::network::IpAddressFamily::_lift(arg0 as u8)); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + pub type NetworkBorrow<'a> = super::super::super::super::exports::wasi::sockets::network::NetworkBorrow< + 'a, + >; + pub type ErrorCode = super::super::super::super::exports::wasi::sockets::network::ErrorCode; + pub type IpAddressFamily = super::super::super::super::exports::wasi::sockets::network::IpAddressFamily; + pub type TcpSocket = super::super::super::super::exports::wasi::sockets::tcp::TcpSocket; + pub type TcpSocketBorrow<'a> = super::super::super::super::exports::wasi::sockets::tcp::TcpSocketBorrow< + 'a, + >; + #[doc(hidden)] + #[allow(non_snake_case)] + pub unsafe fn _export_create_tcp_socket_cabi( + arg0: i32, + ) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::create_tcp_socket( + super::super::super::super::exports::wasi::sockets::network::IpAddressFamily::_lift( + arg0 as u8, + ), + ); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -33986,51 +36674,45 @@ pub mod exports { ) -> Result; } #[doc(hidden)] - - macro_rules! __export_wasi_sockets_tcp_create_socket_0_2_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "wasi:sockets/tcp-create-socket@0.2.0#create-tcp-socket"] - unsafe extern "C" fn export_create_tcp_socket(arg0: i32,) -> *mut u8 { - $($path_to_types)*::_export_create_tcp_socket_cabi::<$ty>(arg0) - } - };); -} + macro_rules! __export_wasi_sockets_tcp_create_socket_0_2_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "wasi:sockets/tcp-create-socket@0.2.0#create-tcp-socket")] unsafe + extern "C" fn export_create_tcp_socket(arg0 : i32,) -> * mut u8 { + unsafe { $($path_to_types)*:: + _export_create_tcp_socket_cabi::<$ty > (arg0) } } }; + }; + } #[doc(hidden)] pub(crate) use __export_wasi_sockets_tcp_create_socket_0_2_0_cabi; #[repr(align(4))] struct _RetArea([::core::mem::MaybeUninit; 8]); - static mut _RET_AREA: _RetArea = _RetArea([::core::mem::MaybeUninit::uninit(); 8]); + static mut _RET_AREA: _RetArea = _RetArea( + [::core::mem::MaybeUninit::uninit(); 8], + ); } - - #[allow(dead_code, clippy::all)] + #[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)] pub mod ip_name_lookup { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; pub type Pollable = super::super::super::super::exports::wasi::io::poll::Pollable; - pub type PollableBorrow<'a> = - super::super::super::super::exports::wasi::io::poll::PollableBorrow<'a>; - pub type Network = - super::super::super::super::exports::wasi::sockets::network::Network; - pub type NetworkBorrow<'a> = - super::super::super::super::exports::wasi::sockets::network::NetworkBorrow<'a>; - pub type ErrorCode = - super::super::super::super::exports::wasi::sockets::network::ErrorCode; - pub type IpAddress = - super::super::super::super::exports::wasi::sockets::network::IpAddress; - + pub type PollableBorrow<'a> = super::super::super::super::exports::wasi::io::poll::PollableBorrow< + 'a, + >; + pub type Network = super::super::super::super::exports::wasi::sockets::network::Network; + pub type NetworkBorrow<'a> = super::super::super::super::exports::wasi::sockets::network::NetworkBorrow< + 'a, + >; + pub type ErrorCode = super::super::super::super::exports::wasi::sockets::network::ErrorCode; + pub type IpAddress = super::super::super::super::exports::wasi::sockets::network::IpAddress; #[derive(Debug)] #[repr(transparent)] pub struct ResolveAddressStream { handle: _rt::Resource, } - type _ResolveAddressStreamRep = Option; - impl ResolveAddressStream { /// Creates a new resource from the specified representation. /// @@ -34040,72 +36722,67 @@ pub mod exports { pub fn new(val: T) -> Self { Self::type_guard::(); let val: _ResolveAddressStreamRep = Some(val); - let ptr: *mut _ResolveAddressStreamRep = - _rt::Box::into_raw(_rt::Box::new(val)); + let ptr: *mut _ResolveAddressStreamRep = _rt::Box::into_raw( + _rt::Box::new(val), + ); unsafe { Self::from_handle(T::_resource_new(ptr.cast())) } } - /// Gets access to the underlying `T` which represents this resource. pub fn get(&self) -> &T { let ptr = unsafe { &*self.as_ptr::() }; ptr.as_ref().unwrap() } - /// Gets mutable access to the underlying `T` which represents this /// resource. pub fn get_mut(&mut self) -> &mut T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_mut().unwrap() } - /// Consumes this resource and returns the underlying `T`. pub fn into_inner(self) -> T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.take().unwrap() } - #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { Self { - handle: _rt::Resource::from_handle(handle), + handle: unsafe { _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) } - - // It's theoretically possible to implement the `GuestResolveAddressStream` trait twice - // so guard against using it with two different types here. #[doc(hidden)] fn type_guard() { use core::any::TypeId; static mut LAST_TYPE: Option = None; unsafe { - assert!(!cfg!(target_feature = "threads")); + assert!(! cfg!(target_feature = "atomics")); let id = TypeId::of::(); match LAST_TYPE { - Some(ty) => assert!( - ty == id, - "cannot use two types with this resource type" - ), + Some(ty) => { + assert!( + ty == id, "cannot use two types with this resource type" + ) + } None => LAST_TYPE = Some(id), } } } - #[doc(hidden)] pub unsafe fn dtor(handle: *mut u8) { Self::type_guard::(); - let _ = _rt::Box::from_raw(handle as *mut _ResolveAddressStreamRep); + let _ = unsafe { + _rt::Box::from_raw( + handle as *mut _ResolveAddressStreamRep, + ) + }; } - fn as_ptr( &self, ) -> *mut _ResolveAddressStreamRep { @@ -34113,7 +36790,6 @@ pub mod exports { T::_resource_rep(self.handle()).cast() } } - /// A borrowed version of [`ResolveAddressStream`] which represents a borrowed value /// with the lifetime `'a`. #[derive(Debug)] @@ -34122,7 +36798,6 @@ pub mod exports { rep: *mut u8, _marker: core::marker::PhantomData<&'a ResolveAddressStream>, } - impl<'a> ResolveAddressStreamBorrow<'a> { #[doc(hidden)] pub unsafe fn lift(rep: usize) -> Self { @@ -34131,43 +36806,34 @@ pub mod exports { _marker: core::marker::PhantomData, } } - /// Gets access to the underlying `T` in this resource. pub fn get(&self) -> &T { let ptr = unsafe { &mut *self.as_ptr::() }; ptr.as_ref().unwrap() } - - // NB: mutable access is not allowed due to the component model allowing - // multiple borrows of the same resource. - fn as_ptr(&self) -> *mut _ResolveAddressStreamRep { ResolveAddressStream::type_guard::(); self.rep.cast() } } - unsafe impl _rt::WasmResource for ResolveAddressStream { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link( wasm_import_module = "[export]wasi:sockets/ip-name-lookup@0.2.0" )] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-drop]resolve-address-stream"] fn drop(_: u32); } - - drop(_handle); + unsafe { drop(_handle) }; } } } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_resolve_addresses_cabi( @@ -34175,15 +36841,14 @@ pub mod exports { arg1: *mut u8, arg2: usize, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let len0 = arg2; let bytes0 = _rt::Vec::from_raw_parts(arg1.cast(), len0, len0); let result1 = T::resolve_addresses( - NetworkBorrow::lift(arg0 as u32 as usize), + unsafe { NetworkBorrow::lift(arg0 as u32 as usize) }, _rt::string_lift(bytes0), ); - let ptr2 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr2 = (&raw mut _RET_AREA.0).cast::(); match result1 { Ok(e) => { *ptr2.add(0).cast::() = (0i32) as u8; @@ -34200,15 +36865,13 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_resolve_address_stream_resolve_next_address_cabi< T: GuestResolveAddressStream, - >( - arg0: *mut u8, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + >(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::resolve_next_address( - ResolveAddressStreamBorrow::lift(arg0 as u32 as usize).get(), + unsafe { ResolveAddressStreamBorrow::lift(arg0 as u32 as usize) } + .get(), ); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); + let ptr1 = (&raw mut _RET_AREA.0).cast::(); match result0 { Ok(e) => { *ptr1.add(0).cast::() = (0i32) as u8; @@ -34227,22 +36890,15 @@ pub mod exports { } V4::Ipv6(e) => { *ptr1.add(4).cast::() = (1i32) as u8; - let (t3_0, t3_1, t3_2, t3_3, t3_4, t3_5, t3_6, t3_7) = - e; + let (t3_0, t3_1, t3_2, t3_3, t3_4, t3_5, t3_6, t3_7) = e; *ptr1.add(6).cast::() = (_rt::as_i32(t3_0)) as u16; *ptr1.add(8).cast::() = (_rt::as_i32(t3_1)) as u16; - *ptr1.add(10).cast::() = - (_rt::as_i32(t3_2)) as u16; - *ptr1.add(12).cast::() = - (_rt::as_i32(t3_3)) as u16; - *ptr1.add(14).cast::() = - (_rt::as_i32(t3_4)) as u16; - *ptr1.add(16).cast::() = - (_rt::as_i32(t3_5)) as u16; - *ptr1.add(18).cast::() = - (_rt::as_i32(t3_6)) as u16; - *ptr1.add(20).cast::() = - (_rt::as_i32(t3_7)) as u16; + *ptr1.add(10).cast::() = (_rt::as_i32(t3_2)) as u16; + *ptr1.add(12).cast::() = (_rt::as_i32(t3_3)) as u16; + *ptr1.add(14).cast::() = (_rt::as_i32(t3_4)) as u16; + *ptr1.add(16).cast::() = (_rt::as_i32(t3_5)) as u16; + *ptr1.add(18).cast::() = (_rt::as_i32(t3_6)) as u16; + *ptr1.add(20).cast::() = (_rt::as_i32(t3_7)) as u16; } } } @@ -34262,13 +36918,12 @@ pub mod exports { #[allow(non_snake_case)] pub unsafe fn _export_method_resolve_address_stream_subscribe_cabi< T: GuestResolveAddressStream, - >( - arg0: *mut u8, - ) -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = - T::subscribe(ResolveAddressStreamBorrow::lift(arg0 as u32 as usize).get()); + >(arg0: *mut u8) -> i32 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::subscribe( + unsafe { ResolveAddressStreamBorrow::lift(arg0 as u32 as usize) } + .get(), + ); (result0).take_handle() as i32 } pub trait Guest { @@ -34309,20 +36964,18 @@ pub mod exports { let _ = val; unreachable!(); } - #[cfg(target_arch = "wasm32")] { #[link( wasm_import_module = "[export]wasi:sockets/ip-name-lookup@0.2.0" )] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-new]resolve-address-stream"] fn new(_: *mut u8) -> u32; } - new(val) + unsafe { new(val) } } } - #[doc(hidden)] fn _resource_rep(handle: u32) -> *mut u8 where @@ -34333,20 +36986,18 @@ pub mod exports { let _ = handle; unreachable!(); } - #[cfg(target_arch = "wasm32")] { #[link( wasm_import_module = "[export]wasi:sockets/ip-name-lookup@0.2.0" )] - extern "C" { + unsafe extern "C" { #[link_name = "[resource-rep]resolve-address-stream"] fn rep(_: u32) -> *mut u8; } unsafe { rep(handle) } } } - /// Returns the next address from the resolver. /// /// This function should be called multiple times. On each call, it will @@ -34360,7 +37011,9 @@ pub mod exports { /// - `temporary-resolver-failure`: A temporary failure in name resolution occurred. (EAI_AGAIN) /// - `permanent-resolver-failure`: A permanent failure in name resolution occurred. (EAI_FAIL) /// - `would-block`: A result is not available yet. (EWOULDBLOCK, EAGAIN) - fn resolve_next_address(&self) -> Result, ErrorCode>; + fn resolve_next_address( + &self, + ) -> Result, ErrorCode>; /// Create a `pollable` which will resolve once the stream is ready for I/O. /// /// Note: this function is here for WASI Preview2 only. @@ -34368,51 +37021,52 @@ pub mod exports { fn subscribe(&self) -> Pollable; } #[doc(hidden)] - - macro_rules! __export_wasi_sockets_ip_name_lookup_0_2_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "wasi:sockets/ip-name-lookup@0.2.0#resolve-addresses"] - unsafe extern "C" fn export_resolve_addresses(arg0: i32,arg1: *mut u8,arg2: usize,) -> *mut u8 { - $($path_to_types)*::_export_resolve_addresses_cabi::<$ty>(arg0, arg1, arg2) - } - #[export_name = "wasi:sockets/ip-name-lookup@0.2.0#[method]resolve-address-stream.resolve-next-address"] - unsafe extern "C" fn export_method_resolve_address_stream_resolve_next_address(arg0: *mut u8,) -> *mut u8 { - $($path_to_types)*::_export_method_resolve_address_stream_resolve_next_address_cabi::<<$ty as $($path_to_types)*::Guest>::ResolveAddressStream>(arg0) - } - #[export_name = "wasi:sockets/ip-name-lookup@0.2.0#[method]resolve-address-stream.subscribe"] - unsafe extern "C" fn export_method_resolve_address_stream_subscribe(arg0: *mut u8,) -> i32 { - $($path_to_types)*::_export_method_resolve_address_stream_subscribe_cabi::<<$ty as $($path_to_types)*::Guest>::ResolveAddressStream>(arg0) - } - - const _: () = { - #[doc(hidden)] - #[export_name = "wasi:sockets/ip-name-lookup@0.2.0#[dtor]resolve-address-stream"] - #[allow(non_snake_case)] - unsafe extern "C" fn dtor(rep: *mut u8) { - $($path_to_types)*::ResolveAddressStream::dtor::< - <$ty as $($path_to_types)*::Guest>::ResolveAddressStream - >(rep) - } - }; - - };); -} + macro_rules! __export_wasi_sockets_ip_name_lookup_0_2_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[unsafe (export_name = + "wasi:sockets/ip-name-lookup@0.2.0#resolve-addresses")] unsafe + extern "C" fn export_resolve_addresses(arg0 : i32, arg1 : * mut + u8, arg2 : usize,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_resolve_addresses_cabi::<$ty > (arg0, arg1, arg2) } } + #[unsafe (export_name = + "wasi:sockets/ip-name-lookup@0.2.0#[method]resolve-address-stream.resolve-next-address")] + unsafe extern "C" fn + export_method_resolve_address_stream_resolve_next_address(arg0 : + * mut u8,) -> * mut u8 { unsafe { $($path_to_types)*:: + _export_method_resolve_address_stream_resolve_next_address_cabi::<<$ty + as $($path_to_types)*:: Guest >::ResolveAddressStream > (arg0) } + } #[unsafe (export_name = + "wasi:sockets/ip-name-lookup@0.2.0#[method]resolve-address-stream.subscribe")] + unsafe extern "C" fn + export_method_resolve_address_stream_subscribe(arg0 : * mut u8,) + -> i32 { unsafe { $($path_to_types)*:: + _export_method_resolve_address_stream_subscribe_cabi::<<$ty as + $($path_to_types)*:: Guest >::ResolveAddressStream > (arg0) } } + const _ : () = { #[doc(hidden)] #[unsafe (export_name = + "wasi:sockets/ip-name-lookup@0.2.0#[dtor]resolve-address-stream")] + #[allow(non_snake_case)] unsafe extern "C" fn dtor(rep : * mut + u8) { unsafe { $($path_to_types)*:: ResolveAddressStream::dtor::< + <$ty as $($path_to_types)*:: Guest >::ResolveAddressStream > + (rep) } } }; }; + }; + } #[doc(hidden)] pub(crate) use __export_wasi_sockets_ip_name_lookup_0_2_0_cabi; #[repr(align(4))] struct _RetArea([::core::mem::MaybeUninit; 22]); - static mut _RET_AREA: _RetArea = _RetArea([::core::mem::MaybeUninit::uninit(); 22]); + static mut _RET_AREA: _RetArea = _RetArea( + [::core::mem::MaybeUninit::uninit(); 22], + ); } } } } +#[rustfmt::skip] mod _rt { - + #![allow(dead_code, clippy::all)] 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. /// @@ -34427,16 +37081,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. /// @@ -34446,7 +37093,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 { @@ -34456,7 +37102,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 @@ -34473,31 +37118,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), } } @@ -34514,30 +37149,25 @@ mod _rt { val != 0 } } - pub use alloc_crate::alloc; pub use alloc_crate::vec::Vec; - + pub use alloc_crate::alloc; 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 { @@ -34556,7 +37186,7 @@ mod _rt { if cfg!(debug_assertions) { panic!("invalid enum discriminant") } else { - core::hint::unreachable_unchecked() + unsafe { core::hint::unreachable_unchecked() } } } pub unsafe fn cabi_dealloc(ptr: *mut u8, size: usize, align: usize) { @@ -34564,120 +37194,100 @@ 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 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 } } - #[cfg(target_arch = "wasm32")] pub fn run_ctors_once() { wit_bindgen_rt::run_ctors_once(); } pub use alloc_crate::boxed::Box; - 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 { @@ -34686,9 +37296,8 @@ mod _rt { } extern crate alloc as alloc_crate; } - -/// Generates `#[no_mangle]` functions to export the specified type as the -/// root implementation of all generated traits. +/// Generates `#[unsafe(no_mangle)]` functions to export the specified type as +/// the root implementation of all generated traits. /// /// For more information see the documentation of `wit_bindgen::generate!`. /// @@ -34705,494 +37314,581 @@ mod _rt { /// ``` #[allow(unused_macros)] #[doc(hidden)] - macro_rules! __export_env_impl { - ($ty:ident) => (self::export!($ty with_types_in self);); - ($ty:ident with_types_in $($path_to_types_root:tt)*) => ( - $($path_to_types_root)*::__export_world_env_cabi!($ty with_types_in $($path_to_types_root)*); - $($path_to_types_root)*::exports::fermyon::spin::key_value::__export_fermyon_spin_key_value_2_0_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::fermyon::spin::key_value); - $($path_to_types_root)*::exports::fermyon::spin::llm::__export_fermyon_spin_llm_2_0_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::fermyon::spin::llm); - $($path_to_types_root)*::exports::fermyon::spin::redis::__export_fermyon_spin_redis_2_0_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::fermyon::spin::redis); - $($path_to_types_root)*::exports::fermyon::spin::rdbms_types::__export_fermyon_spin_rdbms_types_2_0_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::fermyon::spin::rdbms_types); - $($path_to_types_root)*::exports::fermyon::spin::postgres::__export_fermyon_spin_postgres_2_0_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::fermyon::spin::postgres); - $($path_to_types_root)*::exports::fermyon::spin::mqtt::__export_fermyon_spin_mqtt_2_0_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::fermyon::spin::mqtt); - $($path_to_types_root)*::exports::fermyon::spin::mysql::__export_fermyon_spin_mysql_2_0_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::fermyon::spin::mysql); - $($path_to_types_root)*::exports::fermyon::spin::sqlite::__export_fermyon_spin_sqlite_2_0_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::fermyon::spin::sqlite); - $($path_to_types_root)*::exports::fermyon::spin::variables::__export_fermyon_spin_variables_2_0_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::fermyon::spin::variables); - $($path_to_types_root)*::exports::fermyon::spin_test_virt::key_value::__export_fermyon_spin_test_virt_key_value_cabi!($ty with_types_in $($path_to_types_root)*::exports::fermyon::spin_test_virt::key_value); - $($path_to_types_root)*::exports::fermyon::spin_test_virt::sqlite::__export_fermyon_spin_test_virt_sqlite_cabi!($ty with_types_in $($path_to_types_root)*::exports::fermyon::spin_test_virt::sqlite); - $($path_to_types_root)*::exports::fermyon::spin_test_virt::variables::__export_fermyon_spin_test_virt_variables_cabi!($ty with_types_in $($path_to_types_root)*::exports::fermyon::spin_test_virt::variables); - $($path_to_types_root)*::exports::wasi::io::poll::__export_wasi_io_poll_0_2_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::wasi::io::poll); - $($path_to_types_root)*::exports::wasi::clocks::monotonic_clock::__export_wasi_clocks_monotonic_clock_0_2_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::wasi::clocks::monotonic_clock); - $($path_to_types_root)*::exports::wasi::clocks::wall_clock::__export_wasi_clocks_wall_clock_0_2_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::wasi::clocks::wall_clock); - $($path_to_types_root)*::exports::wasi::random::random::__export_wasi_random_random_0_2_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::wasi::random::random); - $($path_to_types_root)*::exports::wasi::random::insecure::__export_wasi_random_insecure_0_2_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::wasi::random::insecure); - $($path_to_types_root)*::exports::wasi::random::insecure_seed::__export_wasi_random_insecure_seed_0_2_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::wasi::random::insecure_seed); - $($path_to_types_root)*::exports::wasi::io::error::__export_wasi_io_error_0_2_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::wasi::io::error); - $($path_to_types_root)*::exports::wasi::io::streams::__export_wasi_io_streams_0_2_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::wasi::io::streams); - $($path_to_types_root)*::exports::wasi::filesystem::types::__export_wasi_filesystem_types_0_2_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::wasi::filesystem::types); - $($path_to_types_root)*::exports::wasi::filesystem::preopens::__export_wasi_filesystem_preopens_0_2_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::wasi::filesystem::preopens); - $($path_to_types_root)*::exports::wasi::cli::stdout::__export_wasi_cli_stdout_0_2_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::wasi::cli::stdout); - $($path_to_types_root)*::exports::wasi::cli::stdin::__export_wasi_cli_stdin_0_2_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::wasi::cli::stdin); - $($path_to_types_root)*::exports::wasi::cli::stderr::__export_wasi_cli_stderr_0_2_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::wasi::cli::stderr); - $($path_to_types_root)*::exports::wasi::cli::terminal_input::__export_wasi_cli_terminal_input_0_2_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::wasi::cli::terminal_input); - $($path_to_types_root)*::exports::wasi::cli::terminal_output::__export_wasi_cli_terminal_output_0_2_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::wasi::cli::terminal_output); - $($path_to_types_root)*::exports::wasi::cli::terminal_stdin::__export_wasi_cli_terminal_stdin_0_2_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::wasi::cli::terminal_stdin); - $($path_to_types_root)*::exports::wasi::cli::terminal_stdout::__export_wasi_cli_terminal_stdout_0_2_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::wasi::cli::terminal_stdout); - $($path_to_types_root)*::exports::wasi::cli::terminal_stderr::__export_wasi_cli_terminal_stderr_0_2_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::wasi::cli::terminal_stderr); - $($path_to_types_root)*::exports::wasi::cli::environment::__export_wasi_cli_environment_0_2_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::wasi::cli::environment); - $($path_to_types_root)*::exports::wasi::cli::exit::__export_wasi_cli_exit_0_2_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::wasi::cli::exit); - $($path_to_types_root)*::exports::wasi::sockets::network::__export_wasi_sockets_network_0_2_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::wasi::sockets::network); - $($path_to_types_root)*::exports::wasi::sockets::instance_network::__export_wasi_sockets_instance_network_0_2_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::wasi::sockets::instance_network); - $($path_to_types_root)*::exports::wasi::sockets::udp::__export_wasi_sockets_udp_0_2_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::wasi::sockets::udp); - $($path_to_types_root)*::exports::wasi::sockets::udp_create_socket::__export_wasi_sockets_udp_create_socket_0_2_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::wasi::sockets::udp_create_socket); - $($path_to_types_root)*::exports::wasi::sockets::tcp::__export_wasi_sockets_tcp_0_2_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::wasi::sockets::tcp); - $($path_to_types_root)*::exports::wasi::sockets::tcp_create_socket::__export_wasi_sockets_tcp_create_socket_0_2_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::wasi::sockets::tcp_create_socket); - $($path_to_types_root)*::exports::wasi::sockets::ip_name_lookup::__export_wasi_sockets_ip_name_lookup_0_2_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::wasi::sockets::ip_name_lookup); - $($path_to_types_root)*::exports::wasi::http::types::__export_wasi_http_types_0_2_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::wasi::http::types); - $($path_to_types_root)*::exports::wasi::http::outgoing_handler::__export_wasi_http_outgoing_handler_0_2_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::wasi::http::outgoing_handler); - $($path_to_types_root)*::exports::fermyon::spin_wasi_virt::http_handler::__export_fermyon_spin_wasi_virt_http_handler_cabi!($ty with_types_in $($path_to_types_root)*::exports::fermyon::spin_wasi_virt::http_handler); - $($path_to_types_root)*::exports::fermyon::spin_wasi_virt::http_helper::__export_fermyon_spin_wasi_virt_http_helper_cabi!($ty with_types_in $($path_to_types_root)*::exports::fermyon::spin_wasi_virt::http_helper); - $($path_to_types_root)*::exports::fermyon::spin_wasi_virt::fs_handler::__export_fermyon_spin_wasi_virt_fs_handler_cabi!($ty with_types_in $($path_to_types_root)*::exports::fermyon::spin_wasi_virt::fs_handler); - ) + ($ty:ident) => { + self::export!($ty with_types_in self); + }; + ($ty:ident with_types_in $($path_to_types_root:tt)*) => { + $($path_to_types_root)*:: __export_world_env_cabi!($ty with_types_in + $($path_to_types_root)*); $($path_to_types_root)*:: + exports::fermyon::spin::key_value::__export_fermyon_spin_key_value_2_0_0_cabi!($ty + with_types_in $($path_to_types_root)*:: exports::fermyon::spin::key_value); + $($path_to_types_root)*:: + exports::fermyon::spin::llm::__export_fermyon_spin_llm_2_0_0_cabi!($ty + with_types_in $($path_to_types_root)*:: exports::fermyon::spin::llm); + $($path_to_types_root)*:: + exports::fermyon::spin::redis::__export_fermyon_spin_redis_2_0_0_cabi!($ty + with_types_in $($path_to_types_root)*:: exports::fermyon::spin::redis); + $($path_to_types_root)*:: + exports::fermyon::spin::rdbms_types::__export_fermyon_spin_rdbms_types_2_0_0_cabi!($ty + with_types_in $($path_to_types_root)*:: exports::fermyon::spin::rdbms_types); + $($path_to_types_root)*:: + exports::fermyon::spin::postgres::__export_fermyon_spin_postgres_2_0_0_cabi!($ty + with_types_in $($path_to_types_root)*:: exports::fermyon::spin::postgres); + $($path_to_types_root)*:: + exports::fermyon::spin::mqtt::__export_fermyon_spin_mqtt_2_0_0_cabi!($ty + with_types_in $($path_to_types_root)*:: exports::fermyon::spin::mqtt); + $($path_to_types_root)*:: + exports::fermyon::spin::mysql::__export_fermyon_spin_mysql_2_0_0_cabi!($ty + with_types_in $($path_to_types_root)*:: exports::fermyon::spin::mysql); + $($path_to_types_root)*:: + exports::fermyon::spin::sqlite::__export_fermyon_spin_sqlite_2_0_0_cabi!($ty + with_types_in $($path_to_types_root)*:: exports::fermyon::spin::sqlite); + $($path_to_types_root)*:: + exports::fermyon::spin::variables::__export_fermyon_spin_variables_2_0_0_cabi!($ty + with_types_in $($path_to_types_root)*:: exports::fermyon::spin::variables); + $($path_to_types_root)*:: + exports::fermyon::spin_test_virt::key_value::__export_fermyon_spin_test_virt_key_value_cabi!($ty + with_types_in $($path_to_types_root)*:: + exports::fermyon::spin_test_virt::key_value); $($path_to_types_root)*:: + exports::fermyon::spin_test_virt::sqlite::__export_fermyon_spin_test_virt_sqlite_cabi!($ty + with_types_in $($path_to_types_root)*:: + exports::fermyon::spin_test_virt::sqlite); $($path_to_types_root)*:: + exports::fermyon::spin_test_virt::variables::__export_fermyon_spin_test_virt_variables_cabi!($ty + with_types_in $($path_to_types_root)*:: + exports::fermyon::spin_test_virt::variables); $($path_to_types_root)*:: + exports::wasi::io::poll::__export_wasi_io_poll_0_2_0_cabi!($ty with_types_in + $($path_to_types_root)*:: exports::wasi::io::poll); $($path_to_types_root)*:: + exports::wasi::clocks::monotonic_clock::__export_wasi_clocks_monotonic_clock_0_2_0_cabi!($ty + with_types_in $($path_to_types_root)*:: exports::wasi::clocks::monotonic_clock); + $($path_to_types_root)*:: + exports::wasi::clocks::wall_clock::__export_wasi_clocks_wall_clock_0_2_0_cabi!($ty + with_types_in $($path_to_types_root)*:: exports::wasi::clocks::wall_clock); + $($path_to_types_root)*:: + exports::wasi::random::random::__export_wasi_random_random_0_2_0_cabi!($ty + with_types_in $($path_to_types_root)*:: exports::wasi::random::random); + $($path_to_types_root)*:: + exports::wasi::random::insecure::__export_wasi_random_insecure_0_2_0_cabi!($ty + with_types_in $($path_to_types_root)*:: exports::wasi::random::insecure); + $($path_to_types_root)*:: + exports::wasi::random::insecure_seed::__export_wasi_random_insecure_seed_0_2_0_cabi!($ty + with_types_in $($path_to_types_root)*:: exports::wasi::random::insecure_seed); + $($path_to_types_root)*:: + exports::wasi::io::error::__export_wasi_io_error_0_2_0_cabi!($ty with_types_in + $($path_to_types_root)*:: exports::wasi::io::error); $($path_to_types_root)*:: + exports::wasi::io::streams::__export_wasi_io_streams_0_2_0_cabi!($ty + with_types_in $($path_to_types_root)*:: exports::wasi::io::streams); + $($path_to_types_root)*:: + exports::wasi::filesystem::types::__export_wasi_filesystem_types_0_2_0_cabi!($ty + with_types_in $($path_to_types_root)*:: exports::wasi::filesystem::types); + $($path_to_types_root)*:: + exports::wasi::filesystem::preopens::__export_wasi_filesystem_preopens_0_2_0_cabi!($ty + with_types_in $($path_to_types_root)*:: exports::wasi::filesystem::preopens); + $($path_to_types_root)*:: + exports::wasi::cli::stdout::__export_wasi_cli_stdout_0_2_0_cabi!($ty + with_types_in $($path_to_types_root)*:: exports::wasi::cli::stdout); + $($path_to_types_root)*:: + exports::wasi::cli::stdin::__export_wasi_cli_stdin_0_2_0_cabi!($ty with_types_in + $($path_to_types_root)*:: exports::wasi::cli::stdin); $($path_to_types_root)*:: + exports::wasi::cli::stderr::__export_wasi_cli_stderr_0_2_0_cabi!($ty + with_types_in $($path_to_types_root)*:: exports::wasi::cli::stderr); + $($path_to_types_root)*:: + exports::wasi::cli::terminal_input::__export_wasi_cli_terminal_input_0_2_0_cabi!($ty + with_types_in $($path_to_types_root)*:: exports::wasi::cli::terminal_input); + $($path_to_types_root)*:: + exports::wasi::cli::terminal_output::__export_wasi_cli_terminal_output_0_2_0_cabi!($ty + with_types_in $($path_to_types_root)*:: exports::wasi::cli::terminal_output); + $($path_to_types_root)*:: + exports::wasi::cli::terminal_stdin::__export_wasi_cli_terminal_stdin_0_2_0_cabi!($ty + with_types_in $($path_to_types_root)*:: exports::wasi::cli::terminal_stdin); + $($path_to_types_root)*:: + exports::wasi::cli::terminal_stdout::__export_wasi_cli_terminal_stdout_0_2_0_cabi!($ty + with_types_in $($path_to_types_root)*:: exports::wasi::cli::terminal_stdout); + $($path_to_types_root)*:: + exports::wasi::cli::terminal_stderr::__export_wasi_cli_terminal_stderr_0_2_0_cabi!($ty + with_types_in $($path_to_types_root)*:: exports::wasi::cli::terminal_stderr); + $($path_to_types_root)*:: + exports::wasi::cli::environment::__export_wasi_cli_environment_0_2_0_cabi!($ty + with_types_in $($path_to_types_root)*:: exports::wasi::cli::environment); + $($path_to_types_root)*:: + exports::wasi::cli::exit::__export_wasi_cli_exit_0_2_0_cabi!($ty with_types_in + $($path_to_types_root)*:: exports::wasi::cli::exit); $($path_to_types_root)*:: + exports::wasi::sockets::network::__export_wasi_sockets_network_0_2_0_cabi!($ty + with_types_in $($path_to_types_root)*:: exports::wasi::sockets::network); + $($path_to_types_root)*:: + exports::wasi::sockets::instance_network::__export_wasi_sockets_instance_network_0_2_0_cabi!($ty + with_types_in $($path_to_types_root)*:: + exports::wasi::sockets::instance_network); $($path_to_types_root)*:: + exports::wasi::sockets::udp::__export_wasi_sockets_udp_0_2_0_cabi!($ty + with_types_in $($path_to_types_root)*:: exports::wasi::sockets::udp); + $($path_to_types_root)*:: + exports::wasi::sockets::udp_create_socket::__export_wasi_sockets_udp_create_socket_0_2_0_cabi!($ty + with_types_in $($path_to_types_root)*:: + exports::wasi::sockets::udp_create_socket); $($path_to_types_root)*:: + exports::wasi::sockets::tcp::__export_wasi_sockets_tcp_0_2_0_cabi!($ty + with_types_in $($path_to_types_root)*:: exports::wasi::sockets::tcp); + $($path_to_types_root)*:: + exports::wasi::sockets::tcp_create_socket::__export_wasi_sockets_tcp_create_socket_0_2_0_cabi!($ty + with_types_in $($path_to_types_root)*:: + exports::wasi::sockets::tcp_create_socket); $($path_to_types_root)*:: + exports::wasi::sockets::ip_name_lookup::__export_wasi_sockets_ip_name_lookup_0_2_0_cabi!($ty + with_types_in $($path_to_types_root)*:: exports::wasi::sockets::ip_name_lookup); + $($path_to_types_root)*:: + exports::wasi::http::types::__export_wasi_http_types_0_2_0_cabi!($ty + with_types_in $($path_to_types_root)*:: exports::wasi::http::types); + $($path_to_types_root)*:: + exports::wasi::http::outgoing_handler::__export_wasi_http_outgoing_handler_0_2_0_cabi!($ty + with_types_in $($path_to_types_root)*:: exports::wasi::http::outgoing_handler); + $($path_to_types_root)*:: + exports::fermyon::spin_wasi_virt::http_handler::__export_fermyon_spin_wasi_virt_http_handler_cabi!($ty + with_types_in $($path_to_types_root)*:: + exports::fermyon::spin_wasi_virt::http_handler); $($path_to_types_root)*:: + exports::fermyon::spin_wasi_virt::http_helper::__export_fermyon_spin_wasi_virt_http_helper_cabi!($ty + with_types_in $($path_to_types_root)*:: + exports::fermyon::spin_wasi_virt::http_helper); $($path_to_types_root)*:: + exports::fermyon::spin_wasi_virt::fs_handler::__export_fermyon_spin_wasi_virt_fs_handler_cabi!($ty + with_types_in $($path_to_types_root)*:: + exports::fermyon::spin_wasi_virt::fs_handler); + }; } #[doc(inline)] pub(crate) use __export_env_impl as export; - #[cfg(target_arch = "wasm32")] -#[link_section = "component-type:wit-bindgen:0.25.0:env:encoded world"] +#[unsafe( + link_section = "component-type:wit-bindgen:0.41.0:fermyon:spin-test-virt:env:encoded world" +)] #[doc(hidden)] +#[allow(clippy::octal_escapes)] pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 28152] = *b"\ \0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\xfd\xda\x01\x01A\x02\ -\x01A\xa2\x01\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[me\ -thod]pollable.block\x01\x03\x01p\x01\x01py\x01@\x01\x02in\x04\0\x05\x04\0\x04pol\ -l\x01\x06\x03\x01\x12wasi:io/poll@0.2.0\x05\0\x02\x03\0\0\x08pollable\x01B\x0f\x02\ -\x03\x02\x01\x01\x04\0\x08pollable\x03\0\0\x01w\x04\0\x07instant\x03\0\x02\x01w\x04\ -\0\x08duration\x03\0\x04\x01@\0\0\x03\x04\0\x03now\x01\x06\x01@\0\0\x05\x04\0\x0a\ -resolution\x01\x07\x01i\x01\x01@\x01\x04when\x03\0\x08\x04\0\x11subscribe-instan\ -t\x01\x09\x01@\x01\x04when\x05\0\x08\x04\0\x12subscribe-duration\x01\x0a\x03\x01\ -!wasi:clocks/monotonic-clock@0.2.0\x05\x02\x01B\x05\x01r\x02\x07secondsw\x0bnano\ -secondsy\x04\0\x08datetime\x03\0\0\x01@\0\0\x01\x04\0\x03now\x01\x02\x04\0\x0are\ -solution\x01\x02\x03\x01\x1cwasi:clocks/wall-clock@0.2.0\x05\x03\x01B\x05\x01p}\x01\ -@\x01\x03lenw\0\0\x04\0\x10get-random-bytes\x01\x01\x01@\0\0w\x04\0\x0eget-rando\ -m-u64\x01\x02\x03\x01\x18wasi:random/random@0.2.0\x05\x04\x01B\x05\x01p}\x01@\x01\ -\x03lenw\0\0\x04\0\x19get-insecure-random-bytes\x01\x01\x01@\0\0w\x04\0\x17get-i\ -nsecure-random-u64\x01\x02\x03\x01\x1awasi:random/insecure@0.2.0\x05\x05\x01B\x03\ -\x01o\x02ww\x01@\0\0\0\x04\0\x0dinsecure-seed\x01\x01\x03\x01\x1fwasi:random/ins\ -ecure-seed@0.2.0\x05\x06\x01B\x04\x04\0\x05error\x03\x01\x01h\0\x01@\x01\x04self\ -\x01\0s\x04\0\x1d[method]error.to-debug-string\x01\x02\x03\x01\x13wasi:io/error@\ -0.2.0\x05\x07\x02\x03\0\x06\x05error\x01B(\x02\x03\x02\x01\x08\x04\0\x05error\x03\ -\0\0\x02\x03\x02\x01\x01\x04\0\x08pollable\x03\0\x02\x01i\x01\x01q\x02\x15last-o\ -peration-failed\x01\x04\0\x06closed\0\0\x04\0\x0cstream-error\x03\0\x05\x04\0\x0c\ -input-stream\x03\x01\x04\0\x0doutput-stream\x03\x01\x01h\x07\x01p}\x01j\x01\x0a\x01\ -\x06\x01@\x02\x04self\x09\x03lenw\0\x0b\x04\0\x19[method]input-stream.read\x01\x0c\ -\x04\0\"[method]input-stream.blocking-read\x01\x0c\x01j\x01w\x01\x06\x01@\x02\x04\ -self\x09\x03lenw\0\x0d\x04\0\x19[method]input-stream.skip\x01\x0e\x04\0\"[method\ -]input-stream.blocking-skip\x01\x0e\x01i\x03\x01@\x01\x04self\x09\0\x0f\x04\0\x1e\ -[method]input-stream.subscribe\x01\x10\x01h\x08\x01@\x01\x04self\x11\0\x0d\x04\0\ -![method]output-stream.check-write\x01\x12\x01j\0\x01\x06\x01@\x02\x04self\x11\x08\ -contents\x0a\0\x13\x04\0\x1b[method]output-stream.write\x01\x14\x04\0.[method]ou\ -tput-stream.blocking-write-and-flush\x01\x14\x01@\x01\x04self\x11\0\x13\x04\0\x1b\ -[method]output-stream.flush\x01\x15\x04\0$[method]output-stream.blocking-flush\x01\ -\x15\x01@\x01\x04self\x11\0\x0f\x04\0\x1f[method]output-stream.subscribe\x01\x16\ -\x01@\x02\x04self\x11\x03lenw\0\x13\x04\0\"[method]output-stream.write-zeroes\x01\ -\x17\x04\05[method]output-stream.blocking-write-zeroes-and-flush\x01\x17\x01@\x03\ -\x04self\x11\x03src\x09\x03lenw\0\x0d\x04\0\x1c[method]output-stream.splice\x01\x18\ -\x04\0%[method]output-stream.blocking-splice\x01\x18\x03\x01\x15wasi:io/streams@\ -0.2.0\x05\x09\x02\x03\0\x07\x0doutput-stream\x01B\x05\x02\x03\x02\x01\x0a\x04\0\x0d\ -output-stream\x03\0\0\x01i\x01\x01@\0\0\x02\x04\0\x0aget-stdout\x01\x03\x03\x01\x15\ -wasi:cli/stdout@0.2.0\x05\x0b\x02\x03\0\x07\x0cinput-stream\x01B\x05\x02\x03\x02\ -\x01\x0c\x04\0\x0cinput-stream\x03\0\0\x01i\x01\x01@\0\0\x02\x04\0\x09get-stdin\x01\ -\x03\x03\x01\x14wasi:cli/stdin@0.2.0\x05\x0d\x01B\x05\x02\x03\x02\x01\x0a\x04\0\x0d\ -output-stream\x03\0\0\x01i\x01\x01@\0\0\x02\x04\0\x0aget-stderr\x01\x03\x03\x01\x15\ -wasi:cli/stderr@0.2.0\x05\x0e\x01B\x01\x04\0\x0eterminal-input\x03\x01\x03\x01\x1d\ -wasi:cli/terminal-input@0.2.0\x05\x0f\x01B\x01\x04\0\x0fterminal-output\x03\x01\x03\ -\x01\x1ewasi:cli/terminal-output@0.2.0\x05\x10\x02\x03\0\x0b\x0eterminal-input\x01\ -B\x06\x02\x03\x02\x01\x11\x04\0\x0eterminal-input\x03\0\0\x01i\x01\x01k\x02\x01@\ -\0\0\x03\x04\0\x12get-terminal-stdin\x01\x04\x03\x01\x1dwasi:cli/terminal-stdin@\ -0.2.0\x05\x12\x02\x03\0\x0c\x0fterminal-output\x01B\x06\x02\x03\x02\x01\x13\x04\0\ +\x01A\xa2\x01\x01@\0\0s\x03\0\x0cget-manifest\x01\0\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]pollable.block\x01\x03\x01p\x01\x01py\x01\ +@\x01\x02in\x04\0\x05\x04\0\x04poll\x01\x06\x03\0\x12wasi:io/poll@0.2.0\x05\x01\x02\ +\x03\0\0\x08pollable\x01B\x0f\x02\x03\x02\x01\x02\x04\0\x08pollable\x03\0\0\x01w\ +\x04\0\x07instant\x03\0\x02\x01w\x04\0\x08duration\x03\0\x04\x01@\0\0\x03\x04\0\x03\ +now\x01\x06\x01@\0\0\x05\x04\0\x0aresolution\x01\x07\x01i\x01\x01@\x01\x04when\x03\ +\0\x08\x04\0\x11subscribe-instant\x01\x09\x01@\x01\x04when\x05\0\x08\x04\0\x12su\ +bscribe-duration\x01\x0a\x03\0!wasi:clocks/monotonic-clock@0.2.0\x05\x03\x01B\x05\ +\x01r\x02\x07secondsw\x0bnanosecondsy\x04\0\x08datetime\x03\0\0\x01@\0\0\x01\x04\ +\0\x03now\x01\x02\x04\0\x0aresolution\x01\x02\x03\0\x1cwasi:clocks/wall-clock@0.\ +2.0\x05\x04\x01B\x05\x01p}\x01@\x01\x03lenw\0\0\x04\0\x10get-random-bytes\x01\x01\ +\x01@\0\0w\x04\0\x0eget-random-u64\x01\x02\x03\0\x18wasi:random/random@0.2.0\x05\ +\x05\x01B\x05\x01p}\x01@\x01\x03lenw\0\0\x04\0\x19get-insecure-random-bytes\x01\x01\ +\x01@\0\0w\x04\0\x17get-insecure-random-u64\x01\x02\x03\0\x1awasi:random/insecur\ +e@0.2.0\x05\x06\x01B\x03\x01o\x02ww\x01@\0\0\0\x04\0\x0dinsecure-seed\x01\x01\x03\ +\0\x1fwasi:random/insecure-seed@0.2.0\x05\x07\x01B\x04\x04\0\x05error\x03\x01\x01\ +h\0\x01@\x01\x04self\x01\0s\x04\0\x1d[method]error.to-debug-string\x01\x02\x03\0\ +\x13wasi:io/error@0.2.0\x05\x08\x02\x03\0\x06\x05error\x01B(\x02\x03\x02\x01\x09\ +\x04\0\x05error\x03\0\0\x02\x03\x02\x01\x02\x04\0\x08pollable\x03\0\x02\x01i\x01\ +\x01q\x02\x15last-operation-failed\x01\x04\0\x06closed\0\0\x04\0\x0cstream-error\ +\x03\0\x05\x04\0\x0cinput-stream\x03\x01\x04\0\x0doutput-stream\x03\x01\x01h\x07\ +\x01p}\x01j\x01\x0a\x01\x06\x01@\x02\x04self\x09\x03lenw\0\x0b\x04\0\x19[method]\ +input-stream.read\x01\x0c\x04\0\"[method]input-stream.blocking-read\x01\x0c\x01j\ +\x01w\x01\x06\x01@\x02\x04self\x09\x03lenw\0\x0d\x04\0\x19[method]input-stream.s\ +kip\x01\x0e\x04\0\"[method]input-stream.blocking-skip\x01\x0e\x01i\x03\x01@\x01\x04\ +self\x09\0\x0f\x04\0\x1e[method]input-stream.subscribe\x01\x10\x01h\x08\x01@\x01\ +\x04self\x11\0\x0d\x04\0![method]output-stream.check-write\x01\x12\x01j\0\x01\x06\ +\x01@\x02\x04self\x11\x08contents\x0a\0\x13\x04\0\x1b[method]output-stream.write\ +\x01\x14\x04\0.[method]output-stream.blocking-write-and-flush\x01\x14\x01@\x01\x04\ +self\x11\0\x13\x04\0\x1b[method]output-stream.flush\x01\x15\x04\0$[method]output\ +-stream.blocking-flush\x01\x15\x01@\x01\x04self\x11\0\x0f\x04\0\x1f[method]outpu\ +t-stream.subscribe\x01\x16\x01@\x02\x04self\x11\x03lenw\0\x13\x04\0\"[method]out\ +put-stream.write-zeroes\x01\x17\x04\05[method]output-stream.blocking-write-zeroe\ +s-and-flush\x01\x17\x01@\x03\x04self\x11\x03src\x09\x03lenw\0\x0d\x04\0\x1c[meth\ +od]output-stream.splice\x01\x18\x04\0%[method]output-stream.blocking-splice\x01\x18\ +\x03\0\x15wasi:io/streams@0.2.0\x05\x0a\x02\x03\0\x07\x0doutput-stream\x01B\x05\x02\ +\x03\x02\x01\x0b\x04\0\x0doutput-stream\x03\0\0\x01i\x01\x01@\0\0\x02\x04\0\x0ag\ +et-stdout\x01\x03\x03\0\x15wasi:cli/stdout@0.2.0\x05\x0c\x02\x03\0\x07\x0cinput-\ +stream\x01B\x05\x02\x03\x02\x01\x0d\x04\0\x0cinput-stream\x03\0\0\x01i\x01\x01@\0\ +\0\x02\x04\0\x09get-stdin\x01\x03\x03\0\x14wasi:cli/stdin@0.2.0\x05\x0e\x01B\x05\ +\x02\x03\x02\x01\x0b\x04\0\x0doutput-stream\x03\0\0\x01i\x01\x01@\0\0\x02\x04\0\x0a\ +get-stderr\x01\x03\x03\0\x15wasi:cli/stderr@0.2.0\x05\x0f\x01B\x01\x04\0\x0eterm\ +inal-input\x03\x01\x03\0\x1dwasi:cli/terminal-input@0.2.0\x05\x10\x01B\x01\x04\0\ +\x0fterminal-output\x03\x01\x03\0\x1ewasi:cli/terminal-output@0.2.0\x05\x11\x02\x03\ +\0\x0b\x0eterminal-input\x01B\x06\x02\x03\x02\x01\x12\x04\0\x0eterminal-input\x03\ +\0\0\x01i\x01\x01k\x02\x01@\0\0\x03\x04\0\x12get-terminal-stdin\x01\x04\x03\0\x1d\ +wasi:cli/terminal-stdin@0.2.0\x05\x13\x02\x03\0\x0c\x0fterminal-output\x01B\x06\x02\ +\x03\x02\x01\x14\x04\0\x0fterminal-output\x03\0\0\x01i\x01\x01k\x02\x01@\0\0\x03\ +\x04\0\x13get-terminal-stdout\x01\x04\x03\0\x1ewasi:cli/terminal-stdout@0.2.0\x05\ +\x15\x01B\x06\x02\x03\x02\x01\x14\x04\0\x0fterminal-output\x03\0\0\x01i\x01\x01k\ +\x02\x01@\0\0\x03\x04\0\x13get-terminal-stderr\x01\x04\x03\0\x1ewasi:cli/termina\ +l-stderr@0.2.0\x05\x16\x01B\x0a\x01o\x02ss\x01p\0\x01@\0\0\x01\x04\0\x0fget-envi\ +ronment\x01\x02\x01ps\x01@\0\0\x03\x04\0\x0dget-arguments\x01\x04\x01ks\x01@\0\0\ +\x05\x04\0\x0binitial-cwd\x01\x06\x03\0\x1awasi:cli/environment@0.2.0\x05\x17\x01\ +B\x03\x01j\0\0\x01@\x01\x06status\0\x01\0\x04\0\x04exit\x01\x01\x03\0\x13wasi:cl\ +i/exit@0.2.0\x05\x18\x02\x03\0\x01\x08duration\x01B\xc0\x01\x02\x03\x02\x01\x19\x04\ +\0\x08duration\x03\0\0\x02\x03\x02\x01\x0d\x04\0\x0cinput-stream\x03\0\x02\x02\x03\ +\x02\x01\x0b\x04\0\x0doutput-stream\x03\0\x04\x02\x03\x02\x01\x09\x04\0\x08io-er\ +ror\x03\0\x06\x02\x03\x02\x01\x02\x04\0\x08pollable\x03\0\x08\x01q\x0a\x03get\0\0\ +\x04head\0\0\x04post\0\0\x03put\0\0\x06delete\0\0\x07connect\0\0\x07options\0\0\x05\ +trace\0\0\x05patch\0\0\x05other\x01s\0\x04\0\x06method\x03\0\x0a\x01q\x03\x04HTT\ +P\0\0\x05HTTPS\0\0\x05other\x01s\0\x04\0\x06scheme\x03\0\x0c\x01ks\x01k{\x01r\x02\ +\x05rcode\x0e\x09info-code\x0f\x04\0\x11DNS-error-payload\x03\0\x10\x01k}\x01r\x02\ +\x08alert-id\x12\x0dalert-message\x0e\x04\0\x1aTLS-alert-received-payload\x03\0\x13\ +\x01ky\x01r\x02\x0afield-name\x0e\x0afield-size\x15\x04\0\x12field-size-payload\x03\ +\0\x16\x01kw\x01k\x17\x01q'\x0bDNS-timeout\0\0\x09DNS-error\x01\x11\0\x15destina\ +tion-not-found\0\0\x17destination-unavailable\0\0\x19destination-IP-prohibited\0\ +\0\x19destination-IP-unroutable\0\0\x12connection-refused\0\0\x15connection-term\ +inated\0\0\x12connection-timeout\0\0\x17connection-read-timeout\0\0\x18connectio\ +n-write-timeout\0\0\x18connection-limit-reached\0\0\x12TLS-protocol-error\0\0\x15\ +TLS-certificate-error\0\0\x12TLS-alert-received\x01\x14\0\x13HTTP-request-denied\ +\0\0\x1cHTTP-request-length-required\0\0\x16HTTP-request-body-size\x01\x18\0\x1b\ +HTTP-request-method-invalid\0\0\x18HTTP-request-URI-invalid\0\0\x19HTTP-request-\ +URI-too-long\0\0\x20HTTP-request-header-section-size\x01\x15\0\x18HTTP-request-h\ +eader-size\x01\x19\0!HTTP-request-trailer-section-size\x01\x15\0\x19HTTP-request\ +-trailer-size\x01\x17\0\x18HTTP-response-incomplete\0\0!HTTP-response-header-sec\ +tion-size\x01\x15\0\x19HTTP-response-header-size\x01\x17\0\x17HTTP-response-body\ +-size\x01\x18\0\"HTTP-response-trailer-section-size\x01\x15\0\x1aHTTP-response-t\ +railer-size\x01\x17\0\x1dHTTP-response-transfer-coding\x01\x0e\0\x1cHTTP-respons\ +e-content-coding\x01\x0e\0\x15HTTP-response-timeout\0\0\x13HTTP-upgrade-failed\0\ +\0\x13HTTP-protocol-error\0\0\x0dloop-detected\0\0\x13configuration-error\0\0\x0e\ +internal-error\x01\x0e\0\x04\0\x0aerror-code\x03\0\x1a\x01q\x03\x0einvalid-synta\ +x\0\0\x09forbidden\0\0\x09immutable\0\0\x04\0\x0cheader-error\x03\0\x1c\x01s\x04\ +\0\x09field-key\x03\0\x1e\x01p}\x04\0\x0bfield-value\x03\0\x20\x04\0\x06fields\x03\ +\x01\x04\0\x07headers\x03\0\"\x04\0\x08trailers\x03\0\"\x04\0\x10incoming-reques\ +t\x03\x01\x04\0\x10outgoing-request\x03\x01\x04\0\x0frequest-options\x03\x01\x04\ +\0\x11response-outparam\x03\x01\x01{\x04\0\x0bstatus-code\x03\0)\x04\0\x11incomi\ +ng-response\x03\x01\x04\0\x0dincoming-body\x03\x01\x04\0\x0ffuture-trailers\x03\x01\ +\x04\0\x11outgoing-response\x03\x01\x04\0\x0doutgoing-body\x03\x01\x04\0\x18futu\ +re-incoming-response\x03\x01\x01i\"\x01@\0\01\x04\0\x13[constructor]fields\x012\x01\ +o\x02\x1f!\x01p3\x01j\x011\x01\x1d\x01@\x01\x07entries4\05\x04\0\x18[static]fiel\ +ds.from-list\x016\x01h\"\x01p!\x01@\x02\x04self7\x04name\x1f\08\x04\0\x12[method\ +]fields.get\x019\x01@\x02\x04self7\x04name\x1f\0\x7f\x04\0\x12[method]fields.has\ +\x01:\x01j\0\x01\x1d\x01@\x03\x04self7\x04name\x1f\x05value8\0;\x04\0\x12[method\ +]fields.set\x01<\x01@\x02\x04self7\x04name\x1f\0;\x04\0\x15[method]fields.delete\ +\x01=\x01@\x03\x04self7\x04name\x1f\x05value!\0;\x04\0\x15[method]fields.append\x01\ +>\x01@\x01\x04self7\04\x04\0\x16[method]fields.entries\x01?\x01@\x01\x04self7\01\ +\x04\0\x14[method]fields.clone\x01@\x01h%\x01@\x01\x04self\xc1\0\0\x0b\x04\0\x1f\ +[method]incoming-request.method\x01B\x01@\x01\x04self\xc1\0\0\x0e\x04\0([method]\ +incoming-request.path-with-query\x01C\x01k\x0d\x01@\x01\x04self\xc1\0\0\xc4\0\x04\ +\0\x1f[method]incoming-request.scheme\x01E\x04\0\"[method]incoming-request.autho\ +rity\x01C\x01i#\x01@\x01\x04self\xc1\0\0\xc6\0\x04\0\x20[method]incoming-request\ +.headers\x01G\x01i,\x01j\x01\xc8\0\0\x01@\x01\x04self\xc1\0\0\xc9\0\x04\0\x20[me\ +thod]incoming-request.consume\x01J\x01i&\x01@\x01\x07headers\xc6\0\0\xcb\0\x04\0\ +\x1d[constructor]outgoing-request\x01L\x01h&\x01i/\x01j\x01\xce\0\0\x01@\x01\x04\ +self\xcd\0\0\xcf\0\x04\0\x1d[method]outgoing-request.body\x01P\x01@\x01\x04self\xcd\ +\0\0\x0b\x04\0\x1f[method]outgoing-request.method\x01Q\x01j\0\0\x01@\x02\x04self\ +\xcd\0\x06method\x0b\0\xd2\0\x04\0#[method]outgoing-request.set-method\x01S\x01@\ +\x01\x04self\xcd\0\0\x0e\x04\0([method]outgoing-request.path-with-query\x01T\x01\ +@\x02\x04self\xcd\0\x0fpath-with-query\x0e\0\xd2\0\x04\0,[method]outgoing-reques\ +t.set-path-with-query\x01U\x01@\x01\x04self\xcd\0\0\xc4\0\x04\0\x1f[method]outgo\ +ing-request.scheme\x01V\x01@\x02\x04self\xcd\0\x06scheme\xc4\0\0\xd2\0\x04\0#[me\ +thod]outgoing-request.set-scheme\x01W\x04\0\"[method]outgoing-request.authority\x01\ +T\x01@\x02\x04self\xcd\0\x09authority\x0e\0\xd2\0\x04\0&[method]outgoing-request\ +.set-authority\x01X\x01@\x01\x04self\xcd\0\0\xc6\0\x04\0\x20[method]outgoing-req\ +uest.headers\x01Y\x01i'\x01@\0\0\xda\0\x04\0\x1c[constructor]request-options\x01\ +[\x01h'\x01k\x01\x01@\x01\x04self\xdc\0\0\xdd\0\x04\0'[method]request-options.co\ +nnect-timeout\x01^\x01@\x02\x04self\xdc\0\x08duration\xdd\0\0\xd2\0\x04\0+[metho\ +d]request-options.set-connect-timeout\x01_\x04\0*[method]request-options.first-b\ +yte-timeout\x01^\x04\0.[method]request-options.set-first-byte-timeout\x01_\x04\0\ +-[method]request-options.between-bytes-timeout\x01^\x04\01[method]request-option\ +s.set-between-bytes-timeout\x01_\x01i(\x01i.\x01j\x01\xe1\0\x01\x1b\x01@\x02\x05\ +param\xe0\0\x08response\xe2\0\x01\0\x04\0\x1d[static]response-outparam.set\x01c\x01\ +h+\x01@\x01\x04self\xe4\0\0*\x04\0\x20[method]incoming-response.status\x01e\x01@\ +\x01\x04self\xe4\0\0\xc6\0\x04\0![method]incoming-response.headers\x01f\x01@\x01\ +\x04self\xe4\0\0\xc9\0\x04\0![method]incoming-response.consume\x01g\x01h,\x01i\x03\ +\x01j\x01\xe9\0\0\x01@\x01\x04self\xe8\0\0\xea\0\x04\0\x1c[method]incoming-body.\ +stream\x01k\x01i-\x01@\x01\x04this\xc8\0\0\xec\0\x04\0\x1c[static]incoming-body.\ +finish\x01m\x01h-\x01i\x09\x01@\x01\x04self\xee\0\0\xef\0\x04\0![method]future-t\ +railers.subscribe\x01p\x01i$\x01k\xf1\0\x01j\x01\xf2\0\x01\x1b\x01j\x01\xf3\0\0\x01\ +k\xf4\0\x01@\x01\x04self\xee\0\0\xf5\0\x04\0\x1b[method]future-trailers.get\x01v\ +\x01@\x01\x07headers\xc6\0\0\xe1\0\x04\0\x1e[constructor]outgoing-response\x01w\x01\ +h.\x01@\x01\x04self\xf8\0\0*\x04\0%[method]outgoing-response.status-code\x01y\x01\ +@\x02\x04self\xf8\0\x0bstatus-code*\0\xd2\0\x04\0)[method]outgoing-response.set-\ +status-code\x01z\x01@\x01\x04self\xf8\0\0\xc6\0\x04\0![method]outgoing-response.\ +headers\x01{\x01@\x01\x04self\xf8\0\0\xcf\0\x04\0\x1e[method]outgoing-response.b\ +ody\x01|\x01h/\x01i\x05\x01j\x01\xfe\0\0\x01@\x01\x04self\xfd\0\0\xff\0\x04\0\x1b\ +[method]outgoing-body.write\x01\x80\x01\x01j\0\x01\x1b\x01@\x02\x04this\xce\0\x08\ +trailers\xf2\0\0\x81\x01\x04\0\x1c[static]outgoing-body.finish\x01\x82\x01\x01h0\ +\x01@\x01\x04self\x83\x01\0\xef\0\x04\0*[method]future-incoming-response.subscri\ +be\x01\x84\x01\x01i+\x01j\x01\x85\x01\x01\x1b\x01j\x01\x86\x01\0\x01k\x87\x01\x01\ +@\x01\x04self\x83\x01\0\x88\x01\x04\0$[method]future-incoming-response.get\x01\x89\ +\x01\x01h\x07\x01k\x1b\x01@\x01\x03err\x8a\x01\0\x8b\x01\x04\0\x0fhttp-error-cod\ +e\x01\x8c\x01\x03\0\x15wasi:http/types@0.2.0\x05\x1a\x01@\x01\x0ccomponent-ids\x01\ +\0\x04\0\x10set-component-id\x01\x1b\x01B\x19\x04\0\x05store\x03\x01\x01q\x04\x10\ +store-table-full\0\0\x0dno-such-store\0\0\x0daccess-denied\0\0\x05other\x01s\0\x04\ +\0\x05error\x03\0\x01\x01i\0\x01j\x01\x03\x01\x02\x01@\x01\x05labels\0\x04\x04\0\ +\x12[static]store.open\x01\x05\x01h\0\x01p}\x01k\x07\x01j\x01\x08\x01\x02\x01@\x02\ +\x04self\x06\x03keys\0\x09\x04\0\x11[method]store.get\x01\x0a\x01j\0\x01\x02\x01\ +@\x03\x04self\x06\x03keys\x05value\x07\0\x0b\x04\0\x11[method]store.set\x01\x0c\x01\ +@\x02\x04self\x06\x03keys\0\x0b\x04\0\x14[method]store.delete\x01\x0d\x01j\x01\x7f\ +\x01\x02\x01@\x02\x04self\x06\x03keys\0\x0e\x04\0\x14[method]store.exists\x01\x0f\ +\x01ps\x01j\x01\x10\x01\x02\x01@\x01\x04self\x06\0\x11\x04\0\x16[method]store.ge\ +t-keys\x01\x12\x04\0\x1cfermyon:spin/key-value@2.0.0\x05\x1c\x01B\x1a\x01s\x04\0\ +\x11inferencing-model\x03\0\0\x01r\x06\x0amax-tokensy\x0erepeat-penaltyv!repeat-\ +penalty-last-n-token-county\x0btemperaturev\x05top-ky\x05top-pv\x04\0\x12inferen\ +cing-params\x03\0\x02\x01q\x03\x13model-not-supported\0\0\x0druntime-error\x01s\0\ +\x0dinvalid-input\x01s\0\x04\0\x05error\x03\0\x04\x01r\x02\x12prompt-token-count\ +y\x15generated-token-county\x04\0\x11inferencing-usage\x03\0\x06\x01r\x02\x04tex\ +ts\x05usage\x07\x04\0\x12inferencing-result\x03\0\x08\x01s\x04\0\x0fembedding-mo\ +del\x03\0\x0a\x01r\x01\x12prompt-token-county\x04\0\x10embeddings-usage\x03\0\x0c\ +\x01pv\x01p\x0e\x01r\x02\x0aembeddings\x0f\x05usage\x0d\x04\0\x11embeddings-resu\ +lt\x03\0\x10\x01k\x03\x01j\x01\x09\x01\x05\x01@\x03\x05model\x01\x06prompts\x06p\ +arams\x12\0\x13\x04\0\x05infer\x01\x14\x01ps\x01j\x01\x11\x01\x05\x01@\x02\x05mo\ +del\x0b\x04text\x15\0\x16\x04\0\x13generate-embeddings\x01\x17\x04\0\x16fermyon:\ +spin/llm@2.0.0\x05\x1d\x01B)\x01q\x04\x0finvalid-address\0\0\x14too-many-connect\ +ions\0\0\x0atype-error\0\0\x05other\x01s\0\x04\0\x05error\x03\0\0\x04\0\x0aconne\ +ction\x03\x01\x01p}\x04\0\x07payload\x03\0\x03\x01q\x02\x05int64\x01x\0\x06binar\ +y\x01\x04\0\x04\0\x0fredis-parameter\x03\0\x05\x01q\x04\x03nil\0\0\x06status\x01\ +s\0\x05int64\x01x\0\x06binary\x01\x04\0\x04\0\x0credis-result\x03\0\x07\x01i\x02\ +\x01j\x01\x09\x01\x01\x01@\x01\x07addresss\0\x0a\x04\0\x17[static]connection.ope\ +n\x01\x0b\x01h\x02\x01j\0\x01\x01\x01@\x03\x04self\x0c\x07channels\x07payload\x04\ +\0\x0d\x04\0\x1a[method]connection.publish\x01\x0e\x01k\x04\x01j\x01\x0f\x01\x01\ +\x01@\x02\x04self\x0c\x03keys\0\x10\x04\0\x16[method]connection.get\x01\x11\x01@\ +\x03\x04self\x0c\x03keys\x05value\x04\0\x0d\x04\0\x16[method]connection.set\x01\x12\ +\x01j\x01x\x01\x01\x01@\x02\x04self\x0c\x03keys\0\x13\x04\0\x17[method]connectio\ +n.incr\x01\x14\x01ps\x01j\x01y\x01\x01\x01@\x02\x04self\x0c\x04keys\x15\0\x16\x04\ +\0\x16[method]connection.del\x01\x17\x01@\x03\x04self\x0c\x03keys\x06values\x15\0\ +\x16\x04\0\x17[method]connection.sadd\x01\x18\x01j\x01\x15\x01\x01\x01@\x02\x04s\ +elf\x0c\x03keys\0\x19\x04\0\x1b[method]connection.smembers\x01\x1a\x04\0\x17[met\ +hod]connection.srem\x01\x18\x01p\x06\x01p\x08\x01j\x01\x1c\x01\x01\x01@\x03\x04s\ +elf\x0c\x07commands\x09arguments\x1b\0\x1d\x04\0\x1a[method]connection.execute\x01\ +\x1e\x04\0\x18fermyon:spin/redis@2.0.0\x05\x1e\x01B\x11\x01q\x05\x11connection-f\ +ailed\x01s\0\x0dbad-parameter\x01s\0\x0cquery-failed\x01s\0\x17value-conversion-\ +failed\x01s\0\x05other\x01s\0\x04\0\x05error\x03\0\0\x01m\x0e\x07boolean\x04int8\ +\x05int16\x05int32\x05int64\x05uint8\x06uint16\x06uint32\x06uint64\x0afloating32\ +\x0afloating64\x03str\x06binary\x05other\x04\0\x0cdb-data-type\x03\0\x02\x01p}\x01\ +q\x0f\x07boolean\x01\x7f\0\x04int8\x01~\0\x05int16\x01|\0\x05int32\x01z\0\x05int\ +64\x01x\0\x05uint8\x01}\0\x06uint16\x01{\0\x06uint32\x01y\0\x06uint64\x01w\0\x0a\ +floating32\x01v\0\x0afloating64\x01u\0\x03str\x01s\0\x06binary\x01\x04\0\x07db-n\ +ull\0\0\x0bunsupported\0\0\x04\0\x08db-value\x03\0\x05\x01q\x0e\x07boolean\x01\x7f\ +\0\x04int8\x01~\0\x05int16\x01|\0\x05int32\x01z\0\x05int64\x01x\0\x05uint8\x01}\0\ +\x06uint16\x01{\0\x06uint32\x01y\0\x06uint64\x01w\0\x0afloating32\x01v\0\x0afloa\ +ting64\x01u\0\x03str\x01s\0\x06binary\x01\x04\0\x07db-null\0\0\x04\0\x0fparamete\ +r-value\x03\0\x07\x01r\x02\x04names\x09data-type\x03\x04\0\x06column\x03\0\x09\x01\ +p\x06\x04\0\x03row\x03\0\x0b\x01p\x0a\x01p\x0c\x01r\x02\x07columns\x0d\x04rows\x0e\ +\x04\0\x07row-set\x03\0\x0f\x04\0\x1efermyon:spin/rdbms-types@2.0.0\x05\x1f\x02\x03\ +\0\x16\x0fparameter-value\x02\x03\0\x16\x07row-set\x02\x03\0\x16\x05error\x01B\x13\ +\x02\x03\x02\x01\x20\x04\0\x0fparameter-value\x03\0\0\x02\x03\x02\x01!\x04\0\x07\ +row-set\x03\0\x02\x02\x03\x02\x01\"\x04\0\x05error\x03\0\x04\x04\0\x0aconnection\ +\x03\x01\x01i\x06\x01j\x01\x07\x01\x05\x01@\x01\x07addresss\0\x08\x04\0\x17[stat\ +ic]connection.open\x01\x09\x01h\x06\x01p\x01\x01j\x01\x03\x01\x05\x01@\x03\x04se\ +lf\x0a\x09statements\x06params\x0b\0\x0c\x04\0\x18[method]connection.query\x01\x0d\ +\x01j\x01w\x01\x05\x01@\x03\x04self\x0a\x09statements\x06params\x0b\0\x0e\x04\0\x1a\ +[method]connection.execute\x01\x0f\x04\0\x1bfermyon:spin/postgres@2.0.0\x05#\x01\ +B\x0f\x01q\x04\x0finvalid-address\0\0\x14too-many-connections\0\0\x11connection-\ +failed\x01s\0\x05other\x01s\0\x04\0\x05error\x03\0\0\x01m\x03\x0cat-most-once\x0d\ +at-least-once\x0cexactly-once\x04\0\x03qos\x03\0\x02\x04\0\x0aconnection\x03\x01\ +\x01p}\x04\0\x07payload\x03\0\x05\x01i\x04\x01j\x01\x07\x01\x01\x01@\x04\x07addr\ +esss\x08usernames\x08passwords\x1bkeep-alive-interval-in-secsw\0\x08\x04\0\x17[s\ +tatic]connection.open\x01\x09\x01h\x04\x01j\0\x01\x01\x01@\x04\x04self\x0a\x05to\ +pics\x07payload\x06\x03qos\x03\0\x0b\x04\0\x1a[method]connection.publish\x01\x0c\ +\x04\0\x17fermyon:spin/mqtt@2.0.0\x05$\x01B\x13\x02\x03\x02\x01\x20\x04\0\x0fpar\ +ameter-value\x03\0\0\x02\x03\x02\x01!\x04\0\x07row-set\x03\0\x02\x02\x03\x02\x01\ +\"\x04\0\x05error\x03\0\x04\x04\0\x0aconnection\x03\x01\x01i\x06\x01j\x01\x07\x01\ +\x05\x01@\x01\x07addresss\0\x08\x04\0\x17[static]connection.open\x01\x09\x01h\x06\ +\x01p\x01\x01j\x01\x03\x01\x05\x01@\x03\x04self\x0a\x09statements\x06params\x0b\0\ +\x0c\x04\0\x18[method]connection.query\x01\x0d\x01j\0\x01\x05\x01@\x03\x04self\x0a\ +\x09statements\x06params\x0b\0\x0e\x04\0\x1a[method]connection.execute\x01\x0f\x04\ +\0\x18fermyon:spin/mysql@2.0.0\x05%\x01B\x15\x04\0\x0aconnection\x03\x01\x01q\x05\ +\x10no-such-database\0\0\x0daccess-denied\0\0\x12invalid-connection\0\0\x0ddatab\ +ase-full\0\0\x02io\x01s\0\x04\0\x05error\x03\0\x01\x01p}\x01q\x05\x07integer\x01\ +x\0\x04real\x01u\0\x04text\x01s\0\x04blob\x01\x03\0\x04null\0\0\x04\0\x05value\x03\ +\0\x04\x01p\x05\x01r\x01\x06values\x06\x04\0\x0arow-result\x03\0\x07\x01ps\x01p\x08\ +\x01r\x02\x07columns\x09\x04rows\x0a\x04\0\x0cquery-result\x03\0\x0b\x01i\0\x01j\ +\x01\x0d\x01\x02\x01@\x01\x08databases\0\x0e\x04\0\x17[static]connection.open\x01\ +\x0f\x01h\0\x01j\x01\x0c\x01\x02\x01@\x03\x04self\x10\x09statements\x0aparameter\ +s\x06\0\x11\x04\0\x1a[method]connection.execute\x01\x12\x04\0\x19fermyon:spin/sq\ +lite@2.0.0\x05&\x01B\x05\x01q\x04\x0cinvalid-name\x01s\0\x09undefined\x01s\0\x08\ +provider\x01s\0\x05other\x01s\0\x04\0\x05error\x03\0\0\x01j\x01s\x01\x01\x01@\x01\ +\x04names\0\x02\x04\0\x03get\x01\x03\x04\0\x1cfermyon:spin/variables@2.0.0\x05'\x01\ +B\x19\x04\0\x05store\x03\x01\x01p}\x01o\x02s\x01\x01q\x05\x03get\x01s\0\x03set\x01\ +\x02\0\x06delete\x01s\0\x06exists\x01s\0\x08get-keys\0\0\x04\0\x04call\x03\0\x03\ +\x01i\0\x01@\x01\x05labels\0\x05\x04\0\x12[static]store.open\x01\x06\x01h\0\x01@\ +\x01\x04self\x07\0s\x04\0\x13[method]store.label\x01\x08\x01k\x01\x01@\x02\x04se\ +lf\x07\x03keys\0\x09\x04\0\x11[method]store.get\x01\x0a\x01@\x03\x04self\x07\x03\ +keys\x05value\x01\x01\0\x04\0\x11[method]store.set\x01\x0b\x01@\x02\x04self\x07\x03\ +keys\x01\0\x04\0\x14[method]store.delete\x01\x0c\x01p\x04\x01o\x02s\x0d\x01p\x0e\ +\x01@\0\0\x0f\x04\0\x05calls\x01\x10\x01@\0\x01\0\x04\0\x0breset-calls\x01\x11\x04\ +\0\x20fermyon:spin-test-virt/key-value\x05(\x02\x03\0\x1a\x05value\x02\x03\0\x1a\ +\x0cquery-result\x02\x03\0\x1a\x05error\x01B\x10\x02\x03\x02\x01)\x04\0\x05value\ +\x03\0\0\x02\x03\x02\x01*\x04\0\x0cquery-result\x03\0\x02\x02\x03\x02\x01+\x04\0\ +\x05error\x03\0\x04\x04\0\x0aconnection\x03\x01\x01i\x06\x01j\x01\x07\x01\x05\x01\ +@\x01\x08databases\0\x08\x04\0\x17[static]connection.open\x01\x09\x01h\x06\x01p\x01\ +\x01j\x01\x03\x01\x05\x01@\x03\x04self\x0a\x09statements\x0aparameters\x0b\0\x0c\ +\x04\0\x1a[method]connection.execute\x01\x0d\x04\0\x1dfermyon:spin-test-virt/sql\ +ite\x05,\x01B\x02\x01@\x02\x03keys\x05values\x01\0\x04\0\x03set\x01\0\x04\0\x20f\ +ermyon:spin-test-virt/variables\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]pollable.block\x01\x03\x01p\x01\x01py\x01@\x01\x02in\ +\x04\0\x05\x04\0\x04poll\x01\x06\x04\0\x12wasi:io/poll@0.2.0\x05.\x01B\x0f\x02\x03\ +\x02\x01\x02\x04\0\x08pollable\x03\0\0\x01w\x04\0\x07instant\x03\0\x02\x01w\x04\0\ +\x08duration\x03\0\x04\x01@\0\0\x03\x04\0\x03now\x01\x06\x01@\0\0\x05\x04\0\x0ar\ +esolution\x01\x07\x01i\x01\x01@\x01\x04when\x03\0\x08\x04\0\x11subscribe-instant\ +\x01\x09\x01@\x01\x04when\x05\0\x08\x04\0\x12subscribe-duration\x01\x0a\x04\0!wa\ +si:clocks/monotonic-clock@0.2.0\x05/\x01B\x05\x01r\x02\x07secondsw\x0bnanosecond\ +sy\x04\0\x08datetime\x03\0\0\x01@\0\0\x01\x04\0\x03now\x01\x02\x04\0\x0aresoluti\ +on\x01\x02\x04\0\x1cwasi:clocks/wall-clock@0.2.0\x050\x01B\x05\x01p}\x01@\x01\x03\ +lenw\0\0\x04\0\x10get-random-bytes\x01\x01\x01@\0\0w\x04\0\x0eget-random-u64\x01\ +\x02\x04\0\x18wasi:random/random@0.2.0\x051\x01B\x05\x01p}\x01@\x01\x03lenw\0\0\x04\ +\0\x19get-insecure-random-bytes\x01\x01\x01@\0\0w\x04\0\x17get-insecure-random-u\ +64\x01\x02\x04\0\x1awasi:random/insecure@0.2.0\x052\x01B\x03\x01o\x02ww\x01@\0\0\ +\0\x04\0\x0dinsecure-seed\x01\x01\x04\0\x1fwasi:random/insecure-seed@0.2.0\x053\x01\ +B\x04\x04\0\x05error\x03\x01\x01h\0\x01@\x01\x04self\x01\0s\x04\0\x1d[method]err\ +or.to-debug-string\x01\x02\x04\0\x13wasi:io/error@0.2.0\x054\x01B(\x02\x03\x02\x01\ +\x09\x04\0\x05error\x03\0\0\x02\x03\x02\x01\x02\x04\0\x08pollable\x03\0\x02\x01i\ +\x01\x01q\x02\x15last-operation-failed\x01\x04\0\x06closed\0\0\x04\0\x0cstream-e\ +rror\x03\0\x05\x04\0\x0cinput-stream\x03\x01\x04\0\x0doutput-stream\x03\x01\x01h\ +\x07\x01p}\x01j\x01\x0a\x01\x06\x01@\x02\x04self\x09\x03lenw\0\x0b\x04\0\x19[met\ +hod]input-stream.read\x01\x0c\x04\0\"[method]input-stream.blocking-read\x01\x0c\x01\ +j\x01w\x01\x06\x01@\x02\x04self\x09\x03lenw\0\x0d\x04\0\x19[method]input-stream.\ +skip\x01\x0e\x04\0\"[method]input-stream.blocking-skip\x01\x0e\x01i\x03\x01@\x01\ +\x04self\x09\0\x0f\x04\0\x1e[method]input-stream.subscribe\x01\x10\x01h\x08\x01@\ +\x01\x04self\x11\0\x0d\x04\0![method]output-stream.check-write\x01\x12\x01j\0\x01\ +\x06\x01@\x02\x04self\x11\x08contents\x0a\0\x13\x04\0\x1b[method]output-stream.w\ +rite\x01\x14\x04\0.[method]output-stream.blocking-write-and-flush\x01\x14\x01@\x01\ +\x04self\x11\0\x13\x04\0\x1b[method]output-stream.flush\x01\x15\x04\0$[method]ou\ +tput-stream.blocking-flush\x01\x15\x01@\x01\x04self\x11\0\x0f\x04\0\x1f[method]o\ +utput-stream.subscribe\x01\x16\x01@\x02\x04self\x11\x03lenw\0\x13\x04\0\"[method\ +]output-stream.write-zeroes\x01\x17\x04\05[method]output-stream.blocking-write-z\ +eroes-and-flush\x01\x17\x01@\x03\x04self\x11\x03src\x09\x03lenw\0\x0d\x04\0\x1c[\ +method]output-stream.splice\x01\x18\x04\0%[method]output-stream.blocking-splice\x01\ +\x18\x04\0\x15wasi:io/streams@0.2.0\x055\x02\x03\0&\x05error\x02\x03\0!\x08datet\ +ime\x01Br\x02\x03\x02\x01\x0d\x04\0\x0cinput-stream\x03\0\0\x02\x03\x02\x01\x0b\x04\ +\0\x0doutput-stream\x03\0\x02\x02\x03\x02\x016\x04\0\x05error\x03\0\x04\x02\x03\x02\ +\x017\x04\0\x08datetime\x03\0\x06\x01w\x04\0\x08filesize\x03\0\x08\x01m\x08\x07u\ +nknown\x0cblock-device\x10character-device\x09directory\x04fifo\x0dsymbolic-link\ +\x0cregular-file\x06socket\x04\0\x0fdescriptor-type\x03\0\x0a\x01n\x06\x04read\x05\ +write\x13file-integrity-sync\x13data-integrity-sync\x14requested-write-sync\x10m\ +utate-directory\x04\0\x10descriptor-flags\x03\0\x0c\x01n\x01\x0esymlink-follow\x04\ +\0\x0apath-flags\x03\0\x0e\x01n\x04\x06create\x09directory\x09exclusive\x08trunc\ +ate\x04\0\x0aopen-flags\x03\0\x10\x01w\x04\0\x0alink-count\x03\0\x12\x01k\x07\x01\ +r\x06\x04type\x0b\x0alink-count\x13\x04size\x09\x15data-access-timestamp\x14\x1b\ +data-modification-timestamp\x14\x17status-change-timestamp\x14\x04\0\x0fdescript\ +or-stat\x03\0\x15\x01q\x03\x09no-change\0\0\x03now\0\0\x09timestamp\x01\x07\0\x04\ +\0\x0dnew-timestamp\x03\0\x17\x01r\x02\x04type\x0b\x04names\x04\0\x0fdirectory-e\ +ntry\x03\0\x19\x01m%\x06access\x0bwould-block\x07already\x0ebad-descriptor\x04bu\ +sy\x08deadlock\x05quota\x05exist\x0efile-too-large\x15illegal-byte-sequence\x0bi\ +n-progress\x0binterrupted\x07invalid\x02io\x0cis-directory\x04loop\x0etoo-many-l\ +inks\x0cmessage-size\x0dname-too-long\x09no-device\x08no-entry\x07no-lock\x13ins\ +ufficient-memory\x12insufficient-space\x0dnot-directory\x09not-empty\x0fnot-reco\ +verable\x0bunsupported\x06no-tty\x0eno-such-device\x08overflow\x0dnot-permitted\x04\ +pipe\x09read-only\x0cinvalid-seek\x0etext-file-busy\x0ccross-device\x04\0\x0aerr\ +or-code\x03\0\x1b\x01m\x06\x06normal\x0asequential\x06random\x09will-need\x09don\ +t-need\x08no-reuse\x04\0\x06advice\x03\0\x1d\x01r\x02\x05lowerw\x05upperw\x04\0\x13\ +metadata-hash-value\x03\0\x1f\x04\0\x0adescriptor\x03\x01\x04\0\x16directory-ent\ +ry-stream\x03\x01\x01h!\x01i\x01\x01j\x01$\x01\x1c\x01@\x02\x04self#\x06offset\x09\ +\0%\x04\0\"[method]descriptor.read-via-stream\x01&\x01i\x03\x01j\x01'\x01\x1c\x01\ +@\x02\x04self#\x06offset\x09\0(\x04\0#[method]descriptor.write-via-stream\x01)\x01\ +@\x01\x04self#\0(\x04\0$[method]descriptor.append-via-stream\x01*\x01j\0\x01\x1c\ +\x01@\x04\x04self#\x06offset\x09\x06length\x09\x06advice\x1e\0+\x04\0\x19[method\ +]descriptor.advise\x01,\x01@\x01\x04self#\0+\x04\0\x1c[method]descriptor.sync-da\ +ta\x01-\x01j\x01\x0d\x01\x1c\x01@\x01\x04self#\0.\x04\0\x1c[method]descriptor.ge\ +t-flags\x01/\x01j\x01\x0b\x01\x1c\x01@\x01\x04self#\00\x04\0\x1b[method]descript\ +or.get-type\x011\x01@\x02\x04self#\x04size\x09\0+\x04\0\x1b[method]descriptor.se\ +t-size\x012\x01@\x03\x04self#\x15data-access-timestamp\x18\x1bdata-modification-\ +timestamp\x18\0+\x04\0\x1c[method]descriptor.set-times\x013\x01p}\x01o\x024\x7f\x01\ +j\x015\x01\x1c\x01@\x03\x04self#\x06length\x09\x06offset\x09\06\x04\0\x17[method\ +]descriptor.read\x017\x01j\x01\x09\x01\x1c\x01@\x03\x04self#\x06buffer4\x06offse\ +t\x09\08\x04\0\x18[method]descriptor.write\x019\x01i\"\x01j\x01:\x01\x1c\x01@\x01\ +\x04self#\0;\x04\0![method]descriptor.read-directory\x01<\x04\0\x17[method]descr\ +iptor.sync\x01-\x01@\x02\x04self#\x04paths\0+\x04\0&[method]descriptor.create-di\ +rectory-at\x01=\x01j\x01\x16\x01\x1c\x01@\x01\x04self#\0>\x04\0\x17[method]descr\ +iptor.stat\x01?\x01@\x03\x04self#\x0apath-flags\x0f\x04paths\0>\x04\0\x1a[method\ +]descriptor.stat-at\x01@\x01@\x05\x04self#\x0apath-flags\x0f\x04paths\x15data-ac\ +cess-timestamp\x18\x1bdata-modification-timestamp\x18\0+\x04\0\x1f[method]descri\ +ptor.set-times-at\x01A\x01@\x05\x04self#\x0eold-path-flags\x0f\x08old-paths\x0en\ +ew-descriptor#\x08new-paths\0+\x04\0\x1a[method]descriptor.link-at\x01B\x01i!\x01\ +j\x01\xc3\0\x01\x1c\x01@\x05\x04self#\x0apath-flags\x0f\x04paths\x0aopen-flags\x11\ +\x05flags\x0d\0\xc4\0\x04\0\x1a[method]descriptor.open-at\x01E\x01j\x01s\x01\x1c\ +\x01@\x02\x04self#\x04paths\0\xc6\0\x04\0\x1e[method]descriptor.readlink-at\x01G\ +\x04\0&[method]descriptor.remove-directory-at\x01=\x01@\x04\x04self#\x08old-path\ +s\x0enew-descriptor#\x08new-paths\0+\x04\0\x1c[method]descriptor.rename-at\x01H\x01\ +@\x03\x04self#\x08old-paths\x08new-paths\0+\x04\0\x1d[method]descriptor.symlink-\ +at\x01I\x04\0![method]descriptor.unlink-file-at\x01=\x01@\x02\x04self#\x05other#\ +\0\x7f\x04\0![method]descriptor.is-same-object\x01J\x01j\x01\x20\x01\x1c\x01@\x01\ +\x04self#\0\xcb\0\x04\0\x20[method]descriptor.metadata-hash\x01L\x01@\x03\x04sel\ +f#\x0apath-flags\x0f\x04paths\0\xcb\0\x04\0#[method]descriptor.metadata-hash-at\x01\ +M\x01h\"\x01k\x1a\x01j\x01\xcf\0\x01\x1c\x01@\x01\x04self\xce\0\0\xd0\0\x04\03[m\ +ethod]directory-entry-stream.read-directory-entry\x01Q\x01h\x05\x01k\x1c\x01@\x01\ +\x03err\xd2\0\0\xd3\0\x04\0\x15filesystem-error-code\x01T\x04\0\x1bwasi:filesyst\ +em/types@0.2.0\x058\x02\x03\0'\x0adescriptor\x01B\x07\x02\x03\x02\x019\x04\0\x0a\ +descriptor\x03\0\0\x01i\x01\x01o\x02\x02s\x01p\x03\x01@\0\0\x04\x04\0\x0fget-dir\ +ectories\x01\x05\x04\0\x1ewasi:filesystem/preopens@0.2.0\x05:\x01B\x05\x02\x03\x02\ +\x01\x0b\x04\0\x0doutput-stream\x03\0\0\x01i\x01\x01@\0\0\x02\x04\0\x0aget-stdou\ +t\x01\x03\x04\0\x15wasi:cli/stdout@0.2.0\x05;\x01B\x05\x02\x03\x02\x01\x0d\x04\0\ +\x0cinput-stream\x03\0\0\x01i\x01\x01@\0\0\x02\x04\0\x09get-stdin\x01\x03\x04\0\x14\ +wasi:cli/stdin@0.2.0\x05<\x01B\x05\x02\x03\x02\x01\x0b\x04\0\x0doutput-stream\x03\ +\0\0\x01i\x01\x01@\0\0\x02\x04\0\x0aget-stderr\x01\x03\x04\0\x15wasi:cli/stderr@\ +0.2.0\x05=\x01B\x01\x04\0\x0eterminal-input\x03\x01\x04\0\x1dwasi:cli/terminal-i\ +nput@0.2.0\x05>\x01B\x01\x04\0\x0fterminal-output\x03\x01\x04\0\x1ewasi:cli/term\ +inal-output@0.2.0\x05?\x01B\x06\x02\x03\x02\x01\x12\x04\0\x0eterminal-input\x03\0\ +\0\x01i\x01\x01k\x02\x01@\0\0\x03\x04\0\x12get-terminal-stdin\x01\x04\x04\0\x1dw\ +asi:cli/terminal-stdin@0.2.0\x05@\x01B\x06\x02\x03\x02\x01\x14\x04\0\x0fterminal\ +-output\x03\0\0\x01i\x01\x01k\x02\x01@\0\0\x03\x04\0\x13get-terminal-stdout\x01\x04\ +\x04\0\x1ewasi:cli/terminal-stdout@0.2.0\x05A\x01B\x06\x02\x03\x02\x01\x14\x04\0\ \x0fterminal-output\x03\0\0\x01i\x01\x01k\x02\x01@\0\0\x03\x04\0\x13get-terminal\ --stdout\x01\x04\x03\x01\x1ewasi:cli/terminal-stdout@0.2.0\x05\x14\x01B\x06\x02\x03\ -\x02\x01\x13\x04\0\x0fterminal-output\x03\0\0\x01i\x01\x01k\x02\x01@\0\0\x03\x04\ -\0\x13get-terminal-stderr\x01\x04\x03\x01\x1ewasi:cli/terminal-stderr@0.2.0\x05\x15\ -\x01B\x0a\x01o\x02ss\x01p\0\x01@\0\0\x01\x04\0\x0fget-environment\x01\x02\x01ps\x01\ -@\0\0\x03\x04\0\x0dget-arguments\x01\x04\x01ks\x01@\0\0\x05\x04\0\x0binitial-cwd\ -\x01\x06\x03\x01\x1awasi:cli/environment@0.2.0\x05\x16\x01B\x03\x01j\0\0\x01@\x01\ -\x06status\0\x01\0\x04\0\x04exit\x01\x01\x03\x01\x13wasi:cli/exit@0.2.0\x05\x17\x02\ -\x03\0\x01\x08duration\x01B\xc0\x01\x02\x03\x02\x01\x18\x04\0\x08duration\x03\0\0\ -\x02\x03\x02\x01\x0c\x04\0\x0cinput-stream\x03\0\x02\x02\x03\x02\x01\x0a\x04\0\x0d\ -output-stream\x03\0\x04\x02\x03\x02\x01\x08\x04\0\x08io-error\x03\0\x06\x02\x03\x02\ -\x01\x01\x04\0\x08pollable\x03\0\x08\x01q\x0a\x03get\0\0\x04head\0\0\x04post\0\0\ -\x03put\0\0\x06delete\0\0\x07connect\0\0\x07options\0\0\x05trace\0\0\x05patch\0\0\ -\x05other\x01s\0\x04\0\x06method\x03\0\x0a\x01q\x03\x04HTTP\0\0\x05HTTPS\0\0\x05\ -other\x01s\0\x04\0\x06scheme\x03\0\x0c\x01ks\x01k{\x01r\x02\x05rcode\x0e\x09info\ --code\x0f\x04\0\x11DNS-error-payload\x03\0\x10\x01k}\x01r\x02\x08alert-id\x12\x0d\ -alert-message\x0e\x04\0\x1aTLS-alert-received-payload\x03\0\x13\x01ky\x01r\x02\x0a\ -field-name\x0e\x0afield-size\x15\x04\0\x12field-size-payload\x03\0\x16\x01kw\x01\ -k\x17\x01q'\x0bDNS-timeout\0\0\x09DNS-error\x01\x11\0\x15destination-not-found\0\ -\0\x17destination-unavailable\0\0\x19destination-IP-prohibited\0\0\x19destinatio\ -n-IP-unroutable\0\0\x12connection-refused\0\0\x15connection-terminated\0\0\x12co\ -nnection-timeout\0\0\x17connection-read-timeout\0\0\x18connection-write-timeout\0\ -\0\x18connection-limit-reached\0\0\x12TLS-protocol-error\0\0\x15TLS-certificate-\ -error\0\0\x12TLS-alert-received\x01\x14\0\x13HTTP-request-denied\0\0\x1cHTTP-req\ -uest-length-required\0\0\x16HTTP-request-body-size\x01\x18\0\x1bHTTP-request-met\ -hod-invalid\0\0\x18HTTP-request-URI-invalid\0\0\x19HTTP-request-URI-too-long\0\0\ -\x20HTTP-request-header-section-size\x01\x15\0\x18HTTP-request-header-size\x01\x19\ -\0!HTTP-request-trailer-section-size\x01\x15\0\x19HTTP-request-trailer-size\x01\x17\ -\0\x18HTTP-response-incomplete\0\0!HTTP-response-header-section-size\x01\x15\0\x19\ -HTTP-response-header-size\x01\x17\0\x17HTTP-response-body-size\x01\x18\0\"HTTP-r\ -esponse-trailer-section-size\x01\x15\0\x1aHTTP-response-trailer-size\x01\x17\0\x1d\ -HTTP-response-transfer-coding\x01\x0e\0\x1cHTTP-response-content-coding\x01\x0e\0\ -\x15HTTP-response-timeout\0\0\x13HTTP-upgrade-failed\0\0\x13HTTP-protocol-error\0\ -\0\x0dloop-detected\0\0\x13configuration-error\0\0\x0einternal-error\x01\x0e\0\x04\ -\0\x0aerror-code\x03\0\x1a\x01q\x03\x0einvalid-syntax\0\0\x09forbidden\0\0\x09im\ -mutable\0\0\x04\0\x0cheader-error\x03\0\x1c\x01s\x04\0\x09field-key\x03\0\x1e\x01\ -p}\x04\0\x0bfield-value\x03\0\x20\x04\0\x06fields\x03\x01\x04\0\x07headers\x03\0\ -\"\x04\0\x08trailers\x03\0\"\x04\0\x10incoming-request\x03\x01\x04\0\x10outgoing\ --request\x03\x01\x04\0\x0frequest-options\x03\x01\x04\0\x11response-outparam\x03\ -\x01\x01{\x04\0\x0bstatus-code\x03\0)\x04\0\x11incoming-response\x03\x01\x04\0\x0d\ -incoming-body\x03\x01\x04\0\x0ffuture-trailers\x03\x01\x04\0\x11outgoing-respons\ -e\x03\x01\x04\0\x0doutgoing-body\x03\x01\x04\0\x18future-incoming-response\x03\x01\ -\x01i\"\x01@\0\01\x04\0\x13[constructor]fields\x012\x01o\x02\x1f!\x01p3\x01j\x01\ -1\x01\x1d\x01@\x01\x07entries4\05\x04\0\x18[static]fields.from-list\x016\x01h\"\x01\ -p!\x01@\x02\x04self7\x04name\x1f\08\x04\0\x12[method]fields.get\x019\x01@\x02\x04\ -self7\x04name\x1f\0\x7f\x04\0\x12[method]fields.has\x01:\x01j\0\x01\x1d\x01@\x03\ -\x04self7\x04name\x1f\x05value8\0;\x04\0\x12[method]fields.set\x01<\x01@\x02\x04\ -self7\x04name\x1f\0;\x04\0\x15[method]fields.delete\x01=\x01@\x03\x04self7\x04na\ -me\x1f\x05value!\0;\x04\0\x15[method]fields.append\x01>\x01@\x01\x04self7\04\x04\ -\0\x16[method]fields.entries\x01?\x01@\x01\x04self7\01\x04\0\x14[method]fields.c\ -lone\x01@\x01h%\x01@\x01\x04self\xc1\0\0\x0b\x04\0\x1f[method]incoming-request.m\ -ethod\x01B\x01@\x01\x04self\xc1\0\0\x0e\x04\0([method]incoming-request.path-with\ --query\x01C\x01k\x0d\x01@\x01\x04self\xc1\0\0\xc4\0\x04\0\x1f[method]incoming-re\ -quest.scheme\x01E\x04\0\"[method]incoming-request.authority\x01C\x01i#\x01@\x01\x04\ -self\xc1\0\0\xc6\0\x04\0\x20[method]incoming-request.headers\x01G\x01i,\x01j\x01\ -\xc8\0\0\x01@\x01\x04self\xc1\0\0\xc9\0\x04\0\x20[method]incoming-request.consum\ -e\x01J\x01i&\x01@\x01\x07headers\xc6\0\0\xcb\0\x04\0\x1d[constructor]outgoing-re\ -quest\x01L\x01h&\x01i/\x01j\x01\xce\0\0\x01@\x01\x04self\xcd\0\0\xcf\0\x04\0\x1d\ -[method]outgoing-request.body\x01P\x01@\x01\x04self\xcd\0\0\x0b\x04\0\x1f[method\ -]outgoing-request.method\x01Q\x01j\0\0\x01@\x02\x04self\xcd\0\x06method\x0b\0\xd2\ -\0\x04\0#[method]outgoing-request.set-method\x01S\x01@\x01\x04self\xcd\0\0\x0e\x04\ -\0([method]outgoing-request.path-with-query\x01T\x01@\x02\x04self\xcd\0\x0fpath-\ -with-query\x0e\0\xd2\0\x04\0,[method]outgoing-request.set-path-with-query\x01U\x01\ -@\x01\x04self\xcd\0\0\xc4\0\x04\0\x1f[method]outgoing-request.scheme\x01V\x01@\x02\ -\x04self\xcd\0\x06scheme\xc4\0\0\xd2\0\x04\0#[method]outgoing-request.set-scheme\ -\x01W\x04\0\"[method]outgoing-request.authority\x01T\x01@\x02\x04self\xcd\0\x09a\ -uthority\x0e\0\xd2\0\x04\0&[method]outgoing-request.set-authority\x01X\x01@\x01\x04\ -self\xcd\0\0\xc6\0\x04\0\x20[method]outgoing-request.headers\x01Y\x01i'\x01@\0\0\ -\xda\0\x04\0\x1c[constructor]request-options\x01[\x01h'\x01k\x01\x01@\x01\x04sel\ -f\xdc\0\0\xdd\0\x04\0'[method]request-options.connect-timeout\x01^\x01@\x02\x04s\ -elf\xdc\0\x08duration\xdd\0\0\xd2\0\x04\0+[method]request-options.set-connect-ti\ -meout\x01_\x04\0*[method]request-options.first-byte-timeout\x01^\x04\0.[method]r\ -equest-options.set-first-byte-timeout\x01_\x04\0-[method]request-options.between\ --bytes-timeout\x01^\x04\01[method]request-options.set-between-bytes-timeout\x01_\ -\x01i(\x01i.\x01j\x01\xe1\0\x01\x1b\x01@\x02\x05param\xe0\0\x08response\xe2\0\x01\ -\0\x04\0\x1d[static]response-outparam.set\x01c\x01h+\x01@\x01\x04self\xe4\0\0*\x04\ -\0\x20[method]incoming-response.status\x01e\x01@\x01\x04self\xe4\0\0\xc6\0\x04\0\ -![method]incoming-response.headers\x01f\x01@\x01\x04self\xe4\0\0\xc9\0\x04\0![me\ -thod]incoming-response.consume\x01g\x01h,\x01i\x03\x01j\x01\xe9\0\0\x01@\x01\x04\ -self\xe8\0\0\xea\0\x04\0\x1c[method]incoming-body.stream\x01k\x01i-\x01@\x01\x04\ -this\xc8\0\0\xec\0\x04\0\x1c[static]incoming-body.finish\x01m\x01h-\x01i\x09\x01\ -@\x01\x04self\xee\0\0\xef\0\x04\0![method]future-trailers.subscribe\x01p\x01i$\x01\ -k\xf1\0\x01j\x01\xf2\0\x01\x1b\x01j\x01\xf3\0\0\x01k\xf4\0\x01@\x01\x04self\xee\0\ -\0\xf5\0\x04\0\x1b[method]future-trailers.get\x01v\x01@\x01\x07headers\xc6\0\0\xe1\ -\0\x04\0\x1e[constructor]outgoing-response\x01w\x01h.\x01@\x01\x04self\xf8\0\0*\x04\ -\0%[method]outgoing-response.status-code\x01y\x01@\x02\x04self\xf8\0\x0bstatus-c\ -ode*\0\xd2\0\x04\0)[method]outgoing-response.set-status-code\x01z\x01@\x01\x04se\ -lf\xf8\0\0\xc6\0\x04\0![method]outgoing-response.headers\x01{\x01@\x01\x04self\xf8\ -\0\0\xcf\0\x04\0\x1e[method]outgoing-response.body\x01|\x01h/\x01i\x05\x01j\x01\xfe\ -\0\0\x01@\x01\x04self\xfd\0\0\xff\0\x04\0\x1b[method]outgoing-body.write\x01\x80\ -\x01\x01j\0\x01\x1b\x01@\x02\x04this\xce\0\x08trailers\xf2\0\0\x81\x01\x04\0\x1c\ -[static]outgoing-body.finish\x01\x82\x01\x01h0\x01@\x01\x04self\x83\x01\0\xef\0\x04\ -\0*[method]future-incoming-response.subscribe\x01\x84\x01\x01i+\x01j\x01\x85\x01\ -\x01\x1b\x01j\x01\x86\x01\0\x01k\x87\x01\x01@\x01\x04self\x83\x01\0\x88\x01\x04\0\ -$[method]future-incoming-response.get\x01\x89\x01\x01h\x07\x01k\x1b\x01@\x01\x03\ -err\x8a\x01\0\x8b\x01\x04\0\x0fhttp-error-code\x01\x8c\x01\x03\x01\x15wasi:http/\ -types@0.2.0\x05\x19\x01@\0\0s\x03\0\x0cget-manifest\x01\x1a\x01@\x01\x0ccomponen\ -t-ids\x01\0\x04\0\x10set-component-id\x01\x1b\x01B\x19\x04\0\x05store\x03\x01\x01\ -q\x04\x10store-table-full\0\0\x0dno-such-store\0\0\x0daccess-denied\0\0\x05other\ -\x01s\0\x04\0\x05error\x03\0\x01\x01i\0\x01j\x01\x03\x01\x02\x01@\x01\x05labels\0\ -\x04\x04\0\x12[static]store.open\x01\x05\x01h\0\x01p}\x01k\x07\x01j\x01\x08\x01\x02\ -\x01@\x02\x04self\x06\x03keys\0\x09\x04\0\x11[method]store.get\x01\x0a\x01j\0\x01\ -\x02\x01@\x03\x04self\x06\x03keys\x05value\x07\0\x0b\x04\0\x11[method]store.set\x01\ -\x0c\x01@\x02\x04self\x06\x03keys\0\x0b\x04\0\x14[method]store.delete\x01\x0d\x01\ -j\x01\x7f\x01\x02\x01@\x02\x04self\x06\x03keys\0\x0e\x04\0\x14[method]store.exis\ -ts\x01\x0f\x01ps\x01j\x01\x10\x01\x02\x01@\x01\x04self\x06\0\x11\x04\0\x16[metho\ -d]store.get-keys\x01\x12\x04\x01\x1cfermyon:spin/key-value@2.0.0\x05\x1c\x01B\x1a\ -\x01s\x04\0\x11inferencing-model\x03\0\0\x01r\x06\x0amax-tokensy\x0erepeat-penal\ -tyv!repeat-penalty-last-n-token-county\x0btemperaturev\x05top-ky\x05top-pv\x04\0\ -\x12inferencing-params\x03\0\x02\x01q\x03\x13model-not-supported\0\0\x0druntime-\ -error\x01s\0\x0dinvalid-input\x01s\0\x04\0\x05error\x03\0\x04\x01r\x02\x12prompt\ --token-county\x15generated-token-county\x04\0\x11inferencing-usage\x03\0\x06\x01\ -r\x02\x04texts\x05usage\x07\x04\0\x12inferencing-result\x03\0\x08\x01s\x04\0\x0f\ -embedding-model\x03\0\x0a\x01r\x01\x12prompt-token-county\x04\0\x10embeddings-us\ -age\x03\0\x0c\x01pv\x01p\x0e\x01r\x02\x0aembeddings\x0f\x05usage\x0d\x04\0\x11em\ -beddings-result\x03\0\x10\x01k\x03\x01j\x01\x09\x01\x05\x01@\x03\x05model\x01\x06\ -prompts\x06params\x12\0\x13\x04\0\x05infer\x01\x14\x01ps\x01j\x01\x11\x01\x05\x01\ -@\x02\x05model\x0b\x04text\x15\0\x16\x04\0\x13generate-embeddings\x01\x17\x04\x01\ -\x16fermyon:spin/llm@2.0.0\x05\x1d\x01B)\x01q\x04\x0finvalid-address\0\0\x14too-\ -many-connections\0\0\x0atype-error\0\0\x05other\x01s\0\x04\0\x05error\x03\0\0\x04\ -\0\x0aconnection\x03\x01\x01p}\x04\0\x07payload\x03\0\x03\x01q\x02\x05int64\x01x\ -\0\x06binary\x01\x04\0\x04\0\x0fredis-parameter\x03\0\x05\x01q\x04\x03nil\0\0\x06\ -status\x01s\0\x05int64\x01x\0\x06binary\x01\x04\0\x04\0\x0credis-result\x03\0\x07\ -\x01i\x02\x01j\x01\x09\x01\x01\x01@\x01\x07addresss\0\x0a\x04\0\x17[static]conne\ -ction.open\x01\x0b\x01h\x02\x01j\0\x01\x01\x01@\x03\x04self\x0c\x07channels\x07p\ -ayload\x04\0\x0d\x04\0\x1a[method]connection.publish\x01\x0e\x01k\x04\x01j\x01\x0f\ -\x01\x01\x01@\x02\x04self\x0c\x03keys\0\x10\x04\0\x16[method]connection.get\x01\x11\ -\x01@\x03\x04self\x0c\x03keys\x05value\x04\0\x0d\x04\0\x16[method]connection.set\ -\x01\x12\x01j\x01x\x01\x01\x01@\x02\x04self\x0c\x03keys\0\x13\x04\0\x17[method]c\ -onnection.incr\x01\x14\x01ps\x01j\x01y\x01\x01\x01@\x02\x04self\x0c\x04keys\x15\0\ -\x16\x04\0\x16[method]connection.del\x01\x17\x01@\x03\x04self\x0c\x03keys\x06val\ -ues\x15\0\x16\x04\0\x17[method]connection.sadd\x01\x18\x01j\x01\x15\x01\x01\x01@\ -\x02\x04self\x0c\x03keys\0\x19\x04\0\x1b[method]connection.smembers\x01\x1a\x04\0\ -\x17[method]connection.srem\x01\x18\x01p\x06\x01p\x08\x01j\x01\x1c\x01\x01\x01@\x03\ -\x04self\x0c\x07commands\x09arguments\x1b\0\x1d\x04\0\x1a[method]connection.exec\ -ute\x01\x1e\x04\x01\x18fermyon:spin/redis@2.0.0\x05\x1e\x01B\x11\x01q\x05\x11con\ -nection-failed\x01s\0\x0dbad-parameter\x01s\0\x0cquery-failed\x01s\0\x17value-co\ -nversion-failed\x01s\0\x05other\x01s\0\x04\0\x05error\x03\0\0\x01m\x0e\x07boolea\ -n\x04int8\x05int16\x05int32\x05int64\x05uint8\x06uint16\x06uint32\x06uint64\x0af\ -loating32\x0afloating64\x03str\x06binary\x05other\x04\0\x0cdb-data-type\x03\0\x02\ -\x01p}\x01q\x0f\x07boolean\x01\x7f\0\x04int8\x01~\0\x05int16\x01|\0\x05int32\x01\ -z\0\x05int64\x01x\0\x05uint8\x01}\0\x06uint16\x01{\0\x06uint32\x01y\0\x06uint64\x01\ -w\0\x0afloating32\x01v\0\x0afloating64\x01u\0\x03str\x01s\0\x06binary\x01\x04\0\x07\ -db-null\0\0\x0bunsupported\0\0\x04\0\x08db-value\x03\0\x05\x01q\x0e\x07boolean\x01\ -\x7f\0\x04int8\x01~\0\x05int16\x01|\0\x05int32\x01z\0\x05int64\x01x\0\x05uint8\x01\ -}\0\x06uint16\x01{\0\x06uint32\x01y\0\x06uint64\x01w\0\x0afloating32\x01v\0\x0af\ -loating64\x01u\0\x03str\x01s\0\x06binary\x01\x04\0\x07db-null\0\0\x04\0\x0fparam\ -eter-value\x03\0\x07\x01r\x02\x04names\x09data-type\x03\x04\0\x06column\x03\0\x09\ -\x01p\x06\x04\0\x03row\x03\0\x0b\x01p\x0a\x01p\x0c\x01r\x02\x07columns\x0d\x04ro\ -ws\x0e\x04\0\x07row-set\x03\0\x0f\x04\x01\x1efermyon:spin/rdbms-types@2.0.0\x05\x1f\ -\x02\x03\0\x16\x0fparameter-value\x02\x03\0\x16\x07row-set\x02\x03\0\x16\x05erro\ -r\x01B\x13\x02\x03\x02\x01\x20\x04\0\x0fparameter-value\x03\0\0\x02\x03\x02\x01!\ -\x04\0\x07row-set\x03\0\x02\x02\x03\x02\x01\"\x04\0\x05error\x03\0\x04\x04\0\x0a\ -connection\x03\x01\x01i\x06\x01j\x01\x07\x01\x05\x01@\x01\x07addresss\0\x08\x04\0\ -\x17[static]connection.open\x01\x09\x01h\x06\x01p\x01\x01j\x01\x03\x01\x05\x01@\x03\ -\x04self\x0a\x09statements\x06params\x0b\0\x0c\x04\0\x18[method]connection.query\ -\x01\x0d\x01j\x01w\x01\x05\x01@\x03\x04self\x0a\x09statements\x06params\x0b\0\x0e\ -\x04\0\x1a[method]connection.execute\x01\x0f\x04\x01\x1bfermyon:spin/postgres@2.\ -0.0\x05#\x01B\x0f\x01q\x04\x0finvalid-address\0\0\x14too-many-connections\0\0\x11\ -connection-failed\x01s\0\x05other\x01s\0\x04\0\x05error\x03\0\0\x01m\x03\x0cat-m\ -ost-once\x0dat-least-once\x0cexactly-once\x04\0\x03qos\x03\0\x02\x04\0\x0aconnec\ -tion\x03\x01\x01p}\x04\0\x07payload\x03\0\x05\x01i\x04\x01j\x01\x07\x01\x01\x01@\ -\x04\x07addresss\x08usernames\x08passwords\x1bkeep-alive-interval-in-secsw\0\x08\ -\x04\0\x17[static]connection.open\x01\x09\x01h\x04\x01j\0\x01\x01\x01@\x04\x04se\ -lf\x0a\x05topics\x07payload\x06\x03qos\x03\0\x0b\x04\0\x1a[method]connection.pub\ -lish\x01\x0c\x04\x01\x17fermyon:spin/mqtt@2.0.0\x05$\x01B\x13\x02\x03\x02\x01\x20\ -\x04\0\x0fparameter-value\x03\0\0\x02\x03\x02\x01!\x04\0\x07row-set\x03\0\x02\x02\ -\x03\x02\x01\"\x04\0\x05error\x03\0\x04\x04\0\x0aconnection\x03\x01\x01i\x06\x01\ -j\x01\x07\x01\x05\x01@\x01\x07addresss\0\x08\x04\0\x17[static]connection.open\x01\ -\x09\x01h\x06\x01p\x01\x01j\x01\x03\x01\x05\x01@\x03\x04self\x0a\x09statements\x06\ -params\x0b\0\x0c\x04\0\x18[method]connection.query\x01\x0d\x01j\0\x01\x05\x01@\x03\ -\x04self\x0a\x09statements\x06params\x0b\0\x0e\x04\0\x1a[method]connection.execu\ -te\x01\x0f\x04\x01\x18fermyon:spin/mysql@2.0.0\x05%\x01B\x15\x04\0\x0aconnection\ -\x03\x01\x01q\x05\x10no-such-database\0\0\x0daccess-denied\0\0\x12invalid-connec\ -tion\0\0\x0ddatabase-full\0\0\x02io\x01s\0\x04\0\x05error\x03\0\x01\x01p}\x01q\x05\ -\x07integer\x01x\0\x04real\x01u\0\x04text\x01s\0\x04blob\x01\x03\0\x04null\0\0\x04\ -\0\x05value\x03\0\x04\x01p\x05\x01r\x01\x06values\x06\x04\0\x0arow-result\x03\0\x07\ -\x01ps\x01p\x08\x01r\x02\x07columns\x09\x04rows\x0a\x04\0\x0cquery-result\x03\0\x0b\ -\x01i\0\x01j\x01\x0d\x01\x02\x01@\x01\x08databases\0\x0e\x04\0\x17[static]connec\ -tion.open\x01\x0f\x01h\0\x01j\x01\x0c\x01\x02\x01@\x03\x04self\x10\x09statements\ -\x0aparameters\x06\0\x11\x04\0\x1a[method]connection.execute\x01\x12\x04\x01\x19\ -fermyon:spin/sqlite@2.0.0\x05&\x01B\x05\x01q\x04\x0cinvalid-name\x01s\0\x09undef\ -ined\x01s\0\x08provider\x01s\0\x05other\x01s\0\x04\0\x05error\x03\0\0\x01j\x01s\x01\ -\x01\x01@\x01\x04names\0\x02\x04\0\x03get\x01\x03\x04\x01\x1cfermyon:spin/variab\ -les@2.0.0\x05'\x01B\x19\x04\0\x05store\x03\x01\x01p}\x01o\x02s\x01\x01q\x05\x03g\ -et\x01s\0\x03set\x01\x02\0\x06delete\x01s\0\x06exists\x01s\0\x08get-keys\0\0\x04\ -\0\x04call\x03\0\x03\x01i\0\x01@\x01\x05labels\0\x05\x04\0\x12[static]store.open\ -\x01\x06\x01h\0\x01@\x01\x04self\x07\0s\x04\0\x13[method]store.label\x01\x08\x01\ -k\x01\x01@\x02\x04self\x07\x03keys\0\x09\x04\0\x11[method]store.get\x01\x0a\x01@\ -\x03\x04self\x07\x03keys\x05value\x01\x01\0\x04\0\x11[method]store.set\x01\x0b\x01\ -@\x02\x04self\x07\x03keys\x01\0\x04\0\x14[method]store.delete\x01\x0c\x01p\x04\x01\ -o\x02s\x0d\x01p\x0e\x01@\0\0\x0f\x04\0\x05calls\x01\x10\x01@\0\x01\0\x04\0\x0bre\ -set-calls\x01\x11\x04\x01\x20fermyon:spin-test-virt/key-value\x05(\x02\x03\0\x1a\ -\x05value\x02\x03\0\x1a\x0cquery-result\x02\x03\0\x1a\x05error\x01B\x10\x02\x03\x02\ -\x01)\x04\0\x05value\x03\0\0\x02\x03\x02\x01*\x04\0\x0cquery-result\x03\0\x02\x02\ -\x03\x02\x01+\x04\0\x05error\x03\0\x04\x04\0\x0aconnection\x03\x01\x01i\x06\x01j\ -\x01\x07\x01\x05\x01@\x01\x08databases\0\x08\x04\0\x17[static]connection.open\x01\ -\x09\x01h\x06\x01p\x01\x01j\x01\x03\x01\x05\x01@\x03\x04self\x0a\x09statements\x0a\ -parameters\x0b\0\x0c\x04\0\x1a[method]connection.execute\x01\x0d\x04\x01\x1dferm\ -yon:spin-test-virt/sqlite\x05,\x01B\x02\x01@\x02\x03keys\x05values\x01\0\x04\0\x03\ -set\x01\0\x04\x01\x20fermyon:spin-test-virt/variables\x05-\x01B\x0a\x04\0\x08pol\ -lable\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]pollable.block\x01\x03\x01p\x01\ -\x01py\x01@\x01\x02in\x04\0\x05\x04\0\x04poll\x01\x06\x04\x01\x12wasi:io/poll@0.\ -2.0\x05.\x01B\x0f\x02\x03\x02\x01\x01\x04\0\x08pollable\x03\0\0\x01w\x04\0\x07in\ -stant\x03\0\x02\x01w\x04\0\x08duration\x03\0\x04\x01@\0\0\x03\x04\0\x03now\x01\x06\ -\x01@\0\0\x05\x04\0\x0aresolution\x01\x07\x01i\x01\x01@\x01\x04when\x03\0\x08\x04\ -\0\x11subscribe-instant\x01\x09\x01@\x01\x04when\x05\0\x08\x04\0\x12subscribe-du\ -ration\x01\x0a\x04\x01!wasi:clocks/monotonic-clock@0.2.0\x05/\x01B\x05\x01r\x02\x07\ -secondsw\x0bnanosecondsy\x04\0\x08datetime\x03\0\0\x01@\0\0\x01\x04\0\x03now\x01\ -\x02\x04\0\x0aresolution\x01\x02\x04\x01\x1cwasi:clocks/wall-clock@0.2.0\x050\x01\ -B\x05\x01p}\x01@\x01\x03lenw\0\0\x04\0\x10get-random-bytes\x01\x01\x01@\0\0w\x04\ -\0\x0eget-random-u64\x01\x02\x04\x01\x18wasi:random/random@0.2.0\x051\x01B\x05\x01\ -p}\x01@\x01\x03lenw\0\0\x04\0\x19get-insecure-random-bytes\x01\x01\x01@\0\0w\x04\ -\0\x17get-insecure-random-u64\x01\x02\x04\x01\x1awasi:random/insecure@0.2.0\x052\ -\x01B\x03\x01o\x02ww\x01@\0\0\0\x04\0\x0dinsecure-seed\x01\x01\x04\x01\x1fwasi:r\ -andom/insecure-seed@0.2.0\x053\x01B\x04\x04\0\x05error\x03\x01\x01h\0\x01@\x01\x04\ -self\x01\0s\x04\0\x1d[method]error.to-debug-string\x01\x02\x04\x01\x13wasi:io/er\ -ror@0.2.0\x054\x01B(\x02\x03\x02\x01\x08\x04\0\x05error\x03\0\0\x02\x03\x02\x01\x01\ -\x04\0\x08pollable\x03\0\x02\x01i\x01\x01q\x02\x15last-operation-failed\x01\x04\0\ -\x06closed\0\0\x04\0\x0cstream-error\x03\0\x05\x04\0\x0cinput-stream\x03\x01\x04\ -\0\x0doutput-stream\x03\x01\x01h\x07\x01p}\x01j\x01\x0a\x01\x06\x01@\x02\x04self\ -\x09\x03lenw\0\x0b\x04\0\x19[method]input-stream.read\x01\x0c\x04\0\"[method]inp\ -ut-stream.blocking-read\x01\x0c\x01j\x01w\x01\x06\x01@\x02\x04self\x09\x03lenw\0\ -\x0d\x04\0\x19[method]input-stream.skip\x01\x0e\x04\0\"[method]input-stream.bloc\ -king-skip\x01\x0e\x01i\x03\x01@\x01\x04self\x09\0\x0f\x04\0\x1e[method]input-str\ -eam.subscribe\x01\x10\x01h\x08\x01@\x01\x04self\x11\0\x0d\x04\0![method]output-s\ -tream.check-write\x01\x12\x01j\0\x01\x06\x01@\x02\x04self\x11\x08contents\x0a\0\x13\ -\x04\0\x1b[method]output-stream.write\x01\x14\x04\0.[method]output-stream.blocki\ -ng-write-and-flush\x01\x14\x01@\x01\x04self\x11\0\x13\x04\0\x1b[method]output-st\ -ream.flush\x01\x15\x04\0$[method]output-stream.blocking-flush\x01\x15\x01@\x01\x04\ -self\x11\0\x0f\x04\0\x1f[method]output-stream.subscribe\x01\x16\x01@\x02\x04self\ -\x11\x03lenw\0\x13\x04\0\"[method]output-stream.write-zeroes\x01\x17\x04\05[meth\ -od]output-stream.blocking-write-zeroes-and-flush\x01\x17\x01@\x03\x04self\x11\x03\ -src\x09\x03lenw\0\x0d\x04\0\x1c[method]output-stream.splice\x01\x18\x04\0%[metho\ -d]output-stream.blocking-splice\x01\x18\x04\x01\x15wasi:io/streams@0.2.0\x055\x02\ -\x03\0&\x05error\x02\x03\0!\x08datetime\x01Br\x02\x03\x02\x01\x0c\x04\0\x0cinput\ --stream\x03\0\0\x02\x03\x02\x01\x0a\x04\0\x0doutput-stream\x03\0\x02\x02\x03\x02\ -\x016\x04\0\x05error\x03\0\x04\x02\x03\x02\x017\x04\0\x08datetime\x03\0\x06\x01w\ -\x04\0\x08filesize\x03\0\x08\x01m\x08\x07unknown\x0cblock-device\x10character-de\ -vice\x09directory\x04fifo\x0dsymbolic-link\x0cregular-file\x06socket\x04\0\x0fde\ -scriptor-type\x03\0\x0a\x01n\x06\x04read\x05write\x13file-integrity-sync\x13data\ --integrity-sync\x14requested-write-sync\x10mutate-directory\x04\0\x10descriptor-\ -flags\x03\0\x0c\x01n\x01\x0esymlink-follow\x04\0\x0apath-flags\x03\0\x0e\x01n\x04\ -\x06create\x09directory\x09exclusive\x08truncate\x04\0\x0aopen-flags\x03\0\x10\x01\ -w\x04\0\x0alink-count\x03\0\x12\x01k\x07\x01r\x06\x04type\x0b\x0alink-count\x13\x04\ -size\x09\x15data-access-timestamp\x14\x1bdata-modification-timestamp\x14\x17stat\ -us-change-timestamp\x14\x04\0\x0fdescriptor-stat\x03\0\x15\x01q\x03\x09no-change\ -\0\0\x03now\0\0\x09timestamp\x01\x07\0\x04\0\x0dnew-timestamp\x03\0\x17\x01r\x02\ -\x04type\x0b\x04names\x04\0\x0fdirectory-entry\x03\0\x19\x01m%\x06access\x0bwoul\ -d-block\x07already\x0ebad-descriptor\x04busy\x08deadlock\x05quota\x05exist\x0efi\ -le-too-large\x15illegal-byte-sequence\x0bin-progress\x0binterrupted\x07invalid\x02\ -io\x0cis-directory\x04loop\x0etoo-many-links\x0cmessage-size\x0dname-too-long\x09\ -no-device\x08no-entry\x07no-lock\x13insufficient-memory\x12insufficient-space\x0d\ -not-directory\x09not-empty\x0fnot-recoverable\x0bunsupported\x06no-tty\x0eno-suc\ -h-device\x08overflow\x0dnot-permitted\x04pipe\x09read-only\x0cinvalid-seek\x0ete\ -xt-file-busy\x0ccross-device\x04\0\x0aerror-code\x03\0\x1b\x01m\x06\x06normal\x0a\ -sequential\x06random\x09will-need\x09dont-need\x08no-reuse\x04\0\x06advice\x03\0\ -\x1d\x01r\x02\x05lowerw\x05upperw\x04\0\x13metadata-hash-value\x03\0\x1f\x04\0\x0a\ -descriptor\x03\x01\x04\0\x16directory-entry-stream\x03\x01\x01h!\x01i\x01\x01j\x01\ -$\x01\x1c\x01@\x02\x04self#\x06offset\x09\0%\x04\0\"[method]descriptor.read-via-\ -stream\x01&\x01i\x03\x01j\x01'\x01\x1c\x01@\x02\x04self#\x06offset\x09\0(\x04\0#\ -[method]descriptor.write-via-stream\x01)\x01@\x01\x04self#\0(\x04\0$[method]desc\ -riptor.append-via-stream\x01*\x01j\0\x01\x1c\x01@\x04\x04self#\x06offset\x09\x06\ -length\x09\x06advice\x1e\0+\x04\0\x19[method]descriptor.advise\x01,\x01@\x01\x04\ -self#\0+\x04\0\x1c[method]descriptor.sync-data\x01-\x01j\x01\x0d\x01\x1c\x01@\x01\ -\x04self#\0.\x04\0\x1c[method]descriptor.get-flags\x01/\x01j\x01\x0b\x01\x1c\x01\ -@\x01\x04self#\00\x04\0\x1b[method]descriptor.get-type\x011\x01@\x02\x04self#\x04\ -size\x09\0+\x04\0\x1b[method]descriptor.set-size\x012\x01@\x03\x04self#\x15data-\ -access-timestamp\x18\x1bdata-modification-timestamp\x18\0+\x04\0\x1c[method]desc\ -riptor.set-times\x013\x01p}\x01o\x024\x7f\x01j\x015\x01\x1c\x01@\x03\x04self#\x06\ -length\x09\x06offset\x09\06\x04\0\x17[method]descriptor.read\x017\x01j\x01\x09\x01\ -\x1c\x01@\x03\x04self#\x06buffer4\x06offset\x09\08\x04\0\x18[method]descriptor.w\ -rite\x019\x01i\"\x01j\x01:\x01\x1c\x01@\x01\x04self#\0;\x04\0![method]descriptor\ -.read-directory\x01<\x04\0\x17[method]descriptor.sync\x01-\x01@\x02\x04self#\x04\ -paths\0+\x04\0&[method]descriptor.create-directory-at\x01=\x01j\x01\x16\x01\x1c\x01\ -@\x01\x04self#\0>\x04\0\x17[method]descriptor.stat\x01?\x01@\x03\x04self#\x0apat\ -h-flags\x0f\x04paths\0>\x04\0\x1a[method]descriptor.stat-at\x01@\x01@\x05\x04sel\ -f#\x0apath-flags\x0f\x04paths\x15data-access-timestamp\x18\x1bdata-modification-\ -timestamp\x18\0+\x04\0\x1f[method]descriptor.set-times-at\x01A\x01@\x05\x04self#\ -\x0eold-path-flags\x0f\x08old-paths\x0enew-descriptor#\x08new-paths\0+\x04\0\x1a\ -[method]descriptor.link-at\x01B\x01i!\x01j\x01\xc3\0\x01\x1c\x01@\x05\x04self#\x0a\ -path-flags\x0f\x04paths\x0aopen-flags\x11\x05flags\x0d\0\xc4\0\x04\0\x1a[method]\ -descriptor.open-at\x01E\x01j\x01s\x01\x1c\x01@\x02\x04self#\x04paths\0\xc6\0\x04\ -\0\x1e[method]descriptor.readlink-at\x01G\x04\0&[method]descriptor.remove-direct\ -ory-at\x01=\x01@\x04\x04self#\x08old-paths\x0enew-descriptor#\x08new-paths\0+\x04\ -\0\x1c[method]descriptor.rename-at\x01H\x01@\x03\x04self#\x08old-paths\x08new-pa\ -ths\0+\x04\0\x1d[method]descriptor.symlink-at\x01I\x04\0![method]descriptor.unli\ -nk-file-at\x01=\x01@\x02\x04self#\x05other#\0\x7f\x04\0![method]descriptor.is-sa\ -me-object\x01J\x01j\x01\x20\x01\x1c\x01@\x01\x04self#\0\xcb\0\x04\0\x20[method]d\ -escriptor.metadata-hash\x01L\x01@\x03\x04self#\x0apath-flags\x0f\x04paths\0\xcb\0\ -\x04\0#[method]descriptor.metadata-hash-at\x01M\x01h\"\x01k\x1a\x01j\x01\xcf\0\x01\ -\x1c\x01@\x01\x04self\xce\0\0\xd0\0\x04\03[method]directory-entry-stream.read-di\ -rectory-entry\x01Q\x01h\x05\x01k\x1c\x01@\x01\x03err\xd2\0\0\xd3\0\x04\0\x15file\ -system-error-code\x01T\x04\x01\x1bwasi:filesystem/types@0.2.0\x058\x02\x03\0'\x0a\ -descriptor\x01B\x07\x02\x03\x02\x019\x04\0\x0adescriptor\x03\0\0\x01i\x01\x01o\x02\ -\x02s\x01p\x03\x01@\0\0\x04\x04\0\x0fget-directories\x01\x05\x04\x01\x1ewasi:fil\ -esystem/preopens@0.2.0\x05:\x01B\x05\x02\x03\x02\x01\x0a\x04\0\x0doutput-stream\x03\ -\0\0\x01i\x01\x01@\0\0\x02\x04\0\x0aget-stdout\x01\x03\x04\x01\x15wasi:cli/stdou\ -t@0.2.0\x05;\x01B\x05\x02\x03\x02\x01\x0c\x04\0\x0cinput-stream\x03\0\0\x01i\x01\ -\x01@\0\0\x02\x04\0\x09get-stdin\x01\x03\x04\x01\x14wasi:cli/stdin@0.2.0\x05<\x01\ -B\x05\x02\x03\x02\x01\x0a\x04\0\x0doutput-stream\x03\0\0\x01i\x01\x01@\0\0\x02\x04\ -\0\x0aget-stderr\x01\x03\x04\x01\x15wasi:cli/stderr@0.2.0\x05=\x01B\x01\x04\0\x0e\ -terminal-input\x03\x01\x04\x01\x1dwasi:cli/terminal-input@0.2.0\x05>\x01B\x01\x04\ -\0\x0fterminal-output\x03\x01\x04\x01\x1ewasi:cli/terminal-output@0.2.0\x05?\x01\ -B\x06\x02\x03\x02\x01\x11\x04\0\x0eterminal-input\x03\0\0\x01i\x01\x01k\x02\x01@\ -\0\0\x03\x04\0\x12get-terminal-stdin\x01\x04\x04\x01\x1dwasi:cli/terminal-stdin@\ -0.2.0\x05@\x01B\x06\x02\x03\x02\x01\x13\x04\0\x0fterminal-output\x03\0\0\x01i\x01\ -\x01k\x02\x01@\0\0\x03\x04\0\x13get-terminal-stdout\x01\x04\x04\x01\x1ewasi:cli/\ -terminal-stdout@0.2.0\x05A\x01B\x06\x02\x03\x02\x01\x13\x04\0\x0fterminal-output\ -\x03\0\0\x01i\x01\x01k\x02\x01@\0\0\x03\x04\0\x13get-terminal-stderr\x01\x04\x04\ -\x01\x1ewasi:cli/terminal-stderr@0.2.0\x05B\x01B\x0a\x01o\x02ss\x01p\0\x01@\0\0\x01\ -\x04\0\x0fget-environment\x01\x02\x01ps\x01@\0\0\x03\x04\0\x0dget-arguments\x01\x04\ -\x01ks\x01@\0\0\x05\x04\0\x0binitial-cwd\x01\x06\x04\x01\x1awasi:cli/environment\ -@0.2.0\x05C\x01B\x03\x01j\0\0\x01@\x01\x06status\0\x01\0\x04\0\x04exit\x01\x01\x04\ -\x01\x13wasi:cli/exit@0.2.0\x05D\x01B\x11\x04\0\x07network\x03\x01\x01m\x15\x07u\ -nknown\x0daccess-denied\x0dnot-supported\x10invalid-argument\x0dout-of-memory\x07\ -timeout\x14concurrency-conflict\x0fnot-in-progress\x0bwould-block\x0dinvalid-sta\ -te\x10new-socket-limit\x14address-not-bindable\x0eaddress-in-use\x12remote-unrea\ -chable\x12connection-refused\x10connection-reset\x12connection-aborted\x12datagr\ -am-too-large\x11name-unresolvable\x1atemporary-resolver-failure\x1apermanent-res\ -olver-failure\x04\0\x0aerror-code\x03\0\x01\x01m\x02\x04ipv4\x04ipv6\x04\0\x11ip\ --address-family\x03\0\x03\x01o\x04}}}}\x04\0\x0cipv4-address\x03\0\x05\x01o\x08{\ -{{{{{{{\x04\0\x0cipv6-address\x03\0\x07\x01q\x02\x04ipv4\x01\x06\0\x04ipv6\x01\x08\ -\0\x04\0\x0aip-address\x03\0\x09\x01r\x02\x04port{\x07address\x06\x04\0\x13ipv4-\ -socket-address\x03\0\x0b\x01r\x04\x04port{\x09flow-infoy\x07address\x08\x08scope\ --idy\x04\0\x13ipv6-socket-address\x03\0\x0d\x01q\x02\x04ipv4\x01\x0c\0\x04ipv6\x01\ -\x0e\0\x04\0\x11ip-socket-address\x03\0\x0f\x04\x01\x1awasi:sockets/network@0.2.\ -0\x05E\x02\x03\03\x07network\x01B\x05\x02\x03\x02\x01F\x04\0\x07network\x03\0\0\x01\ -i\x01\x01@\0\0\x02\x04\0\x10instance-network\x01\x03\x04\x01#wasi:sockets/instan\ -ce-network@0.2.0\x05G\x02\x03\03\x0aerror-code\x02\x03\03\x11ip-socket-address\x02\ -\x03\03\x11ip-address-family\x01BD\x02\x03\x02\x01\x01\x04\0\x08pollable\x03\0\0\ -\x02\x03\x02\x01F\x04\0\x07network\x03\0\x02\x02\x03\x02\x01H\x04\0\x0aerror-cod\ -e\x03\0\x04\x02\x03\x02\x01I\x04\0\x11ip-socket-address\x03\0\x06\x02\x03\x02\x01\ -J\x04\0\x11ip-address-family\x03\0\x08\x01p}\x01r\x02\x04data\x0a\x0eremote-addr\ -ess\x07\x04\0\x11incoming-datagram\x03\0\x0b\x01k\x07\x01r\x02\x04data\x0a\x0ere\ -mote-address\x0d\x04\0\x11outgoing-datagram\x03\0\x0e\x04\0\x0audp-socket\x03\x01\ -\x04\0\x18incoming-datagram-stream\x03\x01\x04\0\x18outgoing-datagram-stream\x03\ -\x01\x01h\x10\x01h\x03\x01j\0\x01\x05\x01@\x03\x04self\x13\x07network\x14\x0dloc\ -al-address\x07\0\x15\x04\0\x1d[method]udp-socket.start-bind\x01\x16\x01@\x01\x04\ -self\x13\0\x15\x04\0\x1e[method]udp-socket.finish-bind\x01\x17\x01i\x11\x01i\x12\ -\x01o\x02\x18\x19\x01j\x01\x1a\x01\x05\x01@\x02\x04self\x13\x0eremote-address\x0d\ -\0\x1b\x04\0\x19[method]udp-socket.stream\x01\x1c\x01j\x01\x07\x01\x05\x01@\x01\x04\ -self\x13\0\x1d\x04\0\x20[method]udp-socket.local-address\x01\x1e\x04\0![method]u\ -dp-socket.remote-address\x01\x1e\x01@\x01\x04self\x13\0\x09\x04\0![method]udp-so\ -cket.address-family\x01\x1f\x01j\x01}\x01\x05\x01@\x01\x04self\x13\0\x20\x04\0$[\ -method]udp-socket.unicast-hop-limit\x01!\x01@\x02\x04self\x13\x05value}\0\x15\x04\ -\0([method]udp-socket.set-unicast-hop-limit\x01\"\x01j\x01w\x01\x05\x01@\x01\x04\ -self\x13\0#\x04\0&[method]udp-socket.receive-buffer-size\x01$\x01@\x02\x04self\x13\ -\x05valuew\0\x15\x04\0*[method]udp-socket.set-receive-buffer-size\x01%\x04\0#[me\ -thod]udp-socket.send-buffer-size\x01$\x04\0'[method]udp-socket.set-send-buffer-s\ -ize\x01%\x01i\x01\x01@\x01\x04self\x13\0&\x04\0\x1c[method]udp-socket.subscribe\x01\ -'\x01h\x11\x01p\x0c\x01j\x01)\x01\x05\x01@\x02\x04self(\x0bmax-resultsw\0*\x04\0\ -([method]incoming-datagram-stream.receive\x01+\x01@\x01\x04self(\0&\x04\0*[metho\ -d]incoming-datagram-stream.subscribe\x01,\x01h\x12\x01@\x01\x04self-\0#\x04\0+[m\ -ethod]outgoing-datagram-stream.check-send\x01.\x01p\x0f\x01@\x02\x04self-\x09dat\ -agrams/\0#\x04\0%[method]outgoing-datagram-stream.send\x010\x01@\x01\x04self-\0&\ -\x04\0*[method]outgoing-datagram-stream.subscribe\x011\x04\x01\x16wasi:sockets/u\ -dp@0.2.0\x05K\x02\x03\05\x0audp-socket\x01B\x0c\x02\x03\x02\x01F\x04\0\x07networ\ -k\x03\0\0\x02\x03\x02\x01H\x04\0\x0aerror-code\x03\0\x02\x02\x03\x02\x01J\x04\0\x11\ -ip-address-family\x03\0\x04\x02\x03\x02\x01L\x04\0\x0audp-socket\x03\0\x06\x01i\x07\ -\x01j\x01\x08\x01\x03\x01@\x01\x0eaddress-family\x05\0\x09\x04\0\x11create-udp-s\ -ocket\x01\x0a\x04\x01$wasi:sockets/udp-create-socket@0.2.0\x05M\x01BT\x02\x03\x02\ -\x01\x0c\x04\0\x0cinput-stream\x03\0\0\x02\x03\x02\x01\x0a\x04\0\x0doutput-strea\ -m\x03\0\x02\x02\x03\x02\x01\x01\x04\0\x08pollable\x03\0\x04\x02\x03\x02\x01\x18\x04\ -\0\x08duration\x03\0\x06\x02\x03\x02\x01F\x04\0\x07network\x03\0\x08\x02\x03\x02\ -\x01H\x04\0\x0aerror-code\x03\0\x0a\x02\x03\x02\x01I\x04\0\x11ip-socket-address\x03\ -\0\x0c\x02\x03\x02\x01J\x04\0\x11ip-address-family\x03\0\x0e\x01m\x03\x07receive\ -\x04send\x04both\x04\0\x0dshutdown-type\x03\0\x10\x04\0\x0atcp-socket\x03\x01\x01\ -h\x12\x01h\x09\x01j\0\x01\x0b\x01@\x03\x04self\x13\x07network\x14\x0dlocal-addre\ -ss\x0d\0\x15\x04\0\x1d[method]tcp-socket.start-bind\x01\x16\x01@\x01\x04self\x13\ -\0\x15\x04\0\x1e[method]tcp-socket.finish-bind\x01\x17\x01@\x03\x04self\x13\x07n\ -etwork\x14\x0eremote-address\x0d\0\x15\x04\0\x20[method]tcp-socket.start-connect\ -\x01\x18\x01i\x01\x01i\x03\x01o\x02\x19\x1a\x01j\x01\x1b\x01\x0b\x01@\x01\x04sel\ -f\x13\0\x1c\x04\0![method]tcp-socket.finish-connect\x01\x1d\x04\0\x1f[method]tcp\ --socket.start-listen\x01\x17\x04\0\x20[method]tcp-socket.finish-listen\x01\x17\x01\ -i\x12\x01o\x03\x1e\x19\x1a\x01j\x01\x1f\x01\x0b\x01@\x01\x04self\x13\0\x20\x04\0\ -\x19[method]tcp-socket.accept\x01!\x01j\x01\x0d\x01\x0b\x01@\x01\x04self\x13\0\"\ -\x04\0\x20[method]tcp-socket.local-address\x01#\x04\0![method]tcp-socket.remote-\ -address\x01#\x01@\x01\x04self\x13\0\x7f\x04\0\x1f[method]tcp-socket.is-listening\ -\x01$\x01@\x01\x04self\x13\0\x0f\x04\0![method]tcp-socket.address-family\x01%\x01\ +-stderr\x01\x04\x04\0\x1ewasi:cli/terminal-stderr@0.2.0\x05B\x01B\x0a\x01o\x02ss\ +\x01p\0\x01@\0\0\x01\x04\0\x0fget-environment\x01\x02\x01ps\x01@\0\0\x03\x04\0\x0d\ +get-arguments\x01\x04\x01ks\x01@\0\0\x05\x04\0\x0binitial-cwd\x01\x06\x04\0\x1aw\ +asi:cli/environment@0.2.0\x05C\x01B\x03\x01j\0\0\x01@\x01\x06status\0\x01\0\x04\0\ +\x04exit\x01\x01\x04\0\x13wasi:cli/exit@0.2.0\x05D\x01B\x11\x04\0\x07network\x03\ +\x01\x01m\x15\x07unknown\x0daccess-denied\x0dnot-supported\x10invalid-argument\x0d\ +out-of-memory\x07timeout\x14concurrency-conflict\x0fnot-in-progress\x0bwould-blo\ +ck\x0dinvalid-state\x10new-socket-limit\x14address-not-bindable\x0eaddress-in-us\ +e\x12remote-unreachable\x12connection-refused\x10connection-reset\x12connection-\ +aborted\x12datagram-too-large\x11name-unresolvable\x1atemporary-resolver-failure\ +\x1apermanent-resolver-failure\x04\0\x0aerror-code\x03\0\x01\x01m\x02\x04ipv4\x04\ +ipv6\x04\0\x11ip-address-family\x03\0\x03\x01o\x04}}}}\x04\0\x0cipv4-address\x03\ +\0\x05\x01o\x08{{{{{{{{\x04\0\x0cipv6-address\x03\0\x07\x01q\x02\x04ipv4\x01\x06\ +\0\x04ipv6\x01\x08\0\x04\0\x0aip-address\x03\0\x09\x01r\x02\x04port{\x07address\x06\ +\x04\0\x13ipv4-socket-address\x03\0\x0b\x01r\x04\x04port{\x09flow-infoy\x07addre\ +ss\x08\x08scope-idy\x04\0\x13ipv6-socket-address\x03\0\x0d\x01q\x02\x04ipv4\x01\x0c\ +\0\x04ipv6\x01\x0e\0\x04\0\x11ip-socket-address\x03\0\x0f\x04\0\x1awasi:sockets/\ +network@0.2.0\x05E\x02\x03\03\x07network\x01B\x05\x02\x03\x02\x01F\x04\0\x07netw\ +ork\x03\0\0\x01i\x01\x01@\0\0\x02\x04\0\x10instance-network\x01\x03\x04\0#wasi:s\ +ockets/instance-network@0.2.0\x05G\x02\x03\03\x0aerror-code\x02\x03\03\x11ip-soc\ +ket-address\x02\x03\03\x11ip-address-family\x01BD\x02\x03\x02\x01\x02\x04\0\x08p\ +ollable\x03\0\0\x02\x03\x02\x01F\x04\0\x07network\x03\0\x02\x02\x03\x02\x01H\x04\ +\0\x0aerror-code\x03\0\x04\x02\x03\x02\x01I\x04\0\x11ip-socket-address\x03\0\x06\ +\x02\x03\x02\x01J\x04\0\x11ip-address-family\x03\0\x08\x01p}\x01r\x02\x04data\x0a\ +\x0eremote-address\x07\x04\0\x11incoming-datagram\x03\0\x0b\x01k\x07\x01r\x02\x04\ +data\x0a\x0eremote-address\x0d\x04\0\x11outgoing-datagram\x03\0\x0e\x04\0\x0audp\ +-socket\x03\x01\x04\0\x18incoming-datagram-stream\x03\x01\x04\0\x18outgoing-data\ +gram-stream\x03\x01\x01h\x10\x01h\x03\x01j\0\x01\x05\x01@\x03\x04self\x13\x07net\ +work\x14\x0dlocal-address\x07\0\x15\x04\0\x1d[method]udp-socket.start-bind\x01\x16\ +\x01@\x01\x04self\x13\0\x15\x04\0\x1e[method]udp-socket.finish-bind\x01\x17\x01i\ +\x11\x01i\x12\x01o\x02\x18\x19\x01j\x01\x1a\x01\x05\x01@\x02\x04self\x13\x0eremo\ +te-address\x0d\0\x1b\x04\0\x19[method]udp-socket.stream\x01\x1c\x01j\x01\x07\x01\ +\x05\x01@\x01\x04self\x13\0\x1d\x04\0\x20[method]udp-socket.local-address\x01\x1e\ +\x04\0![method]udp-socket.remote-address\x01\x1e\x01@\x01\x04self\x13\0\x09\x04\0\ +![method]udp-socket.address-family\x01\x1f\x01j\x01}\x01\x05\x01@\x01\x04self\x13\ +\0\x20\x04\0$[method]udp-socket.unicast-hop-limit\x01!\x01@\x02\x04self\x13\x05v\ +alue}\0\x15\x04\0([method]udp-socket.set-unicast-hop-limit\x01\"\x01j\x01w\x01\x05\ +\x01@\x01\x04self\x13\0#\x04\0&[method]udp-socket.receive-buffer-size\x01$\x01@\x02\ +\x04self\x13\x05valuew\0\x15\x04\0*[method]udp-socket.set-receive-buffer-size\x01\ +%\x04\0#[method]udp-socket.send-buffer-size\x01$\x04\0'[method]udp-socket.set-se\ +nd-buffer-size\x01%\x01i\x01\x01@\x01\x04self\x13\0&\x04\0\x1c[method]udp-socket\ +.subscribe\x01'\x01h\x11\x01p\x0c\x01j\x01)\x01\x05\x01@\x02\x04self(\x0bmax-res\ +ultsw\0*\x04\0([method]incoming-datagram-stream.receive\x01+\x01@\x01\x04self(\0\ +&\x04\0*[method]incoming-datagram-stream.subscribe\x01,\x01h\x12\x01@\x01\x04sel\ +f-\0#\x04\0+[method]outgoing-datagram-stream.check-send\x01.\x01p\x0f\x01@\x02\x04\ +self-\x09datagrams/\0#\x04\0%[method]outgoing-datagram-stream.send\x010\x01@\x01\ +\x04self-\0&\x04\0*[method]outgoing-datagram-stream.subscribe\x011\x04\0\x16wasi\ +:sockets/udp@0.2.0\x05K\x02\x03\05\x0audp-socket\x01B\x0c\x02\x03\x02\x01F\x04\0\ +\x07network\x03\0\0\x02\x03\x02\x01H\x04\0\x0aerror-code\x03\0\x02\x02\x03\x02\x01\ +J\x04\0\x11ip-address-family\x03\0\x04\x02\x03\x02\x01L\x04\0\x0audp-socket\x03\0\ +\x06\x01i\x07\x01j\x01\x08\x01\x03\x01@\x01\x0eaddress-family\x05\0\x09\x04\0\x11\ +create-udp-socket\x01\x0a\x04\0$wasi:sockets/udp-create-socket@0.2.0\x05M\x01BT\x02\ +\x03\x02\x01\x0d\x04\0\x0cinput-stream\x03\0\0\x02\x03\x02\x01\x0b\x04\0\x0doutp\ +ut-stream\x03\0\x02\x02\x03\x02\x01\x02\x04\0\x08pollable\x03\0\x04\x02\x03\x02\x01\ +\x19\x04\0\x08duration\x03\0\x06\x02\x03\x02\x01F\x04\0\x07network\x03\0\x08\x02\ +\x03\x02\x01H\x04\0\x0aerror-code\x03\0\x0a\x02\x03\x02\x01I\x04\0\x11ip-socket-\ +address\x03\0\x0c\x02\x03\x02\x01J\x04\0\x11ip-address-family\x03\0\x0e\x01m\x03\ +\x07receive\x04send\x04both\x04\0\x0dshutdown-type\x03\0\x10\x04\0\x0atcp-socket\ +\x03\x01\x01h\x12\x01h\x09\x01j\0\x01\x0b\x01@\x03\x04self\x13\x07network\x14\x0d\ +local-address\x0d\0\x15\x04\0\x1d[method]tcp-socket.start-bind\x01\x16\x01@\x01\x04\ +self\x13\0\x15\x04\0\x1e[method]tcp-socket.finish-bind\x01\x17\x01@\x03\x04self\x13\ +\x07network\x14\x0eremote-address\x0d\0\x15\x04\0\x20[method]tcp-socket.start-co\ +nnect\x01\x18\x01i\x01\x01i\x03\x01o\x02\x19\x1a\x01j\x01\x1b\x01\x0b\x01@\x01\x04\ +self\x13\0\x1c\x04\0![method]tcp-socket.finish-connect\x01\x1d\x04\0\x1f[method]\ +tcp-socket.start-listen\x01\x17\x04\0\x20[method]tcp-socket.finish-listen\x01\x17\ +\x01i\x12\x01o\x03\x1e\x19\x1a\x01j\x01\x1f\x01\x0b\x01@\x01\x04self\x13\0\x20\x04\ +\0\x19[method]tcp-socket.accept\x01!\x01j\x01\x0d\x01\x0b\x01@\x01\x04self\x13\0\ +\"\x04\0\x20[method]tcp-socket.local-address\x01#\x04\0![method]tcp-socket.remot\ +e-address\x01#\x01@\x01\x04self\x13\0\x7f\x04\0\x1f[method]tcp-socket.is-listeni\ +ng\x01$\x01@\x01\x04self\x13\0\x0f\x04\0![method]tcp-socket.address-family\x01%\x01\ @\x02\x04self\x13\x05valuew\0\x15\x04\0*[method]tcp-socket.set-listen-backlog-si\ ze\x01&\x01j\x01\x7f\x01\x0b\x01@\x01\x04self\x13\0'\x04\0%[method]tcp-socket.ke\ ep-alive-enabled\x01(\x01@\x02\x04self\x13\x05value\x7f\0\x15\x04\0)[method]tcp-\ @@ -35209,69 +37905,69 @@ d]tcp-socket.set-hop-limit\x012\x01j\x01w\x01\x0b\x01@\x01\x04self\x13\03\x04\0& -buffer-size\x01&\x04\0#[method]tcp-socket.send-buffer-size\x014\x04\0'[method]t\ cp-socket.set-send-buffer-size\x01&\x01i\x05\x01@\x01\x04self\x13\05\x04\0\x1c[m\ ethod]tcp-socket.subscribe\x016\x01@\x02\x04self\x13\x0dshutdown-type\x11\0\x15\x04\ -\0\x1b[method]tcp-socket.shutdown\x017\x04\x01\x16wasi:sockets/tcp@0.2.0\x05N\x02\ -\x03\07\x0atcp-socket\x01B\x0c\x02\x03\x02\x01F\x04\0\x07network\x03\0\0\x02\x03\ -\x02\x01H\x04\0\x0aerror-code\x03\0\x02\x02\x03\x02\x01J\x04\0\x11ip-address-fam\ -ily\x03\0\x04\x02\x03\x02\x01O\x04\0\x0atcp-socket\x03\0\x06\x01i\x07\x01j\x01\x08\ -\x01\x03\x01@\x01\x0eaddress-family\x05\0\x09\x04\0\x11create-tcp-socket\x01\x0a\ -\x04\x01$wasi:sockets/tcp-create-socket@0.2.0\x05P\x02\x03\03\x0aip-address\x01B\ -\x16\x02\x03\x02\x01\x01\x04\0\x08pollable\x03\0\0\x02\x03\x02\x01F\x04\0\x07net\ -work\x03\0\x02\x02\x03\x02\x01H\x04\0\x0aerror-code\x03\0\x04\x02\x03\x02\x01Q\x04\ -\0\x0aip-address\x03\0\x06\x04\0\x16resolve-address-stream\x03\x01\x01h\x08\x01k\ -\x07\x01j\x01\x0a\x01\x05\x01@\x01\x04self\x09\0\x0b\x04\03[method]resolve-addre\ -ss-stream.resolve-next-address\x01\x0c\x01i\x01\x01@\x01\x04self\x09\0\x0d\x04\0\ -([method]resolve-address-stream.subscribe\x01\x0e\x01h\x03\x01i\x08\x01j\x01\x10\ -\x01\x05\x01@\x02\x07network\x0f\x04names\0\x11\x04\0\x11resolve-addresses\x01\x12\ -\x04\x01!wasi:sockets/ip-name-lookup@0.2.0\x05R\x01B\xc0\x01\x02\x03\x02\x01\x18\ -\x04\0\x08duration\x03\0\0\x02\x03\x02\x01\x0c\x04\0\x0cinput-stream\x03\0\x02\x02\ -\x03\x02\x01\x0a\x04\0\x0doutput-stream\x03\0\x04\x02\x03\x02\x01\x08\x04\0\x08i\ -o-error\x03\0\x06\x02\x03\x02\x01\x01\x04\0\x08pollable\x03\0\x08\x01q\x0a\x03ge\ -t\0\0\x04head\0\0\x04post\0\0\x03put\0\0\x06delete\0\0\x07connect\0\0\x07options\ -\0\0\x05trace\0\0\x05patch\0\0\x05other\x01s\0\x04\0\x06method\x03\0\x0a\x01q\x03\ -\x04HTTP\0\0\x05HTTPS\0\0\x05other\x01s\0\x04\0\x06scheme\x03\0\x0c\x01ks\x01k{\x01\ -r\x02\x05rcode\x0e\x09info-code\x0f\x04\0\x11DNS-error-payload\x03\0\x10\x01k}\x01\ -r\x02\x08alert-id\x12\x0dalert-message\x0e\x04\0\x1aTLS-alert-received-payload\x03\ -\0\x13\x01ky\x01r\x02\x0afield-name\x0e\x0afield-size\x15\x04\0\x12field-size-pa\ -yload\x03\0\x16\x01kw\x01k\x17\x01q'\x0bDNS-timeout\0\0\x09DNS-error\x01\x11\0\x15\ -destination-not-found\0\0\x17destination-unavailable\0\0\x19destination-IP-prohi\ -bited\0\0\x19destination-IP-unroutable\0\0\x12connection-refused\0\0\x15connecti\ -on-terminated\0\0\x12connection-timeout\0\0\x17connection-read-timeout\0\0\x18co\ -nnection-write-timeout\0\0\x18connection-limit-reached\0\0\x12TLS-protocol-error\ -\0\0\x15TLS-certificate-error\0\0\x12TLS-alert-received\x01\x14\0\x13HTTP-reques\ -t-denied\0\0\x1cHTTP-request-length-required\0\0\x16HTTP-request-body-size\x01\x18\ -\0\x1bHTTP-request-method-invalid\0\0\x18HTTP-request-URI-invalid\0\0\x19HTTP-re\ -quest-URI-too-long\0\0\x20HTTP-request-header-section-size\x01\x15\0\x18HTTP-req\ -uest-header-size\x01\x19\0!HTTP-request-trailer-section-size\x01\x15\0\x19HTTP-r\ -equest-trailer-size\x01\x17\0\x18HTTP-response-incomplete\0\0!HTTP-response-head\ -er-section-size\x01\x15\0\x19HTTP-response-header-size\x01\x17\0\x17HTTP-respons\ -e-body-size\x01\x18\0\"HTTP-response-trailer-section-size\x01\x15\0\x1aHTTP-resp\ -onse-trailer-size\x01\x17\0\x1dHTTP-response-transfer-coding\x01\x0e\0\x1cHTTP-r\ -esponse-content-coding\x01\x0e\0\x15HTTP-response-timeout\0\0\x13HTTP-upgrade-fa\ -iled\0\0\x13HTTP-protocol-error\0\0\x0dloop-detected\0\0\x13configuration-error\0\ -\0\x0einternal-error\x01\x0e\0\x04\0\x0aerror-code\x03\0\x1a\x01q\x03\x0einvalid\ --syntax\0\0\x09forbidden\0\0\x09immutable\0\0\x04\0\x0cheader-error\x03\0\x1c\x01\ -s\x04\0\x09field-key\x03\0\x1e\x01p}\x04\0\x0bfield-value\x03\0\x20\x04\0\x06fie\ -lds\x03\x01\x04\0\x07headers\x03\0\"\x04\0\x08trailers\x03\0\"\x04\0\x10incoming\ --request\x03\x01\x04\0\x10outgoing-request\x03\x01\x04\0\x0frequest-options\x03\x01\ -\x04\0\x11response-outparam\x03\x01\x01{\x04\0\x0bstatus-code\x03\0)\x04\0\x11in\ -coming-response\x03\x01\x04\0\x0dincoming-body\x03\x01\x04\0\x0ffuture-trailers\x03\ -\x01\x04\0\x11outgoing-response\x03\x01\x04\0\x0doutgoing-body\x03\x01\x04\0\x18\ -future-incoming-response\x03\x01\x01i\"\x01@\0\01\x04\0\x13[constructor]fields\x01\ -2\x01o\x02\x1f!\x01p3\x01j\x011\x01\x1d\x01@\x01\x07entries4\05\x04\0\x18[static\ -]fields.from-list\x016\x01h\"\x01p!\x01@\x02\x04self7\x04name\x1f\08\x04\0\x12[m\ -ethod]fields.get\x019\x01@\x02\x04self7\x04name\x1f\0\x7f\x04\0\x12[method]field\ -s.has\x01:\x01j\0\x01\x1d\x01@\x03\x04self7\x04name\x1f\x05value8\0;\x04\0\x12[m\ -ethod]fields.set\x01<\x01@\x02\x04self7\x04name\x1f\0;\x04\0\x15[method]fields.d\ -elete\x01=\x01@\x03\x04self7\x04name\x1f\x05value!\0;\x04\0\x15[method]fields.ap\ -pend\x01>\x01@\x01\x04self7\04\x04\0\x16[method]fields.entries\x01?\x01@\x01\x04\ -self7\01\x04\0\x14[method]fields.clone\x01@\x01h%\x01@\x01\x04self\xc1\0\0\x0b\x04\ -\0\x1f[method]incoming-request.method\x01B\x01@\x01\x04self\xc1\0\0\x0e\x04\0([m\ -ethod]incoming-request.path-with-query\x01C\x01k\x0d\x01@\x01\x04self\xc1\0\0\xc4\ -\0\x04\0\x1f[method]incoming-request.scheme\x01E\x04\0\"[method]incoming-request\ -.authority\x01C\x01i#\x01@\x01\x04self\xc1\0\0\xc6\0\x04\0\x20[method]incoming-r\ -equest.headers\x01G\x01i,\x01j\x01\xc8\0\0\x01@\x01\x04self\xc1\0\0\xc9\0\x04\0\x20\ -[method]incoming-request.consume\x01J\x01i&\x01@\x01\x07headers\xc6\0\0\xcb\0\x04\ -\0\x1d[constructor]outgoing-request\x01L\x01h&\x01i/\x01j\x01\xce\0\0\x01@\x01\x04\ +\0\x1b[method]tcp-socket.shutdown\x017\x04\0\x16wasi:sockets/tcp@0.2.0\x05N\x02\x03\ +\07\x0atcp-socket\x01B\x0c\x02\x03\x02\x01F\x04\0\x07network\x03\0\0\x02\x03\x02\ +\x01H\x04\0\x0aerror-code\x03\0\x02\x02\x03\x02\x01J\x04\0\x11ip-address-family\x03\ +\0\x04\x02\x03\x02\x01O\x04\0\x0atcp-socket\x03\0\x06\x01i\x07\x01j\x01\x08\x01\x03\ +\x01@\x01\x0eaddress-family\x05\0\x09\x04\0\x11create-tcp-socket\x01\x0a\x04\0$w\ +asi:sockets/tcp-create-socket@0.2.0\x05P\x02\x03\03\x0aip-address\x01B\x16\x02\x03\ +\x02\x01\x02\x04\0\x08pollable\x03\0\0\x02\x03\x02\x01F\x04\0\x07network\x03\0\x02\ +\x02\x03\x02\x01H\x04\0\x0aerror-code\x03\0\x04\x02\x03\x02\x01Q\x04\0\x0aip-add\ +ress\x03\0\x06\x04\0\x16resolve-address-stream\x03\x01\x01h\x08\x01k\x07\x01j\x01\ +\x0a\x01\x05\x01@\x01\x04self\x09\0\x0b\x04\03[method]resolve-address-stream.res\ +olve-next-address\x01\x0c\x01i\x01\x01@\x01\x04self\x09\0\x0d\x04\0([method]reso\ +lve-address-stream.subscribe\x01\x0e\x01h\x03\x01i\x08\x01j\x01\x10\x01\x05\x01@\ +\x02\x07network\x0f\x04names\0\x11\x04\0\x11resolve-addresses\x01\x12\x04\0!wasi\ +:sockets/ip-name-lookup@0.2.0\x05R\x01B\xc0\x01\x02\x03\x02\x01\x19\x04\0\x08dur\ +ation\x03\0\0\x02\x03\x02\x01\x0d\x04\0\x0cinput-stream\x03\0\x02\x02\x03\x02\x01\ +\x0b\x04\0\x0doutput-stream\x03\0\x04\x02\x03\x02\x01\x09\x04\0\x08io-error\x03\0\ +\x06\x02\x03\x02\x01\x02\x04\0\x08pollable\x03\0\x08\x01q\x0a\x03get\0\0\x04head\ +\0\0\x04post\0\0\x03put\0\0\x06delete\0\0\x07connect\0\0\x07options\0\0\x05trace\ +\0\0\x05patch\0\0\x05other\x01s\0\x04\0\x06method\x03\0\x0a\x01q\x03\x04HTTP\0\0\ +\x05HTTPS\0\0\x05other\x01s\0\x04\0\x06scheme\x03\0\x0c\x01ks\x01k{\x01r\x02\x05\ +rcode\x0e\x09info-code\x0f\x04\0\x11DNS-error-payload\x03\0\x10\x01k}\x01r\x02\x08\ +alert-id\x12\x0dalert-message\x0e\x04\0\x1aTLS-alert-received-payload\x03\0\x13\x01\ +ky\x01r\x02\x0afield-name\x0e\x0afield-size\x15\x04\0\x12field-size-payload\x03\0\ +\x16\x01kw\x01k\x17\x01q'\x0bDNS-timeout\0\0\x09DNS-error\x01\x11\0\x15destinati\ +on-not-found\0\0\x17destination-unavailable\0\0\x19destination-IP-prohibited\0\0\ +\x19destination-IP-unroutable\0\0\x12connection-refused\0\0\x15connection-termin\ +ated\0\0\x12connection-timeout\0\0\x17connection-read-timeout\0\0\x18connection-\ +write-timeout\0\0\x18connection-limit-reached\0\0\x12TLS-protocol-error\0\0\x15T\ +LS-certificate-error\0\0\x12TLS-alert-received\x01\x14\0\x13HTTP-request-denied\0\ +\0\x1cHTTP-request-length-required\0\0\x16HTTP-request-body-size\x01\x18\0\x1bHT\ +TP-request-method-invalid\0\0\x18HTTP-request-URI-invalid\0\0\x19HTTP-request-UR\ +I-too-long\0\0\x20HTTP-request-header-section-size\x01\x15\0\x18HTTP-request-hea\ +der-size\x01\x19\0!HTTP-request-trailer-section-size\x01\x15\0\x19HTTP-request-t\ +railer-size\x01\x17\0\x18HTTP-response-incomplete\0\0!HTTP-response-header-secti\ +on-size\x01\x15\0\x19HTTP-response-header-size\x01\x17\0\x17HTTP-response-body-s\ +ize\x01\x18\0\"HTTP-response-trailer-section-size\x01\x15\0\x1aHTTP-response-tra\ +iler-size\x01\x17\0\x1dHTTP-response-transfer-coding\x01\x0e\0\x1cHTTP-response-\ +content-coding\x01\x0e\0\x15HTTP-response-timeout\0\0\x13HTTP-upgrade-failed\0\0\ +\x13HTTP-protocol-error\0\0\x0dloop-detected\0\0\x13configuration-error\0\0\x0ei\ +nternal-error\x01\x0e\0\x04\0\x0aerror-code\x03\0\x1a\x01q\x03\x0einvalid-syntax\ +\0\0\x09forbidden\0\0\x09immutable\0\0\x04\0\x0cheader-error\x03\0\x1c\x01s\x04\0\ +\x09field-key\x03\0\x1e\x01p}\x04\0\x0bfield-value\x03\0\x20\x04\0\x06fields\x03\ +\x01\x04\0\x07headers\x03\0\"\x04\0\x08trailers\x03\0\"\x04\0\x10incoming-reques\ +t\x03\x01\x04\0\x10outgoing-request\x03\x01\x04\0\x0frequest-options\x03\x01\x04\ +\0\x11response-outparam\x03\x01\x01{\x04\0\x0bstatus-code\x03\0)\x04\0\x11incomi\ +ng-response\x03\x01\x04\0\x0dincoming-body\x03\x01\x04\0\x0ffuture-trailers\x03\x01\ +\x04\0\x11outgoing-response\x03\x01\x04\0\x0doutgoing-body\x03\x01\x04\0\x18futu\ +re-incoming-response\x03\x01\x01i\"\x01@\0\01\x04\0\x13[constructor]fields\x012\x01\ +o\x02\x1f!\x01p3\x01j\x011\x01\x1d\x01@\x01\x07entries4\05\x04\0\x18[static]fiel\ +ds.from-list\x016\x01h\"\x01p!\x01@\x02\x04self7\x04name\x1f\08\x04\0\x12[method\ +]fields.get\x019\x01@\x02\x04self7\x04name\x1f\0\x7f\x04\0\x12[method]fields.has\ +\x01:\x01j\0\x01\x1d\x01@\x03\x04self7\x04name\x1f\x05value8\0;\x04\0\x12[method\ +]fields.set\x01<\x01@\x02\x04self7\x04name\x1f\0;\x04\0\x15[method]fields.delete\ +\x01=\x01@\x03\x04self7\x04name\x1f\x05value!\0;\x04\0\x15[method]fields.append\x01\ +>\x01@\x01\x04self7\04\x04\0\x16[method]fields.entries\x01?\x01@\x01\x04self7\01\ +\x04\0\x14[method]fields.clone\x01@\x01h%\x01@\x01\x04self\xc1\0\0\x0b\x04\0\x1f\ +[method]incoming-request.method\x01B\x01@\x01\x04self\xc1\0\0\x0e\x04\0([method]\ +incoming-request.path-with-query\x01C\x01k\x0d\x01@\x01\x04self\xc1\0\0\xc4\0\x04\ +\0\x1f[method]incoming-request.scheme\x01E\x04\0\"[method]incoming-request.autho\ +rity\x01C\x01i#\x01@\x01\x04self\xc1\0\0\xc6\0\x04\0\x20[method]incoming-request\ +.headers\x01G\x01i,\x01j\x01\xc8\0\0\x01@\x01\x04self\xc1\0\0\xc9\0\x04\0\x20[me\ +thod]incoming-request.consume\x01J\x01i&\x01@\x01\x07headers\xc6\0\0\xcb\0\x04\0\ +\x1d[constructor]outgoing-request\x01L\x01h&\x01i/\x01j\x01\xce\0\0\x01@\x01\x04\ self\xcd\0\0\xcf\0\x04\0\x1d[method]outgoing-request.body\x01P\x01@\x01\x04self\xcd\ \0\0\x0b\x04\0\x1f[method]outgoing-request.method\x01Q\x01j\0\0\x01@\x02\x04self\ \xcd\0\x06method\x0b\0\xd2\0\x04\0#[method]outgoing-request.set-method\x01S\x01@\ @@ -35310,36 +38006,34 @@ trailers\xf2\0\0\x81\x01\x04\0\x1c[static]outgoing-body.finish\x01\x82\x01\x01h0 be\x01\x84\x01\x01i+\x01j\x01\x85\x01\x01\x1b\x01j\x01\x86\x01\0\x01k\x87\x01\x01\ @\x01\x04self\x83\x01\0\x88\x01\x04\0$[method]future-incoming-response.get\x01\x89\ \x01\x01h\x07\x01k\x1b\x01@\x01\x03err\x8a\x01\0\x8b\x01\x04\0\x0fhttp-error-cod\ -e\x01\x8c\x01\x04\x01\x15wasi:http/types@0.2.0\x05S\x02\x03\0:\x10outgoing-reque\ -st\x02\x03\0:\x0frequest-options\x02\x03\0:\x18future-incoming-response\x02\x03\0\ -:\x0aerror-code\x01B\x0f\x02\x03\x02\x01T\x04\0\x10outgoing-request\x03\0\0\x02\x03\ +e\x01\x8c\x01\x04\0\x15wasi:http/types@0.2.0\x05S\x02\x03\0:\x10outgoing-request\ +\x02\x03\0:\x0frequest-options\x02\x03\0:\x18future-incoming-response\x02\x03\0:\ +\x0aerror-code\x01B\x0f\x02\x03\x02\x01T\x04\0\x10outgoing-request\x03\0\0\x02\x03\ \x02\x01U\x04\0\x0frequest-options\x03\0\x02\x02\x03\x02\x01V\x04\0\x18future-in\ coming-response\x03\0\x04\x02\x03\x02\x01W\x04\0\x0aerror-code\x03\0\x06\x01i\x01\ \x01i\x03\x01k\x09\x01i\x05\x01j\x01\x0b\x01\x07\x01@\x02\x07request\x08\x07opti\ -ons\x0a\0\x0c\x04\0\x06handle\x01\x0d\x04\x01\x20wasi:http/outgoing-handler@0.2.\ -0\x05X\x02\x03\0:\x11outgoing-response\x01B\x07\x02\x03\x02\x01Y\x04\0\x11outgoi\ -ng-response\x03\0\0\x01i\x01\x01q\x02\x04echo\0\0\x08response\x01\x02\0\x04\0\x10\ -response-handler\x03\0\x03\x01@\x02\x03urls\x08response\x04\x01\0\x04\0\x0cset-r\ -esponse\x01\x05\x04\x01#fermyon:spin-wasi-virt/http-handler\x05Z\x02\x03\0:\x10i\ -ncoming-request\x02\x03\0:\x11incoming-response\x02\x03\0:\x11response-outparam\x02\ -\x03\0:\x0dincoming-body\x01B\x1f\x02\x03\x02\x01[\x04\0\x10incoming-request\x03\ -\0\0\x02\x03\x02\x01\\\x04\0\x11incoming-response\x03\0\x02\x02\x03\x02\x01Y\x04\ -\0\x11outgoing-response\x03\0\x04\x02\x03\x02\x01T\x04\0\x10outgoing-request\x03\ -\0\x06\x02\x03\x02\x01]\x04\0\x11response-outparam\x03\0\x08\x02\x03\x02\x01V\x04\ -\0\x18future-incoming-response\x03\0\x0a\x02\x03\x02\x01^\x04\0\x0dincoming-body\ -\x03\0\x0c\x04\0\x11response-receiver\x03\x01\x01h\x0e\x01i\x03\x01k\x10\x01@\x01\ -\x04self\x0f\0\x11\x04\0\x1d[method]response-receiver.get\x01\x12\x01i\x07\x01i\x0d\ -\x01k\x14\x01i\x01\x01@\x02\x07request\x13\x0dincoming-body\x15\0\x16\x04\0\x0bn\ -ew-request\x01\x17\x01i\x09\x01i\x0e\x01o\x02\x18\x19\x01@\0\0\x1a\x04\0\x0cnew-\ -response\x01\x1b\x04\x01\"fermyon:spin-wasi-virt/http-helper\x05_\x01B\x03\x01p}\ -\x01@\x02\x04paths\x08contents\0\x01\0\x04\0\x08add-file\x01\x01\x04\x01!fermyon\ -:spin-wasi-virt/fs-handler\x05`\x04\x01\x1afermyon:spin-test-virt/env\x04\0\x0b\x09\ -\x01\0\x03env\x03\0\0\0G\x09producers\x01\x0cprocessed-by\x02\x0dwit-component\x07\ -0.208.1\x10wit-bindgen-rust\x060.25.0"; - +ons\x0a\0\x0c\x04\0\x06handle\x01\x0d\x04\0\x20wasi:http/outgoing-handler@0.2.0\x05\ +X\x02\x03\0:\x11outgoing-response\x01B\x07\x02\x03\x02\x01Y\x04\0\x11outgoing-re\ +sponse\x03\0\0\x01i\x01\x01q\x02\x04echo\0\0\x08response\x01\x02\0\x04\0\x10resp\ +onse-handler\x03\0\x03\x01@\x02\x03urls\x08response\x04\x01\0\x04\0\x0cset-respo\ +nse\x01\x05\x04\0#fermyon:spin-wasi-virt/http-handler\x05Z\x02\x03\0:\x10incomin\ +g-request\x02\x03\0:\x11incoming-response\x02\x03\0:\x11response-outparam\x02\x03\ +\0:\x0dincoming-body\x01B\x1f\x02\x03\x02\x01[\x04\0\x10incoming-request\x03\0\0\ +\x02\x03\x02\x01\\\x04\0\x11incoming-response\x03\0\x02\x02\x03\x02\x01Y\x04\0\x11\ +outgoing-response\x03\0\x04\x02\x03\x02\x01T\x04\0\x10outgoing-request\x03\0\x06\ +\x02\x03\x02\x01]\x04\0\x11response-outparam\x03\0\x08\x02\x03\x02\x01V\x04\0\x18\ +future-incoming-response\x03\0\x0a\x02\x03\x02\x01^\x04\0\x0dincoming-body\x03\0\ +\x0c\x04\0\x11response-receiver\x03\x01\x01h\x0e\x01i\x03\x01k\x10\x01@\x01\x04s\ +elf\x0f\0\x11\x04\0\x1d[method]response-receiver.get\x01\x12\x01i\x07\x01i\x0d\x01\ +k\x14\x01i\x01\x01@\x02\x07request\x13\x0dincoming-body\x15\0\x16\x04\0\x0bnew-r\ +equest\x01\x17\x01i\x09\x01i\x0e\x01o\x02\x18\x19\x01@\0\0\x1a\x04\0\x0cnew-resp\ +onse\x01\x1b\x04\0\"fermyon:spin-wasi-virt/http-helper\x05_\x01B\x03\x01p}\x01@\x02\ +\x04paths\x08contents\0\x01\0\x04\0\x08add-file\x01\x01\x04\0!fermyon:spin-wasi-\ +virt/fs-handler\x05`\x04\0\x1afermyon:spin-test-virt/env\x04\0\x0b\x09\x01\0\x03\ +env\x03\0\0\0G\x09producers\x01\x0cprocessed-by\x02\x0dwit-component\x070.227.1\x10\ +wit-bindgen-rust\x060.41.0"; #[inline(never)] #[doc(hidden)] -#[cfg(target_arch = "wasm32")] pub fn __link_custom_section_describing_imports() { wit_bindgen_rt::maybe_link_cabi_realloc(); } diff --git a/crates/spin-test-virt/src/lib.rs b/crates/spin-test-virt/src/lib.rs index 88fadd5..7c0507e 100644 --- a/crates/spin-test-virt/src/lib.rs +++ b/crates/spin-test-virt/src/lib.rs @@ -1,6 +1,7 @@ mod helper; #[allow(warnings)] +#[rustfmt::skip] mod bindings; mod manifest; mod wasi; diff --git a/crates/spin-test-virt/src/manifest.rs b/crates/spin-test-virt/src/manifest.rs index 3df30ea..913dcaf 100644 --- a/crates/spin-test-virt/src/manifest.rs +++ b/crates/spin-test-virt/src/manifest.rs @@ -3,6 +3,8 @@ use std::{ sync::{OnceLock, RwLock}, }; +use spin_outbound_networking_config::allowed_hosts::{AllowedHostsConfig, OutboundUrl}; + use crate::VARIABLE_RESOLVER; /// The manifest for the current Spin app. @@ -20,20 +22,20 @@ thread_local! { impl AppManifest { /// Returns the allowed hosts configuration for the current component. - pub fn allowed_hosts() -> anyhow::Result { + pub fn allowed_hosts() -> anyhow::Result { let allowed_outbound_hosts = Self::get_component() .expect("internal error: component id not yet set") .normalized_allowed_outbound_hosts()?; PREPARED_RESOLVER.with(|resolver| { let resolver = resolver.as_ref().map_err(|e| anyhow::anyhow!("{e}"))?; - spin_outbound_networking::AllowedHostsConfig::parse(&allowed_outbound_hosts, resolver) + AllowedHostsConfig::parse(&allowed_outbound_hosts, resolver) }) } /// Returns whether the given URL is allowed by the manifest. pub fn allows_url(url: &str, scheme: &str) -> anyhow::Result { let allowed_hosts = Self::allowed_hosts()?; - let url = spin_outbound_networking::OutboundUrl::parse(url, scheme)?; + let url = OutboundUrl::parse(url, scheme)?; Ok(allowed_hosts.allows(&url)) } @@ -60,7 +62,7 @@ impl AppManifest { Some( Self::get() .components - .remove(&Self::get_component_id()?) + .swap_remove(&Self::get_component_id()?) .expect("internal error: component not found in manifest"), ) } diff --git a/crates/spin-test-virt/src/wasi/tcp.rs b/crates/spin-test-virt/src/wasi/tcp.rs index 0b428ed..3b3d223 100644 --- a/crates/spin-test-virt/src/wasi/tcp.rs +++ b/crates/spin-test-virt/src/wasi/tcp.rs @@ -1,5 +1,9 @@ use core::hash; +use spin_outbound_networking_config::allowed_hosts::{ + AllowedHostsConfig, HostConfig, IndividualPortConfig, PortConfig, +}; + use crate::bindings::exports::wasi::{self, sockets::network::Ipv4SocketAddress}; use crate::Component; @@ -44,8 +48,8 @@ impl wasi::sockets::tcp::GuestTcpSocket for TcpSocket { .map_err(|e| wasi::sockets::tcp::ErrorCode::PermanentResolverFailure)?; let configs = match allowed_hosts { // If all hosts are allowed, then we can skip the rest of the checks. - spin_outbound_networking::AllowedHostsConfig::All => return Ok(()), - spin_outbound_networking::AllowedHostsConfig::SpecificHosts(configs) => configs, + AllowedHostsConfig::All => return Ok(()), + AllowedHostsConfig::SpecificHosts(configs) => configs, }; let (remote_address, remote_port) = match remote_address { @@ -77,22 +81,18 @@ impl wasi::sockets::tcp::GuestTcpSocket for TcpSocket { // Check if the port is allowed. let mut allowed_port = false; match config.port() { - spin_outbound_networking::PortConfig::Any => { + PortConfig::Any => { allowed_port = true; break; } - spin_outbound_networking::PortConfig::List(l) => { + PortConfig::List(l) => { for port in l { match port { - spin_outbound_networking::IndividualPortConfig::Port(p) - if *p == remote_port => - { + IndividualPortConfig::Port(p) if *p == remote_port => { allowed_port = true; break; } - spin_outbound_networking::IndividualPortConfig::Range(r) - if r.contains(&remote_port) => - { + IndividualPortConfig::Range(r) if r.contains(&remote_port) => { allowed_port = true; break; } @@ -111,10 +111,9 @@ impl wasi::sockets::tcp::GuestTcpSocket for TcpSocket { } match config.host() { - spin_outbound_networking::HostConfig::AnySubdomain(_) - | spin_outbound_networking::HostConfig::ToSelf => continue, - spin_outbound_networking::HostConfig::Any => return Ok(()), - spin_outbound_networking::HostConfig::List(hosts) => { + HostConfig::AnySubdomain(_) | HostConfig::ToSelf => continue, + HostConfig::Any => return Ok(()), + HostConfig::List(hosts) => { // Check if any host is a CIDR block that contains the remote address. for host in hosts { // Parse the host as an `IpNet` cidr block and if it fails @@ -130,9 +129,9 @@ impl wasi::sockets::tcp::GuestTcpSocket for TcpSocket { } } } - spin_outbound_networking::HostConfig::Cidr(ip_net) => { + HostConfig::Cidr(ip_net) => { // Check if the host is a CIDR block that contains the remote address. - if ip_net.contains(&remote_address) { + if ip_net.contains(remote_address) { return Ok(()); } } diff --git a/examples/apps/app-py/spin.toml b/examples/apps/app-py/spin.toml index 990abf9..451ce3d 100644 --- a/examples/apps/app-py/spin.toml +++ b/examples/apps/app-py/spin.toml @@ -18,6 +18,6 @@ key_value_stores = ["cache"] command = "componentize-py -w spin-http componentize app -o app.wasm" watch = ["app.py", "Pipfile"] [component.my-app.tool.spin-test] -source = "../../test-rs/target/wasm32-wasi/release/wasm_test.wasm" +source = "../../test-rs/target/wasm32-wasip1/release/wasm_test.wasm" build = "cargo component build --release --target-dir=target" workdir = "../../test-rs" diff --git a/examples/apps/app-rs/Cargo.lock b/examples/apps/app-rs/Cargo.lock deleted file mode 100644 index 13deea5..0000000 --- a/examples/apps/app-rs/Cargo.lock +++ /dev/null @@ -1,622 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "anyhow" -version = "1.0.81" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" - -[[package]] -name = "async-trait" -version = "0.1.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "461abc97219de0eaaf81fe3ef974a540158f3d079c2ab200f891f1a2ef201e85" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.53", -] - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" - -[[package]] -name = "bytes" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "form_urlencoded" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "futures" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" - -[[package]] -name = "futures-executor" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-io" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" - -[[package]] -name = "futures-macro" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.53", -] - -[[package]] -name = "futures-sink" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" - -[[package]] -name = "futures-task" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" - -[[package]] -name = "futures-util" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" - -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "http" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "id-arena" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005" - -[[package]] -name = "indexmap" -version = "2.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4" -dependencies = [ - "equivalent", - "hashbrown", - "serde", -] - -[[package]] -name = "itoa" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" - -[[package]] -name = "leb128" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" - -[[package]] -name = "log" -version = "0.4.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" - -[[package]] -name = "memchr" -version = "2.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" - -[[package]] -name = "my_app" -version = "0.1.0" -dependencies = [ - "anyhow", - "serde", - "serde_json", - "serde_qs", - "spin-sdk", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - -[[package]] -name = "pin-project-lite" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "proc-macro2" -version = "1.0.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "routefinder" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0971d3c8943a6267d6bd0d782fdc4afa7593e7381a92a3df950ff58897e066b5" -dependencies = [ - "smartcow", - "smartstring", -] - -[[package]] -name = "ryu" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" - -[[package]] -name = "semver" -version = "1.0.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" - -[[package]] -name = "serde" -version = "1.0.197" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.197" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.53", -] - -[[package]] -name = "serde_json" -version = "1.0.114" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_qs" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0431a35568651e363364210c91983c1da5eb29404d9f0928b67d4ebcfa7d330c" -dependencies = [ - "percent-encoding", - "serde", - "thiserror", -] - -[[package]] -name = "slab" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] - -[[package]] -name = "smallvec" -version = "1.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" - -[[package]] -name = "smartcow" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "656fcb1c1fca8c4655372134ce87d8afdf5ec5949ebabe8d314be0141d8b5da2" -dependencies = [ - "smartstring", -] - -[[package]] -name = "smartstring" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb72c633efbaa2dd666986505016c32c3044395ceaf881518399d2f4127ee29" -dependencies = [ - "autocfg", - "static_assertions", - "version_check", -] - -[[package]] -name = "spdx" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29ef1a0fa1e39ac22972c8db23ff89aea700ab96aa87114e1fb55937a631a0c9" -dependencies = [ - "smallvec", -] - -[[package]] -name = "spin-macro" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a161ae2fefde8582ef555ead81d87cf897cd31a23a1d1e0c22a9c43fd9af421a" -dependencies = [ - "anyhow", - "bytes", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "spin-sdk" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2c02cf00c243c03fb330cb5be7bf4eb3c8db7c5476425068c7385ddff1567aa" -dependencies = [ - "anyhow", - "async-trait", - "bytes", - "form_urlencoded", - "futures", - "http", - "once_cell", - "routefinder", - "serde", - "serde_json", - "spin-macro", - "thiserror", - "wit-bindgen", -] - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.53" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7383cd0e49fff4b6b90ca5670bfd3e9d6a733b3f90c686605aa7eec8c4996032" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "1.0.58" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.58" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.53", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "unicode-xid" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wasm-encoder" -version = "0.38.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ad2b51884de9c7f4fe2fd1043fccb8dcad4b1e29558146ee57a144d15779f3f" -dependencies = [ - "leb128", -] - -[[package]] -name = "wasm-encoder" -version = "0.41.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "972f97a5d8318f908dded23594188a90bcd09365986b1163e66d70170e5287ae" -dependencies = [ - "leb128", -] - -[[package]] -name = "wasm-metadata" -version = "0.10.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18ebaa7bd0f9e7a5e5dd29b9a998acf21c4abed74265524dd7e85934597bfb10" -dependencies = [ - "anyhow", - "indexmap", - "serde", - "serde_derive", - "serde_json", - "spdx", - "wasm-encoder 0.41.2", - "wasmparser 0.121.2", -] - -[[package]] -name = "wasmparser" -version = "0.118.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77f1154f1ab868e2a01d9834a805faca7bf8b50d041b4ca714d005d0dab1c50c" -dependencies = [ - "indexmap", - "semver", -] - -[[package]] -name = "wasmparser" -version = "0.121.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dbe55c8f9d0dbd25d9447a5a889ff90c0cc3feaa7395310d3d826b2c703eaab" -dependencies = [ - "bitflags", - "indexmap", - "semver", -] - -[[package]] -name = "wit-bindgen" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b76f1d099678b4f69402a421e888bbe71bf20320c2f3f3565d0e7484dbe5bc20" -dependencies = [ - "bitflags", - "wit-bindgen-rust-macro", -] - -[[package]] -name = "wit-bindgen-core" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75d55e1a488af2981fb0edac80d8d20a51ac36897a1bdef4abde33c29c1b6d0d" -dependencies = [ - "anyhow", - "wit-component", - "wit-parser", -] - -[[package]] -name = "wit-bindgen-rust" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01ff9cae7bf5736750d94d91eb8a49f5e3a04aff1d1a3218287d9b2964510f8" -dependencies = [ - "anyhow", - "heck", - "wasm-metadata", - "wit-bindgen-core", - "wit-component", -] - -[[package]] -name = "wit-bindgen-rust-macro" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "804a98e2538393d47aa7da65a7348116d6ff403b426665152b70a168c0146d49" -dependencies = [ - "anyhow", - "proc-macro2", - "quote", - "syn 2.0.53", - "wit-bindgen-core", - "wit-bindgen-rust", - "wit-component", -] - -[[package]] -name = "wit-component" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a35a2a9992898c9d27f1664001860595a4bc99d32dd3599d547412e17d7e2" -dependencies = [ - "anyhow", - "bitflags", - "indexmap", - "log", - "serde", - "serde_derive", - "serde_json", - "wasm-encoder 0.38.1", - "wasm-metadata", - "wasmparser 0.118.2", - "wit-parser", -] - -[[package]] -name = "wit-parser" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "316b36a9f0005f5aa4b03c39bc3728d045df136f8c13a73b7db4510dec725e08" -dependencies = [ - "anyhow", - "id-arena", - "indexmap", - "log", - "semver", - "serde", - "serde_derive", - "serde_json", - "unicode-xid", -] diff --git a/examples/apps/app-rs/Cargo.toml b/examples/apps/app-rs/Cargo.toml index 357e55d..654ac27 100644 --- a/examples/apps/app-rs/Cargo.toml +++ b/examples/apps/app-rs/Cargo.toml @@ -10,7 +10,7 @@ crate-type = ["cdylib"] [dependencies] anyhow = "1" -spin-sdk = "3.0.0" +spin-sdk = "3.1" serde = { version = "1", features = ["derive"] } -serde_qs = "0.12.0" +serde_qs = "0.15.0" serde_json = "1.0" diff --git a/examples/apps/app-rs/spin.toml b/examples/apps/app-rs/spin.toml index 285055a..a648b9c 100644 --- a/examples/apps/app-rs/spin.toml +++ b/examples/apps/app-rs/spin.toml @@ -14,16 +14,16 @@ route = "/..." component = "my-app" [component.my-app] -source = "../../../target/wasm32-wasi/release/my_app.wasm" +source = "../../../target/wasm32-wasip1/release/my_app.wasm" allowed_outbound_hosts = ["https://my.api.com", "redis://redis"] key_value_stores = ["cache"] sqlite_databases = ["database"] [component.my-app.build] -command = "cargo build --target wasm32-wasi --release" +command = "cargo build --target wasm32-wasip1 --release" watch = ["src/**/*.rs", "Cargo.toml"] [component.my-app.variables] cache_name = "cache" [component.my-app.tool.spin-test] -source = "../../test-rs/target/wasm32-wasi/release/wasm_test.wasm" +source = "../../test-rs/target/wasm32-wasip1/release/wasm_test.wasm" build = "cargo component build --release --target-dir=target" workdir = "../../test-rs" diff --git a/host-wit/deps/fermyon/llm.wit b/host-wit/deps/fermyon/llm.wit index ffed09c..bcb59b8 100644 --- a/host-wit/deps/fermyon/llm.wit +++ b/host-wit/deps/fermyon/llm.wit @@ -10,15 +10,15 @@ interface llm { /// Note: the backing implementation may return less tokens. max-tokens: u32, /// The amount the model should avoid repeating tokens. - repeat-penalty: float32, + repeat-penalty: f32, /// The number of tokens the model should apply the repeat penalty to. repeat-penalty-last-n-token-count: u32, /// The randomness with which the next token is selected. - temperature: float32, + temperature: f32, /// The number of possible next tokens the model will choose from. top-k: u32, /// The probability total of next tokens the model will choose from. - top-p: float32 + top-p: f32 } /// The set of errors which may be raised by functions in this interface @@ -57,7 +57,7 @@ interface llm { /// Result of generating embeddings record embeddings-result { /// The embeddings generated by the request - embeddings: list>, + embeddings: list>, /// Usage related to the embeddings generation request usage: embeddings-usage } diff --git a/host-wit/deps/fermyon/rdbms-types.wit b/host-wit/deps/fermyon/rdbms-types.wit index 64f3e59..aff2e96 100644 --- a/host-wit/deps/fermyon/rdbms-types.wit +++ b/host-wit/deps/fermyon/rdbms-types.wit @@ -37,8 +37,8 @@ interface rdbms-types { uint16(u16), uint32(u32), uint64(u64), - floating32(float32), - floating64(float64), + floating32(f32), + floating64(f64), str(string), binary(list), db-null, @@ -56,8 +56,8 @@ interface rdbms-types { uint16(u16), uint32(u32), uint64(u64), - floating32(float32), - floating64(float64), + floating32(f32), + floating64(f64), str(string), binary(list), db-null, diff --git a/host-wit/deps/fermyon/sqlite.wit b/host-wit/deps/fermyon/sqlite.wit index 8a5ab2d..d82f2d9 100644 --- a/host-wit/deps/fermyon/sqlite.wit +++ b/host-wit/deps/fermyon/sqlite.wit @@ -42,7 +42,7 @@ interface sqlite { /// A single column's result from a database query variant value { integer(s64), - real(float64), + real(f64), text(string), blob(list), null diff --git a/src/lib.rs b/src/lib.rs index 96de162..0f1662c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -11,7 +11,7 @@ pub use manifest::ManifestInformation; /// The built `spin-test-virt` component const SPIN_TEST_VIRT: &[u8] = include_bytes!(concat!( env!("OUT_DIR"), - "/wasm32-wasi/release/spin_test_virt.wasm" + "/wasm32-wasip1/release/spin_test_virt.wasm" )); /// The built `router` component const ROUTER: &[u8] = include_bytes!(concat!( @@ -88,7 +88,7 @@ pub fn perform_composition( composition .encode(true) - .context("failed to encode composition") + .context("failed to encode composition of app and test components") } /// Virtualize app component with virtualized environment and router @@ -126,7 +126,7 @@ pub fn virtualize_app(app_component: Component) -> anyhow::Result> { composition .encode(true) - .context("failed to encode composition") + .context("failed to encode composition of app and virtualized environment") } fn instantiate_test( @@ -340,9 +340,9 @@ impl TestTarget { let decoded = wit_component::decode(&test.bytes) .context("failed to decode test component's wit package")?; let resolve = decoded.resolve(); - let packages = &decoded.packages(); + let package = decoded.package(); - let world_id = resolve.select_world(packages, None)?; + let world_id = resolve.select_world(package, None)?; let world = &resolve.worlds[world_id]; let mut exports = HashSet::new(); @@ -388,14 +388,17 @@ fn get_tests_list( ) -> Result, anyhow::Error> { struct TestComponentData { table: wasmtime_wasi::ResourceTable, - ctx: wasmtime_wasi::WasiCtx, + ctx: wasmtime_wasi::p2::WasiCtx, } - impl wasmtime_wasi::WasiView for TestComponentData { + impl wasmtime_wasi::p2::IoView for TestComponentData { fn table(&mut self) -> &mut wasmtime_wasi::ResourceTable { &mut self.table } - fn ctx(&mut self) -> &mut wasmtime_wasi::WasiCtx { + } + + impl wasmtime_wasi::p2::WasiView for TestComponentData { + fn ctx(&mut self) -> &mut wasmtime_wasi::p2::WasiCtx { &mut self.ctx } } @@ -405,7 +408,7 @@ fn get_tests_list( &engine, TestComponentData { table: wasmtime_wasi::ResourceTable::default(), - ctx: wasmtime_wasi::WasiCtxBuilder::new() + ctx: wasmtime_wasi::p2::WasiCtxBuilder::new() .inherit_stdout() .inherit_stderr() .build(), @@ -416,7 +419,7 @@ fn get_tests_list( // Configure the linker including stubbing out all non-wasi imports let mut linker = wasmtime::component::Linker::::new(&engine); - wasmtime_wasi::add_to_linker_sync(&mut linker) + wasmtime_wasi::p2::add_to_linker_sync(&mut linker) .context("failed to link to wasi to the test component")?; stub_imports(&mut linker, world, resolve).context("failed to stub test component imports")?; diff --git a/src/manifest.rs b/src/manifest.rs index 902963d..ed8d88d 100644 --- a/src/manifest.rs +++ b/src/manifest.rs @@ -63,6 +63,9 @@ impl ManifestInformation { spin_manifest::schema::v2::ComponentSource::Remote { .. } => { anyhow::bail!("components with remote sources are not yet supported by `spin-test`") } + spin_manifest::schema::v2::ComponentSource::Registry { .. } => anyhow::bail!( + "components with registry sources are not yet supported by `spin-test`" + ), } } diff --git a/src/runtime.rs b/src/runtime.rs index 84b4354..12c2d72 100644 --- a/src/runtime.rs +++ b/src/runtime.rs @@ -34,7 +34,7 @@ impl Runtime { let _ = std::fs::write("composition.wasm", composed_component); } let mut engine_config = wasmtime::Config::new(); - engine_config.cache_config_load_default()?; + engine_config.cache(Some(wasmtime::Cache::new(wasmtime::CacheConfig::new())?)); let engine = wasmtime::Engine::new(&engine_config)?; let store = wasmtime::Store::new(&engine, Data::new(manifest.raw().to_owned())); @@ -42,7 +42,7 @@ impl Runtime { .context("composed component was an invalid Wasm component")?; let mut linker = wasmtime::component::Linker::::new(&engine); - wasmtime_wasi::add_to_linker_sync(&mut linker).context("failed to link to wasi")?; + wasmtime_wasi::p2::add_to_linker_sync(&mut linker).context("failed to link to wasi")?; non_dynamic::Runner::add_to_linker(&mut linker, |x| x) .context("failed to link to test runner world")?; @@ -74,7 +74,7 @@ impl Runtime { .context(format!("test '{test_name}' failed ")) } TestInvocation::RunArgument(test_name) => { - let (runner, _) = non_dynamic::Runner::instantiate( + let runner = non_dynamic::Runner::instantiate( &mut self.store, &self.component, &self.linker, @@ -179,14 +179,14 @@ pub enum TestInvocation { /// Store specific data struct Data { table: wasmtime_wasi::ResourceTable, - ctx: wasmtime_wasi::WasiCtx, + ctx: wasmtime_wasi::p2::WasiCtx, manifest: String, } impl Data { fn new(manifest: String) -> Self { let table = wasmtime_wasi::ResourceTable::new(); - let ctx = wasmtime_wasi::WasiCtxBuilder::new() + let ctx = wasmtime_wasi::p2::WasiCtxBuilder::new() .inherit_stdout() .inherit_stderr() .inherit_env() @@ -204,13 +204,14 @@ impl non_dynamic::RunnerImports for Data { self.manifest.clone() } } - -impl wasmtime_wasi::WasiView for Data { +impl wasmtime_wasi::p2::IoView for Data { fn table(&mut self) -> &mut wasmtime_wasi::ResourceTable { &mut self.table } +} - fn ctx(&mut self) -> &mut wasmtime_wasi::WasiCtx { +impl wasmtime_wasi::p2::WasiView for Data { + fn ctx(&mut self) -> &mut wasmtime_wasi::p2::WasiCtx { &mut self.ctx } }