diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 936a634..ee62cd7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,12 +21,12 @@ jobs: - name: Install Wasmtime uses: bytecodealliance/actions/wasmtime/setup@v1 with: - version: "v19.0.0" + version: "v23.0.1" - name: Install wasm-tools uses: bytecodealliance/actions/wasm-tools/setup@v1 with: - version: "1.202.0" - - run: curl -LO https://github.com/bytecodealliance/wasmtime/releases/download/v19.0.0/wasi_snapshot_preview1.command.wasm + version: "1.215.0" + - run: curl -LO https://github.com/bytecodealliance/wasmtime/releases/download/v23.0.1/wasi_snapshot_preview1.command.wasm - run: cargo build --examples --target wasm32-wasip1 --no-default-features @@ -59,15 +59,6 @@ jobs: - run: wasm-tools component new ./target/wasm32-wasip1/debug/examples/rand.wasm --adapt ./wasi_snapshot_preview1.command.wasm -o component.wasm - run: wasmtime run component.wasm - rustfmt: - name: Rustfmt - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install Rust - run: rustup update stable && rustup default stable && rustup component add rustfmt - - run: cargo fmt -- --check - generate: name: Ensure generated code up-to-date runs-on: ubuntu-latest @@ -75,6 +66,12 @@ jobs: - uses: actions/checkout@v4 - name: Install Rust run: rustup update stable && rustup default stable - - run: cargo install wit-bindgen-cli@0.24.0 --locked + # Re-vendor all WIT files and ensure that they're all up-to-date by ensuring + # that there's no git changes. + - name: Re-vendor WIT + run: | + ./ci/vendor-wit.sh + git diff --exit-code + - run: cargo install wit-bindgen-cli@0.29.0 --locked - run: ./ci/regenerate.sh - run: git diff --exit-code diff --git a/Cargo.toml b/Cargo.toml index 2830de9..53886be 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "wasi" -version = "0.13.1+wasi-0.2.0" +version = "0.13.2+wasi-0.2.1" authors = ["The Cranelift Project Developers"] description = "WASI API bindings for Rust" categories = ["no-std", "wasm"] @@ -24,7 +24,7 @@ wasi = { version = "0.13", path = ".", default-features = false } members = ["./crates/*"] [dependencies] -wit-bindgen-rt = { version = "0.24.0", features = ["bitflags"] } +wit-bindgen-rt = { version = "0.29.0", features = ["bitflags"] } # When built as part of libstd compiler_builtins = { version = "0.1", optional = true } diff --git a/ci/regenerate.sh b/ci/regenerate.sh index 64f0494..359df52 100755 --- a/ci/regenerate.sh +++ b/ci/regenerate.sh @@ -5,45 +5,46 @@ set -ex generate() { file="$1" shift - wit-bindgen rust wit --out-dir src --std-feature "$@" --rustfmt \ + wit-bindgen rust wit --out-dir src --std-feature "$@" --format \ --runtime-path wit_bindgen_rt } # Generate the main body of the bindings which includes all imports from the two # worlds below. -generate src/bindings.rs --type-section-suffix rust-wasi-from-crates-io +generate src/bindings.rs --type-section-suffix rust-wasi-from-crates-io \ + --generate-all # Generate bindings for the `wasi:cli/command` world specifically, namely the # macro `export_command`. # # Note that `--with` is used to point at the previously generated bindings. -with="wasi:cli/environment@0.2.0=crate::cli::environment" -with="$with,wasi:cli/exit@0.2.0=crate::cli::exit" -with="$with,wasi:cli/stdin@0.2.0=crate::cli::stdin" -with="$with,wasi:cli/stdout@0.2.0=crate::cli::stdout" -with="$with,wasi:cli/stderr@0.2.0=crate::cli::stderr" -with="$with,wasi:cli/terminal-input@0.2.0=crate::cli::terminal_input" -with="$with,wasi:cli/terminal-output@0.2.0=crate::cli::terminal_output" -with="$with,wasi:cli/terminal-stdin@0.2.0=crate::cli::terminal_stdin" -with="$with,wasi:cli/terminal-stdout@0.2.0=crate::cli::terminal_stdout" -with="$with,wasi:cli/terminal-stderr@0.2.0=crate::cli::terminal_stderr" -with="$with,wasi:clocks/monotonic-clock@0.2.0=crate::clocks::monotonic_clock" -with="$with,wasi:clocks/wall-clock@0.2.0=crate::clocks::wall_clock" -with="$with,wasi:filesystem/types@0.2.0=crate::filesystem::types" -with="$with,wasi:filesystem/preopens@0.2.0=crate::filesystem::preopens" -with="$with,wasi:io/error@0.2.0=crate::io::error" -with="$with,wasi:io/poll@0.2.0=crate::io::poll" -with="$with,wasi:io/streams@0.2.0=crate::io::streams" -with="$with,wasi:random/random@0.2.0=crate::random::random" -with="$with,wasi:random/insecure@0.2.0=crate::random::insecure" -with="$with,wasi:random/insecure-seed@0.2.0=crate::random::insecure_seed" -with="$with,wasi:sockets/network@0.2.0=crate::sockets::network" -with="$with,wasi:sockets/instance-network@0.2.0=crate::sockets::instance_network" -with="$with,wasi:sockets/tcp@0.2.0=crate::sockets::tcp" -with="$with,wasi:sockets/tcp-create-socket@0.2.0=crate::sockets::tcp_create_socket" -with="$with,wasi:sockets/udp@0.2.0=crate::sockets::udp" -with="$with,wasi:sockets/udp-create-socket@0.2.0=crate::sockets::udp_create_socket" -with="$with,wasi:sockets/ip-name-lookup@0.2.0=crate::sockets::ip_name_lookup" +with="wasi:cli/environment@0.2.1=crate::cli::environment" +with="$with,wasi:cli/exit@0.2.1=crate::cli::exit" +with="$with,wasi:cli/stdin@0.2.1=crate::cli::stdin" +with="$with,wasi:cli/stdout@0.2.1=crate::cli::stdout" +with="$with,wasi:cli/stderr@0.2.1=crate::cli::stderr" +with="$with,wasi:cli/terminal-input@0.2.1=crate::cli::terminal_input" +with="$with,wasi:cli/terminal-output@0.2.1=crate::cli::terminal_output" +with="$with,wasi:cli/terminal-stdin@0.2.1=crate::cli::terminal_stdin" +with="$with,wasi:cli/terminal-stdout@0.2.1=crate::cli::terminal_stdout" +with="$with,wasi:cli/terminal-stderr@0.2.1=crate::cli::terminal_stderr" +with="$with,wasi:clocks/monotonic-clock@0.2.1=crate::clocks::monotonic_clock" +with="$with,wasi:clocks/wall-clock@0.2.1=crate::clocks::wall_clock" +with="$with,wasi:filesystem/types@0.2.1=crate::filesystem::types" +with="$with,wasi:filesystem/preopens@0.2.1=crate::filesystem::preopens" +with="$with,wasi:io/error@0.2.1=crate::io::error" +with="$with,wasi:io/poll@0.2.1=crate::io::poll" +with="$with,wasi:io/streams@0.2.1=crate::io::streams" +with="$with,wasi:random/random@0.2.1=crate::random::random" +with="$with,wasi:random/insecure@0.2.1=crate::random::insecure" +with="$with,wasi:random/insecure-seed@0.2.1=crate::random::insecure_seed" +with="$with,wasi:sockets/network@0.2.1=crate::sockets::network" +with="$with,wasi:sockets/instance-network@0.2.1=crate::sockets::instance_network" +with="$with,wasi:sockets/tcp@0.2.1=crate::sockets::tcp" +with="$with,wasi:sockets/tcp-create-socket@0.2.1=crate::sockets::tcp_create_socket" +with="$with,wasi:sockets/udp@0.2.1=crate::sockets::udp" +with="$with,wasi:sockets/udp-create-socket@0.2.1=crate::sockets::udp_create_socket" +with="$with,wasi:sockets/ip-name-lookup@0.2.1=crate::sockets::ip_name_lookup" generate src/command.rs \ --world wasi:cli/command \ --with "$with" \ @@ -53,17 +54,17 @@ generate src/command.rs \ --export-macro-name _export_command # Same as the `command` world, but for the proxy world. -with="wasi:cli/stdin@0.2.0=crate::cli::stdin" -with="$with,wasi:cli/stdout@0.2.0=crate::cli::stdout" -with="$with,wasi:cli/stderr@0.2.0=crate::cli::stderr" -with="$with,wasi:clocks/monotonic-clock@0.2.0=crate::clocks::monotonic_clock" -with="$with,wasi:clocks/wall-clock@0.2.0=crate::clocks::wall_clock" -with="$with,wasi:io/error@0.2.0=crate::io::error" -with="$with,wasi:io/poll@0.2.0=crate::io::poll" -with="$with,wasi:io/streams@0.2.0=crate::io::streams" -with="$with,wasi:random/random@0.2.0=crate::random::random" -with="$with,wasi:http/types@0.2.0=crate::http::types" -with="$with,wasi:http/outgoing-handler@0.2.0=crate::http::outgoing_handler" +with="wasi:cli/stdin@0.2.1=crate::cli::stdin" +with="$with,wasi:cli/stdout@0.2.1=crate::cli::stdout" +with="$with,wasi:cli/stderr@0.2.1=crate::cli::stderr" +with="$with,wasi:clocks/monotonic-clock@0.2.1=crate::clocks::monotonic_clock" +with="$with,wasi:clocks/wall-clock@0.2.1=crate::clocks::wall_clock" +with="$with,wasi:io/error@0.2.1=crate::io::error" +with="$with,wasi:io/poll@0.2.1=crate::io::poll" +with="$with,wasi:io/streams@0.2.1=crate::io::streams" +with="$with,wasi:random/random@0.2.1=crate::random::random" +with="$with,wasi:http/types@0.2.1=crate::http::types" +with="$with,wasi:http/outgoing-handler@0.2.1=crate::http::outgoing_handler" generate src/proxy.rs \ --world wasi:http/proxy \ --with "$with" \ diff --git a/ci/vendor-wit.sh b/ci/vendor-wit.sh new file mode 100755 index 0000000..309b206 --- /dev/null +++ b/ci/vendor-wit.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +# Script to re-vendor the WIT files that wasi-rs uses as defined by a +# particular tag in upstream repositories. +# +# This script is executed on CI to ensure that everything is up-to-date. +set -ex + +# Space-separated list of wasi proposals that are vendored here along with the +# tag that they're all vendored at. +# +# This assumes that the repositories all have the pattern: +# https://github.com/WebAssembly/wasi-$repo +# and every repository has a tag `v$tag` here. That is currently done as part +# of the WASI release process. +repos="cli clocks filesystem http io random sockets" +tag=0.2.1 +dst=wit/deps + +rm -rf $dst +mkdir -p $dst + +for repo in $repos; do + mkdir $dst/$repo + curl -L https://github.com/WebAssembly/wasi-$repo/archive/refs/tags/v$tag.tar.gz | \ + tar xzf - --strip-components=2 -C $dst/$repo wasi-$repo-$tag/wit + rm -rf $dst/$repo/deps* +done diff --git a/src/bindings.rs b/src/bindings.rs index 37c68f3..d25ad35 100644 --- a/src/bindings.rs +++ b/src/bindings.rs @@ -1,6 +1,3 @@ -// Generated by `wit-bindgen` 0.24.0. DO NOT EDIT! -// Options used: -// * std_feature #[allow(dead_code)] pub mod wasi { #[allow(dead_code)] @@ -10,8 +7,7 @@ pub mod wasi { #[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. @@ -29,12 +25,11 @@ pub mod wasi { 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:cli/environment@0.2.0")] + #[link(wasm_import_module = "wasi:cli/environment@0.2.1")] extern "C" { #[link_name = "get-environment"] fn wit_import(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8) { unreachable!() @@ -56,7 +51,6 @@ pub mod wasi { 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)) }; result9.push(e9); @@ -74,12 +68,11 @@ pub mod wasi { 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:cli/environment@0.2.0")] + #[link(wasm_import_module = "wasi:cli/environment@0.2.1")] extern "C" { #[link_name = "get-arguments"] fn wit_import(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8) { unreachable!() @@ -97,7 +90,6 @@ pub mod wasi { let l4 = *base.add(4).cast::(); let len5 = l4; let bytes5 = _rt::Vec::from_raw_parts(l3.cast(), len5, len5); - _rt::string_lift(bytes5) }; result6.push(e6); @@ -116,12 +108,11 @@ pub mod wasi { 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:cli/environment@0.2.0")] + #[link(wasm_import_module = "wasi:cli/environment@0.2.1")] extern "C" { #[link_name = "initial-cwd"] fn wit_import(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8) { unreachable!() @@ -135,8 +126,11 @@ pub mod wasi { 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); - + let bytes4 = _rt::Vec::from_raw_parts( + l2.cast(), + len4, + len4, + ); _rt::string_lift(bytes4) }; Some(e) @@ -146,14 +140,12 @@ pub mod wasi { } } } - #[allow(dead_code, 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<(), ()>) { @@ -163,12 +155,11 @@ pub mod wasi { Err(_) => 1i32, }; #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:cli/exit@0.2.0")] + #[link(wasm_import_module = "wasi:cli/exit@0.2.1")] extern "C" { #[link_name = "exit"] fn wit_import(_: i32); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) { unreachable!() @@ -177,107 +168,100 @@ pub mod wasi { } } } - #[allow(dead_code, 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")] + #[link(wasm_import_module = "wasi:cli/stdin@0.2.1")] extern "C" { #[link_name = "get-stdin"] fn wit_import() -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import() -> i32 { unreachable!() } let ret = wit_import(); - super::super::super::wasi::io::streams::InputStream::from_handle(ret as u32) + super::super::super::wasi::io::streams::InputStream::from_handle( + ret as u32, + ) } } } - #[allow(dead_code, 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")] + #[link(wasm_import_module = "wasi:cli/stdout@0.2.1")] extern "C" { #[link_name = "get-stdout"] fn wit_import() -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import() -> i32 { unreachable!() } let ret = wit_import(); - super::super::super::wasi::io::streams::OutputStream::from_handle(ret as u32) + super::super::super::wasi::io::streams::OutputStream::from_handle( + ret as u32, + ) } } } - #[allow(dead_code, 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")] + #[link(wasm_import_module = "wasi:cli/stderr@0.2.1")] extern "C" { #[link_name = "get-stderr"] fn wit_import() -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import() -> i32 { unreachable!() } let ret = wit_import(); - super::super::super::wasi::io::streams::OutputStream::from_handle(ret as u32) + super::super::super::wasi::io::streams::OutputStream::from_handle( + ret as u32, + ) } } } - #[allow(dead_code, 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 { @@ -285,54 +269,45 @@ pub mod wasi { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for 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")] + #[link(wasm_import_module = "wasi:cli/terminal-input@0.2.1")] extern "C" { #[link_name = "[resource-drop]terminal-input"] fn drop(_: u32); } - drop(_handle); } } } } - #[allow(dead_code, 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 { @@ -340,45 +315,38 @@ pub mod wasi { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for 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")] + #[link(wasm_import_module = "wasi:cli/terminal-output@0.2.1")] extern "C" { #[link_name = "[resource-drop]terminal-output"] fn drop(_: u32); } - drop(_handle); } } } } - #[allow(dead_code, 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)] @@ -391,12 +359,11 @@ pub mod wasi { 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:cli/terminal-stdin@0.2.0")] + #[link(wasm_import_module = "wasi:cli/terminal-stdin@0.2.1")] extern "C" { #[link_name = "get-terminal-stdin"] fn wit_import(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8) { unreachable!() @@ -408,8 +375,9 @@ pub mod wasi { 1 => { let e = { let l2 = *ptr0.add(4).cast::(); - - super::super::super::wasi::cli::terminal_input::TerminalInput::from_handle(l2 as u32) + super::super::super::wasi::cli::terminal_input::TerminalInput::from_handle( + l2 as u32, + ) }; Some(e) } @@ -418,17 +386,14 @@ pub mod wasi { } } } - #[allow(dead_code, 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. @@ -439,12 +404,11 @@ pub mod wasi { 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:cli/terminal-stdout@0.2.0")] + #[link(wasm_import_module = "wasi:cli/terminal-stdout@0.2.1")] extern "C" { #[link_name = "get-terminal-stdout"] fn wit_import(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8) { unreachable!() @@ -456,8 +420,9 @@ pub mod wasi { 1 => { let e = { let l2 = *ptr0.add(4).cast::(); - - super::super::super::wasi::cli::terminal_output::TerminalOutput::from_handle(l2 as u32) + super::super::super::wasi::cli::terminal_output::TerminalOutput::from_handle( + l2 as u32, + ) }; Some(e) } @@ -466,17 +431,14 @@ pub mod wasi { } } } - #[allow(dead_code, 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. @@ -487,12 +449,11 @@ pub mod wasi { 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:cli/terminal-stderr@0.2.0")] + #[link(wasm_import_module = "wasi:cli/terminal-stderr@0.2.1")] extern "C" { #[link_name = "get-terminal-stderr"] fn wit_import(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8) { unreachable!() @@ -504,8 +465,9 @@ pub mod wasi { 1 => { let e = { let l2 = *ptr0.add(4).cast::(); - - super::super::super::wasi::cli::terminal_output::TerminalOutput::from_handle(l2 as u32) + super::super::super::wasi::cli::terminal_output::TerminalOutput::from_handle( + l2 as u32, + ) }; Some(e) } @@ -522,8 +484,7 @@ pub mod wasi { #[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 @@ -540,12 +501,11 @@ pub mod wasi { pub fn now() -> Instant { unsafe { #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:clocks/monotonic-clock@0.2.0")] + #[link(wasm_import_module = "wasi:clocks/monotonic-clock@0.2.1")] extern "C" { #[link_name = "now"] fn wit_import() -> i64; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import() -> i64 { unreachable!() @@ -560,12 +520,11 @@ pub mod wasi { pub fn resolution() -> Duration { unsafe { #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:clocks/monotonic-clock@0.2.0")] + #[link(wasm_import_module = "wasi:clocks/monotonic-clock@0.2.1")] extern "C" { #[link_name = "resolution"] fn wit_import() -> i64; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import() -> i64 { unreachable!() @@ -576,54 +535,53 @@ pub mod wasi { } #[allow(unused_unsafe, clippy::all)] /// Create a `pollable` which will resolve once the specified instant - /// occured. + /// has occurred. pub fn subscribe_instant(when: Instant) -> Pollable { unsafe { #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:clocks/monotonic-clock@0.2.0")] + #[link(wasm_import_module = "wasi:clocks/monotonic-clock@0.2.1")] extern "C" { #[link_name = "subscribe-instant"] fn wit_import(_: i64) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i64) -> i32 { unreachable!() } let ret = wit_import(_rt::as_i64(when)); - super::super::super::wasi::io::poll::Pollable::from_handle(ret as u32) + super::super::super::wasi::io::poll::Pollable::from_handle( + ret as u32, + ) } } #[allow(unused_unsafe, clippy::all)] - /// Create a `pollable` which will resolve once the given duration has - /// elapsed, starting at the time at which this function was called. - /// occured. + /// Create a `pollable` that will resolve after the specified duration has + /// elapsed from the time this function is invoked. pub fn subscribe_duration(when: Duration) -> Pollable { unsafe { #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:clocks/monotonic-clock@0.2.0")] + #[link(wasm_import_module = "wasi:clocks/monotonic-clock@0.2.1")] extern "C" { #[link_name = "subscribe-duration"] fn wit_import(_: i64) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i64) -> i32 { unreachable!() } let ret = wit_import(_rt::as_i64(when)); - super::super::super::wasi::io::poll::Pollable::from_handle(ret as u32) + super::super::super::wasi::io::poll::Pollable::from_handle( + ret as u32, + ) } } } - #[allow(dead_code, 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)] @@ -632,7 +590,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) @@ -660,12 +621,11 @@ pub mod wasi { 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:clocks/wall-clock@0.2.0")] + #[link(wasm_import_module = "wasi:clocks/wall-clock@0.2.1")] extern "C" { #[link_name = "now"] fn wit_import(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8) { unreachable!() @@ -690,12 +650,11 @@ pub mod wasi { 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:clocks/wall-clock@0.2.0")] + #[link(wasm_import_module = "wasi:clocks/wall-clock@0.2.1")] extern "C" { #[link_name = "resolution"] fn wit_import(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8) { unreachable!() @@ -718,8 +677,7 @@ pub mod wasi { #[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 InputStream = super::super::super::wasi::io::streams::InputStream; pub type OutputStream = super::super::super::wasi::io::streams::OutputStream; @@ -752,7 +710,10 @@ pub mod wasi { 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() @@ -766,24 +727,27 @@ pub mod wasi { 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() } DescriptorType::RegularFile => { f.debug_tuple("DescriptorType::RegularFile").finish() } - DescriptorType::Socket => f.debug_tuple("DescriptorType::Socket").finish(), + DescriptorType::Socket => { + f.debug_tuple("DescriptorType::Socket").finish() + } } } } - impl DescriptorType { - pub(crate) unsafe fn _lift(val: u8) -> 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, @@ -793,79 +757,73 @@ pub mod wasi { 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 integrity"] #[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; @@ -899,7 +857,10 @@ pub mod wasi { 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) @@ -925,9 +886,14 @@ pub mod wasi { 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::NoChange => { + f.debug_tuple("NewTimestamp::NoChange").finish() + } NewTimestamp::Now => f.debug_tuple("NewTimestamp::Now").finish(), NewTimestamp::Timestamp(e) => { f.debug_tuple("NewTimestamp::Timestamp").field(e).finish() @@ -944,7 +910,10 @@ pub mod wasi { 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) @@ -1077,48 +1046,119 @@ pub mod wasi { } 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()) @@ -1127,20 +1167,21 @@ pub mod wasi { } } 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) } } - #[cfg(feature = "std")] impl std::error::Error for ErrorCode {} - impl ErrorCode { - pub(crate) unsafe fn _lift(val: u8) -> 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, @@ -1179,12 +1220,10 @@ pub mod wasi { 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)] @@ -1209,10 +1248,15 @@ pub mod wasi { 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(), @@ -1220,13 +1264,12 @@ pub mod wasi { } } } - impl Advice { - pub(crate) unsafe fn _lift(val: u8) -> 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, @@ -1234,12 +1277,10 @@ pub mod wasi { 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)] @@ -1251,7 +1292,10 @@ pub mod wasi { 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) @@ -1261,13 +1305,11 @@ pub mod wasi { /// 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, } - impl Descriptor { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { @@ -1275,45 +1317,37 @@ pub mod wasi { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for Descriptor { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "wasi:filesystem/types@0.2.0")] + #[link(wasm_import_module = "wasi:filesystem/types@0.2.1")] extern "C" { #[link_name = "[resource-drop]descriptor"] fn drop(_: u32); } - drop(_handle); } } } - /// A stream of directory entries. - #[derive(Debug)] #[repr(transparent)] pub struct DirectoryEntryStream { handle: _rt::Resource, } - impl DirectoryEntryStream { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { @@ -1321,37 +1355,31 @@ pub mod wasi { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for DirectoryEntryStream { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "wasi:filesystem/types@0.2.0")] + #[link(wasm_import_module = "wasi:filesystem/types@0.2.1")] extern "C" { #[link_name = "[resource-drop]directory-entry-stream"] fn drop(_: u32); } - drop(_handle); } } } - impl Descriptor { #[allow(unused_unsafe, clippy::all)] /// Return a stream for reading from a file, if available. @@ -1362,19 +1390,23 @@ pub mod wasi { /// file and they do not interfere with each other. /// /// Note: This allows using `read-stream`, which is similar to `read` in POSIX. - pub fn read_via_stream(&self, offset: Filesize) -> Result { + pub fn read_via_stream( + &self, + offset: Filesize, + ) -> Result { 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:filesystem/types@0.2.0")] + #[link(wasm_import_module = "wasi:filesystem/types@0.2.1")] extern "C" { #[link_name = "[method]descriptor.read-via-stream"] fn wit_import(_: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i64, _: *mut u8) { unreachable!() @@ -1385,7 +1417,6 @@ pub mod wasi { 0 => { let e = { let l2 = *ptr0.add(4).cast::(); - super::super::super::wasi::io::streams::InputStream::from_handle( l2 as u32, ) @@ -1395,7 +1426,6 @@ pub mod wasi { 1 => { let e = { let l3 = i32::from(*ptr0.add(4).cast::()); - ErrorCode::_lift(l3 as u8) }; Err(e) @@ -1420,15 +1450,16 @@ 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:filesystem/types@0.2.0")] + #[link(wasm_import_module = "wasi:filesystem/types@0.2.1")] extern "C" { #[link_name = "[method]descriptor.write-via-stream"] fn wit_import(_: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i64, _: *mut u8) { unreachable!() @@ -1439,15 +1470,15 @@ pub mod wasi { 0 => { let e = { let l2 = *ptr0.add(4).cast::(); - - super::super::super::wasi::io::streams::OutputStream::from_handle(l2 as u32) + super::super::super::wasi::io::streams::OutputStream::from_handle( + l2 as u32, + ) }; Ok(e) } 1 => { let e = { let l3 = i32::from(*ptr0.add(4).cast::()); - ErrorCode::_lift(l3 as u8) }; Err(e) @@ -1469,15 +1500,16 @@ 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:filesystem/types@0.2.0")] + #[link(wasm_import_module = "wasi:filesystem/types@0.2.1")] extern "C" { #[link_name = "[method]descriptor.append-via-stream"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -1488,15 +1520,15 @@ pub mod wasi { 0 => { let e = { let l2 = *ptr0.add(4).cast::(); - - super::super::super::wasi::io::streams::OutputStream::from_handle(l2 as u32) + super::super::super::wasi::io::streams::OutputStream::from_handle( + l2 as u32, + ) }; Ok(e) } 1 => { let e = { let l3 = i32::from(*ptr0.add(4).cast::()); - ErrorCode::_lift(l3 as u8) }; Err(e) @@ -1520,15 +1552,16 @@ pub mod wasi { 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:filesystem/types@0.2.0")] + #[link(wasm_import_module = "wasi:filesystem/types@0.2.1")] extern "C" { #[link_name = "[method]descriptor.advise"] fn wit_import(_: i32, _: i64, _: i64, _: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i64, _: i64, _: i32, _: *mut u8) { unreachable!() @@ -1549,7 +1582,6 @@ pub mod wasi { 1 => { let e = { let l2 = i32::from(*ptr0.add(1).cast::()); - ErrorCode::_lift(l2 as u8) }; Err(e) @@ -1571,15 +1603,16 @@ pub mod wasi { 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:filesystem/types@0.2.0")] + #[link(wasm_import_module = "wasi:filesystem/types@0.2.1")] extern "C" { #[link_name = "[method]descriptor.sync-data"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -1594,7 +1627,6 @@ pub mod wasi { 1 => { let e = { let l2 = i32::from(*ptr0.add(1).cast::()); - ErrorCode::_lift(l2 as u8) }; Err(e) @@ -1616,15 +1648,16 @@ pub mod wasi { 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:filesystem/types@0.2.0")] + #[link(wasm_import_module = "wasi:filesystem/types@0.2.1")] extern "C" { #[link_name = "[method]descriptor.get-flags"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -1635,7 +1668,6 @@ pub mod wasi { 0 => { let e = { let l2 = i32::from(*ptr0.add(1).cast::()); - DescriptorFlags::empty() | DescriptorFlags::from_bits_retain(((l2 as u8) << 0) as _) }; @@ -1644,7 +1676,6 @@ pub mod wasi { 1 => { let e = { let l3 = i32::from(*ptr0.add(1).cast::()); - ErrorCode::_lift(l3 as u8) }; Err(e) @@ -1670,15 +1701,16 @@ pub mod wasi { 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:filesystem/types@0.2.0")] + #[link(wasm_import_module = "wasi:filesystem/types@0.2.1")] extern "C" { #[link_name = "[method]descriptor.get-type"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -1689,7 +1721,6 @@ pub mod wasi { 0 => { let e = { let l2 = i32::from(*ptr0.add(1).cast::()); - DescriptorType::_lift(l2 as u8) }; Ok(e) @@ -1697,7 +1728,6 @@ pub mod wasi { 1 => { let e = { let l3 = i32::from(*ptr0.add(1).cast::()); - ErrorCode::_lift(l3 as u8) }; Err(e) @@ -1717,15 +1747,16 @@ pub mod wasi { 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:filesystem/types@0.2.0")] + #[link(wasm_import_module = "wasi:filesystem/types@0.2.1")] extern "C" { #[link_name = "[method]descriptor.set-size"] fn wit_import(_: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i64, _: *mut u8) { unreachable!() @@ -1740,7 +1771,6 @@ pub mod wasi { 1 => { let e = { let l2 = i32::from(*ptr0.add(1).cast::()); - ErrorCode::_lift(l2 as u8) }; Err(e) @@ -1765,7 +1795,9 @@ pub mod wasi { 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 (result1_0, result1_1, result1_2) = match data_access_timestamp { NewTimestamp::NoChange => (0i32, 0i64, 0i32), NewTimestamp::Now => (1i32, 0i64, 0i32), @@ -1774,7 +1806,6 @@ pub mod wasi { seconds: seconds0, nanoseconds: nanoseconds0, } = e; - (2i32, _rt::as_i64(seconds0), _rt::as_i32(nanoseconds0)) } }; @@ -1786,13 +1817,12 @@ pub mod wasi { seconds: seconds2, nanoseconds: nanoseconds2, } = e; - (2i32, _rt::as_i64(seconds2), _rt::as_i32(nanoseconds2)) } }; let ptr4 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:filesystem/types@0.2.0")] + #[link(wasm_import_module = "wasi:filesystem/types@0.2.1")] extern "C" { #[link_name = "[method]descriptor.set-times"] fn wit_import( @@ -1806,7 +1836,6 @@ pub mod wasi { _: *mut u8, ); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import( _: i32, @@ -1839,7 +1868,6 @@ pub mod wasi { 1 => { let e = { let l6 = i32::from(*ptr4.add(1).cast::()); - ErrorCode::_lift(l6 as u8) }; Err(e) @@ -1870,15 +1898,16 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 16]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 16]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 16], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:filesystem/types@0.2.0")] + #[link(wasm_import_module = "wasi:filesystem/types@0.2.1")] extern "C" { #[link_name = "[method]descriptor.read"] fn wit_import(_: i32, _: i64, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i64, _: i64, _: *mut u8) { unreachable!() @@ -1897,7 +1926,6 @@ pub mod wasi { let l3 = *ptr0.add(8).cast::(); let len4 = l3; let l5 = i32::from(*ptr0.add(12).cast::()); - ( _rt::Vec::from_raw_parts(l2.cast(), len4, len4), _rt::bool_lift(l5 as u8), @@ -1908,7 +1936,6 @@ pub mod wasi { 1 => { let e = { let l6 = i32::from(*ptr0.add(4).cast::()); - ErrorCode::_lift(l6 as u8) }; Err(e) @@ -1937,18 +1964,25 @@ 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 vec0 = buffer; 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:filesystem/types@0.2.0")] + #[link(wasm_import_module = "wasi:filesystem/types@0.2.1")] extern "C" { #[link_name = "[method]descriptor.write"] - fn wit_import(_: i32, _: *mut u8, _: usize, _: i64, _: *mut u8); + fn wit_import( + _: i32, + _: *mut u8, + _: usize, + _: i64, + _: *mut u8, + ); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8, _: usize, _: i64, _: *mut u8) { unreachable!() @@ -1965,7 +1999,6 @@ pub mod wasi { 0 => { let e = { let l3 = *ptr1.add(8).cast::(); - l3 as u64 }; Ok(e) @@ -1973,7 +2006,6 @@ pub mod wasi { 1 => { let e = { let l4 = i32::from(*ptr1.add(8).cast::()); - ErrorCode::_lift(l4 as u8) }; Err(e) @@ -1998,15 +2030,16 @@ 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:filesystem/types@0.2.0")] + #[link(wasm_import_module = "wasi:filesystem/types@0.2.1")] extern "C" { #[link_name = "[method]descriptor.read-directory"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -2017,7 +2050,6 @@ pub mod wasi { 0 => { let e = { let l2 = *ptr0.add(4).cast::(); - DirectoryEntryStream::from_handle(l2 as u32) }; Ok(e) @@ -2025,7 +2057,6 @@ pub mod wasi { 1 => { let e = { let l3 = i32::from(*ptr0.add(4).cast::()); - ErrorCode::_lift(l3 as u8) }; Err(e) @@ -2047,15 +2078,16 @@ pub mod wasi { 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:filesystem/types@0.2.0")] + #[link(wasm_import_module = "wasi:filesystem/types@0.2.1")] extern "C" { #[link_name = "[method]descriptor.sync"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -2070,7 +2102,6 @@ pub mod wasi { 1 => { let e = { let l2 = i32::from(*ptr0.add(1).cast::()); - ErrorCode::_lift(l2 as u8) }; Err(e) @@ -2089,18 +2120,19 @@ pub mod wasi { 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 = path; 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:filesystem/types@0.2.0")] + #[link(wasm_import_module = "wasi:filesystem/types@0.2.1")] extern "C" { #[link_name = "[method]descriptor.create-directory-at"] fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8) { unreachable!() @@ -2115,7 +2147,6 @@ pub mod wasi { 1 => { let e = { let l3 = i32::from(*ptr1.add(1).cast::()); - ErrorCode::_lift(l3 as u8) }; Err(e) @@ -2140,15 +2171,16 @@ pub mod wasi { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 104]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 104]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 104], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:filesystem/types@0.2.0")] + #[link(wasm_import_module = "wasi:filesystem/types@0.2.1")] extern "C" { #[link_name = "[method]descriptor.stat"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -2164,7 +2196,6 @@ pub mod wasi { let l5 = i32::from(*ptr0.add(32).cast::()); let l8 = i32::from(*ptr0.add(56).cast::()); let l11 = i32::from(*ptr0.add(80).cast::()); - DescriptorStat { type_: DescriptorType::_lift(l2 as u8), link_count: l3 as u64, @@ -2175,11 +2206,10 @@ pub mod wasi { let e = { let l6 = *ptr0.add(40).cast::(); let l7 = *ptr0.add(48).cast::(); - - super::super::super::wasi::clocks::wall_clock::Datetime{ - seconds: l6 as u64, - nanoseconds: l7 as u32, - } + super::super::super::wasi::clocks::wall_clock::Datetime { + seconds: l6 as u64, + nanoseconds: l7 as u32, + } }; Some(e) } @@ -2191,11 +2221,10 @@ pub mod wasi { let e = { let l9 = *ptr0.add(64).cast::(); let l10 = *ptr0.add(72).cast::(); - - super::super::super::wasi::clocks::wall_clock::Datetime{ - seconds: l9 as u64, - nanoseconds: l10 as u32, - } + super::super::super::wasi::clocks::wall_clock::Datetime { + seconds: l9 as u64, + nanoseconds: l10 as u32, + } }; Some(e) } @@ -2207,11 +2236,10 @@ pub mod wasi { let e = { let l12 = *ptr0.add(88).cast::(); let l13 = *ptr0.add(96).cast::(); - - super::super::super::wasi::clocks::wall_clock::Datetime{ - seconds: l12 as u64, - nanoseconds: l13 as u32, - } + super::super::super::wasi::clocks::wall_clock::Datetime { + seconds: l12 as u64, + nanoseconds: l13 as u32, + } }; Some(e) } @@ -2224,7 +2252,6 @@ pub mod wasi { 1 => { let e = { let l14 = i32::from(*ptr0.add(8).cast::()); - ErrorCode::_lift(l14 as u8) }; Err(e) @@ -2251,19 +2278,26 @@ pub mod wasi { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 104]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 104]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 104], + ); let flags0 = path_flags; let vec1 = path; let ptr1 = vec1.as_ptr().cast::(); let len1 = vec1.len(); let ptr2 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:filesystem/types@0.2.0")] + #[link(wasm_import_module = "wasi:filesystem/types@0.2.1")] extern "C" { #[link_name = "[method]descriptor.stat-at"] - fn wit_import(_: i32, _: i32, _: *mut u8, _: usize, _: *mut u8); + fn wit_import( + _: i32, + _: i32, + _: *mut u8, + _: usize, + _: *mut u8, + ); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i32, _: *mut u8, _: usize, _: *mut u8) { unreachable!() @@ -2285,7 +2319,6 @@ pub mod wasi { let l7 = i32::from(*ptr2.add(32).cast::()); let l10 = i32::from(*ptr2.add(56).cast::()); let l13 = i32::from(*ptr2.add(80).cast::()); - DescriptorStat { type_: DescriptorType::_lift(l4 as u8), link_count: l5 as u64, @@ -2296,11 +2329,10 @@ pub mod wasi { let e = { let l8 = *ptr2.add(40).cast::(); let l9 = *ptr2.add(48).cast::(); - - super::super::super::wasi::clocks::wall_clock::Datetime{ - seconds: l8 as u64, - nanoseconds: l9 as u32, - } + super::super::super::wasi::clocks::wall_clock::Datetime { + seconds: l8 as u64, + nanoseconds: l9 as u32, + } }; Some(e) } @@ -2312,11 +2344,10 @@ pub mod wasi { let e = { let l11 = *ptr2.add(64).cast::(); let l12 = *ptr2.add(72).cast::(); - - super::super::super::wasi::clocks::wall_clock::Datetime{ - seconds: l11 as u64, - nanoseconds: l12 as u32, - } + super::super::super::wasi::clocks::wall_clock::Datetime { + seconds: l11 as u64, + nanoseconds: l12 as u32, + } }; Some(e) } @@ -2328,11 +2359,10 @@ pub mod wasi { let e = { let l14 = *ptr2.add(88).cast::(); let l15 = *ptr2.add(96).cast::(); - - super::super::super::wasi::clocks::wall_clock::Datetime{ - seconds: l14 as u64, - nanoseconds: l15 as u32, - } + super::super::super::wasi::clocks::wall_clock::Datetime { + seconds: l14 as u64, + nanoseconds: l15 as u32, + } }; Some(e) } @@ -2345,7 +2375,6 @@ pub mod wasi { 1 => { let e = { let l16 = i32::from(*ptr2.add(8).cast::()); - ErrorCode::_lift(l16 as u8) }; Err(e) @@ -2373,7 +2402,9 @@ pub mod wasi { 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 flags0 = path_flags; let vec1 = path; let ptr1 = vec1.as_ptr().cast::(); @@ -2386,7 +2417,6 @@ pub mod wasi { seconds: seconds2, nanoseconds: nanoseconds2, } = e; - (2i32, _rt::as_i64(seconds2), _rt::as_i32(nanoseconds2)) } }; @@ -2398,13 +2428,12 @@ pub mod wasi { seconds: seconds4, nanoseconds: nanoseconds4, } = e; - (2i32, _rt::as_i64(seconds4), _rt::as_i32(nanoseconds4)) } }; let ptr6 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:filesystem/types@0.2.0")] + #[link(wasm_import_module = "wasi:filesystem/types@0.2.1")] extern "C" { #[link_name = "[method]descriptor.set-times-at"] fn wit_import( @@ -2421,7 +2450,6 @@ pub mod wasi { _: *mut u8, ); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import( _: i32, @@ -2460,7 +2488,6 @@ pub mod wasi { 1 => { let e = { let l8 = i32::from(*ptr6.add(1).cast::()); - ErrorCode::_lift(l8 as u8) }; Err(e) @@ -2485,7 +2512,9 @@ pub mod wasi { 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 flags0 = old_path_flags; let vec1 = old_path; let ptr1 = vec1.as_ptr().cast::(); @@ -2495,7 +2524,7 @@ pub mod wasi { let len2 = vec2.len(); let ptr3 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:filesystem/types@0.2.0")] + #[link(wasm_import_module = "wasi:filesystem/types@0.2.1")] extern "C" { #[link_name = "[method]descriptor.link-at"] fn wit_import( @@ -2509,7 +2538,6 @@ pub mod wasi { _: *mut u8, ); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import( _: i32, @@ -2542,7 +2570,6 @@ pub mod wasi { 1 => { let e = { let l5 = i32::from(*ptr3.add(1).cast::()); - ErrorCode::_lift(l5 as u8) }; Err(e) @@ -2582,7 +2609,9 @@ 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 flags0 = path_flags; let vec1 = path; let ptr1 = vec1.as_ptr().cast::(); @@ -2591,7 +2620,7 @@ pub mod wasi { let flags3 = flags; let ptr4 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:filesystem/types@0.2.0")] + #[link(wasm_import_module = "wasi:filesystem/types@0.2.1")] extern "C" { #[link_name = "[method]descriptor.open-at"] fn wit_import( @@ -2604,7 +2633,6 @@ pub mod wasi { _: *mut u8, ); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import( _: i32, @@ -2631,7 +2659,6 @@ pub mod wasi { 0 => { let e = { let l6 = *ptr4.add(4).cast::(); - Descriptor::from_handle(l6 as u32) }; Ok(e) @@ -2639,7 +2666,6 @@ pub mod wasi { 1 => { let e = { let l7 = i32::from(*ptr4.add(4).cast::()); - ErrorCode::_lift(l7 as u8) }; Err(e) @@ -2661,18 +2687,19 @@ 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 = path; 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:filesystem/types@0.2.0")] + #[link(wasm_import_module = "wasi:filesystem/types@0.2.1")] extern "C" { #[link_name = "[method]descriptor.readlink-at"] fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8) { unreachable!() @@ -2685,8 +2712,11 @@ pub mod wasi { let l3 = *ptr1.add(4).cast::<*mut u8>(); let l4 = *ptr1.add(8).cast::(); let len5 = l4; - let bytes5 = _rt::Vec::from_raw_parts(l3.cast(), len5, len5); - + let bytes5 = _rt::Vec::from_raw_parts( + l3.cast(), + len5, + len5, + ); _rt::string_lift(bytes5) }; Ok(e) @@ -2694,7 +2724,6 @@ pub mod wasi { 1 => { let e = { let l6 = i32::from(*ptr1.add(4).cast::()); - ErrorCode::_lift(l6 as u8) }; Err(e) @@ -2715,18 +2744,19 @@ pub mod wasi { 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 = path; 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:filesystem/types@0.2.0")] + #[link(wasm_import_module = "wasi:filesystem/types@0.2.1")] extern "C" { #[link_name = "[method]descriptor.remove-directory-at"] fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8) { unreachable!() @@ -2741,7 +2771,6 @@ pub mod wasi { 1 => { let e = { let l3 = i32::from(*ptr1.add(1).cast::()); - ErrorCode::_lift(l3 as u8) }; Err(e) @@ -2765,7 +2794,9 @@ pub mod wasi { 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 = old_path; let ptr0 = vec0.as_ptr().cast::(); let len0 = vec0.len(); @@ -2774,7 +2805,7 @@ pub mod wasi { let len1 = vec1.len(); let ptr2 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:filesystem/types@0.2.0")] + #[link(wasm_import_module = "wasi:filesystem/types@0.2.1")] extern "C" { #[link_name = "[method]descriptor.rename-at"] fn wit_import( @@ -2787,7 +2818,6 @@ pub mod wasi { _: *mut u8, ); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import( _: i32, @@ -2818,7 +2848,6 @@ pub mod wasi { 1 => { let e = { let l4 = i32::from(*ptr2.add(1).cast::()); - ErrorCode::_lift(l4 as u8) }; Err(e) @@ -2836,11 +2865,17 @@ pub mod wasi { /// `error-code::not-permitted`. /// /// Note: This is similar to `symlinkat` in POSIX. - pub fn symlink_at(&self, old_path: &str, new_path: &str) -> Result<(), ErrorCode> { + pub fn symlink_at( + &self, + old_path: &str, + new_path: &str, + ) -> Result<(), ErrorCode> { 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 = old_path; let ptr0 = vec0.as_ptr().cast::(); let len0 = vec0.len(); @@ -2849,7 +2884,7 @@ pub mod wasi { let len1 = vec1.len(); let ptr2 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:filesystem/types@0.2.0")] + #[link(wasm_import_module = "wasi:filesystem/types@0.2.1")] extern "C" { #[link_name = "[method]descriptor.symlink-at"] fn wit_import( @@ -2861,7 +2896,6 @@ pub mod wasi { _: *mut u8, ); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import( _: i32, @@ -2890,7 +2924,6 @@ pub mod wasi { 1 => { let e = { let l4 = i32::from(*ptr2.add(1).cast::()); - ErrorCode::_lift(l4 as u8) }; Err(e) @@ -2910,18 +2943,19 @@ pub mod wasi { 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 = path; 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:filesystem/types@0.2.0")] + #[link(wasm_import_module = "wasi:filesystem/types@0.2.1")] extern "C" { #[link_name = "[method]descriptor.unlink-file-at"] fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8) { unreachable!() @@ -2936,7 +2970,6 @@ pub mod wasi { 1 => { let e = { let l3 = i32::from(*ptr1.add(1).cast::()); - ErrorCode::_lift(l3 as u8) }; Err(e) @@ -2957,17 +2990,19 @@ pub mod wasi { pub fn is_same_object(&self, other: &Descriptor) -> bool { unsafe { #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:filesystem/types@0.2.0")] + #[link(wasm_import_module = "wasi:filesystem/types@0.2.1")] extern "C" { #[link_name = "[method]descriptor.is-same-object"] fn wit_import(_: i32, _: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i32) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32, (other).handle() as i32); + let ret = wit_import( + (self).handle() as i32, + (other).handle() as i32, + ); _rt::bool_lift(ret as u8) } } @@ -2997,15 +3032,16 @@ pub mod wasi { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 24]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 24]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 24], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:filesystem/types@0.2.0")] + #[link(wasm_import_module = "wasi:filesystem/types@0.2.1")] extern "C" { #[link_name = "[method]descriptor.metadata-hash"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -3017,7 +3053,6 @@ pub mod wasi { let e = { let l2 = *ptr0.add(8).cast::(); let l3 = *ptr0.add(16).cast::(); - MetadataHashValue { lower: l2 as u64, upper: l3 as u64, @@ -3028,7 +3063,6 @@ pub mod wasi { 1 => { let e = { let l4 = i32::from(*ptr0.add(8).cast::()); - ErrorCode::_lift(l4 as u8) }; Err(e) @@ -3052,19 +3086,26 @@ pub mod wasi { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 24]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 24]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 24], + ); let flags0 = path_flags; let vec1 = path; let ptr1 = vec1.as_ptr().cast::(); let len1 = vec1.len(); let ptr2 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:filesystem/types@0.2.0")] + #[link(wasm_import_module = "wasi:filesystem/types@0.2.1")] extern "C" { #[link_name = "[method]descriptor.metadata-hash-at"] - fn wit_import(_: i32, _: i32, _: *mut u8, _: usize, _: *mut u8); + fn wit_import( + _: i32, + _: i32, + _: *mut u8, + _: usize, + _: *mut u8, + ); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i32, _: *mut u8, _: usize, _: *mut u8) { unreachable!() @@ -3082,7 +3123,6 @@ pub mod wasi { let e = { let l4 = *ptr2.add(8).cast::(); let l5 = *ptr2.add(16).cast::(); - MetadataHashValue { lower: l4 as u64, upper: l5 as u64, @@ -3093,7 +3133,6 @@ pub mod wasi { 1 => { let e = { let l6 = i32::from(*ptr2.add(8).cast::()); - ErrorCode::_lift(l6 as u8) }; Err(e) @@ -3106,19 +3145,22 @@ pub mod wasi { impl DirectoryEntryStream { #[allow(unused_unsafe, clippy::all)] /// Read a single directory entry from a `directory-entry-stream`. - pub fn read_directory_entry(&self) -> Result, ErrorCode> { + pub fn read_directory_entry( + &self, + ) -> Result, ErrorCode> { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 20]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 20]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 20], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:filesystem/types@0.2.0")] + #[link(wasm_import_module = "wasi:filesystem/types@0.2.1")] extern "C" { #[link_name = "[method]directory-entry-stream.read-directory-entry"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -3129,7 +3171,6 @@ pub mod wasi { 0 => { let e = { let l2 = i32::from(*ptr0.add(4).cast::()); - match l2 { 0 => None, 1 => { @@ -3138,9 +3179,11 @@ pub mod wasi { let l4 = *ptr0.add(12).cast::<*mut u8>(); let l5 = *ptr0.add(16).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, + ); DirectoryEntry { type_: DescriptorType::_lift(l3 as u8), name: _rt::string_lift(bytes6), @@ -3156,7 +3199,6 @@ pub mod wasi { 1 => { let e = { let l7 = i32::from(*ptr0.add(4).cast::()); - ErrorCode::_lift(l7 as u8) }; Err(e) @@ -3184,12 +3226,11 @@ pub mod wasi { let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 2]); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:filesystem/types@0.2.0")] + #[link(wasm_import_module = "wasi:filesystem/types@0.2.1")] extern "C" { #[link_name = "filesystem-error-code"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -3201,7 +3242,6 @@ pub mod wasi { 1 => { let e = { let l2 = i32::from(*ptr0.add(1).cast::()); - ErrorCode::_lift(l2 as u8) }; Some(e) @@ -3211,14 +3251,12 @@ pub mod wasi { } } } - #[allow(dead_code, clippy::all)] pub mod preopens { #[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 Descriptor = super::super::super::wasi::filesystem::types::Descriptor; #[allow(unused_unsafe, clippy::all)] @@ -3230,12 +3268,11 @@ pub mod wasi { 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:filesystem/preopens@0.2.0")] + #[link(wasm_import_module = "wasi:filesystem/preopens@0.2.1")] extern "C" { #[link_name = "get-directories"] fn wit_import(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8) { unreachable!() @@ -3254,8 +3291,12 @@ pub mod wasi { let l5 = *base.add(8).cast::(); let len6 = l5; let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6); - - (super::super::super::wasi::filesystem::types::Descriptor::from_handle(l3 as u32), _rt::string_lift(bytes6)) + ( + super::super::super::wasi::filesystem::types::Descriptor::from_handle( + l3 as u32, + ), + _rt::string_lift(bytes6), + ) }; result7.push(e7); } @@ -3272,8 +3313,7 @@ pub mod wasi { #[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; @@ -3295,7 +3335,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(), @@ -3306,7 +3349,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() + } } } } @@ -3318,11 +3363,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() + } } } } @@ -3333,7 +3383,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) @@ -3347,7 +3400,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) @@ -3361,7 +3417,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) @@ -3418,9 +3477,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() } @@ -3460,76 +3524,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() } @@ -3552,11 +3630,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) } } - #[cfg(feature = "std")] impl std::error::Error for ErrorCode {} /// This type enumerates the different kinds of errors that may occur when @@ -3575,22 +3655,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) } } - #[cfg(feature = "std")] impl std::error::Error for HeaderError {} /// Field keys are always strings. @@ -3609,13 +3698,11 @@ 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 { @@ -3623,49 +3710,41 @@ pub mod wasi { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for 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")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[resource-drop]fields"] fn drop(_: u32); } - 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 { @@ -3673,45 +3752,37 @@ pub mod wasi { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for 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")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[resource-drop]incoming-request"] fn drop(_: u32); } - 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 { @@ -3719,50 +3790,42 @@ pub mod wasi { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for 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")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[resource-drop]outgoing-request"] fn drop(_: u32); } - 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 { @@ -3770,49 +3833,41 @@ pub mod wasi { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for 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")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[resource-drop]request-options"] fn drop(_: u32); } - 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 { @@ -3820,47 +3875,39 @@ pub mod wasi { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for 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")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[resource-drop]response-outparam"] fn drop(_: u32); } - 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 { @@ -3868,37 +3915,31 @@ pub mod wasi { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for 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")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[resource-drop]incoming-response"] fn drop(_: u32); } - drop(_handle); } } } - /// Represents an incoming HTTP Request or Response's Body. /// /// A body has both its contents - a stream of bytes - and a (possibly @@ -3907,13 +3948,11 @@ 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 { @@ -3921,49 +3960,41 @@ pub mod wasi { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for 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")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[resource-drop]incoming-body"] fn drop(_: u32); } - drop(_handle); } } } - - /// Represents a future which may eventaully return trailers, or an error. + /// Represents a future which may eventually 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 { @@ -3971,45 +4002,37 @@ pub mod wasi { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for 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")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[resource-drop]future-trailers"] fn drop(_: u32); } - 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 { @@ -4017,37 +4040,31 @@ pub mod wasi { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for 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")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[resource-drop]outgoing-response"] fn drop(_: u32); } - drop(_handle); } } } - /// Represents an outgoing HTTP Request or Response's Body. /// /// A body has both its contents - a stream of bytes - and a (possibly @@ -4060,17 +4077,15 @@ pub mod wasi { /// /// If the user code drops this resource, as opposed to calling the static /// method `finish`, the implementation should treat the body as incomplete, - /// and that an error has occured. The implementation should propogate this + /// and that an error has occurred. The implementation should propagate this /// 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 { @@ -4078,49 +4093,41 @@ pub mod wasi { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for 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")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[resource-drop]outgoing-body"] fn drop(_: u32); } - drop(_handle); } } } - - /// Represents a future which may eventaully return an incoming HTTP + /// Represents a future which may eventually 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 { @@ -4128,37 +4135,31 @@ pub mod wasi { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for 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")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[resource-drop]future-incoming-response"] fn drop(_: u32); } - drop(_handle); } } } - #[allow(unused_unsafe, clippy::all)] /// Attempts to extract a http-related `error` from the wasi:io `error` /// provided. @@ -4178,12 +4179,11 @@ pub mod wasi { let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 40]); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:http/types@0.2.0")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "http-error-code"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -4201,14 +4201,12 @@ pub mod wasi { let e64 = { let l3 = i32::from(*ptr0.add(16).cast::()); let l7 = i32::from(*ptr0.add(28).cast::()); - DnsErrorPayload { rcode: match l3 { 0 => None, 1 => { let e = { - let l4 = - *ptr0.add(20).cast::<*mut u8>(); + let l4 = *ptr0.add(20).cast::<*mut u8>(); let l5 = *ptr0.add(24).cast::(); let len6 = l5; let bytes6 = _rt::Vec::from_raw_parts( @@ -4216,7 +4214,6 @@ pub mod wasi { len6, len6, ); - _rt::string_lift(bytes6) }; Some(e) @@ -4227,10 +4224,7 @@ pub mod wasi { 0 => None, 1 => { let e = { - let l8 = i32::from( - *ptr0.add(30).cast::(), - ); - + let l8 = i32::from(*ptr0.add(30).cast::()); l8 as u16 }; Some(e) @@ -4257,16 +4251,12 @@ pub mod wasi { let e64 = { let l9 = i32::from(*ptr0.add(16).cast::()); let l11 = i32::from(*ptr0.add(20).cast::()); - TlsAlertReceivedPayload { alert_id: match l9 { 0 => None, 1 => { let e = { - let l10 = i32::from( - *ptr0.add(17).cast::(), - ); - + let l10 = i32::from(*ptr0.add(17).cast::()); l10 as u8 }; Some(e) @@ -4277,8 +4267,7 @@ pub mod wasi { 0 => None, 1 => { let e = { - let l12 = - *ptr0.add(24).cast::<*mut u8>(); + let l12 = *ptr0.add(24).cast::<*mut u8>(); let l13 = *ptr0.add(28).cast::(); let len14 = l13; let bytes14 = _rt::Vec::from_raw_parts( @@ -4286,7 +4275,6 @@ pub mod wasi { len14, len14, ); - _rt::string_lift(bytes14) }; Some(e) @@ -4302,13 +4290,11 @@ pub mod wasi { 17 => { let e64 = { let l15 = i32::from(*ptr0.add(16).cast::()); - match l15 { 0 => None, 1 => { let e = { let l16 = *ptr0.add(24).cast::(); - l16 as u64 }; Some(e) @@ -4324,13 +4310,11 @@ pub mod wasi { 21 => { let e64 = { let l17 = i32::from(*ptr0.add(16).cast::()); - match l17 { 0 => None, 1 => { let e = { let l18 = *ptr0.add(20).cast::(); - l18 as u32 }; Some(e) @@ -4343,54 +4327,41 @@ pub mod wasi { 22 => { let e64 = { let l19 = i32::from(*ptr0.add(16).cast::()); - match l19 { 0 => None, 1 => { let e = { - let l20 = - i32::from(*ptr0.add(20).cast::()); - let l24 = - i32::from(*ptr0.add(32).cast::()); - + let l20 = i32::from(*ptr0.add(20).cast::()); + let l24 = i32::from(*ptr0.add(32).cast::()); FieldSizePayload { field_name: match l20 { 0 => None, 1 => { let e = { - let l21 = *ptr0 - .add(24) - .cast::<*mut u8>( - ); - let l22 = *ptr0 - .add(28) - .cast::(); + let l21 = *ptr0.add(24).cast::<*mut u8>(); + let l22 = *ptr0.add(28).cast::(); let len23 = l22; - let bytes23 = _rt::Vec::from_raw_parts(l21.cast(), len23, len23); - + let bytes23 = _rt::Vec::from_raw_parts( + l21.cast(), + len23, + len23, + ); _rt::string_lift(bytes23) }; Some(e) } - _ => { - _rt::invalid_enum_discriminant() - } + _ => _rt::invalid_enum_discriminant(), }, field_size: match l24 { 0 => None, 1 => { let e = { - let l25 = *ptr0 - .add(36) - .cast::(); - + let l25 = *ptr0.add(36).cast::(); l25 as u32 }; Some(e) } - _ => { - _rt::invalid_enum_discriminant() - } + _ => _rt::invalid_enum_discriminant(), }, } }; @@ -4404,13 +4375,11 @@ pub mod wasi { 23 => { let e64 = { let l26 = i32::from(*ptr0.add(16).cast::()); - match l26 { 0 => None, 1 => { let e = { let l27 = *ptr0.add(20).cast::(); - l27 as u32 }; Some(e) @@ -4424,14 +4393,12 @@ pub mod wasi { let e64 = { let l28 = i32::from(*ptr0.add(16).cast::()); let l32 = i32::from(*ptr0.add(28).cast::()); - FieldSizePayload { field_name: match l28 { 0 => None, 1 => { let e = { - let l29 = - *ptr0.add(20).cast::<*mut u8>(); + let l29 = *ptr0.add(20).cast::<*mut u8>(); let l30 = *ptr0.add(24).cast::(); let len31 = l30; let bytes31 = _rt::Vec::from_raw_parts( @@ -4439,7 +4406,6 @@ pub mod wasi { len31, len31, ); - _rt::string_lift(bytes31) }; Some(e) @@ -4451,7 +4417,6 @@ pub mod wasi { 1 => { let e = { let l33 = *ptr0.add(32).cast::(); - l33 as u32 }; Some(e) @@ -4466,13 +4431,11 @@ pub mod wasi { 26 => { let e64 = { let l34 = i32::from(*ptr0.add(16).cast::()); - match l34 { 0 => None, 1 => { let e = { let l35 = *ptr0.add(20).cast::(); - l35 as u32 }; Some(e) @@ -4486,14 +4449,12 @@ pub mod wasi { let e64 = { let l36 = i32::from(*ptr0.add(16).cast::()); let l40 = i32::from(*ptr0.add(28).cast::()); - FieldSizePayload { field_name: match l36 { 0 => None, 1 => { let e = { - let l37 = - *ptr0.add(20).cast::<*mut u8>(); + let l37 = *ptr0.add(20).cast::<*mut u8>(); let l38 = *ptr0.add(24).cast::(); let len39 = l38; let bytes39 = _rt::Vec::from_raw_parts( @@ -4501,7 +4462,6 @@ pub mod wasi { len39, len39, ); - _rt::string_lift(bytes39) }; Some(e) @@ -4513,7 +4473,6 @@ pub mod wasi { 1 => { let e = { let l41 = *ptr0.add(32).cast::(); - l41 as u32 }; Some(e) @@ -4527,13 +4486,11 @@ pub mod wasi { 28 => { let e64 = { let l42 = i32::from(*ptr0.add(16).cast::()); - match l42 { 0 => None, 1 => { let e = { let l43 = *ptr0.add(24).cast::(); - l43 as u64 }; Some(e) @@ -4546,13 +4503,11 @@ pub mod wasi { 29 => { let e64 = { let l44 = i32::from(*ptr0.add(16).cast::()); - match l44 { 0 => None, 1 => { let e = { let l45 = *ptr0.add(20).cast::(); - l45 as u32 }; Some(e) @@ -4566,14 +4521,12 @@ pub mod wasi { let e64 = { let l46 = i32::from(*ptr0.add(16).cast::()); let l50 = i32::from(*ptr0.add(28).cast::()); - FieldSizePayload { field_name: match l46 { 0 => None, 1 => { let e = { - let l47 = - *ptr0.add(20).cast::<*mut u8>(); + let l47 = *ptr0.add(20).cast::<*mut u8>(); let l48 = *ptr0.add(24).cast::(); let len49 = l48; let bytes49 = _rt::Vec::from_raw_parts( @@ -4581,7 +4534,6 @@ pub mod wasi { len49, len49, ); - _rt::string_lift(bytes49) }; Some(e) @@ -4593,7 +4545,6 @@ pub mod wasi { 1 => { let e = { let l51 = *ptr0.add(32).cast::(); - l51 as u32 }; Some(e) @@ -4607,7 +4558,6 @@ pub mod wasi { 31 => { let e64 = { let l52 = i32::from(*ptr0.add(16).cast::()); - match l52 { 0 => None, 1 => { @@ -4620,7 +4570,6 @@ pub mod wasi { len55, len55, ); - _rt::string_lift(bytes55) }; Some(e) @@ -4633,7 +4582,6 @@ pub mod wasi { 32 => { let e64 = { let l56 = i32::from(*ptr0.add(16).cast::()); - match l56 { 0 => None, 1 => { @@ -4646,7 +4594,6 @@ pub mod wasi { len59, len59, ); - _rt::string_lift(bytes59) }; Some(e) @@ -4665,7 +4612,6 @@ pub mod wasi { debug_assert_eq!(n, 38, "invalid enum discriminant"); let e64 = { let l60 = i32::from(*ptr0.add(16).cast::()); - match l60 { 0 => None, 1 => { @@ -4678,7 +4624,6 @@ pub mod wasi { len63, len63, ); - _rt::string_lift(bytes63) }; Some(e) @@ -4689,7 +4634,6 @@ pub mod wasi { ErrorCode::InternalError(e64) } }; - v64 }; Some(e) @@ -4706,12 +4650,11 @@ pub mod wasi { pub fn new() -> Self { unsafe { #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:http/types@0.2.0")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[constructor]fields"] fn wit_import() -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import() -> i32 { unreachable!() @@ -4732,23 +4675,25 @@ pub mod wasi { /// list with the same key. /// /// The tuple is a pair of the field key, represented as a string, and - /// Value, represented as a list of bytes. In a valid Fields, all keys - /// and values are valid UTF-8 strings. However, values are not always - /// well-formed, so they are represented as a raw list of bytes. + /// Value, represented as a list of bytes. /// - /// An error result will be returned if any header or value was - /// syntactically invalid, or if a header was forbidden. + /// An error result will be returned if any `field-key` or `field-value` is + /// syntactically invalid, or if a field is forbidden. pub fn from_list( entries: &[(FieldKey, FieldValue)], ) -> Result { 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() * 16, + 4, + ); let result3 = if layout3.size() != 0 { let ptr = _rt::alloc::alloc(layout3).cast::(); if ptr.is_null() { @@ -4756,9 +4701,7 @@ 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); @@ -4778,12 +4721,11 @@ pub mod wasi { } let ptr4 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:http/types@0.2.0")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[static]fields.from-list"] fn wit_import(_: *mut u8, _: usize, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8, _: usize, _: *mut u8) { unreachable!() @@ -4797,7 +4739,6 @@ pub mod wasi { 0 => { let e = { let l6 = *ptr4.add(4).cast::(); - Fields::from_handle(l6 as u32) }; Ok(e) @@ -4813,7 +4754,6 @@ pub mod wasi { HeaderError::Immutable } }; - v8 }; Err(e) @@ -4826,25 +4766,26 @@ pub mod wasi { impl Fields { #[allow(unused_unsafe, clippy::all)] /// Get all of the values corresponding to a key. If the key is not present - /// 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. + /// in this `fields` or is syntactically invalid, 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 { 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 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")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]fields.get"] fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8) { unreachable!() @@ -4861,7 +4802,6 @@ pub mod wasi { 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) }; result7.push(e7); @@ -4880,19 +4820,21 @@ pub mod wasi { 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")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]fields.has"] fn wit_import(_: i32, _: *mut u8, _: usize) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8, _: usize) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32, ptr0.cast_mut(), len0); + let ret = wit_import( + (self).handle() as i32, + ptr0.cast_mut(), + len0, + ); _rt::bool_lift(ret as u8) } } @@ -4903,6 +4845,9 @@ pub mod wasi { /// key, if they have been set. /// /// Fails with `header-error.immutable` if the `fields` are immutable. + /// + /// Fails with `header-error.invalid-syntax` if the `field-key` or any of + /// the `field-value`s are syntactically invalid. pub fn set( &self, name: &FieldKey, @@ -4911,14 +4856,18 @@ pub mod wasi { 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() * 8, + 4, + ); let result2 = if layout2.size() != 0 { let ptr = _rt::alloc::alloc(layout2).cast::(); if ptr.is_null() { @@ -4926,9 +4875,7 @@ 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); @@ -4942,7 +4889,7 @@ pub mod wasi { } let ptr3 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:http/types@0.2.0")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]fields.set"] fn wit_import( @@ -4954,7 +4901,6 @@ pub mod wasi { _: *mut u8, ); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import( _: i32, @@ -4994,7 +4940,6 @@ pub mod wasi { HeaderError::Immutable } }; - v6 }; Err(e) @@ -5010,22 +4955,26 @@ pub mod wasi { /// exist. /// /// Fails with `header-error.immutable` if the `fields` are immutable. + /// + /// Fails with `header-error.invalid-syntax` if the `field-key` is + /// syntactically invalid. pub fn delete(&self, name: &FieldKey) -> 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")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]fields.delete"] fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8) { unreachable!() @@ -5048,7 +4997,6 @@ pub mod wasi { HeaderError::Immutable } }; - v4 }; Err(e) @@ -5064,6 +5012,9 @@ pub mod wasi { /// values for that key. /// /// Fails with `header-error.immutable` if the `fields` are immutable. + /// + /// Fails with `header-error.invalid-syntax` if the `field-key` or + /// `field-value` are syntactically invalid. pub fn append( &self, name: &FieldKey, @@ -5072,7 +5023,9 @@ pub mod wasi { 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(); @@ -5081,7 +5034,7 @@ pub mod wasi { let len1 = vec1.len(); let ptr2 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:http/types@0.2.0")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]fields.append"] fn wit_import( @@ -5093,7 +5046,6 @@ pub mod wasi { _: *mut u8, ); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import( _: i32, @@ -5130,7 +5082,6 @@ pub mod wasi { HeaderError::Immutable } }; - v5 }; Err(e) @@ -5152,15 +5103,16 @@ 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")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]fields.entries"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -5177,11 +5129,14 @@ pub mod wasi { 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 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; - ( _rt::string_lift(bytes5), _rt::Vec::from_raw_parts(l6.cast(), len8, len8), @@ -5196,18 +5151,17 @@ pub mod wasi { } impl Fields { #[allow(unused_unsafe, clippy::all)] - /// Make a deep copy of the Fields. Equivelant in behavior to calling the + /// Make a deep copy of the Fields. Equivalent in behavior to calling the /// `fields` constructor on the return value of `entries`. The resulting /// `fields` is mutable. pub fn clone(&self) -> Fields { unsafe { #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:http/types@0.2.0")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]fields.clone"] fn wit_import(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) -> i32 { unreachable!() @@ -5224,15 +5178,16 @@ 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:http/types@0.2.0")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]incoming-request.method"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -5255,8 +5210,11 @@ pub mod wasi { 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); - + let bytes4 = _rt::Vec::from_raw_parts( + l2.cast(), + len4, + len4, + ); _rt::string_lift(bytes4) }; Method::Other(e5) @@ -5273,15 +5231,16 @@ 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:http/types@0.2.0")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]incoming-request.path-with-query"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -5295,8 +5254,11 @@ pub mod wasi { 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); - + let bytes4 = _rt::Vec::from_raw_parts( + l2.cast(), + len4, + len4, + ); _rt::string_lift(bytes4) }; Some(e) @@ -5313,15 +5275,16 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 16]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 16]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 16], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:http/types@0.2.0")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]incoming-request.scheme"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -5342,15 +5305,16 @@ pub mod wasi { 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); - + let bytes5 = _rt::Vec::from_raw_parts( + l3.cast(), + len5, + len5, + ); _rt::string_lift(bytes5) }; Scheme::Other(e6) } }; - v6 }; Some(e) @@ -5362,20 +5326,21 @@ pub mod wasi { } impl IncomingRequest { #[allow(unused_unsafe, clippy::all)] - /// Returns the authority from the request, if it was present. + /// Returns the authority of the Request's target URI, if 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]); + 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:http/types@0.2.0")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]incoming-request.authority"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -5389,8 +5354,11 @@ pub mod wasi { 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); - + let bytes4 = _rt::Vec::from_raw_parts( + l2.cast(), + len4, + len4, + ); _rt::string_lift(bytes4) }; Some(e) @@ -5413,12 +5381,11 @@ pub mod wasi { pub fn headers(&self) -> Headers { unsafe { #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:http/types@0.2.0")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]incoming-request.headers"] fn wit_import(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) -> i32 { unreachable!() @@ -5436,15 +5403,16 @@ 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")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]incoming-request.consume"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -5455,7 +5423,6 @@ pub mod wasi { 0 => { let e = { let l2 = *ptr0.add(4).cast::(); - IncomingBody::from_handle(l2 as u32) }; Ok(e) @@ -5484,12 +5451,11 @@ pub mod wasi { pub fn new(headers: Headers) -> Self { unsafe { #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:http/types@0.2.0")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[constructor]outgoing-request"] fn wit_import(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) -> i32 { unreachable!() @@ -5511,15 +5477,16 @@ 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")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]outgoing-request.body"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -5530,7 +5497,6 @@ pub mod wasi { 0 => { let e = { let l2 = *ptr0.add(4).cast::(); - OutgoingBody::from_handle(l2 as u32) }; Ok(e) @@ -5551,15 +5517,16 @@ 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:http/types@0.2.0")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]outgoing-request.method"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -5582,8 +5549,11 @@ pub mod wasi { 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); - + let bytes4 = _rt::Vec::from_raw_parts( + l2.cast(), + len4, + len4, + ); _rt::string_lift(bytes4) }; Method::Other(e5) @@ -5613,24 +5583,25 @@ 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")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]outgoing-request.set-method"] fn wit_import(_: i32, _: i32, _: *mut u8, _: usize) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i32, _: *mut u8, _: usize) -> i32 { unreachable!() } - let ret = - wit_import((self).handle() as i32, result1_0, result1_1, result1_2); + let ret = wit_import( + (self).handle() as i32, + result1_0, + result1_1, + result1_2, + ); match ret { 0 => { let e = (); @@ -5653,15 +5624,16 @@ 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:http/types@0.2.0")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]outgoing-request.path-with-query"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -5675,8 +5647,11 @@ pub mod wasi { 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); - + let bytes4 = _rt::Vec::from_raw_parts( + l2.cast(), + len4, + len4, + ); _rt::string_lift(bytes4) }; Some(e) @@ -5691,31 +5666,36 @@ 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")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]outgoing-request.set-path-with-query"] fn wit_import(_: i32, _: i32, _: *mut u8, _: usize) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i32, _: *mut u8, _: usize) -> i32 { unreachable!() } - let ret = - wit_import((self).handle() as i32, result1_0, result1_1, result1_2); + let ret = wit_import( + (self).handle() as i32, + result1_0, + result1_1, + result1_2, + ); match ret { 0 => { let e = (); @@ -5738,15 +5718,16 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 16]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 16]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 16], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:http/types@0.2.0")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]outgoing-request.scheme"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -5767,15 +5748,16 @@ pub mod wasi { 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); - + let bytes5 = _rt::Vec::from_raw_parts( + l3.cast(), + len5, + len5, + ); _rt::string_lift(bytes5) }; Scheme::Other(e6) } }; - v6 }; Some(e) @@ -5801,24 +5783,33 @@ 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")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]outgoing-request.set-scheme"] - fn wit_import(_: i32, _: i32, _: i32, _: *mut u8, _: usize) -> i32; + fn wit_import( + _: i32, + _: i32, + _: i32, + _: *mut u8, + _: usize, + ) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: i32, _: i32, _: *mut u8, _: usize) -> i32 { + fn wit_import( + _: i32, + _: i32, + _: i32, + _: *mut u8, + _: usize, + ) -> i32 { unreachable!() } let ret = wit_import( @@ -5844,22 +5835,23 @@ pub mod wasi { } impl OutgoingRequest { #[allow(unused_unsafe, clippy::all)] - /// Get the HTTP Authority for the Request. A value of `none` may be used - /// with Related Schemes which do not require an Authority. The HTTP and + /// Get the authority of the Request's target URI. A value of `none` may be used + /// with Related Schemes which do not require an authority. The HTTP and /// 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]); + 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:http/types@0.2.0")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]outgoing-request.authority"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -5873,8 +5865,11 @@ pub mod wasi { 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); - + let bytes4 = _rt::Vec::from_raw_parts( + l2.cast(), + len4, + len4, + ); _rt::string_lift(bytes4) }; Some(e) @@ -5886,10 +5881,10 @@ pub mod wasi { } impl OutgoingRequest { #[allow(unused_unsafe, clippy::all)] - /// Set the HTTP Authority for the Request. A value of `none` may be used - /// with Related Schemes which do not require an Authority. The HTTP and + /// Set the authority of the Request's target URI. A value of `none` may be used + /// 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. + /// not a syntactically valid URI authority. pub fn set_authority(&self, authority: Option<&str>) -> Result<(), ()> { unsafe { let (result1_0, result1_1, result1_2) = match authority { @@ -5897,24 +5892,26 @@ 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")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]outgoing-request.set-authority"] fn wit_import(_: i32, _: i32, _: *mut u8, _: usize) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i32, _: *mut u8, _: usize) -> i32 { unreachable!() } - let ret = - wit_import((self).handle() as i32, result1_0, result1_1, result1_2); + let ret = wit_import( + (self).handle() as i32, + result1_0, + result1_1, + result1_2, + ); match ret { 0 => { let e = (); @@ -5937,17 +5934,16 @@ pub mod wasi { /// `delete` operations will fail with `header-error.immutable`. /// /// This headers resource is a child: it must be dropped before the parent - /// `outgoing-request` is dropped, or its ownership is transfered to + /// `outgoing-request` is dropped, or its ownership is transferred to /// another component by e.g. `outgoing-handler.handle`. pub fn headers(&self) -> Headers { unsafe { #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:http/types@0.2.0")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]outgoing-request.headers"] fn wit_import(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) -> i32 { unreachable!() @@ -5963,12 +5959,11 @@ pub mod wasi { pub fn new() -> Self { unsafe { #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:http/types@0.2.0")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[constructor]request-options"] fn wit_import() -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import() -> i32 { unreachable!() @@ -5985,15 +5980,16 @@ 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")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]request-options.connect-timeout"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -6005,7 +6001,6 @@ pub mod wasi { 1 => { let e = { let l2 = *ptr0.add(8).cast::(); - l2 as u64 }; Some(e) @@ -6019,24 +6014,30 @@ 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)), None => (0i32, 0i64), }; #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:http/types@0.2.0")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]request-options.set-connect-timeout"] fn wit_import(_: i32, _: i32, _: i64) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i32, _: i64) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32, result0_0, result0_1); + let ret = wit_import( + (self).handle() as i32, + result0_0, + result0_1, + ); match ret { 0 => { let e = (); @@ -6058,15 +6059,16 @@ 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")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]request-options.first-byte-timeout"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -6078,7 +6080,6 @@ pub mod wasi { 1 => { let e = { let l2 = *ptr0.add(8).cast::(); - l2 as u64 }; Some(e) @@ -6092,24 +6093,30 @@ 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)), None => (0i32, 0i64), }; #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:http/types@0.2.0")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]request-options.set-first-byte-timeout"] fn wit_import(_: i32, _: i32, _: i64) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i32, _: i64) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32, result0_0, result0_1); + let ret = wit_import( + (self).handle() as i32, + result0_0, + result0_1, + ); match ret { 0 => { let e = (); @@ -6132,15 +6139,16 @@ 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")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]request-options.between-bytes-timeout"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -6152,7 +6160,6 @@ pub mod wasi { 1 => { let e = { let l2 = *ptr0.add(8).cast::(); - l2 as u64 }; Some(e) @@ -6177,17 +6184,20 @@ pub mod wasi { None => (0i32, 0i64), }; #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:http/types@0.2.0")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]request-options.set-between-bytes-timeout"] fn wit_import(_: i32, _: i32, _: i64) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i32, _: i64) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32, result0_0, result0_1); + let ret = wit_import( + (self).handle() as i32, + result0_0, + result0_1, + ); match ret { 0 => { let e = (); @@ -6213,7 +6223,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, @@ -6225,16 +6238,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, @@ -6245,15 +6260,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, @@ -6264,7 +6281,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), @@ -6277,8 +6293,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 }, @@ -6288,114 +6303,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, @@ -6405,13 +6444,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), @@ -6419,33 +6456,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)), @@ -6461,33 +6500,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)), @@ -6496,9 +6541,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, @@ -6519,43 +6562,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, @@ -6570,9 +6606,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, @@ -6584,17 +6618,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), @@ -6603,8 +6635,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 }, @@ -6614,15 +6645,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)), @@ -6631,9 +6664,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, @@ -6645,17 +6676,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), @@ -6664,8 +6693,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 }, @@ -6698,9 +6726,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, @@ -6712,17 +6738,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), @@ -6731,8 +6755,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 }, @@ -6748,7 +6771,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), @@ -6757,8 +6779,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 }, @@ -6774,7 +6795,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), @@ -6783,8 +6803,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 }, @@ -6794,58 +6813,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), @@ -6854,8 +6882,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 }, @@ -6866,15 +6893,20 @@ 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")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[static]response-outparam.set"] fn wit_import( @@ -6889,7 +6921,6 @@ pub mod wasi { _: i32, ); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import( _: i32, @@ -6924,12 +6955,11 @@ pub mod wasi { pub fn status(&self) -> StatusCode { unsafe { #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:http/types@0.2.0")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]incoming-response.status"] fn wit_import(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) -> i32 { unreachable!() @@ -6951,12 +6981,11 @@ pub mod wasi { pub fn headers(&self) -> Headers { unsafe { #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:http/types@0.2.0")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]incoming-response.headers"] fn wit_import(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) -> i32 { unreachable!() @@ -6974,15 +7003,16 @@ 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")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]incoming-response.consume"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -6993,7 +7023,6 @@ pub mod wasi { 0 => { let e = { let l2 = *ptr0.add(4).cast::(); - IncomingBody::from_handle(l2 as u32) }; Ok(e) @@ -7028,15 +7057,16 @@ 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")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]incoming-body.stream"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -7047,7 +7077,6 @@ pub mod wasi { 0 => { let e = { let l2 = *ptr0.add(4).cast::(); - super::super::super::wasi::io::streams::InputStream::from_handle( l2 as u32, ) @@ -7070,12 +7099,11 @@ pub mod wasi { pub fn finish(this: IncomingBody) -> FutureTrailers { unsafe { #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:http/types@0.2.0")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[static]incoming-body.finish"] fn wit_import(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) -> i32 { unreachable!() @@ -7088,29 +7116,30 @@ pub mod wasi { impl FutureTrailers { #[allow(unused_unsafe, clippy::all)] /// Returns a pollable which becomes ready when either the trailers have - /// been received, or an error has occured. When this pollable is ready, + /// been received, or an error has occurred. When this pollable is ready, /// the `get` method will return `some`. pub fn subscribe(&self) -> Pollable { unsafe { #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:http/types@0.2.0")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]future-trailers.subscribe"] fn wit_import(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) -> i32 { unreachable!() } let ret = wit_import((self).handle() as i32); - super::super::super::wasi::io::poll::Pollable::from_handle(ret as u32) + super::super::super::wasi::io::poll::Pollable::from_handle( + ret as u32, + ) } } } impl FutureTrailers { #[allow(unused_unsafe, clippy::all)] - /// Returns the contents of the trailers, or an error which occured, + /// Returns the contents of the trailers, or an error which occurred, /// once the future is ready. /// /// The outer `option` represents future readiness. Users can wait on this @@ -7122,26 +7151,29 @@ pub mod wasi { /// /// The inner `result` represents that either the HTTP Request or Response /// body, as well as any trailers, were received successfully, or that an - /// error occured receiving them. The optional `trailers` indicates whether + /// error occurred receiving them. The optional `trailers` indicates whether /// or not trailers were present in the body. /// /// When some `trailers` are returned by this method, the `trailers` /// 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]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 56], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:http/types@0.2.0")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]future-trailers.get"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -7153,529 +7185,470 @@ pub mod wasi { 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 = 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 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(), + } + }; Ok(e) } 1 => { let e = { - let l6 = i32::from( - *ptr0.add(24).cast::(), - ); + 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) - } - }; - + 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 }; Err(e) @@ -7709,12 +7682,11 @@ pub mod wasi { pub fn new(headers: Headers) -> Self { unsafe { #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:http/types@0.2.0")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[constructor]outgoing-response"] fn wit_import(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) -> i32 { unreachable!() @@ -7730,12 +7702,11 @@ pub mod wasi { pub fn status_code(&self) -> StatusCode { unsafe { #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:http/types@0.2.0")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]outgoing-response.status-code"] fn wit_import(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) -> i32 { unreachable!() @@ -7749,20 +7720,25 @@ 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")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]outgoing-response.set-status-code"] fn wit_import(_: i32, _: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i32) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32, _rt::as_i32(status_code)); + let ret = wit_import( + (self).handle() as i32, + _rt::as_i32(status_code), + ); match ret { 0 => { let e = (); @@ -7785,17 +7761,16 @@ pub mod wasi { /// `delete` operations will fail with `header-error.immutable`. /// /// This headers resource is a child: it must be dropped before the parent - /// `outgoing-request` is dropped, or its ownership is transfered to + /// `outgoing-request` is dropped, or its ownership is transferred to /// another component by e.g. `outgoing-handler.handle`. pub fn headers(&self) -> Headers { unsafe { #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:http/types@0.2.0")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]outgoing-response.headers"] fn wit_import(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) -> i32 { unreachable!() @@ -7816,15 +7791,16 @@ 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")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]outgoing-response.body"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -7835,7 +7811,6 @@ pub mod wasi { 0 => { let e = { let l2 = *ptr0.add(4).cast::(); - OutgoingBody::from_handle(l2 as u32) }; Ok(e) @@ -7864,15 +7839,16 @@ 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")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]outgoing-body.write"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -7883,8 +7859,9 @@ pub mod wasi { 0 => { let e = { let l2 = *ptr0.add(4).cast::(); - - super::super::super::wasi::io::streams::OutputStream::from_handle(l2 as u32) + super::super::super::wasi::io::streams::OutputStream::from_handle( + l2 as u32, + ) }; Ok(e) } @@ -7915,24 +7892,30 @@ pub mod wasi { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 40]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 40]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 40], + ); let (result0_0, result0_1) = match &trailers { Some(e) => (1i32, (e).take_handle() as i32), None => (0i32, 0i32), }; let ptr1 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:http/types@0.2.0")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[static]outgoing-body.finish"] fn wit_import(_: i32, _: i32, _: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i32, _: i32, _: *mut u8) { unreachable!() } - wit_import((&this).take_handle() as i32, result0_0, result0_1, ptr1); + wit_import( + (&this).take_handle() as i32, + result0_0, + result0_1, + ptr1, + ); let l2 = i32::from(*ptr1.add(0).cast::()); match l2 { 0 => { @@ -7948,24 +7931,19 @@ pub mod wasi { let e65 = { let l4 = i32::from(*ptr1.add(16).cast::()); let l8 = i32::from(*ptr1.add(28).cast::()); - DnsErrorPayload { rcode: match l4 { 0 => None, 1 => { let e = { - let l5 = - *ptr1.add(20).cast::<*mut u8>(); - let l6 = - *ptr1.add(24).cast::(); + 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, - ); - + let bytes7 = _rt::Vec::from_raw_parts( + l5.cast(), + len7, + len7, + ); _rt::string_lift(bytes7) }; Some(e) @@ -7976,10 +7954,7 @@ pub mod wasi { 0 => None, 1 => { let e = { - let l9 = i32::from( - *ptr1.add(30).cast::(), - ); - + let l9 = i32::from(*ptr1.add(30).cast::()); l9 as u16 }; Some(e) @@ -8006,16 +7981,12 @@ pub mod wasi { let e65 = { let l10 = i32::from(*ptr1.add(16).cast::()); let l12 = i32::from(*ptr1.add(20).cast::()); - TlsAlertReceivedPayload { alert_id: match l10 { 0 => None, 1 => { let e = { - let l11 = i32::from( - *ptr1.add(17).cast::(), - ); - + let l11 = i32::from(*ptr1.add(17).cast::()); l11 as u8 }; Some(e) @@ -8026,18 +7997,14 @@ pub mod wasi { 0 => None, 1 => { let e = { - let l13 = - *ptr1.add(24).cast::<*mut u8>(); - let l14 = - *ptr1.add(28).cast::(); + 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, - ); - + let bytes15 = _rt::Vec::from_raw_parts( + l13.cast(), + len15, + len15, + ); _rt::string_lift(bytes15) }; Some(e) @@ -8053,13 +8020,11 @@ pub mod wasi { 17 => { let e65 = { let l16 = i32::from(*ptr1.add(16).cast::()); - match l16 { 0 => None, 1 => { let e = { let l17 = *ptr1.add(24).cast::(); - l17 as u64 }; Some(e) @@ -8075,13 +8040,11 @@ pub mod wasi { 21 => { let e65 = { let l18 = i32::from(*ptr1.add(16).cast::()); - match l18 { 0 => None, 1 => { let e = { let l19 = *ptr1.add(20).cast::(); - l19 as u32 }; Some(e) @@ -8094,47 +8057,43 @@ pub mod wasi { 22 => { let e65 = { let l20 = i32::from(*ptr1.add(16).cast::()); - match l20 { 0 => None, 1 => { let e = { - let l21 = i32::from( - *ptr1.add(20).cast::(), - ); - let l25 = i32::from( - *ptr1.add(32).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(), - }, - } + let l21 = i32::from(*ptr1.add(20).cast::()); + let l25 = i32::from(*ptr1.add(32).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(), + }, + } }; Some(e) } @@ -8146,13 +8105,11 @@ pub mod wasi { 23 => { let e65 = { let l27 = i32::from(*ptr1.add(16).cast::()); - match l27 { 0 => None, 1 => { let e = { let l28 = *ptr1.add(20).cast::(); - l28 as u32 }; Some(e) @@ -8166,24 +8123,19 @@ pub mod wasi { let e65 = { let l29 = i32::from(*ptr1.add(16).cast::()); let l33 = i32::from(*ptr1.add(28).cast::()); - FieldSizePayload { field_name: match l29 { 0 => None, 1 => { let e = { - let l30 = - *ptr1.add(20).cast::<*mut u8>(); - let l31 = - *ptr1.add(24).cast::(); + 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, - ); - + let bytes32 = _rt::Vec::from_raw_parts( + l30.cast(), + len32, + len32, + ); _rt::string_lift(bytes32) }; Some(e) @@ -8194,9 +8146,7 @@ pub mod wasi { 0 => None, 1 => { let e = { - let l34 = - *ptr1.add(32).cast::(); - + let l34 = *ptr1.add(32).cast::(); l34 as u32 }; Some(e) @@ -8211,13 +8161,11 @@ pub mod wasi { 26 => { let e65 = { let l35 = i32::from(*ptr1.add(16).cast::()); - match l35 { 0 => None, 1 => { let e = { let l36 = *ptr1.add(20).cast::(); - l36 as u32 }; Some(e) @@ -8231,24 +8179,19 @@ pub mod wasi { let e65 = { let l37 = i32::from(*ptr1.add(16).cast::()); let l41 = i32::from(*ptr1.add(28).cast::()); - FieldSizePayload { field_name: match l37 { 0 => None, 1 => { let e = { - let l38 = - *ptr1.add(20).cast::<*mut u8>(); - let l39 = - *ptr1.add(24).cast::(); + 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, - ); - + let bytes40 = _rt::Vec::from_raw_parts( + l38.cast(), + len40, + len40, + ); _rt::string_lift(bytes40) }; Some(e) @@ -8259,9 +8202,7 @@ pub mod wasi { 0 => None, 1 => { let e = { - let l42 = - *ptr1.add(32).cast::(); - + let l42 = *ptr1.add(32).cast::(); l42 as u32 }; Some(e) @@ -8275,13 +8216,11 @@ pub mod wasi { 28 => { let e65 = { let l43 = i32::from(*ptr1.add(16).cast::()); - match l43 { 0 => None, 1 => { let e = { let l44 = *ptr1.add(24).cast::(); - l44 as u64 }; Some(e) @@ -8294,13 +8233,11 @@ pub mod wasi { 29 => { let e65 = { let l45 = i32::from(*ptr1.add(16).cast::()); - match l45 { 0 => None, 1 => { let e = { let l46 = *ptr1.add(20).cast::(); - l46 as u32 }; Some(e) @@ -8314,24 +8251,19 @@ pub mod wasi { let e65 = { let l47 = i32::from(*ptr1.add(16).cast::()); let l51 = i32::from(*ptr1.add(28).cast::()); - FieldSizePayload { field_name: match l47 { 0 => None, 1 => { let e = { - let l48 = - *ptr1.add(20).cast::<*mut u8>(); - let l49 = - *ptr1.add(24).cast::(); + 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, - ); - + let bytes50 = _rt::Vec::from_raw_parts( + l48.cast(), + len50, + len50, + ); _rt::string_lift(bytes50) }; Some(e) @@ -8342,9 +8274,7 @@ pub mod wasi { 0 => None, 1 => { let e = { - let l52 = - *ptr1.add(32).cast::(); - + let l52 = *ptr1.add(32).cast::(); l52 as u32 }; Some(e) @@ -8358,13 +8288,11 @@ pub mod wasi { 31 => { let e65 = { let l53 = i32::from(*ptr1.add(16).cast::()); - match l53 { 0 => None, 1 => { let e = { - let l54 = - *ptr1.add(20).cast::<*mut u8>(); + let l54 = *ptr1.add(20).cast::<*mut u8>(); let l55 = *ptr1.add(24).cast::(); let len56 = l55; let bytes56 = _rt::Vec::from_raw_parts( @@ -8372,7 +8300,6 @@ pub mod wasi { len56, len56, ); - _rt::string_lift(bytes56) }; Some(e) @@ -8385,13 +8312,11 @@ pub mod wasi { 32 => { let e65 = { let l57 = i32::from(*ptr1.add(16).cast::()); - match l57 { 0 => None, 1 => { let e = { - let l58 = - *ptr1.add(20).cast::<*mut u8>(); + let l58 = *ptr1.add(20).cast::<*mut u8>(); let l59 = *ptr1.add(24).cast::(); let len60 = l59; let bytes60 = _rt::Vec::from_raw_parts( @@ -8399,7 +8324,6 @@ pub mod wasi { len60, len60, ); - _rt::string_lift(bytes60) }; Some(e) @@ -8418,13 +8342,11 @@ pub mod wasi { debug_assert_eq!(n, 38, "invalid enum discriminant"); let e65 = { let l61 = i32::from(*ptr1.add(16).cast::()); - match l61 { 0 => None, 1 => { let e = { - let l62 = - *ptr1.add(20).cast::<*mut u8>(); + let l62 = *ptr1.add(20).cast::<*mut u8>(); let l63 = *ptr1.add(24).cast::(); let len64 = l63; let bytes64 = _rt::Vec::from_raw_parts( @@ -8432,7 +8354,6 @@ pub mod wasi { len64, len64, ); - _rt::string_lift(bytes64) }; Some(e) @@ -8443,7 +8364,6 @@ pub mod wasi { ErrorCode::InternalError(e65) } }; - v65 }; Err(e) @@ -8456,23 +8376,24 @@ pub mod wasi { impl FutureIncomingResponse { #[allow(unused_unsafe, clippy::all)] /// Returns a pollable which becomes ready when either the Response has - /// been received, or an error has occured. When this pollable is ready, + /// been received, or an error has occurred. When this pollable is ready, /// the `get` method will return `some`. pub fn subscribe(&self) -> Pollable { unsafe { #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:http/types@0.2.0")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]future-incoming-response.subscribe"] fn wit_import(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) -> i32 { unreachable!() } let ret = wit_import((self).handle() as i32); - super::super::super::wasi::io::poll::Pollable::from_handle(ret as u32) + super::super::super::wasi::io::poll::Pollable::from_handle( + ret as u32, + ) } } } @@ -8488,23 +8409,26 @@ pub mod wasi { /// is `some`, and error on subsequent calls. /// /// The inner `result` represents that either the incoming HTTP Response - /// status and headers have recieved successfully, or that an error - /// occured. Errors may also occur while consuming the response body, + /// status and headers have received successfully, or that an error + /// occurred. 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]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 56], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:http/types@0.2.0")] + #[link(wasm_import_module = "wasi:http/types@0.2.1")] extern "C" { #[link_name = "[method]future-incoming-response.get"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -8516,515 +8440,460 @@ pub mod wasi { 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 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) - } - }; - + 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 }; Err(e) @@ -9049,19 +8918,16 @@ pub mod wasi { } } } - #[allow(dead_code, clippy::all)] pub mod outgoing_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; use super::super::super::_rt; pub type OutgoingRequest = super::super::super::wasi::http::types::OutgoingRequest; pub type RequestOptions = super::super::super::wasi::http::types::RequestOptions; - pub type FutureIncomingResponse = - super::super::super::wasi::http::types::FutureIncomingResponse; + pub type FutureIncomingResponse = super::super::super::wasi::http::types::FutureIncomingResponse; pub type ErrorCode = super::super::super::wasi::http::types::ErrorCode; #[allow(unused_unsafe, clippy::all)] /// This function is invoked with an outgoing HTTP Request, and it returns @@ -9088,24 +8954,29 @@ pub mod wasi { }; let ptr1 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:http/outgoing-handler@0.2.0")] + #[link(wasm_import_module = "wasi:http/outgoing-handler@0.2.1")] extern "C" { #[link_name = "handle"] fn wit_import(_: i32, _: i32, _: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i32, _: i32, _: *mut u8) { unreachable!() } - wit_import((&request).take_handle() as i32, result0_0, result0_1, ptr1); + wit_import( + (&request).take_handle() as i32, + result0_0, + result0_1, + ptr1, + ); let l2 = i32::from(*ptr1.add(0).cast::()); match l2 { 0 => { let e = { let l3 = *ptr1.add(8).cast::(); - - super::super::super::wasi::http::types::FutureIncomingResponse::from_handle(l3 as u32) + super::super::super::wasi::http::types::FutureIncomingResponse::from_handle( + l3 as u32, + ) }; Ok(e) } @@ -9119,36 +8990,37 @@ pub mod wasi { let e66 = { let l5 = i32::from(*ptr1.add(16).cast::()); let l9 = i32::from(*ptr1.add(28).cast::()); - - super::super::super::wasi::http::types::DnsErrorPayload{ - rcode: match l5 { - 0 => None, - 1 => { - let e = { - let l6 = *ptr1.add(20).cast::<*mut u8>(); - let l7 = *ptr1.add(24).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 l9 { - 0 => None, - 1 => { - let e = { - let l10 = i32::from(*ptr1.add(30).cast::()); - - l10 as u16 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } + super::super::super::wasi::http::types::DnsErrorPayload { + rcode: match l5 { + 0 => None, + 1 => { + let e = { + let l6 = *ptr1.add(20).cast::<*mut u8>(); + let l7 = *ptr1.add(24).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 l9 { + 0 => None, + 1 => { + let e = { + let l10 = i32::from(*ptr1.add(30).cast::()); + l10 as u16 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } }; V66::DnsError(e66) } @@ -9168,36 +9040,37 @@ pub mod wasi { let e66 = { let l11 = i32::from(*ptr1.add(16).cast::()); let l13 = i32::from(*ptr1.add(20).cast::()); - - super::super::super::wasi::http::types::TlsAlertReceivedPayload{ - alert_id: match l11 { - 0 => None, - 1 => { - let e = { - let l12 = i32::from(*ptr1.add(17).cast::()); - - l12 as u8 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - alert_message: match l13 { - 0 => None, - 1 => { - let e = { - let l14 = *ptr1.add(24).cast::<*mut u8>(); - let l15 = *ptr1.add(28).cast::(); - let len16 = l15; - let bytes16 = _rt::Vec::from_raw_parts(l14.cast(), len16, len16); - - _rt::string_lift(bytes16) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } + super::super::super::wasi::http::types::TlsAlertReceivedPayload { + alert_id: match l11 { + 0 => None, + 1 => { + let e = { + let l12 = i32::from(*ptr1.add(17).cast::()); + l12 as u8 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + alert_message: match l13 { + 0 => None, + 1 => { + let e = { + let l14 = *ptr1.add(24).cast::<*mut u8>(); + let l15 = *ptr1.add(28).cast::(); + let len16 = l15; + let bytes16 = _rt::Vec::from_raw_parts( + l14.cast(), + len16, + len16, + ); + _rt::string_lift(bytes16) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } }; V66::TlsAlertReceived(e66) } @@ -9206,13 +9079,11 @@ pub mod wasi { 17 => { let e66 = { let l17 = i32::from(*ptr1.add(16).cast::()); - match l17 { 0 => None, 1 => { let e = { let l18 = *ptr1.add(24).cast::(); - l18 as u64 }; Some(e) @@ -9228,13 +9099,11 @@ pub mod wasi { 21 => { let e66 = { let l19 = i32::from(*ptr1.add(16).cast::()); - match l19 { 0 => None, 1 => { let e = { let l20 = *ptr1.add(20).cast::(); - l20 as u32 }; Some(e) @@ -9247,45 +9116,43 @@ pub mod wasi { 22 => { let e66 = { let l21 = i32::from(*ptr1.add(16).cast::()); - match l21 { 0 => None, 1 => { let e = { - let l22 = - i32::from(*ptr1.add(20).cast::()); - let l26 = - i32::from(*ptr1.add(32).cast::()); - - super::super::super::wasi::http::types::FieldSizePayload{ - field_name: match l22 { - 0 => None, - 1 => { - let e = { - let l23 = *ptr1.add(24).cast::<*mut u8>(); - let l24 = *ptr1.add(28).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(36).cast::(); - - l27 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } + let l22 = i32::from(*ptr1.add(20).cast::()); + let l26 = i32::from(*ptr1.add(32).cast::()); + super::super::super::wasi::http::types::FieldSizePayload { + field_name: match l22 { + 0 => None, + 1 => { + let e = { + let l23 = *ptr1.add(24).cast::<*mut u8>(); + let l24 = *ptr1.add(28).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(36).cast::(); + l27 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } }; Some(e) } @@ -9297,13 +9164,11 @@ pub mod wasi { 23 => { let e66 = { let l28 = i32::from(*ptr1.add(16).cast::()); - match l28 { 0 => None, 1 => { let e = { let l29 = *ptr1.add(20).cast::(); - l29 as u32 }; Some(e) @@ -9317,36 +9182,37 @@ pub mod wasi { let e66 = { let l30 = i32::from(*ptr1.add(16).cast::()); let l34 = i32::from(*ptr1.add(28).cast::()); - - super::super::super::wasi::http::types::FieldSizePayload{ - field_name: match l30 { - 0 => None, - 1 => { - let e = { - let l31 = *ptr1.add(20).cast::<*mut u8>(); - let l32 = *ptr1.add(24).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 l34 { - 0 => None, - 1 => { - let e = { - let l35 = *ptr1.add(32).cast::(); - - l35 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } + super::super::super::wasi::http::types::FieldSizePayload { + field_name: match l30 { + 0 => None, + 1 => { + let e = { + let l31 = *ptr1.add(20).cast::<*mut u8>(); + let l32 = *ptr1.add(24).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 l34 { + 0 => None, + 1 => { + let e = { + let l35 = *ptr1.add(32).cast::(); + l35 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } }; V66::HttpRequestTrailerSize(e66) } @@ -9354,13 +9220,11 @@ pub mod wasi { 26 => { let e66 = { let l36 = i32::from(*ptr1.add(16).cast::()); - match l36 { 0 => None, 1 => { let e = { let l37 = *ptr1.add(20).cast::(); - l37 as u32 }; Some(e) @@ -9374,49 +9238,48 @@ pub mod wasi { let e66 = { let l38 = i32::from(*ptr1.add(16).cast::()); let l42 = i32::from(*ptr1.add(28).cast::()); - - super::super::super::wasi::http::types::FieldSizePayload{ - field_name: match l38 { - 0 => None, - 1 => { - let e = { - let l39 = *ptr1.add(20).cast::<*mut u8>(); - let l40 = *ptr1.add(24).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 l42 { - 0 => None, - 1 => { - let e = { - let l43 = *ptr1.add(32).cast::(); - - l43 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } + super::super::super::wasi::http::types::FieldSizePayload { + field_name: match l38 { + 0 => None, + 1 => { + let e = { + let l39 = *ptr1.add(20).cast::<*mut u8>(); + let l40 = *ptr1.add(24).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 l42 { + 0 => None, + 1 => { + let e = { + let l43 = *ptr1.add(32).cast::(); + l43 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } }; V66::HttpResponseHeaderSize(e66) } 28 => { let e66 = { let l44 = i32::from(*ptr1.add(16).cast::()); - match l44 { 0 => None, 1 => { let e = { let l45 = *ptr1.add(24).cast::(); - l45 as u64 }; Some(e) @@ -9429,13 +9292,11 @@ pub mod wasi { 29 => { let e66 = { let l46 = i32::from(*ptr1.add(16).cast::()); - match l46 { 0 => None, 1 => { let e = { let l47 = *ptr1.add(20).cast::(); - l47 as u32 }; Some(e) @@ -9449,43 +9310,43 @@ pub mod wasi { let e66 = { let l48 = i32::from(*ptr1.add(16).cast::()); let l52 = i32::from(*ptr1.add(28).cast::()); - - super::super::super::wasi::http::types::FieldSizePayload{ - field_name: match l48 { - 0 => None, - 1 => { - let e = { - let l49 = *ptr1.add(20).cast::<*mut u8>(); - let l50 = *ptr1.add(24).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 l52 { - 0 => None, - 1 => { - let e = { - let l53 = *ptr1.add(32).cast::(); - - l53 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } + super::super::super::wasi::http::types::FieldSizePayload { + field_name: match l48 { + 0 => None, + 1 => { + let e = { + let l49 = *ptr1.add(20).cast::<*mut u8>(); + let l50 = *ptr1.add(24).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 l52 { + 0 => None, + 1 => { + let e = { + let l53 = *ptr1.add(32).cast::(); + l53 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } }; V66::HttpResponseTrailerSize(e66) } 31 => { let e66 = { let l54 = i32::from(*ptr1.add(16).cast::()); - match l54 { 0 => None, 1 => { @@ -9498,7 +9359,6 @@ pub mod wasi { len57, len57, ); - _rt::string_lift(bytes57) }; Some(e) @@ -9511,7 +9371,6 @@ pub mod wasi { 32 => { let e66 = { let l58 = i32::from(*ptr1.add(16).cast::()); - match l58 { 0 => None, 1 => { @@ -9524,7 +9383,6 @@ pub mod wasi { len61, len61, ); - _rt::string_lift(bytes61) }; Some(e) @@ -9543,7 +9401,6 @@ pub mod wasi { debug_assert_eq!(n, 38, "invalid enum discriminant"); let e66 = { let l62 = i32::from(*ptr1.add(16).cast::()); - match l62 { 0 => None, 1 => { @@ -9556,7 +9413,6 @@ pub mod wasi { len65, len65, ); - _rt::string_lift(bytes65) }; Some(e) @@ -9567,7 +9423,6 @@ pub mod wasi { V66::InternalError(e66) } }; - v66 }; Err(e) @@ -9585,17 +9440,14 @@ pub mod wasi { #[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 { @@ -9603,37 +9455,31 @@ pub mod wasi { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for Pollable { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "wasi:io/poll@0.2.0")] + #[link(wasm_import_module = "wasi:io/poll@0.2.1")] extern "C" { #[link_name = "[resource-drop]pollable"] fn drop(_: u32); } - drop(_handle); } } } - impl Pollable { #[allow(unused_unsafe, clippy::all)] /// Return the readiness of a pollable. This function never blocks. @@ -9642,12 +9488,11 @@ pub mod wasi { pub fn ready(&self) -> bool { unsafe { #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:io/poll@0.2.0")] + #[link(wasm_import_module = "wasi:io/poll@0.2.1")] extern "C" { #[link_name = "[method]pollable.ready"] fn wit_import(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) -> i32 { unreachable!() @@ -9667,12 +9512,11 @@ pub mod wasi { pub fn block(&self) { unsafe { #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:io/poll@0.2.0")] + #[link(wasm_import_module = "wasi:io/poll@0.2.1")] extern "C" { #[link_name = "[method]pollable.block"] fn wit_import(_: i32); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) { unreachable!() @@ -9690,8 +9534,9 @@ pub mod wasi { /// The result `list` contains one or more indices of handles in the /// argument list that is ready for I/O. /// - /// If the list contains more elements than can be indexed with a `u32` - /// value, this function traps. + /// This function traps if either: + /// - the list is empty, or: + /// - the list contains more elements than can be indexed with a `u32` value. /// /// A timeout can be implemented by adding a pollable from the /// wasi-clocks API to the list. @@ -9699,7 +9544,7 @@ pub mod wasi { /// This function does not return a `result`; polling in itself does not /// do any I/O so it doesn't fail. If any of the I/O sources identified by /// the pollables has an error, it is indicated by marking the source as - /// being reaedy for I/O. + /// being ready for I/O. pub fn poll(in_: &[&Pollable]) -> _rt::Vec { unsafe { #[repr(align(4))] @@ -9707,7 +9552,10 @@ pub mod wasi { let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); let vec0 = in_; let len0 = vec0.len(); - let layout0 = _rt::alloc::Layout::from_size_align_unchecked(vec0.len() * 4, 4); + let layout0 = _rt::alloc::Layout::from_size_align_unchecked( + vec0.len() * 4, + 4, + ); let result0 = if layout0.size() != 0 { let ptr = _rt::alloc::alloc(layout0).cast::(); if ptr.is_null() { @@ -9715,9 +9563,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); @@ -9727,12 +9573,11 @@ 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")] + #[link(wasm_import_module = "wasi:io/poll@0.2.1")] extern "C" { #[link_name = "poll"] fn wit_import(_: *mut u8, _: usize, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8, _: usize, _: *mut u8) { unreachable!() @@ -9748,14 +9593,12 @@ pub mod wasi { } } } - #[allow(dead_code, 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. /// @@ -9766,23 +9609,19 @@ pub mod wasi { /// `wasi:io/streams/stream-error` type. /// /// To provide more specific error information, other interfaces may - /// provide functions to further "downcast" this error into more specific - /// error information. For example, `error`s returned in streams derived - /// from filesystem types to be described using the filesystem's own - /// error-code type, using the function - /// `wasi:filesystem/types/filesystem-error-code`, which takes a parameter - /// `borrow` and returns - /// `option`. + /// offer functions to "downcast" this error into more specific types. For example, + /// errors returned from streams derived from filesystem types can be described using + /// the filesystem's own error-code type. This is done using the function + /// `wasi:filesystem/types/filesystem-error-code`, which takes a `borrow` + /// parameter and returns an `option`. /// /// 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 { @@ -9790,37 +9629,31 @@ pub mod wasi { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for 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")] + #[link(wasm_import_module = "wasi:io/error@0.2.1")] extern "C" { #[link_name = "[resource-drop]error"] fn drop(_: u32); } - drop(_handle); } } } - impl Error { #[allow(unused_unsafe, clippy::all)] /// Returns a string that is suitable to assist humans in debugging @@ -9834,15 +9667,16 @@ 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:io/error@0.2.0")] + #[link(wasm_import_module = "wasi:io/error@0.2.1")] extern "C" { #[link_name = "[method]error.to-debug-string"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -9857,14 +9691,12 @@ pub mod wasi { } } } - #[allow(dead_code, 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; @@ -9880,22 +9712,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) } } - #[cfg(feature = "std")] impl std::error::Error for StreamError {} /// An input bytestream. @@ -9906,13 +9746,11 @@ 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 { @@ -9920,37 +9758,31 @@ pub mod wasi { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for 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")] + #[link(wasm_import_module = "wasi:io/streams@0.2.1")] extern "C" { #[link_name = "[resource-drop]input-stream"] fn drop(_: u32); } - drop(_handle); } } } - /// An output bytestream. /// /// `output-stream`s are *non-blocking* to the extent practical on @@ -9959,13 +9791,15 @@ 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`. - + /// + /// Dropping an `output-stream` while there's still an active write in + /// progress may result in the data being lost. Before dropping the stream, + /// be sure to fully flush your writes. #[derive(Debug)] #[repr(transparent)] pub struct OutputStream { handle: _rt::Resource, } - impl OutputStream { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { @@ -9973,37 +9807,31 @@ pub mod wasi { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for 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")] + #[link(wasm_import_module = "wasi:io/streams@0.2.1")] extern "C" { #[link_name = "[resource-drop]output-stream"] fn drop(_: u32); } - drop(_handle); } } } - impl InputStream { #[allow(unused_unsafe, clippy::all)] /// Perform a non-blocking read from the stream. @@ -10036,15 +9864,16 @@ 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")] + #[link(wasm_import_module = "wasi:io/streams@0.2.1")] extern "C" { #[link_name = "[method]input-stream.read"] fn wit_import(_: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i64, _: *mut u8) { unreachable!() @@ -10057,7 +9886,6 @@ pub mod wasi { 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) }; Ok(e) @@ -10069,8 +9897,9 @@ pub mod wasi { 0 => { let e7 = { let l6 = *ptr0.add(8).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l6 as u32) + super::super::super::wasi::io::error::Error::from_handle( + l6 as u32, + ) }; StreamError::LastOperationFailed(e7) } @@ -10079,7 +9908,6 @@ pub mod wasi { StreamError::Closed } }; - v7 }; Err(e) @@ -10093,19 +9921,23 @@ 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]); + 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")] + #[link(wasm_import_module = "wasi:io/streams@0.2.1")] extern "C" { #[link_name = "[method]input-stream.blocking-read"] fn wit_import(_: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i64, _: *mut u8) { unreachable!() @@ -10118,7 +9950,6 @@ pub mod wasi { 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) }; Ok(e) @@ -10130,8 +9961,9 @@ pub mod wasi { 0 => { let e7 = { let l6 = *ptr0.add(8).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l6 as u32) + super::super::super::wasi::io::error::Error::from_handle( + l6 as u32, + ) }; StreamError::LastOperationFailed(e7) } @@ -10140,7 +9972,6 @@ pub mod wasi { StreamError::Closed } }; - v7 }; Err(e) @@ -10160,15 +9991,16 @@ 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")] + #[link(wasm_import_module = "wasi:io/streams@0.2.1")] extern "C" { #[link_name = "[method]input-stream.skip"] fn wit_import(_: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i64, _: *mut u8) { unreachable!() @@ -10179,7 +10011,6 @@ pub mod wasi { 0 => { let e = { let l2 = *ptr0.add(8).cast::(); - l2 as u64 }; Ok(e) @@ -10191,8 +10022,9 @@ pub mod wasi { 0 => { let e5 = { let l4 = *ptr0.add(12).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l4 as u32) + super::super::super::wasi::io::error::Error::from_handle( + l4 as u32, + ) }; StreamError::LastOperationFailed(e5) } @@ -10201,7 +10033,6 @@ pub mod wasi { StreamError::Closed } }; - v5 }; Err(e) @@ -10219,15 +10050,16 @@ 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")] + #[link(wasm_import_module = "wasi:io/streams@0.2.1")] extern "C" { #[link_name = "[method]input-stream.blocking-skip"] fn wit_import(_: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i64, _: *mut u8) { unreachable!() @@ -10238,7 +10070,6 @@ pub mod wasi { 0 => { let e = { let l2 = *ptr0.add(8).cast::(); - l2 as u64 }; Ok(e) @@ -10250,8 +10081,9 @@ pub mod wasi { 0 => { let e5 = { let l4 = *ptr0.add(12).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l4 as u32) + super::super::super::wasi::io::error::Error::from_handle( + l4 as u32, + ) }; StreamError::LastOperationFailed(e5) } @@ -10260,7 +10092,6 @@ pub mod wasi { StreamError::Closed } }; - v5 }; Err(e) @@ -10281,18 +10112,19 @@ pub mod wasi { pub fn subscribe(&self) -> Pollable { unsafe { #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:io/streams@0.2.0")] + #[link(wasm_import_module = "wasi:io/streams@0.2.1")] extern "C" { #[link_name = "[method]input-stream.subscribe"] fn wit_import(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) -> i32 { unreachable!() } let ret = wit_import((self).handle() as i32); - super::super::super::wasi::io::poll::Pollable::from_handle(ret as u32) + super::super::super::wasi::io::poll::Pollable::from_handle( + ret as u32, + ) } } } @@ -10311,15 +10143,16 @@ 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")] + #[link(wasm_import_module = "wasi:io/streams@0.2.1")] extern "C" { #[link_name = "[method]output-stream.check-write"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -10330,7 +10163,6 @@ pub mod wasi { 0 => { let e = { let l2 = *ptr0.add(8).cast::(); - l2 as u64 }; Ok(e) @@ -10342,8 +10174,9 @@ pub mod wasi { 0 => { let e5 = { let l4 = *ptr0.add(12).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l4 as u32) + super::super::super::wasi::io::error::Error::from_handle( + l4 as u32, + ) }; StreamError::LastOperationFailed(e5) } @@ -10352,7 +10185,6 @@ pub mod wasi { StreamError::Closed } }; - v5 }; Err(e) @@ -10381,18 +10213,19 @@ 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")] + #[link(wasm_import_module = "wasi:io/streams@0.2.1")] extern "C" { #[link_name = "[method]output-stream.write"] fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8) { unreachable!() @@ -10411,8 +10244,9 @@ pub mod wasi { 0 => { let e5 = { let l4 = *ptr1.add(8).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l4 as u32) + super::super::super::wasi::io::error::Error::from_handle( + l4 as u32, + ) }; StreamError::LastOperationFailed(e5) } @@ -10421,7 +10255,6 @@ pub mod wasi { StreamError::Closed } }; - v5 }; Err(e) @@ -10457,22 +10290,26 @@ 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")] + #[link(wasm_import_module = "wasi:io/streams@0.2.1")] extern "C" { #[link_name = "[method]output-stream.blocking-write-and-flush"] fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8) { unreachable!() @@ -10491,8 +10328,9 @@ pub mod wasi { 0 => { let e5 = { let l4 = *ptr1.add(8).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l4 as u32) + super::super::super::wasi::io::error::Error::from_handle( + l4 as u32, + ) }; StreamError::LastOperationFailed(e5) } @@ -10501,7 +10339,6 @@ pub mod wasi { StreamError::Closed } }; - v5 }; Err(e) @@ -10527,15 +10364,16 @@ 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")] + #[link(wasm_import_module = "wasi:io/streams@0.2.1")] extern "C" { #[link_name = "[method]output-stream.flush"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -10554,8 +10392,9 @@ pub mod wasi { 0 => { let e4 = { let l3 = *ptr0.add(8).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l3 as u32) + super::super::super::wasi::io::error::Error::from_handle( + l3 as u32, + ) }; StreamError::LastOperationFailed(e4) } @@ -10564,7 +10403,6 @@ pub mod wasi { StreamError::Closed } }; - v4 }; Err(e) @@ -10582,15 +10420,16 @@ 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")] + #[link(wasm_import_module = "wasi:io/streams@0.2.1")] extern "C" { #[link_name = "[method]output-stream.blocking-flush"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -10609,8 +10448,9 @@ pub mod wasi { 0 => { let e4 = { let l3 = *ptr0.add(8).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l3 as u32) + super::super::super::wasi::io::error::Error::from_handle( + l3 as u32, + ) }; StreamError::LastOperationFailed(e4) } @@ -10619,7 +10459,6 @@ pub mod wasi { StreamError::Closed } }; - v4 }; Err(e) @@ -10632,7 +10471,7 @@ pub mod wasi { impl OutputStream { #[allow(unused_unsafe, clippy::all)] /// Create a `pollable` which will resolve once the output-stream - /// is ready for more writing, or an error has occured. When this + /// is ready for more writing, or an error has occurred. When this /// pollable is ready, `check-write` will return `ok(n)` with n>0, or an /// error. /// @@ -10644,18 +10483,19 @@ pub mod wasi { pub fn subscribe(&self) -> Pollable { unsafe { #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:io/streams@0.2.0")] + #[link(wasm_import_module = "wasi:io/streams@0.2.1")] extern "C" { #[link_name = "[method]output-stream.subscribe"] fn wit_import(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) -> i32 { unreachable!() } let ret = wit_import((self).handle() as i32); - super::super::super::wasi::io::poll::Pollable::from_handle(ret as u32) + super::super::super::wasi::io::poll::Pollable::from_handle( + ret as u32, + ) } } } @@ -10671,15 +10511,16 @@ 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")] + #[link(wasm_import_module = "wasi:io/streams@0.2.1")] extern "C" { #[link_name = "[method]output-stream.write-zeroes"] fn wit_import(_: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i64, _: *mut u8) { unreachable!() @@ -10698,8 +10539,9 @@ pub mod wasi { 0 => { let e4 = { let l3 = *ptr0.add(8).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l3 as u32) + super::super::super::wasi::io::error::Error::from_handle( + l3 as u32, + ) }; StreamError::LastOperationFailed(e4) } @@ -10708,7 +10550,6 @@ pub mod wasi { StreamError::Closed } }; - v4 }; Err(e) @@ -10744,19 +10585,23 @@ 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")] + #[link(wasm_import_module = "wasi:io/streams@0.2.1")] extern "C" { #[link_name = "[method]output-stream.blocking-write-zeroes-and-flush"] fn wit_import(_: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i64, _: *mut u8) { unreachable!() @@ -10775,8 +10620,9 @@ pub mod wasi { 0 => { let e4 = { let l3 = *ptr0.add(8).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l3 as u32) + super::super::super::wasi::io::error::Error::from_handle( + l3 as u32, + ) }; StreamError::LastOperationFailed(e4) } @@ -10785,7 +10631,6 @@ pub mod wasi { StreamError::Closed } }; - v4 }; Err(e) @@ -10799,7 +10644,7 @@ pub mod wasi { #[allow(unused_unsafe, clippy::all)] /// Read from one stream and write to another. /// - /// The behavior of splice is equivelant to: + /// The behavior of splice is equivalent to: /// 1. calling `check-write` on the `output-stream` /// 2. calling `read` on the `input-stream` with the smaller of the /// `check-write` permitted length and the `len` provided to `splice` @@ -10810,19 +10655,24 @@ 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")] + #[link(wasm_import_module = "wasi:io/streams@0.2.1")] extern "C" { #[link_name = "[method]output-stream.splice"] fn wit_import(_: i32, _: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i32, _: i64, _: *mut u8) { unreachable!() @@ -10838,7 +10688,6 @@ pub mod wasi { 0 => { let e = { let l2 = *ptr0.add(8).cast::(); - l2 as u64 }; Ok(e) @@ -10850,8 +10699,9 @@ pub mod wasi { 0 => { let e5 = { let l4 = *ptr0.add(12).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l4 as u32) + super::super::super::wasi::io::error::Error::from_handle( + l4 as u32, + ) }; StreamError::LastOperationFailed(e5) } @@ -10860,7 +10710,6 @@ pub mod wasi { StreamError::Closed } }; - v5 }; Err(e) @@ -10885,15 +10734,16 @@ 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")] + #[link(wasm_import_module = "wasi:io/streams@0.2.1")] extern "C" { #[link_name = "[method]output-stream.blocking-splice"] fn wit_import(_: i32, _: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i32, _: i64, _: *mut u8) { unreachable!() @@ -10909,7 +10759,6 @@ pub mod wasi { 0 => { let e = { let l2 = *ptr0.add(8).cast::(); - l2 as u64 }; Ok(e) @@ -10921,8 +10770,9 @@ pub mod wasi { 0 => { let e5 = { let l4 = *ptr0.add(12).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l4 as u32) + super::super::super::wasi::io::error::Error::from_handle( + l4 as u32, + ) }; StreamError::LastOperationFailed(e5) } @@ -10931,7 +10781,6 @@ pub mod wasi { StreamError::Closed } }; - v5 }; Err(e) @@ -10950,8 +10799,7 @@ pub mod wasi { #[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. @@ -10973,12 +10821,11 @@ pub mod wasi { 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:random/random@0.2.0")] + #[link(wasm_import_module = "wasi:random/random@0.2.1")] extern "C" { #[link_name = "get-random-bytes"] fn wit_import(_: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i64, _: *mut u8) { unreachable!() @@ -10998,12 +10845,11 @@ pub mod wasi { pub fn get_random_u64() -> u64 { unsafe { #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:random/random@0.2.0")] + #[link(wasm_import_module = "wasi:random/random@0.2.1")] extern "C" { #[link_name = "get-random-u64"] fn wit_import() -> i64; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import() -> i64 { unreachable!() @@ -11013,14 +10859,12 @@ pub mod wasi { } } } - #[allow(dead_code, 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. @@ -11038,12 +10882,11 @@ pub mod wasi { 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:random/insecure@0.2.0")] + #[link(wasm_import_module = "wasi:random/insecure@0.2.1")] extern "C" { #[link_name = "get-insecure-random-bytes"] fn wit_import(_: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i64, _: *mut u8) { unreachable!() @@ -11063,12 +10906,11 @@ pub mod wasi { pub fn get_insecure_random_u64() -> u64 { unsafe { #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:random/insecure@0.2.0")] + #[link(wasm_import_module = "wasi:random/insecure@0.2.1")] extern "C" { #[link_name = "get-insecure-random-u64"] fn wit_import() -> i64; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import() -> i64 { unreachable!() @@ -11078,14 +10920,12 @@ pub mod wasi { } } } - #[allow(dead_code, 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. /// @@ -11111,12 +10951,11 @@ pub mod wasi { 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:random/insecure-seed@0.2.0")] + #[link(wasm_import_module = "wasi:random/insecure-seed@0.2.1")] extern "C" { #[link_name = "insecure-seed"] fn wit_import(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8) { unreachable!() @@ -11136,19 +10975,16 @@ pub mod wasi { #[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; /// 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, } - impl Network { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { @@ -11156,37 +10992,31 @@ pub mod wasi { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for Network { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "wasi:sockets/network@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/network@0.2.1")] extern "C" { #[link_name = "[resource-drop]network"] fn drop(_: u32); } - drop(_handle); } } } - /// Error codes. /// /// In theory, every API can return any error code. @@ -11284,55 +11114,98 @@ pub mod wasi { 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()) @@ -11341,20 +11214,21 @@ pub mod wasi { } } 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) } } - #[cfg(feature = "std")] impl std::error::Error for ErrorCode {} - impl ErrorCode { - pub(crate) unsafe fn _lift(val: u8) -> 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, @@ -11377,12 +11251,10 @@ pub mod wasi { 18 => ErrorCode::NameUnresolvable, 19 => ErrorCode::TemporaryResolverFailure, 20 => ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), } } } - #[repr(u8)] #[derive(Clone, Copy, Eq, PartialEq)] pub enum IpAddressFamily { @@ -11392,29 +11264,33 @@ pub mod wasi { 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(), - IpAddressFamily::Ipv6 => f.debug_tuple("IpAddressFamily::Ipv6").finish(), + IpAddressFamily::Ipv4 => { + f.debug_tuple("IpAddressFamily::Ipv4").finish() + } + IpAddressFamily::Ipv6 => { + f.debug_tuple("IpAddressFamily::Ipv6").finish() + } } } } - impl IpAddressFamily { - pub(crate) unsafe fn _lift(val: u8) -> 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)] @@ -11423,10 +11299,17 @@ pub mod wasi { 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(), - IpAddress::Ipv6(e) => f.debug_tuple("IpAddress::Ipv6").field(e).finish(), + IpAddress::Ipv4(e) => { + f.debug_tuple("IpAddress::Ipv4").field(e).finish() + } + IpAddress::Ipv6(e) => { + f.debug_tuple("IpAddress::Ipv6").field(e).finish() + } } } } @@ -11439,7 +11322,10 @@ pub mod wasi { 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) @@ -11459,7 +11345,10 @@ pub mod wasi { 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) @@ -11474,7 +11363,10 @@ pub mod wasi { 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() @@ -11486,43 +11378,40 @@ pub mod wasi { } } } - #[allow(dead_code, clippy::all)] pub mod instance_network { #[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 Network = super::super::super::wasi::sockets::network::Network; #[allow(unused_unsafe, clippy::all)] /// Get a handle to the default network. pub fn instance_network() -> Network { unsafe { #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:sockets/instance-network@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/instance-network@0.2.1")] extern "C" { #[link_name = "instance-network"] fn wit_import() -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import() -> i32 { unreachable!() } let ret = wit_import(); - super::super::super::wasi::sockets::network::Network::from_handle(ret as u32) + super::super::super::wasi::sockets::network::Network::from_handle( + ret as u32, + ) } } } - #[allow(dead_code, clippy::all)] pub mod udp { #[used] #[doc(hidden)] #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::__link_custom_section_describing_imports; use super::super::super::_rt; pub type Pollable = super::super::super::wasi::io::poll::Pollable; pub type Network = super::super::super::wasi::sockets::network::Network; @@ -11544,7 +11433,10 @@ pub mod wasi { 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) @@ -11566,7 +11458,10 @@ pub mod wasi { 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) @@ -11574,13 +11469,11 @@ pub mod wasi { } } /// A UDP socket handle. - #[derive(Debug)] #[repr(transparent)] pub struct UdpSocket { handle: _rt::Resource, } - impl UdpSocket { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { @@ -11588,43 +11481,36 @@ pub mod wasi { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for UdpSocket { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "wasi:sockets/udp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/udp@0.2.1")] extern "C" { #[link_name = "[resource-drop]udp-socket"] fn drop(_: u32); } - drop(_handle); } } } - #[derive(Debug)] #[repr(transparent)] pub struct IncomingDatagramStream { handle: _rt::Resource, } - impl IncomingDatagramStream { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { @@ -11632,43 +11518,36 @@ pub mod wasi { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for IncomingDatagramStream { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "wasi:sockets/udp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/udp@0.2.1")] extern "C" { #[link_name = "[resource-drop]incoming-datagram-stream"] fn drop(_: u32); } - drop(_handle); } } } - #[derive(Debug)] #[repr(transparent)] pub struct OutgoingDatagramStream { handle: _rt::Resource, } - impl OutgoingDatagramStream { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { @@ -11676,37 +11555,31 @@ pub mod wasi { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for OutgoingDatagramStream { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "wasi:sockets/udp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/udp@0.2.1")] extern "C" { #[link_name = "[resource-drop]outgoing-datagram-stream"] fn drop(_: u32); } - drop(_handle); } } } - impl UdpSocket { #[allow(unused_unsafe, clippy::all)] /// Bind the socket to a specific network on the provided IP address and port. @@ -11743,7 +11616,9 @@ pub mod wasi { 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], + ); use super::super::super::wasi::sockets::network::IpSocketAddress as V4; let ( result5_0, @@ -11760,9 +11635,11 @@ pub mod wasi { result5_11, ) = match local_address { V4::Ipv4(e) => { - let super::super::super::wasi::sockets::network::Ipv4SocketAddress{ port:port0, address:address0, } = e; + let super::super::super::wasi::sockets::network::Ipv4SocketAddress { + port: port0, + address: address0, + } = e; let (t1_0, t1_1, t1_2, t1_3) = address0; - ( 0i32, _rt::as_i32(port0), @@ -11779,9 +11656,13 @@ pub mod wasi { ) } V4::Ipv6(e) => { - let super::super::super::wasi::sockets::network::Ipv6SocketAddress{ port:port2, flow_info:flow_info2, address:address2, scope_id:scope_id2, } = e; + let super::super::super::wasi::sockets::network::Ipv6SocketAddress { + port: port2, + flow_info: flow_info2, + address: address2, + scope_id: scope_id2, + } = e; let (t3_0, t3_1, t3_2, t3_3, t3_4, t3_5, t3_6, t3_7) = address2; - ( 1i32, _rt::as_i32(port2), @@ -11800,7 +11681,7 @@ pub mod wasi { }; let ptr6 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:sockets/udp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/udp@0.2.1")] extern "C" { #[link_name = "[method]udp-socket.start-bind"] fn wit_import( @@ -11821,7 +11702,6 @@ pub mod wasi { _: *mut u8, ); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import( _: i32, @@ -11868,7 +11748,6 @@ pub mod wasi { 1 => { let e = { let l8 = i32::from(*ptr6.add(1).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l8 as u8, ) @@ -11886,15 +11765,16 @@ pub mod wasi { 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:sockets/udp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/udp@0.2.1")] extern "C" { #[link_name = "[method]udp-socket.finish-bind"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -11909,7 +11789,6 @@ pub mod wasi { 1 => { let e = { let l2 = i32::from(*ptr0.add(1).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l2 as u8, ) @@ -11966,12 +11845,16 @@ pub mod wasi { pub fn stream( &self, remote_address: Option, - ) -> Result<(IncomingDatagramStream, OutgoingDatagramStream), ErrorCode> - { + ) -> Result< + (IncomingDatagramStream, OutgoingDatagramStream), + ErrorCode, + > { 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 ( result6_0, result6_1, @@ -12004,9 +11887,11 @@ pub mod wasi { result5_11, ) = match e { V4::Ipv4(e) => { - let super::super::super::wasi::sockets::network::Ipv4SocketAddress{ port:port0, address:address0, } = e; + let super::super::super::wasi::sockets::network::Ipv4SocketAddress { + port: port0, + address: address0, + } = e; let (t1_0, t1_1, t1_2, t1_3) = address0; - ( 0i32, _rt::as_i32(port0), @@ -12023,10 +11908,13 @@ pub mod wasi { ) } V4::Ipv6(e) => { - let super::super::super::wasi::sockets::network::Ipv6SocketAddress{ port:port2, flow_info:flow_info2, address:address2, scope_id:scope_id2, } = e; - let (t3_0, t3_1, t3_2, t3_3, t3_4, t3_5, t3_6, t3_7) = - address2; - + let super::super::super::wasi::sockets::network::Ipv6SocketAddress { + port: port2, + flow_info: flow_info2, + address: address2, + scope_id: scope_id2, + } = e; + let (t3_0, t3_1, t3_2, t3_3, t3_4, t3_5, t3_6, t3_7) = address2; ( 1i32, _rt::as_i32(port2), @@ -12043,21 +11931,43 @@ pub mod wasi { ) } }; - ( - 1i32, result5_0, result5_1, result5_2, result5_3, result5_4, - result5_5, result5_6, result5_7, result5_8, result5_9, - result5_10, result5_11, + 1i32, + result5_0, + result5_1, + result5_2, + result5_3, + result5_4, + result5_5, + result5_6, + result5_7, + result5_8, + result5_9, + result5_10, + result5_11, + ) + } + None => { + ( + 0i32, + 0i32, + 0i32, + 0i32, + 0i32, + 0i32, + 0i32, + 0i32, + 0i32, + 0i32, + 0i32, + 0i32, + 0i32, ) } - None => ( - 0i32, 0i32, 0i32, 0i32, 0i32, 0i32, 0i32, 0i32, 0i32, 0i32, 0i32, - 0i32, 0i32, - ), }; let ptr7 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:sockets/udp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/udp@0.2.1")] extern "C" { #[link_name = "[method]udp-socket.stream"] fn wit_import( @@ -12078,7 +11988,6 @@ pub mod wasi { _: *mut u8, ); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import( _: i32, @@ -12122,7 +12031,6 @@ pub mod wasi { let e = { let l9 = *ptr7.add(4).cast::(); let l10 = *ptr7.add(8).cast::(); - ( IncomingDatagramStream::from_handle(l9 as u32), OutgoingDatagramStream::from_handle(l10 as u32), @@ -12133,7 +12041,6 @@ pub mod wasi { 1 => { let e = { let l11 = i32::from(*ptr7.add(4).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l11 as u8, ) @@ -12167,15 +12074,16 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 36]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 36]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 36], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:sockets/udp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/udp@0.2.1")] extern "C" { #[link_name = "[method]udp-socket.local-address"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -12195,11 +12103,10 @@ pub mod wasi { let l5 = i32::from(*ptr0.add(11).cast::()); let l6 = i32::from(*ptr0.add(12).cast::()); let l7 = i32::from(*ptr0.add(13).cast::()); - - super::super::super::wasi::sockets::network::Ipv4SocketAddress{ - port: l3 as u16, - address: (l4 as u8, l5 as u8, l6 as u8, l7 as u8), - } + super::super::super::wasi::sockets::network::Ipv4SocketAddress { + port: l3 as u16, + address: (l4 as u8, l5 as u8, l6 as u8, l7 as u8), + } }; V19::Ipv4(e19) } @@ -12217,18 +12124,25 @@ pub mod wasi { let l16 = i32::from(*ptr0.add(28).cast::()); let l17 = i32::from(*ptr0.add(30).cast::()); let l18 = *ptr0.add(32).cast::(); - - super::super::super::wasi::sockets::network::Ipv6SocketAddress{ - port: l8 as u16, - flow_info: l9 as u32, - address: (l10 as u16, l11 as u16, l12 as u16, l13 as u16, l14 as u16, l15 as u16, l16 as u16, l17 as u16), - scope_id: l18 as u32, - } + super::super::super::wasi::sockets::network::Ipv6SocketAddress { + port: l8 as u16, + flow_info: l9 as u32, + address: ( + l10 as u16, + l11 as u16, + l12 as u16, + l13 as u16, + l14 as u16, + l15 as u16, + l16 as u16, + l17 as u16, + ), + scope_id: l18 as u32, + } }; V19::Ipv6(e19) } }; - v19 }; Ok(e) @@ -12236,7 +12150,6 @@ pub mod wasi { 1 => { let e = { let l20 = i32::from(*ptr0.add(4).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l20 as u8, ) @@ -12264,15 +12177,16 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 36]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 36]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 36], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:sockets/udp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/udp@0.2.1")] extern "C" { #[link_name = "[method]udp-socket.remote-address"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -12292,11 +12206,10 @@ pub mod wasi { let l5 = i32::from(*ptr0.add(11).cast::()); let l6 = i32::from(*ptr0.add(12).cast::()); let l7 = i32::from(*ptr0.add(13).cast::()); - - super::super::super::wasi::sockets::network::Ipv4SocketAddress{ - port: l3 as u16, - address: (l4 as u8, l5 as u8, l6 as u8, l7 as u8), - } + super::super::super::wasi::sockets::network::Ipv4SocketAddress { + port: l3 as u16, + address: (l4 as u8, l5 as u8, l6 as u8, l7 as u8), + } }; V19::Ipv4(e19) } @@ -12314,18 +12227,25 @@ pub mod wasi { let l16 = i32::from(*ptr0.add(28).cast::()); let l17 = i32::from(*ptr0.add(30).cast::()); let l18 = *ptr0.add(32).cast::(); - - super::super::super::wasi::sockets::network::Ipv6SocketAddress{ - port: l8 as u16, - flow_info: l9 as u32, - address: (l10 as u16, l11 as u16, l12 as u16, l13 as u16, l14 as u16, l15 as u16, l16 as u16, l17 as u16), - scope_id: l18 as u32, - } + super::super::super::wasi::sockets::network::Ipv6SocketAddress { + port: l8 as u16, + flow_info: l9 as u32, + address: ( + l10 as u16, + l11 as u16, + l12 as u16, + l13 as u16, + l14 as u16, + l15 as u16, + l16 as u16, + l17 as u16, + ), + scope_id: l18 as u32, + } }; V19::Ipv6(e19) } }; - v19 }; Ok(e) @@ -12333,7 +12253,6 @@ pub mod wasi { 1 => { let e = { let l20 = i32::from(*ptr0.add(4).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l20 as u8, ) @@ -12353,12 +12272,11 @@ pub mod wasi { pub fn address_family(&self) -> IpAddressFamily { unsafe { #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:sockets/udp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/udp@0.2.1")] extern "C" { #[link_name = "[method]udp-socket.address-family"] fn wit_import(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) -> i32 { unreachable!() @@ -12382,15 +12300,16 @@ pub mod wasi { 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:sockets/udp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/udp@0.2.1")] extern "C" { #[link_name = "[method]udp-socket.unicast-hop-limit"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -12401,7 +12320,6 @@ pub mod wasi { 0 => { let e = { let l2 = i32::from(*ptr0.add(1).cast::()); - l2 as u8 }; Ok(e) @@ -12409,7 +12327,6 @@ pub mod wasi { 1 => { let e = { let l3 = i32::from(*ptr0.add(1).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l3 as u8, ) @@ -12427,15 +12344,16 @@ pub mod wasi { 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:sockets/udp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/udp@0.2.1")] extern "C" { #[link_name = "[method]udp-socket.set-unicast-hop-limit"] fn wit_import(_: i32, _: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i32, _: *mut u8) { unreachable!() @@ -12450,7 +12368,6 @@ pub mod wasi { 1 => { let e = { let l2 = i32::from(*ptr0.add(1).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l2 as u8, ) @@ -12478,15 +12395,16 @@ 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:sockets/udp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/udp@0.2.1")] extern "C" { #[link_name = "[method]udp-socket.receive-buffer-size"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -12497,7 +12415,6 @@ pub mod wasi { 0 => { let e = { let l2 = *ptr0.add(8).cast::(); - l2 as u64 }; Ok(e) @@ -12505,7 +12422,6 @@ pub mod wasi { 1 => { let e = { let l3 = i32::from(*ptr0.add(8).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l3 as u8, ) @@ -12519,19 +12435,23 @@ pub mod wasi { } impl UdpSocket { #[allow(unused_unsafe, clippy::all)] - pub fn set_receive_buffer_size(&self, value: u64) -> Result<(), ErrorCode> { + pub fn set_receive_buffer_size( + &self, + value: u64, + ) -> Result<(), ErrorCode> { 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:sockets/udp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/udp@0.2.1")] extern "C" { #[link_name = "[method]udp-socket.set-receive-buffer-size"] fn wit_import(_: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i64, _: *mut u8) { unreachable!() @@ -12546,7 +12466,6 @@ pub mod wasi { 1 => { let e = { let l2 = i32::from(*ptr0.add(1).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l2 as u8, ) @@ -12564,15 +12483,16 @@ 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:sockets/udp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/udp@0.2.1")] extern "C" { #[link_name = "[method]udp-socket.send-buffer-size"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -12583,7 +12503,6 @@ pub mod wasi { 0 => { let e = { let l2 = *ptr0.add(8).cast::(); - l2 as u64 }; Ok(e) @@ -12591,7 +12510,6 @@ pub mod wasi { 1 => { let e = { let l3 = i32::from(*ptr0.add(8).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l3 as u8, ) @@ -12609,15 +12527,16 @@ pub mod wasi { 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:sockets/udp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/udp@0.2.1")] extern "C" { #[link_name = "[method]udp-socket.set-send-buffer-size"] fn wit_import(_: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i64, _: *mut u8) { unreachable!() @@ -12632,7 +12551,6 @@ pub mod wasi { 1 => { let e = { let l2 = i32::from(*ptr0.add(1).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l2 as u8, ) @@ -12653,18 +12571,19 @@ pub mod wasi { pub fn subscribe(&self) -> Pollable { unsafe { #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:sockets/udp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/udp@0.2.1")] extern "C" { #[link_name = "[method]udp-socket.subscribe"] fn wit_import(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) -> i32 { unreachable!() } let ret = wit_import((self).handle() as i32); - super::super::super::wasi::io::poll::Pollable::from_handle(ret as u32) + super::super::super::wasi::io::poll::Pollable::from_handle( + ret as u32, + ) } } } @@ -12700,20 +12619,25 @@ 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:sockets/udp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/udp@0.2.1")] extern "C" { #[link_name = "[method]incoming-datagram-stream.receive"] fn wit_import(_: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i64, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, _rt::as_i64(&max_results), ptr0); + wit_import( + (self).handle() as i32, + _rt::as_i64(&max_results), + ptr0, + ); let l1 = i32::from(*ptr0.add(0).cast::()); match l1 { 0 => { @@ -12734,75 +12658,59 @@ pub mod wasi { let v24 = match l7 { 0 => { let e24 = { - let l8 = - i32::from(*base.add(12).cast::()); - let l9 = - i32::from(*base.add(14).cast::()); - let l10 = - i32::from(*base.add(15).cast::()); - let l11 = - i32::from(*base.add(16).cast::()); - let l12 = - i32::from(*base.add(17).cast::()); - - super::super::super::wasi::sockets::network::Ipv4SocketAddress{ - port: l8 as u16, - address: (l9 as u8, l10 as u8, l11 as u8, l12 as u8), - } + let l8 = i32::from(*base.add(12).cast::()); + let l9 = i32::from(*base.add(14).cast::()); + let l10 = i32::from(*base.add(15).cast::()); + let l11 = i32::from(*base.add(16).cast::()); + let l12 = i32::from(*base.add(17).cast::()); + super::super::super::wasi::sockets::network::Ipv4SocketAddress { + port: l8 as u16, + address: (l9 as u8, l10 as u8, l11 as u8, l12 as u8), + } }; V24::Ipv4(e24) } n => { - debug_assert_eq!( - n, 1, - "invalid enum discriminant" - ); + debug_assert_eq!(n, 1, "invalid enum discriminant"); let e24 = { - let l13 = - i32::from(*base.add(12).cast::()); + let l13 = i32::from(*base.add(12).cast::()); let l14 = *base.add(16).cast::(); - let l15 = - i32::from(*base.add(20).cast::()); - let l16 = - i32::from(*base.add(22).cast::()); - let l17 = - i32::from(*base.add(24).cast::()); - let l18 = - i32::from(*base.add(26).cast::()); - let l19 = - i32::from(*base.add(28).cast::()); - let l20 = - i32::from(*base.add(30).cast::()); - let l21 = - i32::from(*base.add(32).cast::()); - let l22 = - i32::from(*base.add(34).cast::()); + let l15 = i32::from(*base.add(20).cast::()); + let l16 = i32::from(*base.add(22).cast::()); + let l17 = i32::from(*base.add(24).cast::()); + let l18 = i32::from(*base.add(26).cast::()); + let l19 = i32::from(*base.add(28).cast::()); + let l20 = i32::from(*base.add(30).cast::()); + let l21 = i32::from(*base.add(32).cast::()); + let l22 = i32::from(*base.add(34).cast::()); let l23 = *base.add(36).cast::(); - - super::super::super::wasi::sockets::network::Ipv6SocketAddress{ - port: l13 as u16, - flow_info: l14 as u32, - address: (l15 as u16, l16 as u16, l17 as u16, l18 as u16, l19 as u16, l20 as u16, l21 as u16, l22 as u16), - scope_id: l23 as u32, - } + super::super::super::wasi::sockets::network::Ipv6SocketAddress { + port: l13 as u16, + flow_info: l14 as u32, + address: ( + l15 as u16, + l16 as u16, + l17 as u16, + l18 as u16, + l19 as u16, + l20 as u16, + l21 as u16, + l22 as u16, + ), + scope_id: l23 as u32, + } }; V24::Ipv6(e24) } }; - IncomingDatagram { - data: _rt::Vec::from_raw_parts( - l4.cast(), - len6, - len6, - ), + data: _rt::Vec::from_raw_parts(l4.cast(), len6, len6), remote_address: v24, } }; result25.push(e25); } _rt::cabi_dealloc(base25, len25 * 40, 4); - result25 }; Ok(e) @@ -12810,7 +12718,6 @@ pub mod wasi { 1 => { let e = { let l26 = i32::from(*ptr0.add(4).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l26 as u8, ) @@ -12831,18 +12738,19 @@ pub mod wasi { pub fn subscribe(&self) -> Pollable { unsafe { #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:sockets/udp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/udp@0.2.1")] extern "C" { #[link_name = "[method]incoming-datagram-stream.subscribe"] fn wit_import(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) -> i32 { unreachable!() } let ret = wit_import((self).handle() as i32); - super::super::super::wasi::io::poll::Pollable::from_handle(ret as u32) + super::super::super::wasi::io::poll::Pollable::from_handle( + ret as u32, + ) } } } @@ -12863,15 +12771,16 @@ 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:sockets/udp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/udp@0.2.1")] extern "C" { #[link_name = "[method]outgoing-datagram-stream.check-send"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -12882,7 +12791,6 @@ pub mod wasi { 0 => { let e = { let l2 = *ptr0.add(8).cast::(); - l2 as u64 }; Ok(e) @@ -12890,7 +12798,6 @@ pub mod wasi { 1 => { let e = { let l3 = i32::from(*ptr0.add(8).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l3 as u8, ) @@ -12938,15 +12845,22 @@ pub mod wasi { /// - /// - /// - - pub fn send(&self, datagrams: &[OutgoingDatagram]) -> Result { + pub fn send( + &self, + datagrams: &[OutgoingDatagram], + ) -> 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 vec7 = datagrams; let len7 = vec7.len(); - let layout7 = - _rt::alloc::Layout::from_size_align_unchecked(vec7.len() * 44, 4); + let layout7 = _rt::alloc::Layout::from_size_align_unchecked( + vec7.len() * 44, + 4, + ); let result7 = if layout7.size() != 0 { let ptr = _rt::alloc::alloc(layout7).cast::(); if ptr.is_null() { @@ -12954,9 +12868,7 @@ pub mod wasi { } ptr } else { - { - ::core::ptr::null_mut() - } + { ::core::ptr::null_mut() } }; for (i, e) in vec7.into_iter().enumerate() { let base = result7.add(i * 44); @@ -12977,54 +12889,37 @@ pub mod wasi { match e { V6::Ipv4(e) => { *base.add(12).cast::() = (0i32) as u8; - let super::super::super::wasi::sockets::network::Ipv4SocketAddress{ port:port2, address:address2, } = e; - *base.add(16).cast::() = - (_rt::as_i32(port2)) as u16; + let super::super::super::wasi::sockets::network::Ipv4SocketAddress { + port: port2, + address: address2, + } = e; + *base.add(16).cast::() = (_rt::as_i32(port2)) as u16; let (t3_0, t3_1, t3_2, t3_3) = address2; - *base.add(18).cast::() = - (_rt::as_i32(t3_0)) as u8; - *base.add(19).cast::() = - (_rt::as_i32(t3_1)) as u8; - *base.add(20).cast::() = - (_rt::as_i32(t3_2)) as u8; - *base.add(21).cast::() = - (_rt::as_i32(t3_3)) as u8; + *base.add(18).cast::() = (_rt::as_i32(t3_0)) as u8; + *base.add(19).cast::() = (_rt::as_i32(t3_1)) as u8; + *base.add(20).cast::() = (_rt::as_i32(t3_2)) as u8; + *base.add(21).cast::() = (_rt::as_i32(t3_3)) as u8; } V6::Ipv6(e) => { *base.add(12).cast::() = (1i32) as u8; - let super::super::super::wasi::sockets::network::Ipv6SocketAddress{ port:port4, flow_info:flow_info4, address:address4, scope_id:scope_id4, } = e; - *base.add(16).cast::() = - (_rt::as_i32(port4)) as u16; - *base.add(20).cast::() = - _rt::as_i32(flow_info4); - let ( - t5_0, - t5_1, - t5_2, - t5_3, - t5_4, - t5_5, - t5_6, - t5_7, - ) = address4; - *base.add(24).cast::() = - (_rt::as_i32(t5_0)) as u16; - *base.add(26).cast::() = - (_rt::as_i32(t5_1)) as u16; - *base.add(28).cast::() = - (_rt::as_i32(t5_2)) as u16; - *base.add(30).cast::() = - (_rt::as_i32(t5_3)) as u16; - *base.add(32).cast::() = - (_rt::as_i32(t5_4)) as u16; - *base.add(34).cast::() = - (_rt::as_i32(t5_5)) as u16; - *base.add(36).cast::() = - (_rt::as_i32(t5_6)) as u16; - *base.add(38).cast::() = - (_rt::as_i32(t5_7)) as u16; - *base.add(40).cast::() = - _rt::as_i32(scope_id4); + let super::super::super::wasi::sockets::network::Ipv6SocketAddress { + port: port4, + flow_info: flow_info4, + address: address4, + scope_id: scope_id4, + } = e; + *base.add(16).cast::() = (_rt::as_i32(port4)) as u16; + *base.add(20).cast::() = _rt::as_i32(flow_info4); + let (t5_0, t5_1, t5_2, t5_3, t5_4, t5_5, t5_6, t5_7) = address4; + *base.add(24).cast::() = (_rt::as_i32(t5_0)) as u16; + *base.add(26).cast::() = (_rt::as_i32(t5_1)) as u16; + *base.add(28).cast::() = (_rt::as_i32(t5_2)) as u16; + *base.add(30).cast::() = (_rt::as_i32(t5_3)) as u16; + *base.add(32).cast::() = (_rt::as_i32(t5_4)) as u16; + *base.add(34).cast::() = (_rt::as_i32(t5_5)) as u16; + *base.add(36).cast::() = (_rt::as_i32(t5_6)) as u16; + *base.add(38).cast::() = (_rt::as_i32(t5_7)) as u16; + *base.add(40).cast::() = _rt::as_i32(scope_id4); } } } @@ -13036,12 +12931,11 @@ pub mod wasi { } let ptr8 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:sockets/udp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/udp@0.2.1")] extern "C" { #[link_name = "[method]outgoing-datagram-stream.send"] fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8) { unreachable!() @@ -13055,7 +12949,6 @@ pub mod wasi { 0 => { let e = { let l10 = *ptr8.add(8).cast::(); - l10 as u64 }; Ok(e) @@ -13063,7 +12956,6 @@ pub mod wasi { 1 => { let e = { let l11 = i32::from(*ptr8.add(8).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l11 as u8, ) @@ -13084,30 +12976,29 @@ pub mod wasi { pub fn subscribe(&self) -> Pollable { unsafe { #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:sockets/udp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/udp@0.2.1")] extern "C" { #[link_name = "[method]outgoing-datagram-stream.subscribe"] fn wit_import(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) -> i32 { unreachable!() } let ret = wit_import((self).handle() as i32); - super::super::super::wasi::io::poll::Pollable::from_handle(ret as u32) + super::super::super::wasi::io::poll::Pollable::from_handle( + ret as u32, + ) } } } } - #[allow(dead_code, clippy::all)] pub mod udp_create_socket { #[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 ErrorCode = super::super::super::wasi::sockets::network::ErrorCode; pub type IpAddressFamily = super::super::super::wasi::sockets::network::IpAddressFamily; @@ -13142,12 +13033,11 @@ pub mod wasi { 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:sockets/udp-create-socket@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/udp-create-socket@0.2.1")] extern "C" { #[link_name = "create-udp-socket"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -13158,7 +13048,6 @@ pub mod wasi { 0 => { let e = { let l2 = *ptr0.add(4).cast::(); - super::super::super::wasi::sockets::udp::UdpSocket::from_handle( l2 as u32, ) @@ -13168,7 +13057,6 @@ pub mod wasi { 1 => { let e = { let l3 = i32::from(*ptr0.add(4).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l3 as u8, ) @@ -13180,14 +13068,12 @@ pub mod wasi { } } } - #[allow(dead_code, clippy::all)] pub mod tcp { #[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 InputStream = super::super::super::wasi::io::streams::InputStream; pub type OutputStream = super::super::super::wasi::io::streams::OutputStream; @@ -13208,31 +13094,37 @@ pub mod wasi { 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::Receive => { + f.debug_tuple("ShutdownType::Receive").finish() + } + ShutdownType::Send => { + f.debug_tuple("ShutdownType::Send").finish() + } + ShutdownType::Both => { + f.debug_tuple("ShutdownType::Both").finish() + } } } } - impl ShutdownType { - pub(crate) unsafe fn _lift(val: u8) -> 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: @@ -13244,8 +13136,8 @@ pub mod wasi { /// - `connect-in-progress` /// - `connected` /// - `closed` - /// See - /// for a more information. + /// See + /// for more information. /// /// Note: Except where explicitly mentioned, whenever this documentation uses /// the term "bound" without backticks it actually means: in the `bound` state *or higher*. @@ -13254,13 +13146,11 @@ pub mod wasi { /// 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, } - impl TcpSocket { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { @@ -13268,37 +13158,31 @@ pub mod wasi { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for TcpSocket { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "wasi:sockets/tcp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/tcp@0.2.1")] extern "C" { #[link_name = "[resource-drop]tcp-socket"] fn drop(_: u32); } - drop(_handle); } } } - impl TcpSocket { #[allow(unused_unsafe, clippy::all)] /// Bind the socket to a specific network on the provided IP address and port. @@ -13347,7 +13231,9 @@ pub mod wasi { 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], + ); use super::super::super::wasi::sockets::network::IpSocketAddress as V4; let ( result5_0, @@ -13364,9 +13250,11 @@ pub mod wasi { result5_11, ) = match local_address { V4::Ipv4(e) => { - let super::super::super::wasi::sockets::network::Ipv4SocketAddress{ port:port0, address:address0, } = e; + let super::super::super::wasi::sockets::network::Ipv4SocketAddress { + port: port0, + address: address0, + } = e; let (t1_0, t1_1, t1_2, t1_3) = address0; - ( 0i32, _rt::as_i32(port0), @@ -13383,9 +13271,13 @@ pub mod wasi { ) } V4::Ipv6(e) => { - let super::super::super::wasi::sockets::network::Ipv6SocketAddress{ port:port2, flow_info:flow_info2, address:address2, scope_id:scope_id2, } = e; + let super::super::super::wasi::sockets::network::Ipv6SocketAddress { + port: port2, + flow_info: flow_info2, + address: address2, + scope_id: scope_id2, + } = e; let (t3_0, t3_1, t3_2, t3_3, t3_4, t3_5, t3_6, t3_7) = address2; - ( 1i32, _rt::as_i32(port2), @@ -13404,7 +13296,7 @@ pub mod wasi { }; let ptr6 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:sockets/tcp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/tcp@0.2.1")] extern "C" { #[link_name = "[method]tcp-socket.start-bind"] fn wit_import( @@ -13425,7 +13317,6 @@ pub mod wasi { _: *mut u8, ); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import( _: i32, @@ -13472,7 +13363,6 @@ pub mod wasi { 1 => { let e = { let l8 = i32::from(*ptr6.add(1).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l8 as u8, ) @@ -13490,15 +13380,16 @@ pub mod wasi { 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:sockets/tcp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/tcp@0.2.1")] extern "C" { #[link_name = "[method]tcp-socket.finish-bind"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -13513,7 +13404,6 @@ pub mod wasi { 1 => { let e = { let l2 = i32::from(*ptr0.add(1).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l2 as u8, ) @@ -13530,7 +13420,7 @@ pub mod wasi { /// Connect to a remote endpoint. /// /// On success: - /// - the socket is transitioned into the `connection` state. + /// - the socket is transitioned into the `connected` state. /// - a pair of streams is returned that can be used to read & write to the connection /// /// After a failed connection attempt, the socket will be in the `closed` @@ -13577,7 +13467,9 @@ pub mod wasi { 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], + ); use super::super::super::wasi::sockets::network::IpSocketAddress as V4; let ( result5_0, @@ -13594,9 +13486,11 @@ pub mod wasi { result5_11, ) = match remote_address { V4::Ipv4(e) => { - let super::super::super::wasi::sockets::network::Ipv4SocketAddress{ port:port0, address:address0, } = e; + let super::super::super::wasi::sockets::network::Ipv4SocketAddress { + port: port0, + address: address0, + } = e; let (t1_0, t1_1, t1_2, t1_3) = address0; - ( 0i32, _rt::as_i32(port0), @@ -13613,9 +13507,13 @@ pub mod wasi { ) } V4::Ipv6(e) => { - let super::super::super::wasi::sockets::network::Ipv6SocketAddress{ port:port2, flow_info:flow_info2, address:address2, scope_id:scope_id2, } = e; + let super::super::super::wasi::sockets::network::Ipv6SocketAddress { + port: port2, + flow_info: flow_info2, + address: address2, + scope_id: scope_id2, + } = e; let (t3_0, t3_1, t3_2, t3_3, t3_4, t3_5, t3_6, t3_7) = address2; - ( 1i32, _rt::as_i32(port2), @@ -13634,7 +13532,7 @@ pub mod wasi { }; let ptr6 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:sockets/tcp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/tcp@0.2.1")] extern "C" { #[link_name = "[method]tcp-socket.start-connect"] fn wit_import( @@ -13655,7 +13553,6 @@ pub mod wasi { _: *mut u8, ); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import( _: i32, @@ -13702,7 +13599,6 @@ pub mod wasi { 1 => { let e = { let l8 = i32::from(*ptr6.add(1).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l8 as u8, ) @@ -13716,19 +13612,22 @@ pub mod wasi { } impl TcpSocket { #[allow(unused_unsafe, clippy::all)] - pub fn finish_connect(&self) -> Result<(InputStream, OutputStream), ErrorCode> { + pub fn finish_connect( + &self, + ) -> Result<(InputStream, OutputStream), ErrorCode> { 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:sockets/tcp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/tcp@0.2.1")] extern "C" { #[link_name = "[method]tcp-socket.finish-connect"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -13740,15 +13639,20 @@ pub mod wasi { let e = { let l2 = *ptr0.add(4).cast::(); let l3 = *ptr0.add(8).cast::(); - - (super::super::super::wasi::io::streams::InputStream::from_handle(l2 as u32), super::super::super::wasi::io::streams::OutputStream::from_handle(l3 as u32)) + ( + super::super::super::wasi::io::streams::InputStream::from_handle( + l2 as u32, + ), + super::super::super::wasi::io::streams::OutputStream::from_handle( + l3 as u32, + ), + ) }; Ok(e) } 1 => { let e = { let l4 = i32::from(*ptr0.add(4).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l4 as u8, ) @@ -13791,15 +13695,16 @@ pub mod wasi { 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:sockets/tcp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/tcp@0.2.1")] extern "C" { #[link_name = "[method]tcp-socket.start-listen"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -13814,7 +13719,6 @@ pub mod wasi { 1 => { let e = { let l2 = i32::from(*ptr0.add(1).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l2 as u8, ) @@ -13832,15 +13736,16 @@ pub mod wasi { 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:sockets/tcp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/tcp@0.2.1")] extern "C" { #[link_name = "[method]tcp-socket.finish-listen"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -13855,7 +13760,6 @@ pub mod wasi { 1 => { let e = { let l2 = i32::from(*ptr0.add(1).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l2 as u8, ) @@ -13895,19 +13799,22 @@ pub mod wasi { /// - /// - /// - - pub fn accept(&self) -> Result<(TcpSocket, InputStream, OutputStream), ErrorCode> { + pub fn accept( + &self, + ) -> Result<(TcpSocket, InputStream, OutputStream), ErrorCode> { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 16]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 16]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 16], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:sockets/tcp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/tcp@0.2.1")] extern "C" { #[link_name = "[method]tcp-socket.accept"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -13920,15 +13827,21 @@ pub mod wasi { let l2 = *ptr0.add(4).cast::(); let l3 = *ptr0.add(8).cast::(); let l4 = *ptr0.add(12).cast::(); - - (TcpSocket::from_handle(l2 as u32), super::super::super::wasi::io::streams::InputStream::from_handle(l3 as u32), super::super::super::wasi::io::streams::OutputStream::from_handle(l4 as u32)) + ( + TcpSocket::from_handle(l2 as u32), + super::super::super::wasi::io::streams::InputStream::from_handle( + l3 as u32, + ), + super::super::super::wasi::io::streams::OutputStream::from_handle( + l4 as u32, + ), + ) }; Ok(e) } 1 => { let e = { let l5 = i32::from(*ptr0.add(4).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l5 as u8, ) @@ -13962,15 +13875,16 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 36]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 36]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 36], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:sockets/tcp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/tcp@0.2.1")] extern "C" { #[link_name = "[method]tcp-socket.local-address"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -13990,11 +13904,10 @@ pub mod wasi { let l5 = i32::from(*ptr0.add(11).cast::()); let l6 = i32::from(*ptr0.add(12).cast::()); let l7 = i32::from(*ptr0.add(13).cast::()); - - super::super::super::wasi::sockets::network::Ipv4SocketAddress{ - port: l3 as u16, - address: (l4 as u8, l5 as u8, l6 as u8, l7 as u8), - } + super::super::super::wasi::sockets::network::Ipv4SocketAddress { + port: l3 as u16, + address: (l4 as u8, l5 as u8, l6 as u8, l7 as u8), + } }; V19::Ipv4(e19) } @@ -14012,18 +13925,25 @@ pub mod wasi { let l16 = i32::from(*ptr0.add(28).cast::()); let l17 = i32::from(*ptr0.add(30).cast::()); let l18 = *ptr0.add(32).cast::(); - - super::super::super::wasi::sockets::network::Ipv6SocketAddress{ - port: l8 as u16, - flow_info: l9 as u32, - address: (l10 as u16, l11 as u16, l12 as u16, l13 as u16, l14 as u16, l15 as u16, l16 as u16, l17 as u16), - scope_id: l18 as u32, - } + super::super::super::wasi::sockets::network::Ipv6SocketAddress { + port: l8 as u16, + flow_info: l9 as u32, + address: ( + l10 as u16, + l11 as u16, + l12 as u16, + l13 as u16, + l14 as u16, + l15 as u16, + l16 as u16, + l17 as u16, + ), + scope_id: l18 as u32, + } }; V19::Ipv6(e19) } }; - v19 }; Ok(e) @@ -14031,7 +13951,6 @@ pub mod wasi { 1 => { let e = { let l20 = i32::from(*ptr0.add(4).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l20 as u8, ) @@ -14059,15 +13978,16 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 36]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 36]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 36], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:sockets/tcp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/tcp@0.2.1")] extern "C" { #[link_name = "[method]tcp-socket.remote-address"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -14087,11 +14007,10 @@ pub mod wasi { let l5 = i32::from(*ptr0.add(11).cast::()); let l6 = i32::from(*ptr0.add(12).cast::()); let l7 = i32::from(*ptr0.add(13).cast::()); - - super::super::super::wasi::sockets::network::Ipv4SocketAddress{ - port: l3 as u16, - address: (l4 as u8, l5 as u8, l6 as u8, l7 as u8), - } + super::super::super::wasi::sockets::network::Ipv4SocketAddress { + port: l3 as u16, + address: (l4 as u8, l5 as u8, l6 as u8, l7 as u8), + } }; V19::Ipv4(e19) } @@ -14109,18 +14028,25 @@ pub mod wasi { let l16 = i32::from(*ptr0.add(28).cast::()); let l17 = i32::from(*ptr0.add(30).cast::()); let l18 = *ptr0.add(32).cast::(); - - super::super::super::wasi::sockets::network::Ipv6SocketAddress{ - port: l8 as u16, - flow_info: l9 as u32, - address: (l10 as u16, l11 as u16, l12 as u16, l13 as u16, l14 as u16, l15 as u16, l16 as u16, l17 as u16), - scope_id: l18 as u32, - } + super::super::super::wasi::sockets::network::Ipv6SocketAddress { + port: l8 as u16, + flow_info: l9 as u32, + address: ( + l10 as u16, + l11 as u16, + l12 as u16, + l13 as u16, + l14 as u16, + l15 as u16, + l16 as u16, + l17 as u16, + ), + scope_id: l18 as u32, + } }; V19::Ipv6(e19) } }; - v19 }; Ok(e) @@ -14128,7 +14054,6 @@ pub mod wasi { 1 => { let e = { let l20 = i32::from(*ptr0.add(4).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l20 as u8, ) @@ -14148,12 +14073,11 @@ pub mod wasi { pub fn is_listening(&self) -> bool { unsafe { #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:sockets/tcp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/tcp@0.2.1")] extern "C" { #[link_name = "[method]tcp-socket.is-listening"] fn wit_import(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) -> i32 { unreachable!() @@ -14171,12 +14095,11 @@ pub mod wasi { pub fn address_family(&self) -> IpAddressFamily { unsafe { #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:sockets/tcp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/tcp@0.2.1")] extern "C" { #[link_name = "[method]tcp-socket.address-family"] fn wit_import(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) -> i32 { unreachable!() @@ -14199,19 +14122,23 @@ pub mod wasi { /// - `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. - pub fn set_listen_backlog_size(&self, value: u64) -> Result<(), ErrorCode> { + pub fn set_listen_backlog_size( + &self, + value: u64, + ) -> Result<(), ErrorCode> { 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:sockets/tcp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/tcp@0.2.1")] extern "C" { #[link_name = "[method]tcp-socket.set-listen-backlog-size"] fn wit_import(_: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i64, _: *mut u8) { unreachable!() @@ -14226,7 +14153,6 @@ pub mod wasi { 1 => { let e = { let l2 = i32::from(*ptr0.add(1).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l2 as u8, ) @@ -14253,15 +14179,16 @@ pub mod wasi { 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:sockets/tcp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/tcp@0.2.1")] extern "C" { #[link_name = "[method]tcp-socket.keep-alive-enabled"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -14272,7 +14199,6 @@ pub mod wasi { 0 => { let e = { let l2 = i32::from(*ptr0.add(1).cast::()); - _rt::bool_lift(l2 as u8) }; Ok(e) @@ -14280,7 +14206,6 @@ pub mod wasi { 1 => { let e = { let l3 = i32::from(*ptr0.add(1).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l3 as u8, ) @@ -14294,19 +14219,23 @@ pub mod wasi { } impl TcpSocket { #[allow(unused_unsafe, clippy::all)] - pub fn set_keep_alive_enabled(&self, value: bool) -> Result<(), ErrorCode> { + pub fn set_keep_alive_enabled( + &self, + value: bool, + ) -> Result<(), ErrorCode> { 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:sockets/tcp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/tcp@0.2.1")] extern "C" { #[link_name = "[method]tcp-socket.set-keep-alive-enabled"] fn wit_import(_: i32, _: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i32, _: *mut u8) { unreachable!() @@ -14328,7 +14257,6 @@ pub mod wasi { 1 => { let e = { let l2 = i32::from(*ptr0.add(1).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l2 as u8, ) @@ -14356,15 +14284,16 @@ 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:sockets/tcp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/tcp@0.2.1")] extern "C" { #[link_name = "[method]tcp-socket.keep-alive-idle-time"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -14375,7 +14304,6 @@ pub mod wasi { 0 => { let e = { let l2 = *ptr0.add(8).cast::(); - l2 as u64 }; Ok(e) @@ -14383,7 +14311,6 @@ pub mod wasi { 1 => { let e = { let l3 = i32::from(*ptr0.add(8).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l3 as u8, ) @@ -14397,19 +14324,23 @@ pub mod wasi { } impl TcpSocket { #[allow(unused_unsafe, clippy::all)] - pub fn set_keep_alive_idle_time(&self, value: Duration) -> Result<(), ErrorCode> { + pub fn set_keep_alive_idle_time( + &self, + value: Duration, + ) -> Result<(), ErrorCode> { 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:sockets/tcp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/tcp@0.2.1")] extern "C" { #[link_name = "[method]tcp-socket.set-keep-alive-idle-time"] fn wit_import(_: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i64, _: *mut u8) { unreachable!() @@ -14424,7 +14355,6 @@ pub mod wasi { 1 => { let e = { let l2 = i32::from(*ptr0.add(1).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l2 as u8, ) @@ -14452,15 +14382,16 @@ 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:sockets/tcp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/tcp@0.2.1")] extern "C" { #[link_name = "[method]tcp-socket.keep-alive-interval"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -14471,7 +14402,6 @@ pub mod wasi { 0 => { let e = { let l2 = *ptr0.add(8).cast::(); - l2 as u64 }; Ok(e) @@ -14479,7 +14409,6 @@ pub mod wasi { 1 => { let e = { let l3 = i32::from(*ptr0.add(8).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l3 as u8, ) @@ -14493,19 +14422,23 @@ pub mod wasi { } impl TcpSocket { #[allow(unused_unsafe, clippy::all)] - pub fn set_keep_alive_interval(&self, value: Duration) -> Result<(), ErrorCode> { + pub fn set_keep_alive_interval( + &self, + value: Duration, + ) -> Result<(), ErrorCode> { 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:sockets/tcp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/tcp@0.2.1")] extern "C" { #[link_name = "[method]tcp-socket.set-keep-alive-interval"] fn wit_import(_: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i64, _: *mut u8) { unreachable!() @@ -14520,7 +14453,6 @@ pub mod wasi { 1 => { let e = { let l2 = i32::from(*ptr0.add(1).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l2 as u8, ) @@ -14548,15 +14480,16 @@ 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:sockets/tcp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/tcp@0.2.1")] extern "C" { #[link_name = "[method]tcp-socket.keep-alive-count"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -14567,7 +14500,6 @@ pub mod wasi { 0 => { let e = { let l2 = *ptr0.add(4).cast::(); - l2 as u32 }; Ok(e) @@ -14575,7 +14507,6 @@ pub mod wasi { 1 => { let e = { let l3 = i32::from(*ptr0.add(4).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l3 as u8, ) @@ -14593,15 +14524,16 @@ pub mod wasi { 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:sockets/tcp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/tcp@0.2.1")] extern "C" { #[link_name = "[method]tcp-socket.set-keep-alive-count"] fn wit_import(_: i32, _: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i32, _: *mut u8) { unreachable!() @@ -14616,7 +14548,6 @@ pub mod wasi { 1 => { let e = { let l2 = i32::from(*ptr0.add(1).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l2 as u8, ) @@ -14640,15 +14571,16 @@ pub mod wasi { 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:sockets/tcp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/tcp@0.2.1")] extern "C" { #[link_name = "[method]tcp-socket.hop-limit"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -14659,7 +14591,6 @@ pub mod wasi { 0 => { let e = { let l2 = i32::from(*ptr0.add(1).cast::()); - l2 as u8 }; Ok(e) @@ -14667,7 +14598,6 @@ pub mod wasi { 1 => { let e = { let l3 = i32::from(*ptr0.add(1).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l3 as u8, ) @@ -14685,15 +14615,16 @@ pub mod wasi { 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:sockets/tcp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/tcp@0.2.1")] extern "C" { #[link_name = "[method]tcp-socket.set-hop-limit"] fn wit_import(_: i32, _: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i32, _: *mut u8) { unreachable!() @@ -14708,7 +14639,6 @@ pub mod wasi { 1 => { let e = { let l2 = i32::from(*ptr0.add(1).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l2 as u8, ) @@ -14736,15 +14666,16 @@ 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:sockets/tcp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/tcp@0.2.1")] extern "C" { #[link_name = "[method]tcp-socket.receive-buffer-size"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -14755,7 +14686,6 @@ pub mod wasi { 0 => { let e = { let l2 = *ptr0.add(8).cast::(); - l2 as u64 }; Ok(e) @@ -14763,7 +14693,6 @@ pub mod wasi { 1 => { let e = { let l3 = i32::from(*ptr0.add(8).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l3 as u8, ) @@ -14777,19 +14706,23 @@ pub mod wasi { } impl TcpSocket { #[allow(unused_unsafe, clippy::all)] - pub fn set_receive_buffer_size(&self, value: u64) -> Result<(), ErrorCode> { + pub fn set_receive_buffer_size( + &self, + value: u64, + ) -> Result<(), ErrorCode> { 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:sockets/tcp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/tcp@0.2.1")] extern "C" { #[link_name = "[method]tcp-socket.set-receive-buffer-size"] fn wit_import(_: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i64, _: *mut u8) { unreachable!() @@ -14804,7 +14737,6 @@ pub mod wasi { 1 => { let e = { let l2 = i32::from(*ptr0.add(1).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l2 as u8, ) @@ -14822,15 +14754,16 @@ 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:sockets/tcp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/tcp@0.2.1")] extern "C" { #[link_name = "[method]tcp-socket.send-buffer-size"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -14841,7 +14774,6 @@ pub mod wasi { 0 => { let e = { let l2 = *ptr0.add(8).cast::(); - l2 as u64 }; Ok(e) @@ -14849,7 +14781,6 @@ pub mod wasi { 1 => { let e = { let l3 = i32::from(*ptr0.add(8).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l3 as u8, ) @@ -14867,15 +14798,16 @@ pub mod wasi { 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:sockets/tcp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/tcp@0.2.1")] extern "C" { #[link_name = "[method]tcp-socket.set-send-buffer-size"] fn wit_import(_: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i64, _: *mut u8) { unreachable!() @@ -14890,7 +14822,6 @@ pub mod wasi { 1 => { let e = { let l2 = i32::from(*ptr0.add(1).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l2 as u8, ) @@ -14916,26 +14847,27 @@ pub mod wasi { /// `subscribe` only has to be called once per socket and can then be /// (re)used for the remainder of the socket's lifetime. /// - /// See - /// for a more information. + /// See + /// for more information. /// /// Note: this function is here for WASI Preview2 only. /// It's planned to be removed when `future` is natively supported in Preview3. pub fn subscribe(&self) -> Pollable { unsafe { #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:sockets/tcp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/tcp@0.2.1")] extern "C" { #[link_name = "[method]tcp-socket.subscribe"] fn wit_import(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) -> i32 { unreachable!() } let ret = wit_import((self).handle() as i32); - super::super::super::wasi::io::poll::Pollable::from_handle(ret as u32) + super::super::super::wasi::io::poll::Pollable::from_handle( + ret as u32, + ) } } } @@ -14951,7 +14883,7 @@ pub mod wasi { /// 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 + /// This function is idempotent; shutting down a direction more than once /// has no effect and returns `ok`. /// /// The shutdown function does not close (drop) the socket. @@ -14964,24 +14896,32 @@ pub mod wasi { /// - /// - /// - - pub fn shutdown(&self, shutdown_type: ShutdownType) -> Result<(), ErrorCode> { + pub fn shutdown( + &self, + shutdown_type: ShutdownType, + ) -> Result<(), ErrorCode> { 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 ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:sockets/tcp@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/tcp@0.2.1")] extern "C" { #[link_name = "[method]tcp-socket.shutdown"] fn wit_import(_: i32, _: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i32, _: *mut u8) { unreachable!() } - wit_import((self).handle() as i32, shutdown_type.clone() as i32, ptr0); + wit_import( + (self).handle() as i32, + shutdown_type.clone() as i32, + ptr0, + ); let l1 = i32::from(*ptr0.add(0).cast::()); match l1 { 0 => { @@ -14991,7 +14931,6 @@ pub mod wasi { 1 => { let e = { let l2 = i32::from(*ptr0.add(1).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l2 as u8, ) @@ -15004,14 +14943,12 @@ pub mod wasi { } } } - #[allow(dead_code, clippy::all)] pub mod tcp_create_socket { #[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 ErrorCode = super::super::super::wasi::sockets::network::ErrorCode; pub type IpAddressFamily = super::super::super::wasi::sockets::network::IpAddressFamily; @@ -15046,12 +14983,11 @@ pub mod wasi { 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:sockets/tcp-create-socket@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/tcp-create-socket@0.2.1")] extern "C" { #[link_name = "create-tcp-socket"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -15062,7 +14998,6 @@ pub mod wasi { 0 => { let e = { let l2 = *ptr0.add(4).cast::(); - super::super::super::wasi::sockets::tcp::TcpSocket::from_handle( l2 as u32, ) @@ -15072,7 +15007,6 @@ pub mod wasi { 1 => { let e = { let l3 = i32::from(*ptr0.add(4).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l3 as u8, ) @@ -15084,26 +15018,22 @@ pub mod wasi { } } } - #[allow(dead_code, clippy::all)] pub mod ip_name_lookup { #[used] #[doc(hidden)] #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::__link_custom_section_describing_imports; use super::super::super::_rt; pub type Pollable = super::super::super::wasi::io::poll::Pollable; pub type Network = super::super::super::wasi::sockets::network::Network; pub type ErrorCode = super::super::super::wasi::sockets::network::ErrorCode; pub type IpAddress = super::super::super::wasi::sockets::network::IpAddress; - #[derive(Debug)] #[repr(transparent)] pub struct ResolveAddressStream { handle: _rt::Resource, } - impl ResolveAddressStream { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { @@ -15111,37 +15041,31 @@ pub mod wasi { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for ResolveAddressStream { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { - #[link(wasm_import_module = "wasi:sockets/ip-name-lookup@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/ip-name-lookup@0.2.1")] extern "C" { #[link_name = "[resource-drop]resolve-address-stream"] fn drop(_: u32); } - drop(_handle); } } } - #[allow(unused_unsafe, clippy::all)] /// Resolve an internet host name to a list of IP addresses. /// @@ -15176,12 +15100,11 @@ pub mod wasi { let len0 = vec0.len(); let ptr1 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:sockets/ip-name-lookup@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/ip-name-lookup@0.2.1")] extern "C" { #[link_name = "resolve-addresses"] fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8) { unreachable!() @@ -15192,7 +15115,6 @@ pub mod wasi { 0 => { let e = { let l3 = *ptr1.add(4).cast::(); - ResolveAddressStream::from_handle(l3 as u32) }; Ok(e) @@ -15200,7 +15122,6 @@ pub mod wasi { 1 => { let e = { let l4 = i32::from(*ptr1.add(4).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l4 as u8, ) @@ -15226,19 +15147,22 @@ pub mod wasi { /// - `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) - pub fn resolve_next_address(&self) -> Result, ErrorCode> { + pub fn resolve_next_address( + &self, + ) -> Result, ErrorCode> { unsafe { #[repr(align(2))] struct RetArea([::core::mem::MaybeUninit; 22]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 22]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 22], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:sockets/ip-name-lookup@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/ip-name-lookup@0.2.1")] extern "C" { #[link_name = "[method]resolve-address-stream.resolve-next-address"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -15249,7 +15173,6 @@ pub mod wasi { 0 => { let e = { let l2 = i32::from(*ptr0.add(2).cast::()); - match l2 { 0 => None, 1 => { @@ -15259,64 +15182,39 @@ pub mod wasi { let v16 = match l3 { 0 => { let e16 = { - let l4 = i32::from( - *ptr0.add(6).cast::(), - ); - let l5 = i32::from( - *ptr0.add(7).cast::(), - ); - let l6 = i32::from( - *ptr0.add(8).cast::(), - ); - let l7 = i32::from( - *ptr0.add(9).cast::(), - ); - + let l4 = i32::from(*ptr0.add(6).cast::()); + let l5 = i32::from(*ptr0.add(7).cast::()); + let l6 = i32::from(*ptr0.add(8).cast::()); + let l7 = i32::from(*ptr0.add(9).cast::()); (l4 as u8, l5 as u8, l6 as u8, l7 as u8) }; V16::Ipv4(e16) } n => { - debug_assert_eq!( - n, 1, - "invalid enum discriminant" - ); + debug_assert_eq!(n, 1, "invalid enum discriminant"); let e16 = { - let l8 = i32::from( - *ptr0.add(6).cast::(), - ); - let l9 = i32::from( - *ptr0.add(8).cast::(), - ); - let l10 = i32::from( - *ptr0.add(10).cast::(), - ); - let l11 = i32::from( - *ptr0.add(12).cast::(), - ); - let l12 = i32::from( - *ptr0.add(14).cast::(), - ); - let l13 = i32::from( - *ptr0.add(16).cast::(), - ); - let l14 = i32::from( - *ptr0.add(18).cast::(), - ); - let l15 = i32::from( - *ptr0.add(20).cast::(), - ); - + let l8 = i32::from(*ptr0.add(6).cast::()); + let l9 = i32::from(*ptr0.add(8).cast::()); + let l10 = i32::from(*ptr0.add(10).cast::()); + let l11 = i32::from(*ptr0.add(12).cast::()); + let l12 = i32::from(*ptr0.add(14).cast::()); + let l13 = i32::from(*ptr0.add(16).cast::()); + let l14 = i32::from(*ptr0.add(18).cast::()); + let l15 = i32::from(*ptr0.add(20).cast::()); ( - l8 as u16, l9 as u16, l10 as u16, - l11 as u16, l12 as u16, l13 as u16, - l14 as u16, l15 as u16, + l8 as u16, + l9 as u16, + l10 as u16, + l11 as u16, + l12 as u16, + l13 as u16, + l14 as u16, + l15 as u16, ) }; V16::Ipv6(e16) } }; - v16 }; Some(e) @@ -15329,7 +15227,6 @@ pub mod wasi { 1 => { let e = { let l17 = i32::from(*ptr0.add(2).cast::()); - super::super::super::wasi::sockets::network::ErrorCode::_lift( l17 as u8, ) @@ -15350,18 +15247,19 @@ pub mod wasi { pub fn subscribe(&self) -> Pollable { unsafe { #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:sockets/ip-name-lookup@0.2.0")] + #[link(wasm_import_module = "wasi:sockets/ip-name-lookup@0.2.1")] extern "C" { #[link_name = "[method]resolve-address-stream.subscribe"] fn wit_import(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) -> i32 { unreachable!() } let ret = wit_import((self).handle() as i32); - super::super::super::wasi::io::poll::Pollable::from_handle(ret as u32) + super::super::super::wasi::io::poll::Pollable::from_handle( + ret as u32, + ) } } } @@ -15369,11 +15267,9 @@ pub mod wasi { } } mod _rt { - use core::fmt; use core::marker; use core::sync::atomic::{AtomicU32, Ordering::Relaxed}; - /// A type which represents a component model resource, either imported or /// exported into this component. /// @@ -15388,25 +15284,18 @@ 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. /// /// This generally is implemented by generated code, not user-facing code. + #[allow(clippy::missing_safety_doc)] pub unsafe trait WasmResource { /// Invokes the `[resource-drop]...` intrinsic. unsafe fn drop(handle: u32); } - impl Resource { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { @@ -15416,7 +15305,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 @@ -15433,31 +15321,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), } } @@ -15474,30 +15352,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 { @@ -15524,72 +15397,61 @@ 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 { @@ -15598,23 +15460,22 @@ mod _rt { } extern crate alloc as alloc_crate; } - #[cfg(target_arch = "wasm32")] -#[link_section = "component-type:wit-bindgen:0.24.0:bindings:encoded worldrust-wasi-from-crates-io"] +#[link_section = "component-type:wit-bindgen:0.29.0:bindings:encoded worldrust-wasi-from-crates-io"] #[doc(hidden)] pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 15607] = *b"\ \0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\xf8x\x01A\x02\x01AO\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\ -\x12wasi:io/poll@0.2.0\x05\0\x02\x03\0\0\x08pollable\x01B\x0f\x02\x03\x02\x01\x01\ +\x12wasi:io/poll@0.2.1\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\ +onotonic-clock@0.2.1\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\ +ror@0.2.1\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\ @@ -15632,7 +15493,7 @@ 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\ +wasi:io/streams@0.2.1\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\ @@ -15721,35 +15582,35 @@ 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\x03\x01\x15wasi:http/types@0.2.0\x05\x09\x02\x03\0\x04\x10outgoing\ +e\x01\x8c\x01\x03\x01\x15wasi:http/types@0.2.1\x05\x09\x02\x03\0\x04\x10outgoing\ -request\x02\x03\0\x04\x0frequest-options\x02\x03\0\x04\x18future-incoming-respo\ nse\x02\x03\0\x04\x0aerror-code\x01B\x0f\x02\x03\x02\x01\x0a\x04\0\x10outgoing-r\ equest\x03\0\0\x02\x03\x02\x01\x0b\x04\0\x0frequest-options\x03\0\x02\x02\x03\x02\ \x01\x0c\x04\0\x18future-incoming-response\x03\0\x04\x02\x03\x02\x01\x0d\x04\0\x0a\ error-code\x03\0\x06\x01i\x01\x01i\x03\x01k\x09\x01i\x05\x01j\x01\x0b\x01\x07\x01\ @\x02\x07request\x08\x07options\x0a\0\x0c\x04\0\x06handle\x01\x0d\x03\x01\x20was\ -i:http/outgoing-handler@0.2.0\x05\x0e\x01B\x0a\x01o\x02ss\x01p\0\x01@\0\0\x01\x04\ +i:http/outgoing-handler@0.2.1\x05\x0e\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\x01\ ks\x01@\0\0\x05\x04\0\x0binitial-cwd\x01\x06\x03\x01\x1awasi:cli/environment@0.2\ -.0\x05\x0f\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\x10\x01B\x05\x02\x03\x02\x01\x07\x04\0\x0cinput-\ +.1\x05\x0f\x01B\x03\x01j\0\0\x01@\x01\x06status\0\x01\0\x04\0\x04exit\x01\x01\x03\ +\x01\x13wasi:cli/exit@0.2.1\x05\x10\x01B\x05\x02\x03\x02\x01\x07\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\x11\x01B\x05\x02\x03\x02\x01\x08\x04\0\x0doutput-stream\x03\0\ +cli/stdin@0.2.1\x05\x11\x01B\x05\x02\x03\x02\x01\x08\x04\0\x0doutput-stream\x03\0\ \0\x01i\x01\x01@\0\0\x02\x04\0\x0aget-stdout\x01\x03\x03\x01\x15wasi:cli/stdout@\ -0.2.0\x05\x12\x01B\x05\x02\x03\x02\x01\x08\x04\0\x0doutput-stream\x03\0\0\x01i\x01\ -\x01@\0\0\x02\x04\0\x0aget-stderr\x01\x03\x03\x01\x15wasi:cli/stderr@0.2.0\x05\x13\ +0.2.1\x05\x12\x01B\x05\x02\x03\x02\x01\x08\x04\0\x0doutput-stream\x03\0\0\x01i\x01\ +\x01@\0\0\x02\x04\0\x0aget-stderr\x01\x03\x03\x01\x15wasi:cli/stderr@0.2.1\x05\x13\ \x01B\x01\x04\0\x0eterminal-input\x03\x01\x03\x01\x1dwasi:cli/terminal-input@0.2\ -.0\x05\x14\x01B\x01\x04\0\x0fterminal-output\x03\x01\x03\x01\x1ewasi:cli/termina\ -l-output@0.2.0\x05\x15\x02\x03\0\x0b\x0eterminal-input\x01B\x06\x02\x03\x02\x01\x16\ +.1\x05\x14\x01B\x01\x04\0\x0fterminal-output\x03\x01\x03\x01\x1ewasi:cli/termina\ +l-output@0.2.1\x05\x15\x02\x03\0\x0b\x0eterminal-input\x01B\x06\x02\x03\x02\x01\x16\ \x04\0\x0eterminal-input\x03\0\0\x01i\x01\x01k\x02\x01@\0\0\x03\x04\0\x12get-ter\ -minal-stdin\x01\x04\x03\x01\x1dwasi:cli/terminal-stdin@0.2.0\x05\x17\x02\x03\0\x0c\ +minal-stdin\x01\x04\x03\x01\x1dwasi:cli/terminal-stdin@0.2.1\x05\x17\x02\x03\0\x0c\ \x0fterminal-output\x01B\x06\x02\x03\x02\x01\x18\x04\0\x0fterminal-output\x03\0\0\ \x01i\x01\x01k\x02\x01@\0\0\x03\x04\0\x13get-terminal-stdout\x01\x04\x03\x01\x1e\ -wasi:cli/terminal-stdout@0.2.0\x05\x19\x01B\x06\x02\x03\x02\x01\x18\x04\0\x0fter\ +wasi:cli/terminal-stdout@0.2.1\x05\x19\x01B\x06\x02\x03\x02\x01\x18\x04\0\x0fter\ minal-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\x1a\x01B\x05\x01r\x02\x07\ +\x01\x04\x03\x01\x1ewasi:cli/terminal-stderr@0.2.1\x05\x1a\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\x03\x01\x1cwasi:clocks/wall-clock@0.2.0\x05\x1b\ +\x02\x04\0\x0aresolution\x01\x02\x03\x01\x1cwasi:clocks/wall-clock@0.2.1\x05\x1b\ \x02\x03\0\x03\x05error\x02\x03\0\x10\x08datetime\x01Br\x02\x03\x02\x01\x07\x04\0\ \x0cinput-stream\x03\0\0\x02\x03\x02\x01\x08\x04\0\x0doutput-stream\x03\0\x02\x02\ \x03\x02\x01\x1c\x04\0\x05error\x03\0\x04\x02\x03\x02\x01\x1d\x04\0\x08datetime\x03\ @@ -15808,10 +15669,10 @@ criptor.is-same-object\x01J\x01j\x01\x20\x01\x1c\x01@\x01\x04self#\0\xcb\0\x04\0 paths\0\xcb\0\x04\0#[method]descriptor.metadata-hash-at\x01M\x01h\"\x01k\x1a\x01\ j\x01\xcf\0\x01\x1c\x01@\x01\x04self\xce\0\0\xd0\0\x04\03[method]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\x03\x01\x1bwasi:filesystem/types@0.2.0\x05\x1e\ +\x04\0\x15filesystem-error-code\x01T\x03\x01\x1bwasi:filesystem/types@0.2.1\x05\x1e\ \x02\x03\0\x11\x0adescriptor\x01B\x07\x02\x03\x02\x01\x1f\x04\0\x0adescriptor\x03\ \0\0\x01i\x01\x01o\x02\x02s\x01p\x03\x01@\0\0\x04\x04\0\x0fget-directories\x01\x05\ -\x03\x01\x1ewasi:filesystem/preopens@0.2.0\x05\x20\x01B\x11\x04\0\x07network\x03\ +\x03\x01\x1ewasi:filesystem/preopens@0.2.1\x05\x20\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\ @@ -15824,9 +15685,9 @@ ipv6\x04\0\x11ip-address-family\x03\0\x03\x01o\x04}}}}\x04\0\x0cipv4-address\x03 \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\x03\x01\x1awasi:socket\ -s/network@0.2.0\x05!\x02\x03\0\x13\x07network\x01B\x05\x02\x03\x02\x01\"\x04\0\x07\ +s/network@0.2.1\x05!\x02\x03\0\x13\x07network\x01B\x05\x02\x03\x02\x01\"\x04\0\x07\ network\x03\0\0\x01i\x01\x01@\0\0\x02\x04\0\x10instance-network\x01\x03\x03\x01#\ -wasi:sockets/instance-network@0.2.0\x05#\x02\x03\0\x13\x0aerror-code\x02\x03\0\x13\ +wasi:sockets/instance-network@0.2.1\x05#\x02\x03\0\x13\x0aerror-code\x02\x03\0\x13\ \x11ip-socket-address\x02\x03\0\x13\x11ip-address-family\x01BD\x02\x03\x02\x01\x01\ \x04\0\x08pollable\x03\0\0\x02\x03\x02\x01\"\x04\0\x07network\x03\0\x02\x02\x03\x02\ \x01$\x04\0\x0aerror-code\x03\0\x04\x02\x03\x02\x01%\x04\0\x11ip-socket-address\x03\ @@ -15854,11 +15715,11 @@ elf(\0&\x04\0*[method]incoming-datagram-stream.subscribe\x01,\x01h\x12\x01@\x01\ self-\0#\x04\0+[method]outgoing-datagram-stream.check-send\x01.\x01p\x0f\x01@\x02\ \x04self-\x09datagrams/\0#\x04\0%[method]outgoing-datagram-stream.send\x010\x01@\ \x01\x04self-\0&\x04\0*[method]outgoing-datagram-stream.subscribe\x011\x03\x01\x16\ -wasi:sockets/udp@0.2.0\x05'\x02\x03\0\x15\x0audp-socket\x01B\x0c\x02\x03\x02\x01\ +wasi:sockets/udp@0.2.1\x05'\x02\x03\0\x15\x0audp-socket\x01B\x0c\x02\x03\x02\x01\ \"\x04\0\x07network\x03\0\0\x02\x03\x02\x01$\x04\0\x0aerror-code\x03\0\x02\x02\x03\ \x02\x01&\x04\0\x11ip-address-family\x03\0\x04\x02\x03\x02\x01(\x04\0\x0audp-soc\ ket\x03\0\x06\x01i\x07\x01j\x01\x08\x01\x03\x01@\x01\x0eaddress-family\x05\0\x09\ -\x04\0\x11create-udp-socket\x01\x0a\x03\x01$wasi:sockets/udp-create-socket@0.2.0\ +\x04\0\x11create-udp-socket\x01\x0a\x03\x01$wasi:sockets/udp-create-socket@0.2.1\ \x05)\x01BT\x02\x03\x02\x01\x07\x04\0\x0cinput-stream\x03\0\0\x02\x03\x02\x01\x08\ \x04\0\x0doutput-stream\x03\0\x02\x02\x03\x02\x01\x01\x04\0\x08pollable\x03\0\x04\ \x02\x03\x02\x01\x06\x04\0\x08duration\x03\0\x06\x02\x03\x02\x01\"\x04\0\x07netw\ @@ -15894,11 +15755,11 @@ et-receive-buffer-size\x01&\x04\0#[method]tcp-socket.send-buffer-size\x014\x04\0 '[method]tcp-socket.set-send-buffer-size\x01&\x01i\x05\x01@\x01\x04self\x13\05\x04\ \0\x1c[method]tcp-socket.subscribe\x016\x01@\x02\x04self\x13\x0dshutdown-type\x11\ \0\x15\x04\0\x1b[method]tcp-socket.shutdown\x017\x03\x01\x16wasi:sockets/tcp@0.2\ -.0\x05*\x02\x03\0\x17\x0atcp-socket\x01B\x0c\x02\x03\x02\x01\"\x04\0\x07network\x03\ +.1\x05*\x02\x03\0\x17\x0atcp-socket\x01B\x0c\x02\x03\x02\x01\"\x04\0\x07network\x03\ \0\0\x02\x03\x02\x01$\x04\0\x0aerror-code\x03\0\x02\x02\x03\x02\x01&\x04\0\x11ip\ -address-family\x03\0\x04\x02\x03\x02\x01+\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-s\ -ocket\x01\x0a\x03\x01$wasi:sockets/tcp-create-socket@0.2.0\x05,\x02\x03\0\x13\x0a\ +ocket\x01\x0a\x03\x01$wasi:sockets/tcp-create-socket@0.2.1\x05,\x02\x03\0\x13\x0a\ ip-address\x01B\x16\x02\x03\x02\x01\x01\x04\0\x08pollable\x03\0\0\x02\x03\x02\x01\ \"\x04\0\x07network\x03\0\x02\x02\x03\x02\x01$\x04\0\x0aerror-code\x03\0\x04\x02\ \x03\x02\x01-\x04\0\x0aip-address\x03\0\x06\x04\0\x16resolve-address-stream\x03\x01\ @@ -15906,16 +15767,15 @@ ip-address\x01B\x16\x02\x03\x02\x01\x01\x04\0\x08pollable\x03\0\0\x02\x03\x02\x0 ]resolve-address-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\x01\ j\x01\x10\x01\x05\x01@\x02\x07network\x0f\x04names\0\x11\x04\0\x11resolve-addres\ -ses\x01\x12\x03\x01!wasi:sockets/ip-name-lookup@0.2.0\x05.\x01B\x05\x01p}\x01@\x01\ +ses\x01\x12\x03\x01!wasi:sockets/ip-name-lookup@0.2.1\x05.\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\x01\x18wasi:random/random@0.2.0\x05/\x01B\x05\x01p}\x01@\x01\x03len\ +\x01\x02\x03\x01\x18wasi:random/random@0.2.1\x05/\x01B\x05\x01p}\x01@\x01\x03len\ w\0\0\x04\0\x19get-insecure-random-bytes\x01\x01\x01@\0\0w\x04\0\x17get-insecure\ --random-u64\x01\x02\x03\x01\x1awasi:random/insecure@0.2.0\x050\x01B\x03\x01o\x02\ +-random-u64\x01\x02\x03\x01\x1awasi:random/insecure@0.2.1\x050\x01B\x03\x01o\x02\ ww\x01@\0\0\0\x04\0\x0dinsecure-seed\x01\x01\x03\x01\x1fwasi:random/insecure-see\ -d@0.2.0\x051\x04\x01\x12rust:wasi/bindings\x04\0\x0b\x0e\x01\0\x08bindings\x03\0\ -\0\0G\x09producers\x01\x0cprocessed-by\x02\x0dwit-component\x070.202.0\x10wit-bi\ -ndgen-rust\x060.24.0"; - +d@0.2.1\x051\x04\x01\x12rust:wasi/bindings\x04\0\x0b\x0e\x01\0\x08bindings\x03\0\ +\0\0G\x09producers\x01\x0cprocessed-by\x02\x0dwit-component\x070.215.0\x10wit-bi\ +ndgen-rust\x060.29.0"; #[inline(never)] #[doc(hidden)] #[cfg(target_arch = "wasm32")] diff --git a/src/command.rs b/src/command.rs index 20ac3c3..0515df8 100644 --- a/src/command.rs +++ b/src/command.rs @@ -1,63 +1,30 @@ -// Generated by `wit-bindgen` 0.24.0. DO NOT EDIT! -// Options used: -// * std_feature -// * with "wasi:cli/environment@0.2.0" = "crate::cli::environment" -// * with "wasi:cli/exit@0.2.0" = "crate::cli::exit" -// * with "wasi:cli/stdin@0.2.0" = "crate::cli::stdin" -// * with "wasi:cli/stdout@0.2.0" = "crate::cli::stdout" -// * with "wasi:cli/stderr@0.2.0" = "crate::cli::stderr" -// * with "wasi:cli/terminal-input@0.2.0" = "crate::cli::terminal_input" -// * with "wasi:cli/terminal-output@0.2.0" = "crate::cli::terminal_output" -// * with "wasi:cli/terminal-stdin@0.2.0" = "crate::cli::terminal_stdin" -// * with "wasi:cli/terminal-stdout@0.2.0" = "crate::cli::terminal_stdout" -// * with "wasi:cli/terminal-stderr@0.2.0" = "crate::cli::terminal_stderr" -// * with "wasi:clocks/monotonic-clock@0.2.0" = "crate::clocks::monotonic_clock" -// * with "wasi:clocks/wall-clock@0.2.0" = "crate::clocks::wall_clock" -// * with "wasi:filesystem/types@0.2.0" = "crate::filesystem::types" -// * with "wasi:filesystem/preopens@0.2.0" = "crate::filesystem::preopens" -// * with "wasi:io/error@0.2.0" = "crate::io::error" -// * with "wasi:io/poll@0.2.0" = "crate::io::poll" -// * with "wasi:io/streams@0.2.0" = "crate::io::streams" -// * with "wasi:random/random@0.2.0" = "crate::random::random" -// * with "wasi:random/insecure@0.2.0" = "crate::random::insecure" -// * with "wasi:random/insecure-seed@0.2.0" = "crate::random::insecure_seed" -// * with "wasi:sockets/network@0.2.0" = "crate::sockets::network" -// * with "wasi:sockets/instance-network@0.2.0" = "crate::sockets::instance_network" -// * with "wasi:sockets/tcp@0.2.0" = "crate::sockets::tcp" -// * with "wasi:sockets/tcp-create-socket@0.2.0" = "crate::sockets::tcp_create_socket" -// * with "wasi:sockets/udp@0.2.0" = "crate::sockets::udp" -// * with "wasi:sockets/udp-create-socket@0.2.0" = "crate::sockets::udp_create_socket" -// * with "wasi:sockets/ip-name-lookup@0.2.0" = "crate::sockets::ip_name_lookup" -// * default-bindings-module: "wasi" -// * export-macro-name: _export_command -// * pub-export-macro use crate::cli::environment as __with_name0; use crate::cli::exit as __with_name1; -use crate::cli::stderr as __with_name7; +use crate::io::error as __with_name2; +use crate::io::poll as __with_name3; +use crate::io::streams as __with_name4; use crate::cli::stdin as __with_name5; use crate::cli::stdout as __with_name6; +use crate::cli::stderr as __with_name7; use crate::cli::terminal_input as __with_name8; use crate::cli::terminal_output as __with_name9; -use crate::cli::terminal_stderr as __with_name12; use crate::cli::terminal_stdin as __with_name10; use crate::cli::terminal_stdout as __with_name11; +use crate::cli::terminal_stderr as __with_name12; use crate::clocks::monotonic_clock as __with_name13; use crate::clocks::wall_clock as __with_name14; -use crate::filesystem::preopens as __with_name16; use crate::filesystem::types as __with_name15; -use crate::io::error as __with_name2; -use crate::io::poll as __with_name3; -use crate::io::streams as __with_name4; -use crate::random::insecure as __with_name25; -use crate::random::insecure_seed as __with_name26; -use crate::random::random as __with_name24; -use crate::sockets::instance_network as __with_name18; -use crate::sockets::ip_name_lookup as __with_name23; +use crate::filesystem::preopens as __with_name16; use crate::sockets::network as __with_name17; -use crate::sockets::tcp as __with_name21; -use crate::sockets::tcp_create_socket as __with_name22; +use crate::sockets::instance_network as __with_name18; use crate::sockets::udp as __with_name19; use crate::sockets::udp_create_socket as __with_name20; +use crate::sockets::tcp as __with_name21; +use crate::sockets::tcp_create_socket as __with_name22; +use crate::sockets::ip_name_lookup as __with_name23; +use crate::random::random as __with_name24; +use crate::random::insecure as __with_name25; +use crate::random::insecure_seed as __with_name26; #[allow(dead_code)] pub mod exports { #[allow(dead_code)] @@ -69,14 +36,12 @@ pub mod exports { #[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_run_cabi() -> i32 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::run(); let result1 = match result0 { Ok(_) => 0i32, @@ -90,29 +55,25 @@ pub mod exports { } #[doc(hidden)] #[macro_export] - macro_rules! __export_wasi_cli_run_0_2_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "wasi:cli/run@0.2.0#run"] - unsafe extern "C" fn export_run() -> i32 { - $($path_to_types)*::_export_run_cabi::<$ty>() - } - };); - } + macro_rules! __export_wasi_cli_run_0_2_1_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[export_name = "wasi:cli/run@0.2.1#run"] unsafe + extern "C" fn export_run() -> i32 { $($path_to_types)*:: + _export_run_cabi::<$ty > () } }; + }; + } #[doc(hidden)] - pub use __export_wasi_cli_run_0_2_0_cabi; + pub use __export_wasi_cli_run_0_2_1_cabi; } } } } mod _rt { - #[cfg(target_arch = "wasm32")] pub fn run_ctors_once() { wit_bindgen_rt::run_ctors_once(); } } - /// Generates `#[no_mangle]` functions to export the specified type as the /// root implementation of all generated traits. /// @@ -133,26 +94,28 @@ mod _rt { #[doc(hidden)] #[macro_export] macro_rules! __export_command_impl { - ($ty:ident) => (wasi::_export_command!($ty with_types_in wasi);); - ($ty:ident with_types_in $($path_to_types_root:tt)*) => ( - $($path_to_types_root)*::exports::wasi::cli::run::__export_wasi_cli_run_0_2_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::wasi::cli::run); - const _: () = { - - #[cfg(target_arch = "wasm32")] - #[link_section = "component-type:wit-bindgen:0.24.0:command:imports and exportsrust-wasi-from-crates-io-command-world"] - #[doc(hidden)] - pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 10773] = *b"\ + ($ty:ident) => { + wasi::_export_command!($ty with_types_in wasi); + }; + ($ty:ident with_types_in $($path_to_types_root:tt)*) => { + $($path_to_types_root)*:: + exports::wasi::cli::run::__export_wasi_cli_run_0_2_1_cabi!($ty with_types_in + $($path_to_types_root)*:: exports::wasi::cli::run); const _ : () = { + #[cfg(target_arch = "wasm32")] #[link_section = + "component-type:wit-bindgen:0.29.0:command:imports and exportsrust-wasi-from-crates-io-command-world"] + #[doc(hidden)] pub static __WIT_BINDGEN_COMPONENT_TYPE : [u8; 10773] = * + b"\ \0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\x97S\x01A\x02\x01AI\x01\ B\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\0\x01B\x03\x01j\0\0\x01@\x01\x06s\ -tatus\0\x01\0\x04\0\x04exit\x01\x01\x03\x01\x13wasi:cli/exit@0.2.0\x05\x01\x01B\x04\ +\x06\x03\x01\x1awasi:cli/environment@0.2.1\x05\0\x01B\x03\x01j\0\0\x01@\x01\x06s\ +tatus\0\x01\0\x04\0\x04exit\x01\x01\x03\x01\x13wasi:cli/exit@0.2.1\x05\x01\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\x02\x01B\x0a\x04\0\x08p\ +-debug-string\x01\x02\x03\x01\x13wasi:io/error@0.2.1\x05\x02\x01B\x0a\x04\0\x08p\ ollable\x03\x01\x01h\0\x01@\x01\x04self\x01\0\x7f\x04\0\x16[method]pollable.read\ y\x01\x02\x01@\x01\x04self\x01\x01\0\x04\0\x16[method]pollable.block\x01\x03\x01\ p\x01\x01py\x01@\x01\x02in\x04\0\x05\x04\0\x04poll\x01\x06\x03\x01\x12wasi:io/po\ -ll@0.2.0\x05\x03\x02\x03\0\x02\x05error\x02\x03\0\x03\x08pollable\x01B(\x02\x03\x02\ +ll@0.2.1\x05\x03\x02\x03\0\x02\x05error\x02\x03\0\x03\x08pollable\x01B(\x02\x03\x02\ \x01\x04\x04\0\x05error\x03\0\0\x02\x03\x02\x01\x05\x04\0\x08pollable\x03\0\x02\x01\ i\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\x01\ @@ -170,30 +133,30 @@ 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\x03\x01\x15wasi:io/streams@0.2.0\x05\x06\x02\x03\0\x04\x0cinput-stream\x01B\ +\x18\x03\x01\x15wasi:io/streams@0.2.1\x05\x06\x02\x03\0\x04\x0cinput-stream\x01B\ \x05\x02\x03\x02\x01\x07\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\x08\x02\x03\0\x04\x0d\ +\0\x09get-stdin\x01\x03\x03\x01\x14wasi:cli/stdin@0.2.1\x05\x08\x02\x03\0\x04\x0d\ output-stream\x01B\x05\x02\x03\x02\x01\x09\x04\0\x0doutput-stream\x03\0\0\x01i\x01\ -\x01@\0\0\x02\x04\0\x0aget-stdout\x01\x03\x03\x01\x15wasi:cli/stdout@0.2.0\x05\x0a\ +\x01@\0\0\x02\x04\0\x0aget-stdout\x01\x03\x03\x01\x15wasi:cli/stdout@0.2.1\x05\x0a\ \x01B\x05\x02\x03\x02\x01\x09\x04\0\x0doutput-stream\x03\0\0\x01i\x01\x01@\0\0\x02\ -\x04\0\x0aget-stderr\x01\x03\x03\x01\x15wasi:cli/stderr@0.2.0\x05\x0b\x01B\x01\x04\ -\0\x0eterminal-input\x03\x01\x03\x01\x1dwasi:cli/terminal-input@0.2.0\x05\x0c\x01\ -B\x01\x04\0\x0fterminal-output\x03\x01\x03\x01\x1ewasi:cli/terminal-output@0.2.0\ +\x04\0\x0aget-stderr\x01\x03\x03\x01\x15wasi:cli/stderr@0.2.1\x05\x0b\x01B\x01\x04\ +\0\x0eterminal-input\x03\x01\x03\x01\x1dwasi:cli/terminal-input@0.2.1\x05\x0c\x01\ +B\x01\x04\0\x0fterminal-output\x03\x01\x03\x01\x1ewasi:cli/terminal-output@0.2.1\ \x05\x0d\x02\x03\0\x08\x0eterminal-input\x01B\x06\x02\x03\x02\x01\x0e\x04\0\x0et\ erminal-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\x0f\x02\x03\0\x09\x0ftermi\ +\x01\x04\x03\x01\x1dwasi:cli/terminal-stdin@0.2.1\x05\x0f\x02\x03\0\x09\x0ftermi\ nal-output\x01B\x06\x02\x03\x02\x01\x10\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\x11\x01B\x06\x02\x03\x02\x01\x10\x04\0\x0fterminal-out\ +terminal-stdout@0.2.1\x05\x11\x01B\x06\x02\x03\x02\x01\x10\x04\0\x0fterminal-out\ put\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\x12\x01B\x0f\x02\x03\x02\x01\x05\x04\0\ +\x01\x1ewasi:cli/terminal-stderr@0.2.1\x05\x12\x01B\x0f\x02\x03\x02\x01\x05\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\x0aresolution\x01\x07\x01\ i\x01\x01@\x01\x04when\x03\0\x08\x04\0\x11subscribe-instant\x01\x09\x01@\x01\x04\ when\x05\0\x08\x04\0\x12subscribe-duration\x01\x0a\x03\x01!wasi:clocks/monotonic\ --clock@0.2.0\x05\x13\x01B\x05\x01r\x02\x07secondsw\x0bnanosecondsy\x04\0\x08date\ +-clock@0.2.1\x05\x13\x01B\x05\x01r\x02\x07secondsw\x0bnanosecondsy\x04\0\x08date\ time\x03\0\0\x01@\0\0\x01\x04\0\x03now\x01\x02\x04\0\x0aresolution\x01\x02\x03\x01\ -\x1cwasi:clocks/wall-clock@0.2.0\x05\x14\x02\x03\0\x04\x05error\x02\x03\0\x0e\x08\ +\x1cwasi:clocks/wall-clock@0.2.1\x05\x14\x02\x03\0\x04\x05error\x02\x03\0\x0e\x08\ datetime\x01Br\x02\x03\x02\x01\x07\x04\0\x0cinput-stream\x03\0\0\x02\x03\x02\x01\ \x09\x04\0\x0doutput-stream\x03\0\x02\x02\x03\x02\x01\x15\x04\0\x05error\x03\0\x04\ \x02\x03\x02\x01\x16\x04\0\x08datetime\x03\0\x06\x01w\x04\0\x08filesize\x03\0\x08\ @@ -252,9 +215,9 @@ self#\x05other#\0\x7f\x04\0![method]descriptor.is-same-object\x01J\x01j\x01\x20\ ata-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-directory-entry\x01Q\x01h\x05\x01\ k\x1c\x01@\x01\x03err\xd2\0\0\xd3\0\x04\0\x15filesystem-error-code\x01T\x03\x01\x1b\ -wasi:filesystem/types@0.2.0\x05\x17\x02\x03\0\x0f\x0adescriptor\x01B\x07\x02\x03\ +wasi:filesystem/types@0.2.1\x05\x17\x02\x03\0\x0f\x0adescriptor\x01B\x07\x02\x03\ \x02\x01\x18\x04\0\x0adescriptor\x03\0\0\x01i\x01\x01o\x02\x02s\x01p\x03\x01@\0\0\ -\x04\x04\0\x0fget-directories\x01\x05\x03\x01\x1ewasi:filesystem/preopens@0.2.0\x05\ +\x04\x04\0\x0fget-directories\x01\x05\x03\x01\x1ewasi:filesystem/preopens@0.2.1\x05\ \x19\x01B\x11\x04\0\x07network\x03\x01\x01m\x15\x07unknown\x0daccess-denied\x0dn\ ot-supported\x10invalid-argument\x0dout-of-memory\x07timeout\x14concurrency-conf\ lict\x0fnot-in-progress\x0bwould-block\x0dinvalid-state\x10new-socket-limit\x14a\ @@ -267,9 +230,9 @@ o\x04}}}}\x04\0\x0cipv4-address\x03\0\x05\x01o\x08{{{{{{{{\x04\0\x0cipv6-address \x09\x01r\x02\x04port{\x07address\x06\x04\0\x13ipv4-socket-address\x03\0\x0b\x01\ r\x04\x04port{\x09flow-infoy\x07address\x08\x08scope-idy\x04\0\x13ipv6-socket-ad\ dress\x03\0\x0d\x01q\x02\x04ipv4\x01\x0c\0\x04ipv6\x01\x0e\0\x04\0\x11ip-socket-\ -address\x03\0\x0f\x03\x01\x1awasi:sockets/network@0.2.0\x05\x1a\x02\x03\0\x11\x07\ +address\x03\0\x0f\x03\x01\x1awasi:sockets/network@0.2.1\x05\x1a\x02\x03\0\x11\x07\ network\x01B\x05\x02\x03\x02\x01\x1b\x04\0\x07network\x03\0\0\x01i\x01\x01@\0\0\x02\ -\x04\0\x10instance-network\x01\x03\x03\x01#wasi:sockets/instance-network@0.2.0\x05\ +\x04\0\x10instance-network\x01\x03\x03\x01#wasi:sockets/instance-network@0.2.1\x05\ \x1c\x02\x03\0\x11\x0aerror-code\x02\x03\0\x11\x11ip-socket-address\x02\x03\0\x11\ \x11ip-address-family\x01BD\x02\x03\x02\x01\x05\x04\0\x08pollable\x03\0\0\x02\x03\ \x02\x01\x1b\x04\0\x07network\x03\0\x02\x02\x03\x02\x01\x1d\x04\0\x0aerror-code\x03\ @@ -298,11 +261,11 @@ 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\x03\x01\x16wasi:sockets/u\ -dp@0.2.0\x05\x20\x02\x03\0\x13\x0audp-socket\x01B\x0c\x02\x03\x02\x01\x1b\x04\0\x07\ +dp@0.2.1\x05\x20\x02\x03\0\x13\x0audp-socket\x01B\x0c\x02\x03\x02\x01\x1b\x04\0\x07\ network\x03\0\0\x02\x03\x02\x01\x1d\x04\0\x0aerror-code\x03\0\x02\x02\x03\x02\x01\ \x1f\x04\0\x11ip-address-family\x03\0\x04\x02\x03\x02\x01!\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\x03\x01$wasi:sockets/udp-create-socket@0.2.0\x05\"\x02\ +create-udp-socket\x01\x0a\x03\x01$wasi:sockets/udp-create-socket@0.2.1\x05\"\x02\ \x03\0\x0d\x08duration\x01BT\x02\x03\x02\x01\x07\x04\0\x0cinput-stream\x03\0\0\x02\ \x03\x02\x01\x09\x04\0\x0doutput-stream\x03\0\x02\x02\x03\x02\x01\x05\x04\0\x08p\ ollable\x03\0\x04\x02\x03\x02\x01#\x04\0\x08duration\x03\0\x06\x02\x03\x02\x01\x1b\ @@ -338,12 +301,12 @@ w\x01\x0b\x01@\x01\x04self\x13\03\x04\0&[method]tcp-socket.receive-buffer-size\x .send-buffer-size\x014\x04\0'[method]tcp-socket.set-send-buffer-size\x01&\x01i\x05\ \x01@\x01\x04self\x13\05\x04\0\x1c[method]tcp-socket.subscribe\x016\x01@\x02\x04\ self\x13\x0dshutdown-type\x11\0\x15\x04\0\x1b[method]tcp-socket.shutdown\x017\x03\ -\x01\x16wasi:sockets/tcp@0.2.0\x05$\x02\x03\0\x15\x0atcp-socket\x01B\x0c\x02\x03\ +\x01\x16wasi:sockets/tcp@0.2.1\x05$\x02\x03\0\x15\x0atcp-socket\x01B\x0c\x02\x03\ \x02\x01\x1b\x04\0\x07network\x03\0\0\x02\x03\x02\x01\x1d\x04\0\x0aerror-code\x03\ \0\x02\x02\x03\x02\x01\x1f\x04\0\x11ip-address-family\x03\0\x04\x02\x03\x02\x01%\ \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\x03\x01$wasi:sockets/tcp-cr\ -eate-socket@0.2.0\x05&\x02\x03\0\x11\x0aip-address\x01B\x16\x02\x03\x02\x01\x05\x04\ +eate-socket@0.2.1\x05&\x02\x03\0\x11\x0aip-address\x01B\x16\x02\x03\x02\x01\x05\x04\ \0\x08pollable\x03\0\0\x02\x03\x02\x01\x1b\x04\0\x07network\x03\0\x02\x02\x03\x02\ \x01\x1d\x04\0\x0aerror-code\x03\0\x04\x02\x03\x02\x01'\x04\0\x0aip-address\x03\0\ \x06\x04\0\x16resolve-address-stream\x03\x01\x01h\x08\x01k\x07\x01j\x01\x0a\x01\x05\ @@ -351,36 +314,35 @@ eate-socket@0.2.0\x05&\x02\x03\0\x11\x0aip-address\x01B\x16\x02\x03\x02\x01\x05\ dress\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\x07netw\ ork\x0f\x04names\0\x11\x04\0\x11resolve-addresses\x01\x12\x03\x01!wasi:sockets/i\ -p-name-lookup@0.2.0\x05(\x01B\x05\x01p}\x01@\x01\x03lenw\0\0\x04\0\x10get-random\ +p-name-lookup@0.2.1\x05(\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\x01\x18wasi:random/\ -random@0.2.0\x05)\x01B\x05\x01p}\x01@\x01\x03lenw\0\0\x04\0\x19get-insecure-rand\ +random@0.2.1\x05)\x01B\x05\x01p}\x01@\x01\x03lenw\0\0\x04\0\x19get-insecure-rand\ om-bytes\x01\x01\x01@\0\0w\x04\0\x17get-insecure-random-u64\x01\x02\x03\x01\x1aw\ -asi:random/insecure@0.2.0\x05*\x01B\x03\x01o\x02ww\x01@\0\0\0\x04\0\x0dinsecure-\ -seed\x01\x01\x03\x01\x1fwasi:random/insecure-seed@0.2.0\x05+\x01B\x03\x01j\0\0\x01\ -@\0\0\0\x04\0\x03run\x01\x01\x04\x01\x12wasi:cli/run@0.2.0\x05,\x04\x01\x16wasi:\ -cli/command@0.2.0\x04\0\x0b\x0d\x01\0\x07command\x03\0\0\0G\x09producers\x01\x0c\ -processed-by\x02\x0dwit-component\x070.202.0\x10wit-bindgen-rust\x060.24.0"; - }; - ) +asi:random/insecure@0.2.1\x05*\x01B\x03\x01o\x02ww\x01@\0\0\0\x04\0\x0dinsecure-\ +seed\x01\x01\x03\x01\x1fwasi:random/insecure-seed@0.2.1\x05+\x01B\x03\x01j\0\0\x01\ +@\0\0\0\x04\0\x03run\x01\x01\x04\x01\x12wasi:cli/run@0.2.1\x05,\x04\x01\x16wasi:\ +cli/command@0.2.1\x04\0\x0b\x0d\x01\0\x07command\x03\0\0\0G\x09producers\x01\x0c\ +processed-by\x02\x0dwit-component\x070.215.0\x10wit-bindgen-rust\x060.29.0"; + }; + }; } #[doc(inline)] pub use __export_command_impl as _export_command; - #[cfg(target_arch = "wasm32")] -#[link_section = "component-type:wit-bindgen:0.24.0:command-with-all-of-its-exports-removed:encoded worldrust-wasi-from-crates-io-command-world"] +#[link_section = "component-type:wit-bindgen:0.29.0:command-with-all-of-its-exports-removed:encoded worldrust-wasi-from-crates-io-command-world"] #[doc(hidden)] pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 10794] = *b"\ \0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\x8cS\x01A\x02\x01AG\x01\ B\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\0\x01B\x03\x01j\0\0\x01@\x01\x06s\ -tatus\0\x01\0\x04\0\x04exit\x01\x01\x03\x01\x13wasi:cli/exit@0.2.0\x05\x01\x01B\x04\ +\x06\x03\x01\x1awasi:cli/environment@0.2.1\x05\0\x01B\x03\x01j\0\0\x01@\x01\x06s\ +tatus\0\x01\0\x04\0\x04exit\x01\x01\x03\x01\x13wasi:cli/exit@0.2.1\x05\x01\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\x02\x01B\x0a\x04\0\x08p\ +-debug-string\x01\x02\x03\x01\x13wasi:io/error@0.2.1\x05\x02\x01B\x0a\x04\0\x08p\ ollable\x03\x01\x01h\0\x01@\x01\x04self\x01\0\x7f\x04\0\x16[method]pollable.read\ y\x01\x02\x01@\x01\x04self\x01\x01\0\x04\0\x16[method]pollable.block\x01\x03\x01\ p\x01\x01py\x01@\x01\x02in\x04\0\x05\x04\0\x04poll\x01\x06\x03\x01\x12wasi:io/po\ -ll@0.2.0\x05\x03\x02\x03\0\x02\x05error\x02\x03\0\x03\x08pollable\x01B(\x02\x03\x02\ +ll@0.2.1\x05\x03\x02\x03\0\x02\x05error\x02\x03\0\x03\x08pollable\x01B(\x02\x03\x02\ \x01\x04\x04\0\x05error\x03\0\0\x02\x03\x02\x01\x05\x04\0\x08pollable\x03\0\x02\x01\ i\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\x01\ @@ -398,30 +360,30 @@ 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\x03\x01\x15wasi:io/streams@0.2.0\x05\x06\x02\x03\0\x04\x0cinput-stream\x01B\ +\x18\x03\x01\x15wasi:io/streams@0.2.1\x05\x06\x02\x03\0\x04\x0cinput-stream\x01B\ \x05\x02\x03\x02\x01\x07\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\x08\x02\x03\0\x04\x0d\ +\0\x09get-stdin\x01\x03\x03\x01\x14wasi:cli/stdin@0.2.1\x05\x08\x02\x03\0\x04\x0d\ output-stream\x01B\x05\x02\x03\x02\x01\x09\x04\0\x0doutput-stream\x03\0\0\x01i\x01\ -\x01@\0\0\x02\x04\0\x0aget-stdout\x01\x03\x03\x01\x15wasi:cli/stdout@0.2.0\x05\x0a\ +\x01@\0\0\x02\x04\0\x0aget-stdout\x01\x03\x03\x01\x15wasi:cli/stdout@0.2.1\x05\x0a\ \x01B\x05\x02\x03\x02\x01\x09\x04\0\x0doutput-stream\x03\0\0\x01i\x01\x01@\0\0\x02\ -\x04\0\x0aget-stderr\x01\x03\x03\x01\x15wasi:cli/stderr@0.2.0\x05\x0b\x01B\x01\x04\ -\0\x0eterminal-input\x03\x01\x03\x01\x1dwasi:cli/terminal-input@0.2.0\x05\x0c\x01\ -B\x01\x04\0\x0fterminal-output\x03\x01\x03\x01\x1ewasi:cli/terminal-output@0.2.0\ +\x04\0\x0aget-stderr\x01\x03\x03\x01\x15wasi:cli/stderr@0.2.1\x05\x0b\x01B\x01\x04\ +\0\x0eterminal-input\x03\x01\x03\x01\x1dwasi:cli/terminal-input@0.2.1\x05\x0c\x01\ +B\x01\x04\0\x0fterminal-output\x03\x01\x03\x01\x1ewasi:cli/terminal-output@0.2.1\ \x05\x0d\x02\x03\0\x08\x0eterminal-input\x01B\x06\x02\x03\x02\x01\x0e\x04\0\x0et\ erminal-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\x0f\x02\x03\0\x09\x0ftermi\ +\x01\x04\x03\x01\x1dwasi:cli/terminal-stdin@0.2.1\x05\x0f\x02\x03\0\x09\x0ftermi\ nal-output\x01B\x06\x02\x03\x02\x01\x10\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\x11\x01B\x06\x02\x03\x02\x01\x10\x04\0\x0fterminal-out\ +terminal-stdout@0.2.1\x05\x11\x01B\x06\x02\x03\x02\x01\x10\x04\0\x0fterminal-out\ put\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\x12\x01B\x0f\x02\x03\x02\x01\x05\x04\0\ +\x01\x1ewasi:cli/terminal-stderr@0.2.1\x05\x12\x01B\x0f\x02\x03\x02\x01\x05\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\x0aresolution\x01\x07\x01\ i\x01\x01@\x01\x04when\x03\0\x08\x04\0\x11subscribe-instant\x01\x09\x01@\x01\x04\ when\x05\0\x08\x04\0\x12subscribe-duration\x01\x0a\x03\x01!wasi:clocks/monotonic\ --clock@0.2.0\x05\x13\x01B\x05\x01r\x02\x07secondsw\x0bnanosecondsy\x04\0\x08date\ +-clock@0.2.1\x05\x13\x01B\x05\x01r\x02\x07secondsw\x0bnanosecondsy\x04\0\x08date\ time\x03\0\0\x01@\0\0\x01\x04\0\x03now\x01\x02\x04\0\x0aresolution\x01\x02\x03\x01\ -\x1cwasi:clocks/wall-clock@0.2.0\x05\x14\x02\x03\0\x04\x05error\x02\x03\0\x0e\x08\ +\x1cwasi:clocks/wall-clock@0.2.1\x05\x14\x02\x03\0\x04\x05error\x02\x03\0\x0e\x08\ datetime\x01Br\x02\x03\x02\x01\x07\x04\0\x0cinput-stream\x03\0\0\x02\x03\x02\x01\ \x09\x04\0\x0doutput-stream\x03\0\x02\x02\x03\x02\x01\x15\x04\0\x05error\x03\0\x04\ \x02\x03\x02\x01\x16\x04\0\x08datetime\x03\0\x06\x01w\x04\0\x08filesize\x03\0\x08\ @@ -480,9 +442,9 @@ self#\x05other#\0\x7f\x04\0![method]descriptor.is-same-object\x01J\x01j\x01\x20\ ata-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-directory-entry\x01Q\x01h\x05\x01\ k\x1c\x01@\x01\x03err\xd2\0\0\xd3\0\x04\0\x15filesystem-error-code\x01T\x03\x01\x1b\ -wasi:filesystem/types@0.2.0\x05\x17\x02\x03\0\x0f\x0adescriptor\x01B\x07\x02\x03\ +wasi:filesystem/types@0.2.1\x05\x17\x02\x03\0\x0f\x0adescriptor\x01B\x07\x02\x03\ \x02\x01\x18\x04\0\x0adescriptor\x03\0\0\x01i\x01\x01o\x02\x02s\x01p\x03\x01@\0\0\ -\x04\x04\0\x0fget-directories\x01\x05\x03\x01\x1ewasi:filesystem/preopens@0.2.0\x05\ +\x04\x04\0\x0fget-directories\x01\x05\x03\x01\x1ewasi:filesystem/preopens@0.2.1\x05\ \x19\x01B\x11\x04\0\x07network\x03\x01\x01m\x15\x07unknown\x0daccess-denied\x0dn\ ot-supported\x10invalid-argument\x0dout-of-memory\x07timeout\x14concurrency-conf\ lict\x0fnot-in-progress\x0bwould-block\x0dinvalid-state\x10new-socket-limit\x14a\ @@ -495,9 +457,9 @@ o\x04}}}}\x04\0\x0cipv4-address\x03\0\x05\x01o\x08{{{{{{{{\x04\0\x0cipv6-address \x09\x01r\x02\x04port{\x07address\x06\x04\0\x13ipv4-socket-address\x03\0\x0b\x01\ r\x04\x04port{\x09flow-infoy\x07address\x08\x08scope-idy\x04\0\x13ipv6-socket-ad\ dress\x03\0\x0d\x01q\x02\x04ipv4\x01\x0c\0\x04ipv6\x01\x0e\0\x04\0\x11ip-socket-\ -address\x03\0\x0f\x03\x01\x1awasi:sockets/network@0.2.0\x05\x1a\x02\x03\0\x11\x07\ +address\x03\0\x0f\x03\x01\x1awasi:sockets/network@0.2.1\x05\x1a\x02\x03\0\x11\x07\ network\x01B\x05\x02\x03\x02\x01\x1b\x04\0\x07network\x03\0\0\x01i\x01\x01@\0\0\x02\ -\x04\0\x10instance-network\x01\x03\x03\x01#wasi:sockets/instance-network@0.2.0\x05\ +\x04\0\x10instance-network\x01\x03\x03\x01#wasi:sockets/instance-network@0.2.1\x05\ \x1c\x02\x03\0\x11\x0aerror-code\x02\x03\0\x11\x11ip-socket-address\x02\x03\0\x11\ \x11ip-address-family\x01BD\x02\x03\x02\x01\x05\x04\0\x08pollable\x03\0\0\x02\x03\ \x02\x01\x1b\x04\0\x07network\x03\0\x02\x02\x03\x02\x01\x1d\x04\0\x0aerror-code\x03\ @@ -526,11 +488,11 @@ 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\x03\x01\x16wasi:sockets/u\ -dp@0.2.0\x05\x20\x02\x03\0\x13\x0audp-socket\x01B\x0c\x02\x03\x02\x01\x1b\x04\0\x07\ +dp@0.2.1\x05\x20\x02\x03\0\x13\x0audp-socket\x01B\x0c\x02\x03\x02\x01\x1b\x04\0\x07\ network\x03\0\0\x02\x03\x02\x01\x1d\x04\0\x0aerror-code\x03\0\x02\x02\x03\x02\x01\ \x1f\x04\0\x11ip-address-family\x03\0\x04\x02\x03\x02\x01!\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\x03\x01$wasi:sockets/udp-create-socket@0.2.0\x05\"\x02\ +create-udp-socket\x01\x0a\x03\x01$wasi:sockets/udp-create-socket@0.2.1\x05\"\x02\ \x03\0\x0d\x08duration\x01BT\x02\x03\x02\x01\x07\x04\0\x0cinput-stream\x03\0\0\x02\ \x03\x02\x01\x09\x04\0\x0doutput-stream\x03\0\x02\x02\x03\x02\x01\x05\x04\0\x08p\ ollable\x03\0\x04\x02\x03\x02\x01#\x04\0\x08duration\x03\0\x06\x02\x03\x02\x01\x1b\ @@ -566,12 +528,12 @@ w\x01\x0b\x01@\x01\x04self\x13\03\x04\0&[method]tcp-socket.receive-buffer-size\x .send-buffer-size\x014\x04\0'[method]tcp-socket.set-send-buffer-size\x01&\x01i\x05\ \x01@\x01\x04self\x13\05\x04\0\x1c[method]tcp-socket.subscribe\x016\x01@\x02\x04\ self\x13\x0dshutdown-type\x11\0\x15\x04\0\x1b[method]tcp-socket.shutdown\x017\x03\ -\x01\x16wasi:sockets/tcp@0.2.0\x05$\x02\x03\0\x15\x0atcp-socket\x01B\x0c\x02\x03\ +\x01\x16wasi:sockets/tcp@0.2.1\x05$\x02\x03\0\x15\x0atcp-socket\x01B\x0c\x02\x03\ \x02\x01\x1b\x04\0\x07network\x03\0\0\x02\x03\x02\x01\x1d\x04\0\x0aerror-code\x03\ \0\x02\x02\x03\x02\x01\x1f\x04\0\x11ip-address-family\x03\0\x04\x02\x03\x02\x01%\ \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\x03\x01$wasi:sockets/tcp-cr\ -eate-socket@0.2.0\x05&\x02\x03\0\x11\x0aip-address\x01B\x16\x02\x03\x02\x01\x05\x04\ +eate-socket@0.2.1\x05&\x02\x03\0\x11\x0aip-address\x01B\x16\x02\x03\x02\x01\x05\x04\ \0\x08pollable\x03\0\0\x02\x03\x02\x01\x1b\x04\0\x07network\x03\0\x02\x02\x03\x02\ \x01\x1d\x04\0\x0aerror-code\x03\0\x04\x02\x03\x02\x01'\x04\0\x0aip-address\x03\0\ \x06\x04\0\x16resolve-address-stream\x03\x01\x01h\x08\x01k\x07\x01j\x01\x0a\x01\x05\ @@ -579,16 +541,15 @@ eate-socket@0.2.0\x05&\x02\x03\0\x11\x0aip-address\x01B\x16\x02\x03\x02\x01\x05\ dress\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\x07netw\ ork\x0f\x04names\0\x11\x04\0\x11resolve-addresses\x01\x12\x03\x01!wasi:sockets/i\ -p-name-lookup@0.2.0\x05(\x01B\x05\x01p}\x01@\x01\x03lenw\0\0\x04\0\x10get-random\ +p-name-lookup@0.2.1\x05(\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\x01\x18wasi:random/\ -random@0.2.0\x05)\x01B\x05\x01p}\x01@\x01\x03lenw\0\0\x04\0\x19get-insecure-rand\ +random@0.2.1\x05)\x01B\x05\x01p}\x01@\x01\x03lenw\0\0\x04\0\x19get-insecure-rand\ om-bytes\x01\x01\x01@\0\0w\x04\0\x17get-insecure-random-u64\x01\x02\x03\x01\x1aw\ -asi:random/insecure@0.2.0\x05*\x01B\x03\x01o\x02ww\x01@\0\0\0\x04\0\x0dinsecure-\ -seed\x01\x01\x03\x01\x1fwasi:random/insecure-seed@0.2.0\x05+\x04\x016wasi:cli/co\ -mmand-with-all-of-its-exports-removed@0.2.0\x04\0\x0b-\x01\0'command-with-all-of\ +asi:random/insecure@0.2.1\x05*\x01B\x03\x01o\x02ww\x01@\0\0\0\x04\0\x0dinsecure-\ +seed\x01\x01\x03\x01\x1fwasi:random/insecure-seed@0.2.1\x05+\x04\x016wasi:cli/co\ +mmand-with-all-of-its-exports-removed@0.2.1\x04\0\x0b-\x01\0'command-with-all-of\ -its-exports-removed\x03\0\0\0G\x09producers\x01\x0cprocessed-by\x02\x0dwit-comp\ -onent\x070.202.0\x10wit-bindgen-rust\x060.24.0"; - +onent\x070.215.0\x10wit-bindgen-rust\x060.29.0"; #[inline(never)] #[doc(hidden)] #[cfg(target_arch = "wasm32")] diff --git a/src/proxy.rs b/src/proxy.rs index 0caf379..462503f 100644 --- a/src/proxy.rs +++ b/src/proxy.rs @@ -1,31 +1,14 @@ -// Generated by `wit-bindgen` 0.24.0. DO NOT EDIT! -// Options used: -// * std_feature -// * with "wasi:cli/stdin@0.2.0" = "crate::cli::stdin" -// * with "wasi:cli/stdout@0.2.0" = "crate::cli::stdout" -// * with "wasi:cli/stderr@0.2.0" = "crate::cli::stderr" -// * with "wasi:clocks/monotonic-clock@0.2.0" = "crate::clocks::monotonic_clock" -// * with "wasi:clocks/wall-clock@0.2.0" = "crate::clocks::wall_clock" -// * with "wasi:io/error@0.2.0" = "crate::io::error" -// * with "wasi:io/poll@0.2.0" = "crate::io::poll" -// * with "wasi:io/streams@0.2.0" = "crate::io::streams" -// * with "wasi:random/random@0.2.0" = "crate::random::random" -// * with "wasi:http/types@0.2.0" = "crate::http::types" -// * with "wasi:http/outgoing-handler@0.2.0" = "crate::http::outgoing_handler" -// * default-bindings-module: "wasi" -// * export-macro-name: _export_proxy -// * pub-export-macro -use crate::cli::stderr as __with_name5; -use crate::cli::stdin as __with_name6; -use crate::cli::stdout as __with_name4; -use crate::clocks::monotonic_clock as __with_name7; -use crate::clocks::wall_clock as __with_name10; -use crate::http::outgoing_handler as __with_name9; -use crate::http::types as __with_name8; -use crate::io::error as __with_name1; -use crate::io::poll as __with_name2; +use crate::io::poll as __with_name0; +use crate::clocks::monotonic_clock as __with_name1; +use crate::io::error as __with_name2; use crate::io::streams as __with_name3; -use crate::random::random as __with_name0; +use crate::http::types as __with_name4; +use crate::clocks::wall_clock as __with_name5; +use crate::random::random as __with_name6; +use crate::cli::stdout as __with_name7; +use crate::cli::stderr as __with_name8; +use crate::cli::stdin as __with_name9; +use crate::http::outgoing_handler as __with_name10; #[allow(dead_code)] pub mod exports { #[allow(dead_code)] @@ -37,23 +20,19 @@ pub mod exports { #[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::__with_name8::IncomingRequest; - pub type ResponseOutparam = - super::super::super::super::__with_name8::ResponseOutparam; + pub type IncomingRequest = super::super::super::super::__with_name4::IncomingRequest; + pub type ResponseOutparam = super::super::super::super::__with_name4::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(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); T::handle( - super::super::super::super::__with_name8::IncomingRequest::from_handle( + super::super::super::super::__with_name4::IncomingRequest::from_handle( arg0 as u32, ), - super::super::super::super::__with_name8::ResponseOutparam::from_handle( + super::super::super::super::__with_name4::ResponseOutparam::from_handle( arg1 as u32, ), ); @@ -73,29 +52,26 @@ pub mod exports { } #[doc(hidden)] #[macro_export] - 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_1_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[export_name = + "wasi:http/incoming-handler@0.2.1#handle"] unsafe extern "C" fn + export_handle(arg0 : i32, arg1 : i32,) { $($path_to_types)*:: + _export_handle_cabi::<$ty > (arg0, arg1) } }; + }; + } #[doc(hidden)] - pub use __export_wasi_http_incoming_handler_0_2_0_cabi; + pub use __export_wasi_http_incoming_handler_0_2_1_cabi; } } } } mod _rt { - #[cfg(target_arch = "wasm32")] pub fn run_ctors_once() { wit_bindgen_rt::run_ctors_once(); } } - /// Generates `#[no_mangle]` functions to export the specified type as the /// root implementation of all generated traits. /// @@ -116,306 +92,306 @@ mod _rt { #[doc(hidden)] #[macro_export] macro_rules! __export_proxy_impl { - ($ty:ident) => (wasi::_export_proxy!($ty with_types_in wasi);); - ($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); - const _: () = { - - #[cfg(target_arch = "wasm32")] - #[link_section = "component-type:wit-bindgen:0.24.0:proxy:imports and exportsrust-wasi-from-crates-io-proxy-world"] - #[doc(hidden)] - pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 7024] = *b"\ + ($ty:ident) => { + wasi::_export_proxy!($ty with_types_in wasi); + }; + ($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_1_cabi!($ty + with_types_in $($path_to_types_root)*:: exports::wasi::http::incoming_handler); + const _ : () = { #[cfg(target_arch = "wasm32")] #[link_section = + "component-type:wit-bindgen:0.29.0:proxy:imports and exportsrust-wasi-from-crates-io-proxy-world"] + #[doc(hidden)] pub static __WIT_BINDGEN_COMPONENT_TYPE : [u8; 7024] = * + b"\ \0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\xf45\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\ +\x12wasi:io/poll@0.2.1\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.1\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.1\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.1\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.1\x05\x09\x01B\x05\x01r\x02\x07seco\ +ndsw\x0bnanosecondsy\x04\0\x08datetime\x03\0\0\x01@\0\0\x01\x04\0\x03now\x01\x02\ +\x04\0\x0aresolution\x01\x02\x03\x01\x1cwasi:clocks/wall-clock@0.2.1\x05\x0a\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\x03\x01\x18wasi:random/random@0.2.0\x05\0\x01B\x04\x04\ -\0\x05error\x03\x01\x01h\0\x01@\x01\x04self\x01\0s\x04\0\x1d[method]error.to-deb\ -ug-string\x01\x02\x03\x01\x13wasi:io/error@0.2.0\x05\x01\x01B\x0a\x04\0\x08polla\ -ble\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\x01\x12wasi:io/poll@0.\ -2.0\x05\x02\x02\x03\0\x01\x05error\x02\x03\0\x02\x08pollable\x01B(\x02\x03\x02\x01\ -\x03\x04\0\x05error\x03\0\0\x02\x03\x02\x01\x04\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\x03\x01\x15wasi:io/streams@0.2.0\x05\x05\x02\x03\0\x03\x0doutput-stream\x01\ -B\x05\x02\x03\x02\x01\x06\x04\0\x0doutput-stream\x03\0\0\x01i\x01\x01@\0\0\x02\x04\ -\0\x0aget-stdout\x01\x03\x03\x01\x15wasi:cli/stdout@0.2.0\x05\x07\x01B\x05\x02\x03\ -\x02\x01\x06\x04\0\x0doutput-stream\x03\0\0\x01i\x01\x01@\0\0\x02\x04\0\x0aget-s\ -tderr\x01\x03\x03\x01\x15wasi:cli/stderr@0.2.0\x05\x08\x02\x03\0\x03\x0cinput-st\ -ream\x01B\x05\x02\x03\x02\x01\x09\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\x0a\x01B\x0f\ -\x02\x03\x02\x01\x04\x04\0\x08pollable\x03\0\0\x01w\x04\0\x07instant\x03\0\x02\x01\ -w\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-duration\x01\x0a\x03\ -\x01!wasi:clocks/monotonic-clock@0.2.0\x05\x0b\x02\x03\0\x07\x08duration\x01B\xc0\ -\x01\x02\x03\x02\x01\x0c\x04\0\x08duration\x03\0\0\x02\x03\x02\x01\x09\x04\0\x0c\ -input-stream\x03\0\x02\x02\x03\x02\x01\x06\x04\0\x0doutput-stream\x03\0\x04\x02\x03\ -\x02\x01\x03\x04\0\x08io-error\x03\0\x06\x02\x03\x02\x01\x04\x04\0\x08pollable\x03\ -\0\x08\x01q\x0a\x03get\0\0\x04head\0\0\x04post\0\0\x03put\0\0\x06delete\0\0\x07c\ -onnect\0\0\x07options\0\0\x05trace\0\0\x05patch\0\0\x05other\x01s\0\x04\0\x06met\ -hod\x03\0\x0a\x01q\x03\x04HTTP\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-pay\ -load\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\x09\ -DNS-error\x01\x11\0\x15destination-not-found\0\0\x17destination-unavailable\0\0\x19\ -destination-IP-prohibited\0\0\x19destination-IP-unroutable\0\0\x12connection-ref\ -used\0\0\x15connection-terminated\0\0\x12connection-timeout\0\0\x17connection-re\ -ad-timeout\0\0\x18connection-write-timeout\0\0\x18connection-limit-reached\0\0\x12\ -TLS-protocol-error\0\0\x15TLS-certificate-error\0\0\x12TLS-alert-received\x01\x14\ -\0\x13HTTP-request-denied\0\0\x1cHTTP-request-length-required\0\0\x16HTTP-reques\ -t-body-size\x01\x18\0\x1bHTTP-request-method-invalid\0\0\x18HTTP-request-URI-inv\ -alid\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!HT\ -TP-response-header-section-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-trailer-size\x01\x17\0\x1dHTTP-response-transfer-coding\x01\x0e\ -\0\x1cHTTP-response-content-coding\x01\x0e\0\x15HTTP-response-timeout\0\0\x13HTT\ -P-upgrade-failed\0\0\x13HTTP-protocol-error\0\0\x0dloop-detected\0\0\x13configur\ -ation-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\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\x10\ -incoming-request\x03\x01\x04\0\x10outgoing-request\x03\x01\x04\0\x0frequest-opti\ -ons\x03\x01\x04\0\x11response-outparam\x03\x01\x01{\x04\0\x0bstatus-code\x03\0)\x04\ -\0\x11incoming-response\x03\x01\x04\0\x0dincoming-body\x03\x01\x04\0\x0ffuture-t\ -railers\x03\x01\x04\0\x11outgoing-response\x03\x01\x04\0\x0doutgoing-body\x03\x01\ -\x04\0\x18future-incoming-response\x03\x01\x01i\"\x01@\0\01\x04\0\x13[constructo\ -r]fields\x012\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[method]fields.get\x019\x01@\x02\x04self7\x04name\x1f\0\x7f\x04\0\x12[meth\ -od]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]f\ -ields.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.authority\x01C\x01i#\x01@\x01\x04self\xc1\0\0\xc6\0\x04\0\x20[method]in\ -coming-request.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\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-meth\ -od\x01S\x01@\x01\x04self\xcd\0\0\x0e\x04\0([method]outgoing-request.path-with-qu\ -ery\x01T\x01@\x02\x04self\xcd\0\x0fpath-with-query\x0e\0\xd2\0\x04\0,[method]out\ -going-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-reques\ -t.authority\x01T\x01@\x02\x04self\xcd\0\x09authority\x0e\0\xd2\0\x04\0&[method]o\ -utgoing-request.set-authority\x01X\x01@\x01\x04self\xcd\0\0\xc6\0\x04\0\x20[meth\ -od]outgoing-request.headers\x01Y\x01i'\x01@\0\0\xda\0\x04\0\x1c[constructor]requ\ -est-options\x01[\x01h'\x01k\x01\x01@\x01\x04self\xdc\0\0\xdd\0\x04\0'[method]req\ -uest-options.connect-timeout\x01^\x01@\x02\x04self\xdc\0\x08duration\xdd\0\0\xd2\ -\0\x04\0+[method]request-options.set-connect-timeout\x01_\x04\0*[method]request-\ -options.first-byte-timeout\x01^\x04\0.[method]request-options.set-first-byte-tim\ -eout\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-outpa\ -ram.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.heade\ -rs\x01f\x01@\x01\x04self\xe4\0\0\xc9\0\x04\0![method]incoming-response.consume\x01\ -g\x01h,\x01i\x03\x01j\x01\xe9\0\0\x01@\x01\x04self\xe8\0\0\xea\0\x04\0\x1c[metho\ -d]incoming-body.stream\x01k\x01i-\x01@\x01\x04this\xc8\0\0\xec\0\x04\0\x1c[stati\ -c]incoming-body.finish\x01m\x01h-\x01i\x09\x01@\x01\x04self\xee\0\0\xef\0\x04\0!\ -[method]future-trailers.subscribe\x01p\x01i$\x01k\xf1\0\x01j\x01\xf2\0\x01\x1b\x01\ -j\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]outgoi\ -ng-response\x01w\x01h.\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]o\ -utgoing-response.set-status-code\x01z\x01@\x01\x04self\xf8\0\0\xc6\0\x04\0![meth\ -od]outgoing-response.headers\x01{\x01@\x01\x04self\xf8\0\0\xcf\0\x04\0\x1e[metho\ -d]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-incomin\ -g-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\x03err\x8a\x01\0\x8b\x01\x04\ -\0\x0fhttp-error-code\x01\x8c\x01\x03\x01\x15wasi:http/types@0.2.0\x05\x0d\x02\x03\ -\0\x08\x10outgoing-request\x02\x03\0\x08\x0frequest-options\x02\x03\0\x08\x18fut\ -ure-incoming-response\x02\x03\0\x08\x0aerror-code\x01B\x0f\x02\x03\x02\x01\x0e\x04\ -\0\x10outgoing-request\x03\0\0\x02\x03\x02\x01\x0f\x04\0\x0frequest-options\x03\0\ -\x02\x02\x03\x02\x01\x10\x04\0\x18future-incoming-response\x03\0\x04\x02\x03\x02\ -\x01\x11\x04\0\x0aerror-code\x03\0\x06\x01i\x01\x01i\x03\x01k\x09\x01i\x05\x01j\x01\ -\x0b\x01\x07\x01@\x02\x07request\x08\x07options\x0a\0\x0c\x04\0\x06handle\x01\x0d\ -\x03\x01\x20wasi:http/outgoing-handler@0.2.0\x05\x12\x01B\x05\x01r\x02\x07second\ -sw\x0bnanosecondsy\x04\0\x08datetime\x03\0\0\x01@\0\0\x01\x04\0\x03now\x01\x02\x04\ -\0\x0aresolution\x01\x02\x03\x01\x1cwasi:clocks/wall-clock@0.2.0\x05\x13\x02\x03\ -\0\x08\x10incoming-request\x02\x03\0\x08\x11response-outparam\x01B\x08\x02\x03\x02\ -\x01\x14\x04\0\x10incoming-request\x03\0\0\x02\x03\x02\x01\x15\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\x01\x20wasi:http/incoming-handler@0.2.0\x05\x16\ -\x04\x01\x15wasi:http/proxy@0.2.0\x04\0\x0b\x0b\x01\0\x05proxy\x03\0\0\0G\x09pro\ -ducers\x01\x0cprocessed-by\x02\x0dwit-component\x070.202.0\x10wit-bindgen-rust\x06\ -0.24.0"; - }; - ) +\0\x0eget-random-u64\x01\x02\x03\x01\x18wasi:random/random@0.2.1\x05\x0b\x01B\x05\ +\x02\x03\x02\x01\x08\x04\0\x0doutput-stream\x03\0\0\x01i\x01\x01@\0\0\x02\x04\0\x0a\ +get-stdout\x01\x03\x03\x01\x15wasi:cli/stdout@0.2.1\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-stder\ +r\x01\x03\x03\x01\x15wasi:cli/stderr@0.2.1\x05\x0d\x01B\x05\x02\x03\x02\x01\x07\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.1\x05\x0e\x02\x03\0\x04\x10outgoing-request\x02\x03\0\x04\ +\x0frequest-options\x02\x03\0\x04\x18future-incoming-response\x02\x03\0\x04\x0ae\ +rror-code\x01B\x0f\x02\x03\x02\x01\x0f\x04\0\x10outgoing-request\x03\0\0\x02\x03\ +\x02\x01\x10\x04\0\x0frequest-options\x03\0\x02\x02\x03\x02\x01\x11\x04\0\x18fut\ +ure-incoming-response\x03\0\x04\x02\x03\x02\x01\x12\x04\0\x0aerror-code\x03\0\x06\ +\x01i\x01\x01i\x03\x01k\x09\x01i\x05\x01j\x01\x0b\x01\x07\x01@\x02\x07request\x08\ +\x07options\x0a\0\x0c\x04\0\x06handle\x01\x0d\x03\x01\x20wasi:http/outgoing-hand\ +ler@0.2.1\x05\x13\x02\x03\0\x04\x10incoming-request\x02\x03\0\x04\x11response-ou\ +tparam\x01B\x08\x02\x03\x02\x01\x14\x04\0\x10incoming-request\x03\0\0\x02\x03\x02\ +\x01\x15\x04\0\x11response-outparam\x03\0\x02\x01i\x01\x01i\x03\x01@\x02\x07requ\ +est\x04\x0cresponse-out\x05\x01\0\x04\0\x06handle\x01\x06\x04\x01\x20wasi:http/i\ +ncoming-handler@0.2.1\x05\x16\x04\x01\x15wasi:http/proxy@0.2.1\x04\0\x0b\x0b\x01\ +\0\x05proxy\x03\0\0\0G\x09producers\x01\x0cprocessed-by\x02\x0dwit-component\x07\ +0.215.0\x10wit-bindgen-rust\x060.29.0"; + }; + }; } #[doc(inline)] pub use __export_proxy_impl as _export_proxy; - #[cfg(target_arch = "wasm32")] -#[link_section = "component-type:wit-bindgen:0.24.0:proxy-with-all-of-its-exports-removed:encoded worldrust-wasi-from-crates-io-proxy-world"] +#[link_section = "component-type:wit-bindgen:0.29.0:proxy-with-all-of-its-exports-removed:encoded worldrust-wasi-from-crates-io-proxy-world"] #[doc(hidden)] pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 6905] = *b"\ \0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\xdd4\x01A\x02\x01A\x1f\ -\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\x01\x18wasi:random/random@0.2.0\x05\0\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\x01\x01B\x0a\x04\0\x08p\ -ollable\x03\x01\x01h\0\x01@\x01\x04self\x01\0\x7f\x04\0\x16[method]pollable.read\ -y\x01\x02\x01@\x01\x04self\x01\x01\0\x04\0\x16[method]pollable.block\x01\x03\x01\ -p\x01\x01py\x01@\x01\x02in\x04\0\x05\x04\0\x04poll\x01\x06\x03\x01\x12wasi:io/po\ -ll@0.2.0\x05\x02\x02\x03\0\x01\x05error\x02\x03\0\x02\x08pollable\x01B(\x02\x03\x02\ -\x01\x03\x04\0\x05error\x03\0\0\x02\x03\x02\x01\x04\x04\0\x08pollable\x03\0\x02\x01\ -i\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\x01\ -h\x07\x01p}\x01j\x01\x0a\x01\x06\x01@\x02\x04self\x09\x03lenw\0\x0b\x04\0\x19[me\ -thod]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-str\ -eam.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\x03\x01\x15wasi:io/streams@0.2.0\x05\x05\x02\x03\0\x03\x0doutput-stream\x01\ -B\x05\x02\x03\x02\x01\x06\x04\0\x0doutput-stream\x03\0\0\x01i\x01\x01@\0\0\x02\x04\ -\0\x0aget-stdout\x01\x03\x03\x01\x15wasi:cli/stdout@0.2.0\x05\x07\x01B\x05\x02\x03\ -\x02\x01\x06\x04\0\x0doutput-stream\x03\0\0\x01i\x01\x01@\0\0\x02\x04\0\x0aget-s\ -tderr\x01\x03\x03\x01\x15wasi:cli/stderr@0.2.0\x05\x08\x02\x03\0\x03\x0cinput-st\ -ream\x01B\x05\x02\x03\x02\x01\x09\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\x0a\x01B\x0f\ -\x02\x03\x02\x01\x04\x04\0\x08pollable\x03\0\0\x01w\x04\0\x07instant\x03\0\x02\x01\ -w\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-duration\x01\x0a\x03\ -\x01!wasi:clocks/monotonic-clock@0.2.0\x05\x0b\x02\x03\0\x07\x08duration\x01B\xc0\ -\x01\x02\x03\x02\x01\x0c\x04\0\x08duration\x03\0\0\x02\x03\x02\x01\x09\x04\0\x0c\ -input-stream\x03\0\x02\x02\x03\x02\x01\x06\x04\0\x0doutput-stream\x03\0\x04\x02\x03\ -\x02\x01\x03\x04\0\x08io-error\x03\0\x06\x02\x03\x02\x01\x04\x04\0\x08pollable\x03\ -\0\x08\x01q\x0a\x03get\0\0\x04head\0\0\x04post\0\0\x03put\0\0\x06delete\0\0\x07c\ -onnect\0\0\x07options\0\0\x05trace\0\0\x05patch\0\0\x05other\x01s\0\x04\0\x06met\ -hod\x03\0\x0a\x01q\x03\x04HTTP\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-pay\ -load\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\x09\ -DNS-error\x01\x11\0\x15destination-not-found\0\0\x17destination-unavailable\0\0\x19\ -destination-IP-prohibited\0\0\x19destination-IP-unroutable\0\0\x12connection-ref\ -used\0\0\x15connection-terminated\0\0\x12connection-timeout\0\0\x17connection-re\ -ad-timeout\0\0\x18connection-write-timeout\0\0\x18connection-limit-reached\0\0\x12\ -TLS-protocol-error\0\0\x15TLS-certificate-error\0\0\x12TLS-alert-received\x01\x14\ -\0\x13HTTP-request-denied\0\0\x1cHTTP-request-length-required\0\0\x16HTTP-reques\ -t-body-size\x01\x18\0\x1bHTTP-request-method-invalid\0\0\x18HTTP-request-URI-inv\ -alid\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!HT\ -TP-response-header-section-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-trailer-size\x01\x17\0\x1dHTTP-response-transfer-coding\x01\x0e\ -\0\x1cHTTP-response-content-coding\x01\x0e\0\x15HTTP-response-timeout\0\0\x13HTT\ -P-upgrade-failed\0\0\x13HTTP-protocol-error\0\0\x0dloop-detected\0\0\x13configur\ -ation-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\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\x10\ -incoming-request\x03\x01\x04\0\x10outgoing-request\x03\x01\x04\0\x0frequest-opti\ -ons\x03\x01\x04\0\x11response-outparam\x03\x01\x01{\x04\0\x0bstatus-code\x03\0)\x04\ -\0\x11incoming-response\x03\x01\x04\0\x0dincoming-body\x03\x01\x04\0\x0ffuture-t\ -railers\x03\x01\x04\0\x11outgoing-response\x03\x01\x04\0\x0doutgoing-body\x03\x01\ -\x04\0\x18future-incoming-response\x03\x01\x01i\"\x01@\0\01\x04\0\x13[constructo\ -r]fields\x012\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[method]fields.get\x019\x01@\x02\x04self7\x04name\x1f\0\x7f\x04\0\x12[meth\ -od]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]f\ -ields.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.authority\x01C\x01i#\x01@\x01\x04self\xc1\0\0\xc6\0\x04\0\x20[method]in\ -coming-request.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\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-meth\ -od\x01S\x01@\x01\x04self\xcd\0\0\x0e\x04\0([method]outgoing-request.path-with-qu\ -ery\x01T\x01@\x02\x04self\xcd\0\x0fpath-with-query\x0e\0\xd2\0\x04\0,[method]out\ -going-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-reques\ -t.authority\x01T\x01@\x02\x04self\xcd\0\x09authority\x0e\0\xd2\0\x04\0&[method]o\ -utgoing-request.set-authority\x01X\x01@\x01\x04self\xcd\0\0\xc6\0\x04\0\x20[meth\ -od]outgoing-request.headers\x01Y\x01i'\x01@\0\0\xda\0\x04\0\x1c[constructor]requ\ -est-options\x01[\x01h'\x01k\x01\x01@\x01\x04self\xdc\0\0\xdd\0\x04\0'[method]req\ -uest-options.connect-timeout\x01^\x01@\x02\x04self\xdc\0\x08duration\xdd\0\0\xd2\ -\0\x04\0+[method]request-options.set-connect-timeout\x01_\x04\0*[method]request-\ -options.first-byte-timeout\x01^\x04\0.[method]request-options.set-first-byte-tim\ -eout\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-outpa\ -ram.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.heade\ -rs\x01f\x01@\x01\x04self\xe4\0\0\xc9\0\x04\0![method]incoming-response.consume\x01\ -g\x01h,\x01i\x03\x01j\x01\xe9\0\0\x01@\x01\x04self\xe8\0\0\xea\0\x04\0\x1c[metho\ -d]incoming-body.stream\x01k\x01i-\x01@\x01\x04this\xc8\0\0\xec\0\x04\0\x1c[stati\ -c]incoming-body.finish\x01m\x01h-\x01i\x09\x01@\x01\x04self\xee\0\0\xef\0\x04\0!\ -[method]future-trailers.subscribe\x01p\x01i$\x01k\xf1\0\x01j\x01\xf2\0\x01\x1b\x01\ -j\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]outgoi\ -ng-response\x01w\x01h.\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]o\ -utgoing-response.set-status-code\x01z\x01@\x01\x04self\xf8\0\0\xc6\0\x04\0![meth\ -od]outgoing-response.headers\x01{\x01@\x01\x04self\xf8\0\0\xcf\0\x04\0\x1e[metho\ -d]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-incomin\ -g-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\x03err\x8a\x01\0\x8b\x01\x04\ -\0\x0fhttp-error-code\x01\x8c\x01\x03\x01\x15wasi:http/types@0.2.0\x05\x0d\x02\x03\ -\0\x08\x10outgoing-request\x02\x03\0\x08\x0frequest-options\x02\x03\0\x08\x18fut\ -ure-incoming-response\x02\x03\0\x08\x0aerror-code\x01B\x0f\x02\x03\x02\x01\x0e\x04\ -\0\x10outgoing-request\x03\0\0\x02\x03\x02\x01\x0f\x04\0\x0frequest-options\x03\0\ -\x02\x02\x03\x02\x01\x10\x04\0\x18future-incoming-response\x03\0\x04\x02\x03\x02\ -\x01\x11\x04\0\x0aerror-code\x03\0\x06\x01i\x01\x01i\x03\x01k\x09\x01i\x05\x01j\x01\ -\x0b\x01\x07\x01@\x02\x07request\x08\x07options\x0a\0\x0c\x04\0\x06handle\x01\x0d\ -\x03\x01\x20wasi:http/outgoing-handler@0.2.0\x05\x12\x01B\x05\x01r\x02\x07second\ -sw\x0bnanosecondsy\x04\0\x08datetime\x03\0\0\x01@\0\0\x01\x04\0\x03now\x01\x02\x04\ -\0\x0aresolution\x01\x02\x03\x01\x1cwasi:clocks/wall-clock@0.2.0\x05\x13\x04\x01\ -5wasi:http/proxy-with-all-of-its-exports-removed@0.2.0\x04\0\x0b+\x01\0%proxy-wi\ -th-all-of-its-exports-removed\x03\0\0\0G\x09producers\x01\x0cprocessed-by\x02\x0d\ -wit-component\x070.202.0\x10wit-bindgen-rust\x060.24.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]pollab\ +le.block\x01\x03\x01p\x01\x01py\x01@\x01\x02in\x04\0\x05\x04\0\x04poll\x01\x06\x03\ +\x01\x12wasi:io/poll@0.2.1\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\x08dur\ +ation\x03\0\x04\x01@\0\0\x03\x04\0\x03now\x01\x06\x01@\0\0\x05\x04\0\x0aresoluti\ +on\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:clo\ +cks/monotonic-clock@0.2.1\x05\x02\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:i\ +o/error@0.2.1\x05\x03\x02\x03\0\x02\x05error\x01B(\x02\x03\x02\x01\x04\x04\0\x05\ +error\x03\0\0\x02\x03\x02\x01\x01\x04\0\x08pollable\x03\0\x02\x01i\x01\x01q\x02\x15\ +last-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.1\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.1\x05\x09\x01B\x05\x01r\x02\x07seco\ +ndsw\x0bnanosecondsy\x04\0\x08datetime\x03\0\0\x01@\0\0\x01\x04\0\x03now\x01\x02\ +\x04\0\x0aresolution\x01\x02\x03\x01\x1cwasi:clocks/wall-clock@0.2.1\x05\x0a\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\x03\x01\x18wasi:random/random@0.2.1\x05\x0b\x01B\x05\ +\x02\x03\x02\x01\x08\x04\0\x0doutput-stream\x03\0\0\x01i\x01\x01@\0\0\x02\x04\0\x0a\ +get-stdout\x01\x03\x03\x01\x15wasi:cli/stdout@0.2.1\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-stder\ +r\x01\x03\x03\x01\x15wasi:cli/stderr@0.2.1\x05\x0d\x01B\x05\x02\x03\x02\x01\x07\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.1\x05\x0e\x02\x03\0\x04\x10outgoing-request\x02\x03\0\x04\ +\x0frequest-options\x02\x03\0\x04\x18future-incoming-response\x02\x03\0\x04\x0ae\ +rror-code\x01B\x0f\x02\x03\x02\x01\x0f\x04\0\x10outgoing-request\x03\0\0\x02\x03\ +\x02\x01\x10\x04\0\x0frequest-options\x03\0\x02\x02\x03\x02\x01\x11\x04\0\x18fut\ +ure-incoming-response\x03\0\x04\x02\x03\x02\x01\x12\x04\0\x0aerror-code\x03\0\x06\ +\x01i\x01\x01i\x03\x01k\x09\x01i\x05\x01j\x01\x0b\x01\x07\x01@\x02\x07request\x08\ +\x07options\x0a\0\x0c\x04\0\x06handle\x01\x0d\x03\x01\x20wasi:http/outgoing-hand\ +ler@0.2.1\x05\x13\x04\x015wasi:http/proxy-with-all-of-its-exports-removed@0.2.1\x04\ +\0\x0b+\x01\0%proxy-with-all-of-its-exports-removed\x03\0\0\0G\x09producers\x01\x0c\ +processed-by\x02\x0dwit-component\x070.215.0\x10wit-bindgen-rust\x060.29.0"; #[inline(never)] #[doc(hidden)] #[cfg(target_arch = "wasm32")] diff --git a/wit/deps/cli/command.wit b/wit/deps/cli/command.wit index d8005bd..dc064a3 100644 --- a/wit/deps/cli/command.wit +++ b/wit/deps/cli/command.wit @@ -1,7 +1,10 @@ -package wasi:cli@0.2.0; +package wasi:cli@0.2.1; +@since(version = 0.2.0) world command { + @since(version = 0.2.0) include imports; + @since(version = 0.2.0) export run; } diff --git a/wit/deps/cli/environment.wit b/wit/deps/cli/environment.wit index 7006523..2f449bd 100644 --- a/wit/deps/cli/environment.wit +++ b/wit/deps/cli/environment.wit @@ -1,3 +1,4 @@ +@since(version = 0.2.0) interface environment { /// Get the POSIX-style environment variables. /// @@ -7,12 +8,15 @@ interface environment { /// Morally, these are a value import, but until value imports are available /// in the component model, this import function should return the same /// values each time it is called. + @since(version = 0.2.0) get-environment: func() -> list>; /// Get the POSIX-style arguments to the program. + @since(version = 0.2.0) get-arguments: func() -> list; /// Return a path that programs should use as their initial current working /// directory, interpreting `.` as shorthand for this. + @since(version = 0.2.0) initial-cwd: func() -> option; } diff --git a/wit/deps/cli/exit.wit b/wit/deps/cli/exit.wit index d0c2b82..427935c 100644 --- a/wit/deps/cli/exit.wit +++ b/wit/deps/cli/exit.wit @@ -1,4 +1,17 @@ +@since(version = 0.2.0) interface exit { /// Exit the current instance and any linked instances. + @since(version = 0.2.0) exit: func(status: result); + + /// Exit the current instance and any linked instances, reporting the + /// specified status code to the host. + /// + /// The meaning of the code depends on the context, with 0 usually meaning + /// "success", and other values indicating various types of failure. + /// + /// This function does not return; the effect is analogous to a trap, but + /// without the connotation that something bad has happened. + @unstable(feature = cli-exit-with-code) + exit-with-code: func(status-code: u8); } diff --git a/wit/deps/cli/imports.wit b/wit/deps/cli/imports.wit index 083b84a..b8339d3 100644 --- a/wit/deps/cli/imports.wit +++ b/wit/deps/cli/imports.wit @@ -1,20 +1,36 @@ -package wasi:cli@0.2.0; +package wasi:cli@0.2.1; +@since(version = 0.2.0) world imports { - include wasi:clocks/imports@0.2.0; - include wasi:filesystem/imports@0.2.0; - include wasi:sockets/imports@0.2.0; - include wasi:random/imports@0.2.0; - include wasi:io/imports@0.2.0; + @since(version = 0.2.0) + include wasi:clocks/imports@0.2.1; + @since(version = 0.2.0) + include wasi:filesystem/imports@0.2.1; + @since(version = 0.2.0) + include wasi:sockets/imports@0.2.1; + @since(version = 0.2.0) + include wasi:random/imports@0.2.1; + @since(version = 0.2.0) + include wasi:io/imports@0.2.1; + @since(version = 0.2.0) import environment; + @since(version = 0.2.0) import exit; + @since(version = 0.2.0) import stdin; + @since(version = 0.2.0) import stdout; + @since(version = 0.2.0) import stderr; + @since(version = 0.2.0) import terminal-input; + @since(version = 0.2.0) import terminal-output; + @since(version = 0.2.0) import terminal-stdin; + @since(version = 0.2.0) import terminal-stdout; + @since(version = 0.2.0) import terminal-stderr; } diff --git a/wit/deps/cli/run.wit b/wit/deps/cli/run.wit index a70ee8c..655346e 100644 --- a/wit/deps/cli/run.wit +++ b/wit/deps/cli/run.wit @@ -1,4 +1,6 @@ +@since(version = 0.2.0) interface run { /// Run the program. + @since(version = 0.2.0) run: func() -> result; } diff --git a/wit/deps/cli/stdio.wit b/wit/deps/cli/stdio.wit index 31ef35b..d1d26eb 100644 --- a/wit/deps/cli/stdio.wit +++ b/wit/deps/cli/stdio.wit @@ -1,17 +1,26 @@ +@since(version = 0.2.0) interface stdin { - use wasi:io/streams@0.2.0.{input-stream}; + @since(version = 0.2.0) + use wasi:io/streams@0.2.1.{input-stream}; + @since(version = 0.2.0) get-stdin: func() -> input-stream; } +@since(version = 0.2.0) interface stdout { - use wasi:io/streams@0.2.0.{output-stream}; + @since(version = 0.2.0) + use wasi:io/streams@0.2.1.{output-stream}; + @since(version = 0.2.0) get-stdout: func() -> output-stream; } +@since(version = 0.2.0) interface stderr { - use wasi:io/streams@0.2.0.{output-stream}; + @since(version = 0.2.0) + use wasi:io/streams@0.2.1.{output-stream}; + @since(version = 0.2.0) get-stderr: func() -> output-stream; } diff --git a/wit/deps/cli/terminal.wit b/wit/deps/cli/terminal.wit index 38c724e..d305498 100644 --- a/wit/deps/cli/terminal.wit +++ b/wit/deps/cli/terminal.wit @@ -3,8 +3,10 @@ /// 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. +@since(version = 0.2.0) interface terminal-input { /// The input side of a terminal. + @since(version = 0.2.0) resource terminal-input; } @@ -13,37 +15,48 @@ interface terminal-input { /// In the future, this may include functions for querying the terminal /// size, being notified of terminal size changes, querying supported /// features, and so on. +@since(version = 0.2.0) interface terminal-output { /// The output side of a terminal. + @since(version = 0.2.0) resource terminal-output; } /// An interface providing an optional `terminal-input` for stdin as a /// link-time authority. +@since(version = 0.2.0) interface terminal-stdin { + @since(version = 0.2.0) use terminal-input.{terminal-input}; /// If stdin is connected to a terminal, return a `terminal-input` handle /// allowing further interaction with it. + @since(version = 0.2.0) get-terminal-stdin: func() -> option; } /// An interface providing an optional `terminal-output` for stdout as a /// link-time authority. +@since(version = 0.2.0) interface terminal-stdout { + @since(version = 0.2.0) use terminal-output.{terminal-output}; /// If stdout is connected to a terminal, return a `terminal-output` handle /// allowing further interaction with it. + @since(version = 0.2.0) get-terminal-stdout: func() -> option; } /// An interface providing an optional `terminal-output` for stderr as a /// link-time authority. +@since(version = 0.2.0) interface terminal-stderr { + @since(version = 0.2.0) use terminal-output.{terminal-output}; /// If stderr is connected to a terminal, return a `terminal-output` handle /// allowing further interaction with it. + @since(version = 0.2.0) get-terminal-stderr: func() -> option; } diff --git a/wit/deps/clocks/monotonic-clock.wit b/wit/deps/clocks/monotonic-clock.wit index 4e4dc3a..3c24840 100644 --- a/wit/deps/clocks/monotonic-clock.wit +++ b/wit/deps/clocks/monotonic-clock.wit @@ -1,4 +1,4 @@ -package wasi:clocks@0.2.0; +package wasi:clocks@0.2.1; /// WASI Monotonic Clock is a clock API intended to let users measure elapsed /// time. /// @@ -7,38 +7,43 @@ package wasi:clocks@0.2.0; /// /// 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. +@since(version = 0.2.0) interface monotonic-clock { - use wasi:io/poll@0.2.0.{pollable}; + @since(version = 0.2.0) + use wasi:io/poll@0.2.1.{pollable}; /// 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. + @since(version = 0.2.0) type instant = u64; /// A duration of time, in nanoseconds. + @since(version = 0.2.0) type duration = u64; /// Read the current value of the clock. /// /// The clock is monotonic, therefore calling this function repeatedly will /// produce a sequence of non-decreasing values. + @since(version = 0.2.0) now: func() -> instant; /// Query the resolution of the clock. Returns the duration of time /// corresponding to a clock tick. + @since(version = 0.2.0) resolution: func() -> duration; /// Create a `pollable` which will resolve once the specified instant - /// occured. + /// has occurred. + @since(version = 0.2.0) subscribe-instant: func( when: instant, ) -> pollable; - /// Create a `pollable` which will resolve once the given duration has - /// elapsed, starting at the time at which this function was called. - /// occured. + /// Create a `pollable` that will resolve after the specified duration has + /// elapsed from the time this function is invoked. + @since(version = 0.2.0) subscribe-duration: func( when: duration, ) -> pollable; diff --git a/wit/deps/clocks/timezone.wit b/wit/deps/clocks/timezone.wit new file mode 100644 index 0000000..212da66 --- /dev/null +++ b/wit/deps/clocks/timezone.wit @@ -0,0 +1,55 @@ +package wasi:clocks@0.2.1; + +@unstable(feature = clocks-timezone) +interface timezone { + @unstable(feature = clocks-timezone) + use wall-clock.{datetime}; + + /// Return information needed to display the given `datetime`. This includes + /// the UTC offset, the time zone name, and a flag indicating whether + /// daylight saving time is active. + /// + /// If the timezone cannot be determined for the given `datetime`, return a + /// `timezone-display` for `UTC` with a `utc-offset` of 0 and no daylight + /// saving time. + @unstable(feature = clocks-timezone) + display: func(when: datetime) -> timezone-display; + + /// The same as `display`, but only return the UTC offset. + @unstable(feature = clocks-timezone) + utc-offset: func(when: datetime) -> s32; + + /// Information useful for displaying the timezone of a specific `datetime`. + /// + /// This information may vary within a single `timezone` to reflect daylight + /// saving time adjustments. + @unstable(feature = clocks-timezone) + record timezone-display { + /// The number of seconds difference between UTC time and the local + /// time of the timezone. + /// + /// The returned value will always be less than 86400 which is the + /// number of seconds in a day (24*60*60). + /// + /// In implementations that do not expose an actual time zone, this + /// should return 0. + utc-offset: s32, + + /// The abbreviated name of the timezone to display to a user. The name + /// `UTC` indicates Coordinated Universal Time. Otherwise, this should + /// reference local standards for the name of the time zone. + /// + /// In implementations that do not expose an actual time zone, this + /// should be the string `UTC`. + /// + /// In time zones that do not have an applicable name, a formatted + /// representation of the UTC offset may be returned, such as `-04:00`. + name: string, + + /// Whether daylight saving time is active. + /// + /// In implementations that do not expose an actual time zone, this + /// should return false. + in-daylight-saving-time: bool, + } +} diff --git a/wit/deps/clocks/wall-clock.wit b/wit/deps/clocks/wall-clock.wit index 440ca0f..6be069a 100644 --- a/wit/deps/clocks/wall-clock.wit +++ b/wit/deps/clocks/wall-clock.wit @@ -1,4 +1,4 @@ -package wasi:clocks@0.2.0; +package wasi:clocks@0.2.1; /// 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. @@ -13,8 +13,10 @@ package wasi:clocks@0.2.0; /// monotonic, making it unsuitable for measuring elapsed time. /// /// It is intended for reporting the current date and time for humans. +@since(version = 0.2.0) interface wall-clock { /// A time and date in seconds plus nanoseconds. + @since(version = 0.2.0) record datetime { seconds: u64, nanoseconds: u32, @@ -33,10 +35,12 @@ interface wall-clock { /// /// [POSIX's Seconds Since the Epoch]: https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xbd_chap04.html#tag_21_04_16 /// [Unix Time]: https://en.wikipedia.org/wiki/Unix_time + @since(version = 0.2.0) now: func() -> datetime; /// Query the resolution of the clock. /// /// The nanoseconds field of the output is always less than 1000000000. + @since(version = 0.2.0) resolution: func() -> datetime; } diff --git a/wit/deps/clocks/world.wit b/wit/deps/clocks/world.wit index c022457..9251ac6 100644 --- a/wit/deps/clocks/world.wit +++ b/wit/deps/clocks/world.wit @@ -1,6 +1,11 @@ -package wasi:clocks@0.2.0; +package wasi:clocks@0.2.1; +@since(version = 0.2.0) world imports { + @since(version = 0.2.0) import monotonic-clock; + @since(version = 0.2.0) import wall-clock; + @unstable(feature = clocks-timezone) + import timezone; } diff --git a/wit/deps/filesystem/preopens.wit b/wit/deps/filesystem/preopens.wit index da801f6..ca2f726 100644 --- a/wit/deps/filesystem/preopens.wit +++ b/wit/deps/filesystem/preopens.wit @@ -1,8 +1,11 @@ -package wasi:filesystem@0.2.0; +package wasi:filesystem@0.2.1; +@since(version = 0.2.0) interface preopens { + @since(version = 0.2.0) use types.{descriptor}; /// Return the set of preopened directories, and their path. + @since(version = 0.2.0) get-directories: func() -> list>; } diff --git a/wit/deps/filesystem/types.wit b/wit/deps/filesystem/types.wit index 11108fc..db3d968 100644 --- a/wit/deps/filesystem/types.wit +++ b/wit/deps/filesystem/types.wit @@ -1,4 +1,4 @@ -package wasi:filesystem@0.2.0; +package wasi:filesystem@0.2.1; /// 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. @@ -23,16 +23,21 @@ package wasi:filesystem@0.2.0; /// [WASI filesystem path resolution]. /// /// [WASI filesystem path resolution]: https://github.com/WebAssembly/wasi-filesystem/blob/main/path-resolution.md +@since(version = 0.2.0) interface types { - use wasi:io/streams@0.2.0.{input-stream, output-stream, error}; - use wasi:clocks/wall-clock@0.2.0.{datetime}; + @since(version = 0.2.0) + use wasi:io/streams@0.2.1.{input-stream, output-stream, error}; + @since(version = 0.2.0) + use wasi:clocks/wall-clock@0.2.1.{datetime}; /// File size or length of a region within a file. + @since(version = 0.2.0) type filesize = u64; /// The type of a filesystem object referenced by a descriptor. /// /// Note: This was called `filetype` in earlier versions of WASI. + @since(version = 0.2.0) enum descriptor-type { /// The type of the descriptor or file is unknown or is different from /// any of the other types specified. @@ -56,6 +61,7 @@ interface types { /// Descriptor flags. /// /// Note: This was called `fdflags` in earlier versions of WASI. + @since(version = 0.2.0) flags descriptor-flags { /// Read mode: Data can be read. read, @@ -77,7 +83,7 @@ interface types { /// WASI. At this time, it should be interpreted as a request, and not a /// requirement. data-integrity-sync, - /// Requests that reads be performed at the same level of integrety + /// Requests that reads be performed at the same level of integrity /// requested for writes. This is similar to `O_RSYNC` in POSIX. /// /// The precise semantics of this operation have not yet been defined for @@ -99,6 +105,7 @@ interface types { /// File attributes. /// /// Note: This was called `filestat` in earlier versions of WASI. + @since(version = 0.2.0) record descriptor-stat { /// File type. %type: descriptor-type, @@ -125,6 +132,7 @@ interface types { } /// Flags determining the method of how paths are resolved. + @since(version = 0.2.0) flags path-flags { /// As long as the resolved path corresponds to a symbolic link, it is /// expanded. @@ -132,6 +140,7 @@ interface types { } /// Open flags used by `open-at`. + @since(version = 0.2.0) flags open-flags { /// Create file if it does not exist, similar to `O_CREAT` in POSIX. create, @@ -144,9 +153,11 @@ interface types { } /// Number of hard links to an inode. + @since(version = 0.2.0) type link-count = u64; /// When setting a timestamp, this gives the value to set it to. + @since(version = 0.2.0) variant new-timestamp { /// Leave the timestamp set to its previous value. no-change, @@ -248,6 +259,7 @@ interface types { } /// File or memory access pattern advisory information. + @since(version = 0.2.0) enum advice { /// The application has no advice to give on its behavior with respect /// to the specified data. @@ -271,6 +283,7 @@ interface types { /// A 128-bit hash value, split into parts because wasm doesn't have a /// 128-bit integer type. + @since(version = 0.2.0) record metadata-hash-value { /// 64 bits of a 128-bit hash value. lower: u64, @@ -281,6 +294,7 @@ interface types { /// 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. + @since(version = 0.2.0) resource descriptor { /// Return a stream for reading from a file, if available. /// @@ -290,6 +304,7 @@ interface types { /// file and they do not interfere with each other. /// /// Note: This allows using `read-stream`, which is similar to `read` in POSIX. + @since(version = 0.2.0) read-via-stream: func( /// The offset within the file at which to start reading. offset: filesize, @@ -301,6 +316,7 @@ interface types { /// /// Note: This allows using `write-stream`, which is similar to `write` in /// POSIX. + @since(version = 0.2.0) write-via-stream: func( /// The offset within the file at which to start writing. offset: filesize, @@ -312,11 +328,13 @@ interface types { /// /// Note: This allows using `write-stream`, which is similar to `write` with /// `O_APPEND` in in POSIX. + @since(version = 0.2.0) append-via-stream: func() -> result; /// Provide file advisory information on a descriptor. /// /// This is similar to `posix_fadvise` in POSIX. + @since(version = 0.2.0) advise: func( /// The offset within the file to which the advisory applies. offset: filesize, @@ -332,6 +350,7 @@ interface types { /// opened for writing. /// /// Note: This is similar to `fdatasync` in POSIX. + @since(version = 0.2.0) sync-data: func() -> result<_, error-code>; /// Get flags associated with a descriptor. @@ -340,6 +359,7 @@ interface types { /// /// Note: This returns the value that was the `fs_flags` value returned /// from `fdstat_get` in earlier versions of WASI. + @since(version = 0.2.0) get-flags: func() -> result; /// Get the dynamic type of a descriptor. @@ -352,12 +372,14 @@ interface types { /// /// Note: This returns the value that was the `fs_filetype` value returned /// from `fdstat_get` in earlier versions of WASI. + @since(version = 0.2.0) get-type: func() -> result; /// Adjust the size of an open file. If this increases the file's size, the /// extra bytes are filled with zeros. /// /// Note: This was called `fd_filestat_set_size` in earlier versions of WASI. + @since(version = 0.2.0) set-size: func(size: filesize) -> result<_, error-code>; /// Adjust the timestamps of an open file or directory. @@ -365,6 +387,7 @@ interface types { /// Note: This is similar to `futimens` in POSIX. /// /// Note: This was called `fd_filestat_set_times` in earlier versions of WASI. + @since(version = 0.2.0) set-times: func( /// The desired values of the data access timestamp. data-access-timestamp: new-timestamp, @@ -383,6 +406,7 @@ interface types { /// In the future, this may change to return a `stream`. /// /// Note: This is similar to `pread` in POSIX. + @since(version = 0.2.0) read: func( /// The maximum number of bytes to read. length: filesize, @@ -399,6 +423,7 @@ interface types { /// In the future, this may change to take a `stream`. /// /// Note: This is similar to `pwrite` in POSIX. + @since(version = 0.2.0) write: func( /// Data to write buffer: list, @@ -415,6 +440,7 @@ interface types { /// This always returns a new stream which starts at the beginning of the /// directory. Multiple streams may be active on the same directory, and they /// do not interfere with each other. + @since(version = 0.2.0) read-directory: func() -> result; /// Synchronize the data and metadata of a file to disk. @@ -423,11 +449,13 @@ interface types { /// opened for writing. /// /// Note: This is similar to `fsync` in POSIX. + @since(version = 0.2.0) sync: func() -> result<_, error-code>; /// Create a directory. /// /// Note: This is similar to `mkdirat` in POSIX. + @since(version = 0.2.0) create-directory-at: func( /// The relative path at which to create the directory. path: string, @@ -442,6 +470,7 @@ interface types { /// modified, use `metadata-hash`. /// /// Note: This was called `fd_filestat_get` in earlier versions of WASI. + @since(version = 0.2.0) stat: func() -> result; /// Return the attributes of a file or directory. @@ -451,6 +480,7 @@ interface types { /// discussion of alternatives. /// /// Note: This was called `path_filestat_get` in earlier versions of WASI. + @since(version = 0.2.0) stat-at: func( /// Flags determining the method of how the path is resolved. path-flags: path-flags, @@ -464,6 +494,7 @@ interface types { /// /// Note: This was called `path_filestat_set_times` in earlier versions of /// WASI. + @since(version = 0.2.0) set-times-at: func( /// Flags determining the method of how the path is resolved. path-flags: path-flags, @@ -478,6 +509,7 @@ interface types { /// Create a hard link. /// /// Note: This is similar to `linkat` in POSIX. + @since(version = 0.2.0) link-at: func( /// Flags determining the method of how the path is resolved. old-path-flags: path-flags, @@ -507,6 +539,7 @@ interface types { /// `error-code::read-only`. /// /// Note: This is similar to `openat` in POSIX. + @since(version = 0.2.0) open-at: func( /// Flags determining the method of how the path is resolved. path-flags: path-flags, @@ -524,6 +557,7 @@ interface types { /// filesystem, this function fails with `error-code::not-permitted`. /// /// Note: This is similar to `readlinkat` in POSIX. + @since(version = 0.2.0) readlink-at: func( /// The relative path of the symbolic link from which to read. path: string, @@ -534,6 +568,7 @@ interface types { /// Return `error-code::not-empty` if the directory is not empty. /// /// Note: This is similar to `unlinkat(fd, path, AT_REMOVEDIR)` in POSIX. + @since(version = 0.2.0) remove-directory-at: func( /// The relative path to a directory to remove. path: string, @@ -542,6 +577,7 @@ interface types { /// Rename a filesystem object. /// /// Note: This is similar to `renameat` in POSIX. + @since(version = 0.2.0) rename-at: func( /// The relative source path of the file or directory to rename. old-path: string, @@ -557,6 +593,7 @@ interface types { /// `error-code::not-permitted`. /// /// Note: This is similar to `symlinkat` in POSIX. + @since(version = 0.2.0) symlink-at: func( /// The contents of the symbolic link. old-path: string, @@ -568,6 +605,7 @@ interface types { /// /// Return `error-code::is-directory` if the path refers to a directory. /// Note: This is similar to `unlinkat(fd, path, 0)` in POSIX. + @since(version = 0.2.0) unlink-file-at: func( /// The relative path to a file to unlink. path: string, @@ -579,6 +617,7 @@ interface types { /// same device (`st_dev`) and inode (`st_ino` or `d_ino`) numbers. /// wasi-filesystem does not expose device and inode numbers, so this function /// may be used instead. + @since(version = 0.2.0) is-same-object: func(other: borrow) -> bool; /// Return a hash of the metadata associated with a filesystem object referred @@ -600,12 +639,14 @@ interface types { /// computed hash. /// /// However, none of these is required. + @since(version = 0.2.0) metadata-hash: func() -> result; /// Return a hash of the metadata associated with a filesystem object referred /// to by a directory descriptor and a relative path. /// /// This performs the same hash computation as `metadata-hash`. + @since(version = 0.2.0) metadata-hash-at: func( /// Flags determining the method of how the path is resolved. path-flags: path-flags, @@ -615,8 +656,10 @@ interface types { } /// A stream of directory entries. + @since(version = 0.2.0) resource directory-entry-stream { /// Read a single directory entry from a `directory-entry-stream`. + @since(version = 0.2.0) read-directory-entry: func() -> result, error-code>; } @@ -630,5 +673,6 @@ interface types { /// /// Note that this function is fallible because not all stream-related /// errors are filesystem-related errors. + @since(version = 0.2.0) filesystem-error-code: func(err: borrow) -> option; } diff --git a/wit/deps/filesystem/world.wit b/wit/deps/filesystem/world.wit index 663f579..af0146c 100644 --- a/wit/deps/filesystem/world.wit +++ b/wit/deps/filesystem/world.wit @@ -1,6 +1,9 @@ -package wasi:filesystem@0.2.0; +package wasi:filesystem@0.2.1; +@since(version = 0.2.0) world imports { + @since(version = 0.2.0) import types; + @since(version = 0.2.0) import preopens; } diff --git a/wit/deps/http/handler.wit b/wit/deps/http/handler.wit index a34a064..6a6c629 100644 --- a/wit/deps/http/handler.wit +++ b/wit/deps/http/handler.wit @@ -1,6 +1,8 @@ /// This interface defines a handler of incoming HTTP Requests. It should /// be exported by components which can respond to HTTP Requests. +@since(version = 0.2.0) interface incoming-handler { + @since(version = 0.2.0) use types.{incoming-request, response-outparam}; /// This function is invoked with an incoming HTTP Request, and a resource @@ -13,6 +15,7 @@ interface incoming-handler { /// 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. + @since(version = 0.2.0) handle: func( request: incoming-request, response-out: response-outparam @@ -21,7 +24,9 @@ interface incoming-handler { /// This interface defines a handler of outgoing HTTP Requests. It should be /// imported by components which wish to make HTTP Requests. +@since(version = 0.2.0) interface outgoing-handler { + @since(version = 0.2.0) use types.{ outgoing-request, request-options, future-incoming-response, error-code }; @@ -36,6 +41,7 @@ interface outgoing-handler { /// This function may return an error if the `outgoing-request` is invalid /// or not allowed to be made. Otherwise, protocol errors are reported /// through the `future-incoming-response`. + @since(version = 0.2.0) handle: func( request: outgoing-request, options: option diff --git a/wit/deps/http/proxy.wit b/wit/deps/http/proxy.wit index 687c24d..415d2ee 100644 --- a/wit/deps/http/proxy.wit +++ b/wit/deps/http/proxy.wit @@ -1,32 +1,50 @@ -package wasi:http@0.2.0; +package wasi:http@0.2.1; -/// The `wasi:http/proxy` world captures a widely-implementable intersection of -/// hosts that includes HTTP forward and reverse proxies. Components targeting -/// this world may concurrently stream in and out any number of incoming and -/// outgoing HTTP requests. -world proxy { +/// The `wasi:http/imports` world imports all the APIs for HTTP proxies. +/// It is intended to be `include`d in other worlds. +@since(version = 0.2.0) +world imports { /// HTTP proxies have access to time and randomness. - include wasi:clocks/imports@0.2.0; - import wasi:random/random@0.2.0; + @since(version = 0.2.0) + import wasi:clocks/monotonic-clock@0.2.1; + @since(version = 0.2.0) + import wasi:clocks/wall-clock@0.2.1; + @since(version = 0.2.0) + import wasi:random/random@0.2.1; /// Proxies have standard output and error streams which are expected to /// terminate in a developer-facing console provided by the host. - import wasi:cli/stdout@0.2.0; - import wasi:cli/stderr@0.2.0; + @since(version = 0.2.0) + import wasi:cli/stdout@0.2.1; + @since(version = 0.2.0) + import wasi:cli/stderr@0.2.1; /// TODO: this is a temporary workaround until component tooling is able to /// gracefully handle the absence of stdin. Hosts must return an eof stream /// for this import, which is what wasi-libc + tooling will do automatically /// when this import is properly removed. - import wasi:cli/stdin@0.2.0; + @since(version = 0.2.0) + import wasi:cli/stdin@0.2.1; /// This is the default handler to use when user code simply wants to make an /// HTTP request (e.g., via `fetch()`). + @since(version = 0.2.0) import outgoing-handler; +} + +/// The `wasi:http/proxy` world captures a widely-implementable intersection of +/// hosts that includes HTTP forward and reverse proxies. Components targeting +/// this world may concurrently stream in and out any number of incoming and +/// outgoing HTTP requests. +@since(version = 0.2.0) +world proxy { + @since(version = 0.2.0) + include imports; /// The host delivers incoming HTTP requests to a component by calling the /// `handle` function of this exported interface. A host may arbitrarily reuse /// or not reuse component instance when delivering incoming HTTP requests and /// thus a component must be able to handle 0..N calls to `handle`. + @since(version = 0.2.0) export incoming-handler; } diff --git a/wit/deps/http/types.wit b/wit/deps/http/types.wit index 755ac6a..3c45cd0 100644 --- a/wit/deps/http/types.wit +++ b/wit/deps/http/types.wit @@ -1,13 +1,19 @@ /// 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. +@since(version = 0.2.0) interface types { - use wasi:clocks/monotonic-clock@0.2.0.{duration}; - use wasi:io/streams@0.2.0.{input-stream, output-stream}; - use wasi:io/error@0.2.0.{error as io-error}; - use wasi:io/poll@0.2.0.{pollable}; + @since(version = 0.2.0) + use wasi:clocks/monotonic-clock@0.2.1.{duration}; + @since(version = 0.2.0) + use wasi:io/streams@0.2.1.{input-stream, output-stream}; + @since(version = 0.2.0) + use wasi:io/error@0.2.1.{error as io-error}; + @since(version = 0.2.0) + use wasi:io/poll@0.2.1.{pollable}; /// This type corresponds to HTTP standard Methods. + @since(version = 0.2.0) variant method { get, head, @@ -22,6 +28,7 @@ interface types { } /// This type corresponds to HTTP standard Related Schemes. + @since(version = 0.2.0) variant scheme { HTTP, HTTPS, @@ -30,6 +37,7 @@ interface types { /// 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 + @since(version = 0.2.0) variant error-code { DNS-timeout, DNS-error(DNS-error-payload), @@ -78,18 +86,21 @@ interface types { } /// Defines the case payload type for `DNS-error` above: + @since(version = 0.2.0) record DNS-error-payload { rcode: option, info-code: option } /// Defines the case payload type for `TLS-alert-received` above: + @since(version = 0.2.0) record TLS-alert-received-payload { alert-id: option, alert-message: option } /// Defines the case payload type for `HTTP-response-{header,trailer}-size` above: + @since(version = 0.2.0) record field-size-payload { field-name: option, field-size: option @@ -106,10 +117,12 @@ interface types { /// /// Note that this function is fallible because not all io-errors are /// http-related errors. + @since(version = 0.2.0) http-error-code: func(err: borrow) -> option; /// This type enumerates the different kinds of errors that may occur when /// setting or appending to a `fields` resource. + @since(version = 0.2.0) variant header-error { /// This error indicates that a `field-key` or `field-value` was /// syntactically invalid when used with an operation that sets headers in a @@ -126,11 +139,13 @@ interface types { } /// Field keys are always strings. + @since(version = 0.2.0) type field-key = string; /// Field values should always be ASCII strings. However, in /// reality, HTTP implementations often have to interpret malformed values, /// so they are provided as a list of bytes. + @since(version = 0.2.0) type field-value = list; /// This following block defines the `fields` resource which corresponds to @@ -143,11 +158,13 @@ interface types { /// `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`. + @since(version = 0.2.0) resource fields { /// Construct an empty HTTP Fields. /// /// The resulting `fields` is mutable. + @since(version = 0.2.0) constructor(); /// Construct an HTTP Fields. @@ -159,42 +176,55 @@ interface types { /// list with the same key. /// /// The tuple is a pair of the field key, represented as a string, and - /// Value, represented as a list of bytes. In a valid Fields, all keys - /// and values are valid UTF-8 strings. However, values are not always - /// well-formed, so they are represented as a raw list of bytes. + /// Value, represented as a list of bytes. /// - /// An error result will be returned if any header or value was - /// syntactically invalid, or if a header was forbidden. + /// An error result will be returned if any `field-key` or `field-value` is + /// syntactically invalid, or if a field is forbidden. + @since(version = 0.2.0) from-list: static func( entries: list> ) -> result; /// Get all of the values corresponding to a key. If the key is not present - /// 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. + /// in this `fields` or is syntactically invalid, 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. + @since(version = 0.2.0) get: func(name: field-key) -> list; /// Returns `true` when the key is present in this `fields`. If the key is /// syntactically invalid, `false` is returned. + @since(version = 0.2.0) has: func(name: field-key) -> bool; /// Set all of the values for a key. Clears any existing values for that /// key, if they have been set. /// /// Fails with `header-error.immutable` if the `fields` are immutable. + /// + /// Fails with `header-error.invalid-syntax` if the `field-key` or any of + /// the `field-value`s are syntactically invalid. + @since(version = 0.2.0) set: func(name: field-key, value: list) -> result<_, header-error>; /// Delete all values for a key. Does nothing if no values for the key /// exist. /// /// Fails with `header-error.immutable` if the `fields` are immutable. + /// + /// Fails with `header-error.invalid-syntax` if the `field-key` is + /// syntactically invalid. + @since(version = 0.2.0) delete: func(name: field-key) -> result<_, header-error>; /// Append a value for a key. Does not change or delete any existing /// values for that key. /// /// Fails with `header-error.immutable` if the `fields` are immutable. + /// + /// Fails with `header-error.invalid-syntax` if the `field-key` or + /// `field-value` are syntactically invalid. + @since(version = 0.2.0) append: func(name: field-key, value: field-value) -> result<_, header-error>; /// Retrieve the full set of keys and values in the Fields. Like the @@ -203,33 +233,42 @@ interface types { /// The outer list represents each key-value pair in the Fields. Keys /// which have multiple values are represented by multiple entries in this /// list with the same key. + @since(version = 0.2.0) entries: func() -> list>; - /// Make a deep copy of the Fields. Equivelant in behavior to calling the + /// Make a deep copy of the Fields. Equivalent in behavior to calling the /// `fields` constructor on the return value of `entries`. The resulting /// `fields` is mutable. + @since(version = 0.2.0) clone: func() -> fields; } /// Headers is an alias for Fields. + @since(version = 0.2.0) type headers = fields; /// Trailers is an alias for Fields. + @since(version = 0.2.0) type trailers = fields; /// Represents an incoming HTTP Request. + @since(version = 0.2.0) resource incoming-request { /// Returns the method of the incoming request. + @since(version = 0.2.0) method: func() -> method; /// Returns the path with query parameters from the request, as a string. + @since(version = 0.2.0) path-with-query: func() -> option; /// Returns the protocol scheme from the request. + @since(version = 0.2.0) scheme: func() -> option; - /// Returns the authority from the request, if it was present. + /// Returns the authority of the Request's target URI, if present. + @since(version = 0.2.0) authority: func() -> option; /// Get the `headers` associated with the request. @@ -240,14 +279,17 @@ interface types { /// The `headers` returned are a child resource: it must be dropped before /// the parent `incoming-request` is dropped. Dropping this /// `incoming-request` before all children are dropped will trap. + @since(version = 0.2.0) headers: func() -> headers; /// Gives the `incoming-body` associated with this request. Will only /// return success at most once, and subsequent calls will return error. + @since(version = 0.2.0) consume: func() -> result; } /// Represents an outgoing HTTP Request. + @since(version = 0.2.0) resource outgoing-request { /// Construct a new `outgoing-request` with a default `method` of `GET`, and @@ -260,6 +302,7 @@ interface types { /// and `authority`, or `headers` which are not permitted to be sent. /// It is the obligation of the `outgoing-handler.handle` implementation /// to reject invalid constructions of `outgoing-request`. + @since(version = 0.2.0) constructor( headers: headers ); @@ -270,38 +313,47 @@ interface types { /// Returns success on the first call: the `outgoing-body` resource for /// this `outgoing-request` can be retrieved at most once. Subsequent /// calls will return error. + @since(version = 0.2.0) body: func() -> result; /// Get the Method for the Request. + @since(version = 0.2.0) method: func() -> method; /// Set the Method for the Request. Fails if the string present in a /// `method.other` argument is not a syntactically valid method. + @since(version = 0.2.0) set-method: func(method: method) -> result; /// Get the combination of the HTTP Path and Query for the Request. /// When `none`, this represents an empty Path and empty Query. + @since(version = 0.2.0) path-with-query: func() -> option; /// 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. + @since(version = 0.2.0) set-path-with-query: func(path-with-query: option) -> result; /// Get the HTTP Related Scheme for the Request. When `none`, the /// implementation may choose an appropriate default scheme. + @since(version = 0.2.0) scheme: func() -> option; /// Set the HTTP Related Scheme for the Request. When `none`, the /// implementation may choose an appropriate default scheme. Fails if the /// string given is not a syntactically valid uri scheme. + @since(version = 0.2.0) set-scheme: func(scheme: option) -> result; - /// Get the HTTP Authority for the Request. A value of `none` may be used - /// with Related Schemes which do not require an Authority. The HTTP and + /// Get the authority of the Request's target URI. A value of `none` may be used + /// with Related Schemes which do not require an authority. The HTTP and /// HTTPS schemes always require an authority. + @since(version = 0.2.0) authority: func() -> option; - /// Set the HTTP Authority for the Request. A value of `none` may be used - /// with Related Schemes which do not require an Authority. The HTTP and + /// Set the authority of the Request's target URI. A value of `none` may be used + /// 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. + /// not a syntactically valid URI authority. + @since(version = 0.2.0) set-authority: func(authority: option) -> result; /// Get the headers associated with the Request. @@ -310,8 +362,9 @@ interface types { /// `delete` operations will fail with `header-error.immutable`. /// /// This headers resource is a child: it must be dropped before the parent - /// `outgoing-request` is dropped, or its ownership is transfered to + /// `outgoing-request` is dropped, or its ownership is transferred to /// another component by e.g. `outgoing-handler.handle`. + @since(version = 0.2.0) headers: func() -> headers; } @@ -321,31 +374,39 @@ interface types { /// /// These timeouts are separate from any the user may use to bound a /// blocking call to `wasi:io/poll.poll`. + @since(version = 0.2.0) resource request-options { /// Construct a default `request-options` value. + @since(version = 0.2.0) constructor(); /// The timeout for the initial connect to the HTTP Server. + @since(version = 0.2.0) connect-timeout: func() -> option; /// Set the timeout for the initial connect to the HTTP Server. An error /// return value indicates that this timeout is not supported. + @since(version = 0.2.0) set-connect-timeout: func(duration: option) -> result; /// The timeout for receiving the first byte of the Response body. + @since(version = 0.2.0) first-byte-timeout: func() -> option; /// Set the timeout for receiving the first byte of the Response body. An /// error return value indicates that this timeout is not supported. + @since(version = 0.2.0) set-first-byte-timeout: func(duration: option) -> result; /// The timeout for receiving subsequent chunks of bytes in the Response /// body stream. + @since(version = 0.2.0) between-bytes-timeout: func() -> option; /// Set the timeout for receiving subsequent chunks of bytes in the Response /// body stream. An error return value indicates that this timeout is not /// supported. + @since(version = 0.2.0) set-between-bytes-timeout: func(duration: option) -> result; } @@ -354,6 +415,7 @@ interface types { /// 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`. + @since(version = 0.2.0) resource response-outparam { /// Set the value of the `response-outparam` to either send a response, @@ -365,6 +427,7 @@ interface types { /// /// The user may provide an `error` to `response` to allow the /// implementation determine how to respond with an HTTP error response. + @since(version = 0.2.0) set: static func( param: response-outparam, response: result, @@ -372,12 +435,15 @@ interface types { } /// This type corresponds to the HTTP standard Status Code. + @since(version = 0.2.0) type status-code = u16; /// Represents an incoming HTTP Response. + @since(version = 0.2.0) resource incoming-response { /// Returns the status code from the incoming response. + @since(version = 0.2.0) status: func() -> status-code; /// Returns the headers from the incoming response. @@ -387,10 +453,12 @@ interface types { /// /// This headers resource is a child: it must be dropped before the parent /// `incoming-response` is dropped. + @since(version = 0.2.0) headers: func() -> headers; /// Returns the incoming body. May be called at most once. Returns error /// if called additional times. + @since(version = 0.2.0) consume: func() -> result; } @@ -402,6 +470,7 @@ interface types { /// 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. + @since(version = 0.2.0) resource incoming-body { /// Returns the contents of the body, as a stream of bytes. @@ -419,26 +488,30 @@ interface types { /// backpressure is to be applied when the user is consuming the body, /// and for that backpressure to not inhibit delivery of the trailers if /// the user does not read the entire body. + @since(version = 0.2.0) %stream: func() -> result; /// Takes ownership of `incoming-body`, and returns a `future-trailers`. /// This function will trap if the `input-stream` child is still alive. + @since(version = 0.2.0) finish: static func(this: incoming-body) -> future-trailers; } - /// Represents a future which may eventaully return trailers, or an error. + /// Represents a future which may eventually 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. + @since(version = 0.2.0) resource future-trailers { /// Returns a pollable which becomes ready when either the trailers have - /// been received, or an error has occured. When this pollable is ready, + /// been received, or an error has occurred. When this pollable is ready, /// the `get` method will return `some`. + @since(version = 0.2.0) subscribe: func() -> pollable; - /// Returns the contents of the trailers, or an error which occured, + /// Returns the contents of the trailers, or an error which occurred, /// once the future is ready. /// /// The outer `option` represents future readiness. Users can wait on this @@ -450,17 +523,19 @@ interface types { /// /// The inner `result` represents that either the HTTP Request or Response /// body, as well as any trailers, were received successfully, or that an - /// error occured receiving them. The optional `trailers` indicates whether + /// error occurred receiving them. The optional `trailers` indicates whether /// or not trailers were present in the body. /// /// When some `trailers` are returned by this method, the `trailers` /// 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. + @since(version = 0.2.0) get: func() -> option, error-code>>>; } /// Represents an outgoing HTTP Response. + @since(version = 0.2.0) resource outgoing-response { /// Construct an `outgoing-response`, with a default `status-code` of `200`. @@ -468,13 +543,16 @@ interface types { /// `set-status-code` method. /// /// * `headers` is the HTTP Headers for the Response. + @since(version = 0.2.0) constructor(headers: headers); /// Get the HTTP Status Code for the Response. + @since(version = 0.2.0) status-code: func() -> status-code; /// Set the HTTP Status Code for the Response. Fails if the status-code /// given is not a valid http status code. + @since(version = 0.2.0) set-status-code: func(status-code: status-code) -> result; /// Get the headers associated with the Request. @@ -483,8 +561,9 @@ interface types { /// `delete` operations will fail with `header-error.immutable`. /// /// This headers resource is a child: it must be dropped before the parent - /// `outgoing-request` is dropped, or its ownership is transfered to + /// `outgoing-request` is dropped, or its ownership is transferred to /// another component by e.g. `outgoing-handler.handle`. + @since(version = 0.2.0) headers: func() -> headers; /// Returns the resource corresponding to the outgoing Body for this Response. @@ -492,6 +571,7 @@ interface types { /// Returns success on the first call: the `outgoing-body` resource for /// this `outgoing-response` can be retrieved at most once. Subsequent /// calls will return error. + @since(version = 0.2.0) body: func() -> result; } @@ -507,10 +587,11 @@ interface types { /// /// If the user code drops this resource, as opposed to calling the static /// method `finish`, the implementation should treat the body as incomplete, - /// and that an error has occured. The implementation should propogate this + /// and that an error has occurred. The implementation should propagate this /// 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. + @since(version = 0.2.0) resource outgoing-body { /// Returns a stream for writing the body contents. @@ -522,6 +603,7 @@ interface types { /// Returns success on the first call: the `output-stream` resource for /// this `outgoing-body` may be retrieved at most once. Subsequent calls /// will return error. + @since(version = 0.2.0) write: func() -> result; /// Finalize an outgoing body, optionally providing trailers. This must be @@ -533,21 +615,24 @@ interface types { /// constructed with a Content-Length header, and the contents written /// to the body (via `write`) does not match the value given in the /// Content-Length. + @since(version = 0.2.0) finish: static func( this: outgoing-body, trailers: option ) -> result<_, error-code>; } - /// Represents a future which may eventaully return an incoming HTTP + /// Represents a future which may eventually 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. + @since(version = 0.2.0) resource future-incoming-response { /// Returns a pollable which becomes ready when either the Response has - /// been received, or an error has occured. When this pollable is ready, + /// been received, or an error has occurred. When this pollable is ready, /// the `get` method will return `some`. + @since(version = 0.2.0) subscribe: func() -> pollable; /// Returns the incoming HTTP Response, or an error, once one is ready. @@ -560,11 +645,11 @@ interface types { /// is `some`, and error on subsequent calls. /// /// The inner `result` represents that either the incoming HTTP Response - /// status and headers have recieved successfully, or that an error - /// occured. Errors may also occur while consuming the response body, + /// status and headers have received successfully, or that an error + /// occurred. Errors may also occur while consuming the response body, /// but those will be reported by the `incoming-body` and its /// `output-stream` child. + @since(version = 0.2.0) get: func() -> option>>; - } } diff --git a/wit/deps/io/error.wit b/wit/deps/io/error.wit index 22e5b64..4ea29c4 100644 --- a/wit/deps/io/error.wit +++ b/wit/deps/io/error.wit @@ -1,6 +1,6 @@ -package wasi:io@0.2.0; - +package wasi:io@0.2.1; +@since(version = 0.2.0) interface error { /// A resource which represents some error information. /// @@ -11,16 +11,15 @@ interface error { /// `wasi:io/streams/stream-error` type. /// /// To provide more specific error information, other interfaces may - /// provide functions to further "downcast" this error into more specific - /// error information. For example, `error`s returned in streams derived - /// from filesystem types to be described using the filesystem's own - /// error-code type, using the function - /// `wasi:filesystem/types/filesystem-error-code`, which takes a parameter - /// `borrow` and returns - /// `option`. + /// offer functions to "downcast" this error into more specific types. For example, + /// errors returned from streams derived from filesystem types can be described using + /// the filesystem's own error-code type. This is done using the function + /// `wasi:filesystem/types/filesystem-error-code`, which takes a `borrow` + /// parameter and returns an `option`. /// /// The set of functions which can "downcast" an `error` into a more /// concrete type is open. + @since(version = 0.2.0) resource error { /// Returns a string that is suitable to assist humans in debugging /// this error. @@ -29,6 +28,7 @@ interface error { /// It may change across platforms, hosts, or other implementation /// details. Parsing this string is a major platform-compatibility /// hazard. + @since(version = 0.2.0) to-debug-string: func() -> string; } } diff --git a/wit/deps/io/poll.wit b/wit/deps/io/poll.wit index ddc67f8..b25ac72 100644 --- a/wit/deps/io/poll.wit +++ b/wit/deps/io/poll.wit @@ -1,14 +1,17 @@ -package wasi:io@0.2.0; +package wasi:io@0.2.1; /// A poll API intended to let users wait for I/O events on multiple handles /// at once. +@since(version = 0.2.0) interface poll { /// `pollable` represents a single I/O event which may be ready, or not. + @since(version = 0.2.0) resource pollable { /// Return the readiness of a pollable. This function never blocks. /// /// Returns `true` when the pollable is ready, and `false` otherwise. + @since(version = 0.2.0) ready: func() -> bool; /// `block` returns immediately if the pollable is ready, and otherwise @@ -16,6 +19,7 @@ interface poll { /// /// This function is equivalent to calling `poll.poll` on a list /// containing only this pollable. + @since(version = 0.2.0) block: func(); } @@ -27,8 +31,9 @@ interface poll { /// The result `list` contains one or more indices of handles in the /// argument list that is ready for I/O. /// - /// If the list contains more elements than can be indexed with a `u32` - /// value, this function traps. + /// This function traps if either: + /// - the list is empty, or: + /// - the list contains more elements than can be indexed with a `u32` value. /// /// A timeout can be implemented by adding a pollable from the /// wasi-clocks API to the list. @@ -36,6 +41,7 @@ interface poll { /// This function does not return a `result`; polling in itself does not /// do any I/O so it doesn't fail. If any of the I/O sources identified by /// the pollables has an error, it is indicated by marking the source as - /// being reaedy for I/O. + /// being ready for I/O. + @since(version = 0.2.0) poll: func(in: list>) -> list; } diff --git a/wit/deps/io/streams.wit b/wit/deps/io/streams.wit index 6d2f871..b697e24 100644 --- a/wit/deps/io/streams.wit +++ b/wit/deps/io/streams.wit @@ -1,15 +1,19 @@ -package wasi:io@0.2.0; +package wasi:io@0.2.1; /// 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. +@since(version = 0.2.0) interface streams { + @since(version = 0.2.0) use error.{error}; + @since(version = 0.2.0) use poll.{pollable}; /// An error for input-stream and output-stream operations. + @since(version = 0.2.0) variant stream-error { /// The last operation (a write or flush) failed before completion. /// @@ -29,6 +33,7 @@ interface streams { /// 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`. + @since(version = 0.2.0) resource input-stream { /// Perform a non-blocking read from the stream. /// @@ -56,6 +61,7 @@ interface streams { /// is not possible to allocate in wasm32, or not desirable to allocate as /// as a return value by the callee. The callee may return a list of bytes /// less than `len` in size while more bytes are available for reading. + @since(version = 0.2.0) read: func( /// The maximum number of bytes to read len: u64 @@ -63,6 +69,7 @@ interface streams { /// Read bytes from a stream, after blocking until at least one byte can /// be read. Except for blocking, behavior is identical to `read`. + @since(version = 0.2.0) blocking-read: func( /// The maximum number of bytes to read len: u64 @@ -72,6 +79,7 @@ interface streams { /// /// Behaves identical to `read`, except instead of returning a list /// of bytes, returns the number of bytes consumed from the stream. + @since(version = 0.2.0) skip: func( /// The maximum number of bytes to skip. len: u64, @@ -79,6 +87,7 @@ interface streams { /// Skip bytes from a stream, after blocking until at least one byte /// can be skipped. Except for blocking behavior, identical to `skip`. + @since(version = 0.2.0) blocking-skip: func( /// The maximum number of bytes to skip. len: u64, @@ -90,6 +99,7 @@ interface streams { /// The created `pollable` is a child resource of the `input-stream`. /// Implementations may trap if the `input-stream` is dropped before /// all derived `pollable`s created with this function are dropped. + @since(version = 0.2.0) subscribe: func() -> pollable; } @@ -102,6 +112,11 @@ interface streams { /// 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`. + /// + /// Dropping an `output-stream` while there's still an active write in + /// progress may result in the data being lost. Before dropping the stream, + /// be sure to fully flush your writes. + @since(version = 0.2.0) resource output-stream { /// Check readiness for writing. This function never blocks. /// @@ -112,6 +127,7 @@ interface streams { /// When this function returns 0 bytes, the `subscribe` pollable will /// become ready when this function will report at least 1 byte, or an /// error. + @since(version = 0.2.0) check-write: func() -> result; /// Perform a write. This function never blocks. @@ -127,6 +143,7 @@ interface streams { /// /// returns Err(closed) without writing if the stream has closed since /// the last call to check-write provided a permit. + @since(version = 0.2.0) write: func( contents: list ) -> result<_, stream-error>; @@ -155,6 +172,7 @@ interface streams { /// // Check for any errors that arose during `flush` /// let _ = this.check-write(); // eliding error handling /// ``` + @since(version = 0.2.0) blocking-write-and-flush: func( contents: list ) -> result<_, stream-error>; @@ -169,14 +187,16 @@ interface streams { /// writes (`check-write` will return `ok(0)`) until the flush has /// completed. The `subscribe` pollable will become ready when the /// flush has completed and the stream can accept more writes. + @since(version = 0.2.0) flush: func() -> result<_, stream-error>; /// Request to flush buffered output, and block until flush completes /// and stream is ready for writing again. + @since(version = 0.2.0) blocking-flush: func() -> result<_, stream-error>; /// Create a `pollable` which will resolve once the output-stream - /// is ready for more writing, or an error has occured. When this + /// is ready for more writing, or an error has occurred. When this /// pollable is ready, `check-write` will return `ok(n)` with n>0, or an /// error. /// @@ -193,6 +213,7 @@ interface streams { /// preconditions (must use check-write first), but instead of /// passing a list of bytes, you simply pass the number of zero-bytes /// that should be written. + @since(version = 0.2.0) write-zeroes: func( /// The number of zero-bytes to write len: u64 @@ -222,6 +243,7 @@ interface streams { /// // Check for any errors that arose during `flush` /// let _ = this.check-write(); // eliding error handling /// ``` + @since(version = 0.2.0) blocking-write-zeroes-and-flush: func( /// The number of zero-bytes to write len: u64 @@ -229,7 +251,7 @@ interface streams { /// Read from one stream and write to another. /// - /// The behavior of splice is equivelant to: + /// The behavior of splice is equivalent to: /// 1. calling `check-write` on the `output-stream` /// 2. calling `read` on the `input-stream` with the smaller of the /// `check-write` permitted length and the `len` provided to `splice` @@ -240,6 +262,7 @@ interface streams { /// /// This function returns the number of bytes transferred; it may be less /// than `len`. + @since(version = 0.2.0) splice: func( /// The stream to read from src: borrow, @@ -252,6 +275,7 @@ interface streams { /// This is similar to `splice`, except that it blocks until the /// `output-stream` is ready for writing, and the `input-stream` /// is ready for reading, before performing the `splice`. + @since(version = 0.2.0) blocking-splice: func( /// The stream to read from src: borrow, diff --git a/wit/deps/io/world.wit b/wit/deps/io/world.wit index 5f0b43f..6405a4e 100644 --- a/wit/deps/io/world.wit +++ b/wit/deps/io/world.wit @@ -1,6 +1,10 @@ -package wasi:io@0.2.0; +package wasi:io@0.2.1; +@since(version = 0.2.0) world imports { + @since(version = 0.2.0) import streams; + + @since(version = 0.2.0) import poll; } diff --git a/wit/deps/random/insecure-seed.wit b/wit/deps/random/insecure-seed.wit index 47210ac..7e708dc 100644 --- a/wit/deps/random/insecure-seed.wit +++ b/wit/deps/random/insecure-seed.wit @@ -1,8 +1,9 @@ -package wasi:random@0.2.0; +package wasi:random@0.2.1; /// The insecure-seed interface for seeding hash-map DoS resistance. /// /// It is intended to be portable at least between Unix-family platforms and /// Windows. +@since(version = 0.2.0) interface insecure-seed { /// Return a 128-bit value that may contain a pseudo-random value. /// @@ -21,5 +22,6 @@ interface insecure-seed { /// This will likely be changed to a value import, to prevent it from being /// called multiple times and potentially used for purposes other than DoS /// protection. + @since(version = 0.2.0) insecure-seed: func() -> tuple; } diff --git a/wit/deps/random/insecure.wit b/wit/deps/random/insecure.wit index c58f4ee..3cdb53d 100644 --- a/wit/deps/random/insecure.wit +++ b/wit/deps/random/insecure.wit @@ -1,8 +1,9 @@ -package wasi:random@0.2.0; +package wasi:random@0.2.1; /// The insecure interface for insecure pseudo-random numbers. /// /// It is intended to be portable at least between Unix-family platforms and /// Windows. +@since(version = 0.2.0) interface insecure { /// Return `len` insecure pseudo-random bytes. /// @@ -12,11 +13,13 @@ interface insecure { /// There are no requirements on the values of the returned bytes, however /// implementations are encouraged to return evenly distributed values with /// a long period. + @since(version = 0.2.0) get-insecure-random-bytes: func(len: u64) -> list; /// Return an insecure pseudo-random `u64` value. /// /// This function returns the same type of pseudo-random data as /// `get-insecure-random-bytes`, represented as a `u64`. + @since(version = 0.2.0) get-insecure-random-u64: func() -> u64; } diff --git a/wit/deps/random/random.wit b/wit/deps/random/random.wit index 0c017f0..2b5035d 100644 --- a/wit/deps/random/random.wit +++ b/wit/deps/random/random.wit @@ -1,8 +1,9 @@ -package wasi:random@0.2.0; +package wasi:random@0.2.1; /// WASI Random is a random data API. /// /// It is intended to be portable at least between Unix-family platforms and /// Windows. +@since(version = 0.2.0) interface random { /// Return `len` cryptographically-secure random or pseudo-random bytes. /// @@ -16,11 +17,13 @@ interface random { /// This function must always return fresh data. Deterministic environments /// must omit this function, rather than implementing it with deterministic /// data. + @since(version = 0.2.0) get-random-bytes: func(len: u64) -> list; /// Return a cryptographically-secure random or pseudo-random `u64` value. /// /// This function returns the same type of data as `get-random-bytes`, /// represented as a `u64`. + @since(version = 0.2.0) get-random-u64: func() -> u64; } diff --git a/wit/deps/random/world.wit b/wit/deps/random/world.wit index 3da3491..c615e96 100644 --- a/wit/deps/random/world.wit +++ b/wit/deps/random/world.wit @@ -1,7 +1,13 @@ -package wasi:random@0.2.0; +package wasi:random@0.2.1; +@since(version = 0.2.0) world imports { + @since(version = 0.2.0) import random; + + @since(version = 0.2.0) import insecure; + + @since(version = 0.2.0) import insecure-seed; } diff --git a/wit/deps/sockets/instance-network.wit b/wit/deps/sockets/instance-network.wit index e455d0f..5f6e6c1 100644 --- a/wit/deps/sockets/instance-network.wit +++ b/wit/deps/sockets/instance-network.wit @@ -1,9 +1,11 @@ /// This interface provides a value-export of the default network handle.. +@since(version = 0.2.0) interface instance-network { + @since(version = 0.2.0) use network.{network}; /// Get a handle to the default network. + @since(version = 0.2.0) instance-network: func() -> network; - } diff --git a/wit/deps/sockets/ip-name-lookup.wit b/wit/deps/sockets/ip-name-lookup.wit index 8e639ec..dc56f30 100644 --- a/wit/deps/sockets/ip-name-lookup.wit +++ b/wit/deps/sockets/ip-name-lookup.wit @@ -1,9 +1,10 @@ - +@since(version = 0.2.0) interface ip-name-lookup { - use wasi:io/poll@0.2.0.{pollable}; + @since(version = 0.2.0) + use wasi:io/poll@0.2.1.{pollable}; + @since(version = 0.2.0) use network.{network, error-code, ip-address}; - /// Resolve an internet host name to a list of IP addresses. /// /// Unicode domain names are automatically converted to ASCII using IDNA encoding. @@ -24,8 +25,10 @@ interface ip-name-lookup { /// - /// - /// - + @since(version = 0.2.0) resolve-addresses: func(network: borrow, name: string) -> result; + @since(version = 0.2.0) resource resolve-address-stream { /// Returns the next address from the resolver. /// @@ -40,12 +43,14 @@ interface ip-name-lookup { /// - `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) + @since(version = 0.2.0) resolve-next-address: func() -> result, error-code>; /// Create a `pollable` which will resolve once the stream is ready for I/O. /// /// Note: this function is here for WASI Preview2 only. /// It's planned to be removed when `future` is natively supported in Preview3. + @since(version = 0.2.0) subscribe: func() -> pollable; } } diff --git a/wit/deps/sockets/network.wit b/wit/deps/sockets/network.wit index 9cadf06..8c13b34 100644 --- a/wit/deps/sockets/network.wit +++ b/wit/deps/sockets/network.wit @@ -1,8 +1,9 @@ - +@since(version = 0.2.0) interface network { /// 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. + @since(version = 0.2.0) resource network; /// Error codes. @@ -17,6 +18,7 @@ interface network { /// - `concurrency-conflict` /// /// See each individual API for what the POSIX equivalents are. They sometimes differ per API. + @since(version = 0.2.0) enum error-code { /// Unknown error unknown, @@ -103,6 +105,7 @@ interface network { permanent-resolver-failure, } + @since(version = 0.2.0) enum ip-address-family { /// Similar to `AF_INET` in POSIX. ipv4, @@ -111,14 +114,18 @@ interface network { ipv6, } + @since(version = 0.2.0) type ipv4-address = tuple; + @since(version = 0.2.0) type ipv6-address = tuple; + @since(version = 0.2.0) variant ip-address { ipv4(ipv4-address), ipv6(ipv6-address), } + @since(version = 0.2.0) record ipv4-socket-address { /// sin_port port: u16, @@ -126,6 +133,7 @@ interface network { address: ipv4-address, } + @since(version = 0.2.0) record ipv6-socket-address { /// sin6_port port: u16, @@ -137,9 +145,9 @@ interface network { scope-id: u32, } + @since(version = 0.2.0) variant ip-socket-address { ipv4(ipv4-socket-address), ipv6(ipv6-socket-address), } - } diff --git a/wit/deps/sockets/tcp-create-socket.wit b/wit/deps/sockets/tcp-create-socket.wit index c7ddf1f..eedbd30 100644 --- a/wit/deps/sockets/tcp-create-socket.wit +++ b/wit/deps/sockets/tcp-create-socket.wit @@ -1,6 +1,8 @@ - +@since(version = 0.2.0) interface tcp-create-socket { + @since(version = 0.2.0) use network.{network, error-code, ip-address-family}; + @since(version = 0.2.0) use tcp.{tcp-socket}; /// Create a new TCP socket. @@ -23,5 +25,6 @@ interface tcp-create-socket { /// - /// - /// - + @since(version = 0.2.0) create-tcp-socket: func(address-family: ip-address-family) -> result; } diff --git a/wit/deps/sockets/tcp.wit b/wit/deps/sockets/tcp.wit index 5902b9e..bae5a29 100644 --- a/wit/deps/sockets/tcp.wit +++ b/wit/deps/sockets/tcp.wit @@ -1,10 +1,15 @@ - +@since(version = 0.2.0) interface tcp { - use wasi:io/streams@0.2.0.{input-stream, output-stream}; - use wasi:io/poll@0.2.0.{pollable}; - use wasi:clocks/monotonic-clock@0.2.0.{duration}; + @since(version = 0.2.0) + use wasi:io/streams@0.2.1.{input-stream, output-stream}; + @since(version = 0.2.0) + use wasi:io/poll@0.2.1.{pollable}; + @since(version = 0.2.0) + use wasi:clocks/monotonic-clock@0.2.1.{duration}; + @since(version = 0.2.0) use network.{network, error-code, ip-socket-address, ip-address-family}; + @since(version = 0.2.0) enum shutdown-type { /// Similar to `SHUT_RD` in POSIX. receive, @@ -27,8 +32,8 @@ interface tcp { /// - `connect-in-progress` /// - `connected` /// - `closed` - /// See - /// for a more information. + /// See + /// for more information. /// /// Note: Except where explicitly mentioned, whenever this documentation uses /// the term "bound" without backticks it actually means: in the `bound` state *or higher*. @@ -37,6 +42,7 @@ interface tcp { /// 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. + @since(version = 0.2.0) resource tcp-socket { /// Bind the socket to a specific network on the provided IP address and port. /// @@ -76,13 +82,15 @@ interface tcp { /// - /// - /// - + @since(version = 0.2.0) start-bind: func(network: borrow, local-address: ip-socket-address) -> result<_, error-code>; + @since(version = 0.2.0) finish-bind: func() -> result<_, error-code>; /// Connect to a remote endpoint. /// /// On success: - /// - the socket is transitioned into the `connection` state. + /// - the socket is transitioned into the `connected` state. /// - a pair of streams is returned that can be used to read & write to the connection /// /// After a failed connection attempt, the socket will be in the `closed` @@ -121,7 +129,9 @@ interface tcp { /// - /// - /// - + @since(version = 0.2.0) start-connect: func(network: borrow, remote-address: ip-socket-address) -> result<_, error-code>; + @since(version = 0.2.0) finish-connect: func() -> result, error-code>; /// Start listening for new connections. @@ -149,7 +159,9 @@ interface tcp { /// - /// - /// - + @since(version = 0.2.0) start-listen: func() -> result<_, error-code>; + @since(version = 0.2.0) finish-listen: func() -> result<_, error-code>; /// Accept a new client socket. @@ -178,6 +190,7 @@ interface tcp { /// - /// - /// - + @since(version = 0.2.0) accept: func() -> result, error-code>; /// Get the bound local address. @@ -196,6 +209,7 @@ interface tcp { /// - /// - /// - + @since(version = 0.2.0) local-address: func() -> result; /// Get the remote address. @@ -208,16 +222,19 @@ interface tcp { /// - /// - /// - + @since(version = 0.2.0) remote-address: func() -> result; /// Whether the socket is in the `listening` state. /// /// Equivalent to the SO_ACCEPTCONN socket option. + @since(version = 0.2.0) is-listening: func() -> bool; /// Whether this is a IPv4 or IPv6 socket. /// /// Equivalent to the SO_DOMAIN socket option. + @since(version = 0.2.0) address-family: func() -> ip-address-family; /// Hints the desired listen queue size. Implementations are free to ignore this. @@ -229,6 +246,7 @@ interface tcp { /// - `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. + @since(version = 0.2.0) set-listen-backlog-size: func(value: u64) -> result<_, error-code>; /// Enables or disables keepalive. @@ -240,7 +258,9 @@ interface tcp { /// These properties can be configured while `keep-alive-enabled` is false, but only come into effect when `keep-alive-enabled` is true. /// /// Equivalent to the SO_KEEPALIVE socket option. + @since(version = 0.2.0) keep-alive-enabled: func() -> result; + @since(version = 0.2.0) set-keep-alive-enabled: func(value: bool) -> result<_, error-code>; /// Amount of time the connection has to be idle before TCP starts sending keepalive packets. @@ -253,7 +273,9 @@ interface tcp { /// /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. + @since(version = 0.2.0) keep-alive-idle-time: func() -> result; + @since(version = 0.2.0) set-keep-alive-idle-time: func(value: duration) -> result<_, error-code>; /// The time between keepalive packets. @@ -266,7 +288,9 @@ interface tcp { /// /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. + @since(version = 0.2.0) keep-alive-interval: func() -> result; + @since(version = 0.2.0) set-keep-alive-interval: func(value: duration) -> result<_, error-code>; /// The maximum amount of keepalive packets TCP should send before aborting the connection. @@ -279,7 +303,9 @@ interface tcp { /// /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. + @since(version = 0.2.0) keep-alive-count: func() -> result; + @since(version = 0.2.0) set-keep-alive-count: func(value: u32) -> result<_, error-code>; /// Equivalent to the IP_TTL & IPV6_UNICAST_HOPS socket options. @@ -288,7 +314,9 @@ interface tcp { /// /// # Typical errors /// - `invalid-argument`: (set) The TTL value must be 1 or higher. + @since(version = 0.2.0) hop-limit: func() -> result; + @since(version = 0.2.0) set-hop-limit: func(value: u8) -> result<_, error-code>; /// The kernel buffer space reserved for sends/receives on this socket. @@ -301,9 +329,13 @@ interface tcp { /// /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. + @since(version = 0.2.0) receive-buffer-size: func() -> result; + @since(version = 0.2.0) set-receive-buffer-size: func(value: u64) -> result<_, error-code>; + @since(version = 0.2.0) send-buffer-size: func() -> result; + @since(version = 0.2.0) set-send-buffer-size: func(value: u64) -> result<_, error-code>; /// Create a `pollable` which can be used to poll for, or block on, @@ -318,11 +350,12 @@ interface tcp { /// `subscribe` only has to be called once per socket and can then be /// (re)used for the remainder of the socket's lifetime. /// - /// See - /// for a more information. + /// See + /// for more information. /// /// Note: this function is here for WASI Preview2 only. /// It's planned to be removed when `future` is natively supported in Preview3. + @since(version = 0.2.0) subscribe: func() -> pollable; /// Initiate a graceful shutdown. @@ -335,7 +368,7 @@ interface tcp { /// 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 + /// This function is idempotent; shutting down a direction more than once /// has no effect and returns `ok`. /// /// The shutdown function does not close (drop) the socket. @@ -348,6 +381,7 @@ interface tcp { /// - /// - /// - + @since(version = 0.2.0) shutdown: func(shutdown-type: shutdown-type) -> result<_, error-code>; } } diff --git a/wit/deps/sockets/udp-create-socket.wit b/wit/deps/sockets/udp-create-socket.wit index 0482d1f..e8eeacb 100644 --- a/wit/deps/sockets/udp-create-socket.wit +++ b/wit/deps/sockets/udp-create-socket.wit @@ -1,6 +1,8 @@ - +@since(version = 0.2.0) interface udp-create-socket { + @since(version = 0.2.0) use network.{network, error-code, ip-address-family}; + @since(version = 0.2.0) use udp.{udp-socket}; /// Create a new UDP socket. @@ -23,5 +25,6 @@ interface udp-create-socket { /// - /// - /// - + @since(version = 0.2.0) create-udp-socket: func(address-family: ip-address-family) -> result; } diff --git a/wit/deps/sockets/udp.wit b/wit/deps/sockets/udp.wit index d987a0a..b289e49 100644 --- a/wit/deps/sockets/udp.wit +++ b/wit/deps/sockets/udp.wit @@ -1,9 +1,12 @@ - +@since(version = 0.2.0) interface udp { - use wasi:io/poll@0.2.0.{pollable}; + @since(version = 0.2.0) + use wasi:io/poll@0.2.1.{pollable}; + @since(version = 0.2.0) use network.{network, error-code, ip-socket-address, ip-address-family}; /// A received datagram. + @since(version = 0.2.0) record incoming-datagram { /// The payload. /// @@ -19,6 +22,7 @@ interface udp { } /// A datagram to be sent out. + @since(version = 0.2.0) record outgoing-datagram { /// The payload. data: list, @@ -33,9 +37,8 @@ interface udp { remote-address: option, } - - /// A UDP socket handle. + @since(version = 0.2.0) resource udp-socket { /// Bind the socket to a specific network on the provided IP address and port. /// @@ -63,7 +66,9 @@ interface udp { /// - /// - /// - + @since(version = 0.2.0) start-bind: func(network: borrow, local-address: ip-socket-address) -> result<_, error-code>; + @since(version = 0.2.0) finish-bind: func() -> result<_, error-code>; /// Set up inbound & outbound communication channels, optionally to a specific peer. @@ -106,6 +111,7 @@ interface udp { /// - /// - /// - + @since(version = 0.2.0) %stream: func(remote-address: option) -> result, error-code>; /// Get the current bound address. @@ -124,6 +130,7 @@ interface udp { /// - /// - /// - + @since(version = 0.2.0) local-address: func() -> result; /// Get the address the socket is currently streaming to. @@ -136,11 +143,13 @@ interface udp { /// - /// - /// - + @since(version = 0.2.0) remote-address: func() -> result; /// Whether this is a IPv4 or IPv6 socket. /// /// Equivalent to the SO_DOMAIN socket option. + @since(version = 0.2.0) address-family: func() -> ip-address-family; /// Equivalent to the IP_TTL & IPV6_UNICAST_HOPS socket options. @@ -149,7 +158,9 @@ interface udp { /// /// # Typical errors /// - `invalid-argument`: (set) The TTL value must be 1 or higher. + @since(version = 0.2.0) unicast-hop-limit: func() -> result; + @since(version = 0.2.0) set-unicast-hop-limit: func(value: u8) -> result<_, error-code>; /// The kernel buffer space reserved for sends/receives on this socket. @@ -162,18 +173,24 @@ interface udp { /// /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. + @since(version = 0.2.0) receive-buffer-size: func() -> result; + @since(version = 0.2.0) set-receive-buffer-size: func(value: u64) -> result<_, error-code>; + @since(version = 0.2.0) send-buffer-size: func() -> result; + @since(version = 0.2.0) set-send-buffer-size: func(value: u64) -> result<_, error-code>; /// Create a `pollable` which will resolve once the socket is ready for I/O. /// /// Note: this function is here for WASI Preview2 only. /// It's planned to be removed when `future` is natively supported in Preview3. + @since(version = 0.2.0) subscribe: func() -> pollable; } + @since(version = 0.2.0) resource incoming-datagram-stream { /// Receive messages on the socket. /// @@ -198,15 +215,18 @@ interface udp { /// - /// - /// - + @since(version = 0.2.0) receive: func(max-results: u64) -> result, error-code>; /// Create a `pollable` which will resolve once the stream is ready to receive again. /// /// Note: this function is here for WASI Preview2 only. /// It's planned to be removed when `future` is natively supported in Preview3. + @since(version = 0.2.0) subscribe: func() -> pollable; } + @since(version = 0.2.0) resource outgoing-datagram-stream { /// Check readiness for sending. This function never blocks. /// @@ -255,12 +275,14 @@ interface udp { /// - /// - /// - + @since(version = 0.2.0) send: func(datagrams: list) -> result; /// Create a `pollable` which will resolve once the stream is ready to send again. /// /// Note: this function is here for WASI Preview2 only. /// It's planned to be removed when `future` is natively supported in Preview3. + @since(version = 0.2.0) subscribe: func() -> pollable; } } diff --git a/wit/deps/sockets/world.wit b/wit/deps/sockets/world.wit index f8bb92a..a1d4267 100644 --- a/wit/deps/sockets/world.wit +++ b/wit/deps/sockets/world.wit @@ -1,11 +1,19 @@ -package wasi:sockets@0.2.0; +package wasi:sockets@0.2.1; +@since(version = 0.2.0) world imports { + @since(version = 0.2.0) import instance-network; + @since(version = 0.2.0) import network; + @since(version = 0.2.0) import udp; + @since(version = 0.2.0) import udp-create-socket; + @since(version = 0.2.0) import tcp; + @since(version = 0.2.0) import tcp-create-socket; + @since(version = 0.2.0) import ip-name-lookup; } diff --git a/wit/wasi-crate.wit b/wit/wasi-crate.wit index ce5184a..41feb66 100644 --- a/wit/wasi-crate.wit +++ b/wit/wasi-crate.wit @@ -1,6 +1,6 @@ package rust:wasi; world bindings { - include wasi:cli/imports@0.2.0; - import wasi:http/outgoing-handler@0.2.0; + include wasi:cli/imports@0.2.1; + import wasi:http/outgoing-handler@0.2.1; }