diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bb368b2..8d540eb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -97,7 +97,7 @@ jobs: ./ci/vendor-wit.sh git diff --exit-code - run: | - version=0.60.0 + version=0.61.0 mkdir wit-bindgen cd wit-bindgen diff --git a/Cargo.toml b/Cargo.toml index 1e59277..3faf4b7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ rust-version = "1.87.0" [workspace.dependencies] rand = { version = "0.8.5", default-features = false } wasi = { version = "0.14.6", path = ".", default-features = false } -wit-bindgen = { version = "0.57.1", default-features = false } +wit-bindgen = { version = "0.61.0", default-features = false } wasip1 = { version = "1.0.0", path = "crates/wasip1", default-features = false } wasip2 = { version = "1.0.1", path = "crates/wasip2", default-features = false } wasip3 = { version = "0.1.1", path = "crates/wasip3", default-features = false } diff --git a/crates/wasip2/src/command.rs b/crates/wasip2/src/command.rs index 3a68382..3e9d435 100644 --- a/crates/wasip2/src/command.rs +++ b/crates/wasip2/src/command.rs @@ -1,4 +1,4 @@ -// Generated by `wit-bindgen` 0.60.0. DO NOT EDIT! +// Generated by `wit-bindgen` 0.61.0. DO NOT EDIT! // Options used: // * std_feature // * with "wasi:cli/environment@0.2.12" = "crate::cli::environment" @@ -113,7 +113,7 @@ pub mod exports { pub trait Guest { /// Run the program. #[allow(async_fn_in_trait)] - fn run() -> Result<(), ()>; + fn run() -> ::core::result::Result<(), ()>; } #[doc(hidden)] #[macro_export] @@ -167,7 +167,7 @@ macro_rules! __export_command_impl { exports::wasi::cli::run::__export_wasi_cli_run_0_2_12_cabi!($ty with_types_in $($path_to_types_root)*:: exports::wasi::cli::run); const _ : () = { #[rustfmt::skip] #[cfg(target_arch = "wasm32")] #[unsafe (link_section = - "component-type:wit-bindgen:0.60.0:wasi:cli@0.2.12:command:imports and exportsrust-wasip2-1.0.4+wasi-0.2.12-from-crates-io-command-world")] + "component-type:wit-bindgen:0.61.0:wasi:cli@0.2.12:command:imports and exportsrust-wasip2-1.0.4+wasi-0.2.12-from-crates-io-command-world")] #[doc(hidden)] #[allow(clippy::octal_escapes)] pub static __WIT_BINDGEN_COMPONENT_TYPE : [u8; 10839] = * b"\ @@ -389,7 +389,7 @@ get-insecure-random-u64\x01\x02\x03\0\x1bwasi:random/insecure@0.2.12\x05*\x01B\x ure-seed@0.2.12\x05+\x01B\x03\x01j\0\0\x01@\0\0\0\x04\0\x03run\x01\x01\x04\0\x13\ wasi:cli/run@0.2.12\x05,\x04\0\x17wasi:cli/command@0.2.12\x04\0\x0b\x0d\x01\0\x07\ command\x03\0\0\0G\x09producers\x01\x0cprocessed-by\x02\x0dwit-component\x070.25\ -4.0\x10wit-bindgen-rust\x060.60.0"; +8.0\x10wit-bindgen-rust\x060.61.0"; }; }; } @@ -398,8 +398,8 @@ pub use __export_command_impl as _export_command; #[rustfmt::skip] #[cfg(target_arch = "wasm32")] -#[cfg_attr(feature = "rustc-dep-of-std", unsafe(link_section = "component-type:wit-bindgen:0.60.0:wasi:cli@0.2.12:command-with-all-of-its-exports-removed:encoded worldrust-wasip2-1.0.4+wasi-0.2.12-from-crates-io-command-world-in-libstd"))] -#[cfg_attr(not(feature = "rustc-dep-of-std"), unsafe(link_section = "component-type:wit-bindgen:0.60.0:wasi:cli@0.2.12:command-with-all-of-its-exports-removed:encoded worldrust-wasip2-1.0.4+wasi-0.2.12-from-crates-io-command-world"))] +#[cfg_attr(feature = "rustc-dep-of-std", unsafe(link_section = "component-type:wit-bindgen:0.61.0:wasi:cli@0.2.12:command-with-all-of-its-exports-removed:encoded worldrust-wasip2-1.0.4+wasi-0.2.12-from-crates-io-command-world-in-libstd"))] +#[cfg_attr(not(feature = "rustc-dep-of-std"), unsafe(link_section = "component-type:wit-bindgen:0.61.0:wasi:cli@0.2.12:command-with-all-of-its-exports-removed:encoded worldrust-wasip2-1.0.4+wasi-0.2.12-from-crates-io-command-world"))] #[doc(hidden)] #[allow(clippy::octal_escapes)] @@ -621,8 +621,8 @@ get-insecure-random-u64\x01\x02\x03\0\x1bwasi:random/insecure@0.2.12\x05*\x01B\x \x01o\x02ww\x01@\0\0\0\x04\0\x0dinsecure-seed\x01\x01\x03\0\x20wasi:random/insec\ ure-seed@0.2.12\x05+\x04\07wasi:cli/command-with-all-of-its-exports-removed@0.2.\ 12\x04\0\x0b-\x01\0'command-with-all-of-its-exports-removed\x03\0\0\0G\x09produc\ -ers\x01\x0cprocessed-by\x02\x0dwit-component\x070.254.0\x10wit-bindgen-rust\x060\ -.60.0"; +ers\x01\x0cprocessed-by\x02\x0dwit-component\x070.258.0\x10wit-bindgen-rust\x060\ +.61.0"; #[inline(never)] #[doc(hidden)] pub fn __link_custom_section_describing_imports() { diff --git a/crates/wasip2/src/imports.rs b/crates/wasip2/src/imports.rs index c8f09f1..beb4446 100644 --- a/crates/wasip2/src/imports.rs +++ b/crates/wasip2/src/imports.rs @@ -1,4 +1,4 @@ -// Generated by `wit-bindgen` 0.60.0. DO NOT EDIT! +// Generated by `wit-bindgen` 0.61.0. DO NOT EDIT! // Options used: // * std_feature // * type_section_suffix: "rust-wasip2-1.0.4+wasi-0.2.12-from-crates-io" @@ -147,7 +147,7 @@ pub mod wasi { /// Return a path that programs should use as their initial current working /// directory, interpreting `.` as shorthand for this. #[allow(async_fn_in_trait)] - pub fn initial_cwd() -> Option<_rt::String> { + pub fn initial_cwd() -> ::core::option::Option<_rt::String> { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -208,7 +208,7 @@ pub mod wasi { #[allow(unused_unsafe, clippy::all)] /// Exit the current instance and any linked instances. #[allow(async_fn_in_trait)] - pub fn exit(status: Result<(), ()>) -> () { + pub fn exit(status: ::core::result::Result<(), ()>) -> () { unsafe { let result0 = match status { Ok(_) => 0i32, @@ -451,7 +451,7 @@ pub mod wasi { /// If stdin is connected to a terminal, return a `terminal-input` handle /// allowing further interaction with it. #[allow(async_fn_in_trait)] - pub fn get_terminal_stdin() -> Option { + pub fn get_terminal_stdin() -> ::core::option::Option { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); @@ -499,7 +499,7 @@ pub mod wasi { /// If stdout is connected to a terminal, return a `terminal-output` handle /// allowing further interaction with it. #[allow(async_fn_in_trait)] - pub fn get_terminal_stdout() -> Option { + pub fn get_terminal_stdout() -> ::core::option::Option { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); @@ -547,7 +547,7 @@ pub mod wasi { /// If stderr is connected to a terminal, return a `terminal-output` handle /// allowing further interaction with it. #[allow(async_fn_in_trait)] - pub fn get_terminal_stderr() -> Option { + pub fn get_terminal_stderr() -> ::core::option::Option { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); @@ -1004,17 +1004,17 @@ pub mod wasi { /// /// If the `option` is none, the platform doesn't maintain an access /// timestamp for this file. - pub data_access_timestamp: Option, + pub data_access_timestamp: ::core::option::Option, /// Last data modification timestamp. /// /// If the `option` is none, the platform doesn't maintain a /// modification timestamp for this file. - pub data_modification_timestamp: Option, + pub data_modification_timestamp: ::core::option::Option, /// Last file status-change timestamp. /// /// If the `option` is none, the platform doesn't maintain a /// status-change timestamp for this file. - pub status_change_timestamp: Option, + pub status_change_timestamp: ::core::option::Option, } impl ::core::fmt::Debug for DescriptorStat { fn fmt( @@ -1558,7 +1558,7 @@ pub mod wasi { pub fn read_via_stream( &self, offset: Filesize, - ) -> Result { + ) -> ::core::result::Result { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); @@ -1613,7 +1613,7 @@ pub mod wasi { pub fn write_via_stream( &self, offset: Filesize, - ) -> Result { + ) -> ::core::result::Result { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); @@ -1665,7 +1665,9 @@ pub mod wasi { /// Note: This allows using `write-stream`, which is similar to `write` with /// `O_APPEND` in POSIX. #[allow(async_fn_in_trait)] - pub fn append_via_stream(&self) -> Result { + pub fn append_via_stream( + &self, + ) -> ::core::result::Result { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); @@ -1719,7 +1721,7 @@ pub mod wasi { offset: Filesize, length: Filesize, advice: Advice, - ) -> Result<(), ErrorCode> { + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); @@ -1778,7 +1780,7 @@ pub mod wasi { /// /// Note: This is similar to `fdatasync` in POSIX. #[allow(async_fn_in_trait)] - pub fn sync_data(&self) -> Result<(), ErrorCode> { + pub fn sync_data(&self) -> ::core::result::Result<(), ErrorCode> { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); @@ -1825,7 +1827,9 @@ pub mod wasi { /// Note: This returns the value that was the `fs_flags` value returned /// from `fdstat_get` in earlier versions of WASI. #[allow(async_fn_in_trait)] - pub fn get_flags(&self) -> Result { + pub fn get_flags( + &self, + ) -> ::core::result::Result { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); @@ -1880,7 +1884,9 @@ pub mod wasi { /// Note: This returns the value that was the `fs_filetype` value returned /// from `fdstat_get` in earlier versions of WASI. #[allow(async_fn_in_trait)] - pub fn get_type(&self) -> Result { + pub fn get_type( + &self, + ) -> ::core::result::Result { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); @@ -1928,7 +1934,10 @@ pub mod wasi { /// /// Note: This was called `fd_filestat_set_size` in earlier versions of WASI. #[allow(async_fn_in_trait)] - pub fn set_size(&self, size: Filesize) -> Result<(), ErrorCode> { + pub fn set_size( + &self, + size: Filesize, + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); @@ -1978,7 +1987,7 @@ pub mod wasi { &self, data_access_timestamp: NewTimestamp, data_modification_timestamp: NewTimestamp, - ) -> Result<(), ErrorCode> { + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); @@ -2083,7 +2092,7 @@ pub mod wasi { &self, length: Filesize, offset: Filesize, - ) -> Result<(_rt::Vec, bool), ErrorCode> { + ) -> ::core::result::Result<(_rt::Vec, bool), ErrorCode> { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -2174,7 +2183,7 @@ pub mod wasi { &self, buffer: &[u8], offset: Filesize, - ) -> Result { + ) -> ::core::result::Result { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 16]); @@ -2248,7 +2257,9 @@ pub mod wasi { /// directory. Multiple streams may be active on the same directory, and they /// do not interfere with each other. #[allow(async_fn_in_trait)] - pub fn read_directory(&self) -> Result { + pub fn read_directory( + &self, + ) -> ::core::result::Result { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); @@ -2298,7 +2309,7 @@ pub mod wasi { /// /// Note: This is similar to `fsync` in POSIX. #[allow(async_fn_in_trait)] - pub fn sync(&self) -> Result<(), ErrorCode> { + pub fn sync(&self) -> ::core::result::Result<(), ErrorCode> { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); @@ -2342,7 +2353,10 @@ pub mod wasi { /// /// Note: This is similar to `mkdirat` in POSIX. #[allow(async_fn_in_trait)] - pub fn create_directory_at(&self, path: &str) -> Result<(), ErrorCode> { + pub fn create_directory_at( + &self, + path: &str, + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); @@ -2400,7 +2414,7 @@ pub mod wasi { /// /// Note: This was called `fd_filestat_get` in earlier versions of WASI. #[allow(async_fn_in_trait)] - pub fn stat(&self) -> Result { + pub fn stat(&self) -> ::core::result::Result { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 104]); @@ -2509,7 +2523,7 @@ pub mod wasi { &self, path_flags: PathFlags, path: &str, - ) -> Result { + ) -> ::core::result::Result { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 104]); @@ -2641,7 +2655,7 @@ pub mod wasi { path: &str, data_access_timestamp: NewTimestamp, data_modification_timestamp: NewTimestamp, - ) -> Result<(), ErrorCode> { + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); @@ -2757,7 +2771,7 @@ pub mod wasi { old_path: &str, new_descriptor: &Descriptor, new_path: &str, - ) -> Result<(), ErrorCode> { + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); @@ -2850,7 +2864,7 @@ pub mod wasi { path: &str, open_flags: OpenFlags, flags: DescriptorFlags, - ) -> Result { + ) -> ::core::result::Result { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); @@ -2930,7 +2944,10 @@ pub mod wasi { /// /// Note: This is similar to `readlinkat` in POSIX. #[allow(async_fn_in_trait)] - pub fn readlink_at(&self, path: &str) -> Result<_rt::String, ErrorCode> { + pub fn readlink_at( + &self, + path: &str, + ) -> ::core::result::Result<_rt::String, ErrorCode> { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -3006,7 +3023,10 @@ pub mod wasi { /// /// Note: This is similar to `unlinkat(fd, path, AT_REMOVEDIR)` in POSIX. #[allow(async_fn_in_trait)] - pub fn remove_directory_at(&self, path: &str) -> Result<(), ErrorCode> { + pub fn remove_directory_at( + &self, + path: &str, + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); @@ -3063,7 +3083,7 @@ pub mod wasi { old_path: &str, new_descriptor: &Descriptor, new_path: &str, - ) -> Result<(), ErrorCode> { + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); @@ -3144,7 +3164,7 @@ pub mod wasi { &self, old_path: &str, new_path: &str, - ) -> Result<(), ErrorCode> { + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); @@ -3216,7 +3236,10 @@ pub mod wasi { /// Return `error-code::is-directory` if the path refers to a directory. /// Note: This is similar to `unlinkat(fd, path, 0)` in POSIX. #[allow(async_fn_in_trait)] - pub fn unlink_file_at(&self, path: &str) -> Result<(), ErrorCode> { + pub fn unlink_file_at( + &self, + path: &str, + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); @@ -3313,7 +3336,9 @@ pub mod wasi { /// /// However, none of these is required. #[allow(async_fn_in_trait)] - pub fn metadata_hash(&self) -> Result { + pub fn metadata_hash( + &self, + ) -> ::core::result::Result { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 24]); @@ -3369,7 +3394,7 @@ pub mod wasi { &self, path_flags: PathFlags, path: &str, - ) -> Result { + ) -> ::core::result::Result { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 24]); @@ -3442,7 +3467,10 @@ pub mod wasi { #[allow(async_fn_in_trait)] pub fn read_directory_entry( &self, - ) -> Result, ErrorCode> { + ) -> ::core::result::Result< + ::core::option::Option, + ErrorCode, + > { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -3534,7 +3562,9 @@ pub mod wasi { /// Note that this function is fallible because not all stream-related /// errors are filesystem-related errors. #[allow(async_fn_in_trait)] - pub fn filesystem_error_code(err: &Error) -> Option { + pub fn filesystem_error_code( + err: &Error, + ) -> ::core::option::Option { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); @@ -4097,7 +4127,10 @@ pub mod wasi { /// 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. #[allow(async_fn_in_trait)] - pub fn read(&self, len: u64) -> Result<_rt::Vec, StreamError> { + pub fn read( + &self, + len: u64, + ) -> ::core::result::Result<_rt::Vec, StreamError> { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -4179,7 +4212,7 @@ pub mod wasi { pub fn blocking_read( &self, len: u64, - ) -> Result<_rt::Vec, StreamError> { + ) -> ::core::result::Result<_rt::Vec, StreamError> { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -4260,7 +4293,10 @@ pub mod wasi { /// Behaves identical to `read`, except instead of returning a list /// of bytes, returns the number of bytes consumed from the stream. #[allow(async_fn_in_trait)] - pub fn skip(&self, len: u64) -> Result { + pub fn skip( + &self, + len: u64, + ) -> ::core::result::Result { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 16]); @@ -4321,7 +4357,10 @@ pub mod wasi { /// Skip bytes from a stream, after blocking until at least one byte /// can be skipped. Except for blocking behavior, identical to `skip`. #[allow(async_fn_in_trait)] - pub fn blocking_skip(&self, len: u64) -> Result { + pub fn blocking_skip( + &self, + len: u64, + ) -> ::core::result::Result { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 16]); @@ -4417,7 +4456,7 @@ pub mod wasi { /// become ready when this function will report at least 1 byte, or an /// error. #[allow(async_fn_in_trait)] - pub fn check_write(&self) -> Result { + pub fn check_write(&self) -> ::core::result::Result { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 16]); @@ -4489,7 +4528,10 @@ pub mod wasi { /// returns Err(closed) without writing if the stream has closed since /// the last call to check-write provided a permit. #[allow(async_fn_in_trait)] - pub fn write(&self, contents: &[u8]) -> Result<(), StreamError> { + pub fn write( + &self, + contents: &[u8], + ) -> ::core::result::Result<(), StreamError> { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 12]); @@ -4566,7 +4608,7 @@ pub mod wasi { pub fn blocking_write_and_flush( &self, contents: &[u8], - ) -> Result<(), StreamError> { + ) -> ::core::result::Result<(), StreamError> { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 12]); @@ -4640,7 +4682,7 @@ pub mod wasi { /// completed. The `subscribe` pollable will become ready when the /// flush has completed and the stream can accept more writes. #[allow(async_fn_in_trait)] - pub fn flush(&self) -> Result<(), StreamError> { + pub fn flush(&self) -> ::core::result::Result<(), StreamError> { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 12]); @@ -4698,7 +4740,7 @@ pub mod wasi { /// Request to flush buffered output, and block until flush completes /// and stream is ready for writing again. #[allow(async_fn_in_trait)] - pub fn blocking_flush(&self) -> Result<(), StreamError> { + pub fn blocking_flush(&self) -> ::core::result::Result<(), StreamError> { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 12]); @@ -4792,7 +4834,10 @@ pub mod wasi { /// passing a list of bytes, you simply pass the number of zero-bytes /// that should be written. #[allow(async_fn_in_trait)] - pub fn write_zeroes(&self, len: u64) -> Result<(), StreamError> { + pub fn write_zeroes( + &self, + len: u64, + ) -> ::core::result::Result<(), StreamError> { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 12]); @@ -4857,7 +4902,7 @@ pub mod wasi { pub fn blocking_write_zeroes_and_flush( &self, len: u64, - ) -> Result<(), StreamError> { + ) -> ::core::result::Result<(), StreamError> { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 12]); @@ -4930,7 +4975,7 @@ pub mod wasi { &self, src: &InputStream, len: u64, - ) -> Result { + ) -> ::core::result::Result { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 16]); @@ -5008,7 +5053,7 @@ pub mod wasi { &self, src: &InputStream, len: u64, - ) -> Result { + ) -> ::core::result::Result { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 16]); @@ -5779,7 +5824,7 @@ pub mod wasi { /// - without a remote address: this field is required. /// /// If this value is None, the send operation is equivalent to `send` in POSIX. Otherwise it is equivalent to `sendto`. - pub remote_address: Option, + pub remote_address: ::core::option::Option, } impl ::core::fmt::Debug for OutgoingDatagram { fn fmt( @@ -5943,7 +5988,7 @@ pub mod wasi { &self, network: &Network, local_address: IpSocketAddress, - ) -> Result<(), ErrorCode> { + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); @@ -6094,7 +6139,7 @@ pub mod wasi { impl UdpSocket { #[allow(unused_unsafe, clippy::all)] #[allow(async_fn_in_trait)] - pub fn finish_bind(&self) -> Result<(), ErrorCode> { + pub fn finish_bind(&self) -> ::core::result::Result<(), ErrorCode> { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); @@ -6179,8 +6224,8 @@ pub mod wasi { #[allow(async_fn_in_trait)] pub fn stream( &self, - remote_address: Option, - ) -> Result< + remote_address: ::core::option::Option, + ) -> ::core::result::Result< (IncomingDatagramStream, OutgoingDatagramStream), ErrorCode, > { @@ -6407,7 +6452,9 @@ pub mod wasi { /// - /// - #[allow(async_fn_in_trait)] - pub fn local_address(&self) -> Result { + pub fn local_address( + &self, + ) -> ::core::result::Result { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 36]); @@ -6512,7 +6559,9 @@ pub mod wasi { /// - /// - #[allow(async_fn_in_trait)] - pub fn remote_address(&self) -> Result { + pub fn remote_address( + &self, + ) -> ::core::result::Result { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 36]); @@ -6638,7 +6687,9 @@ pub mod wasi { /// # Typical errors /// - `invalid-argument`: (set) The TTL value must be 1 or higher. #[allow(async_fn_in_trait)] - pub fn unicast_hop_limit(&self) -> Result { + pub fn unicast_hop_limit( + &self, + ) -> ::core::result::Result { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); @@ -6684,7 +6735,10 @@ pub mod wasi { impl UdpSocket { #[allow(unused_unsafe, clippy::all)] #[allow(async_fn_in_trait)] - pub fn set_unicast_hop_limit(&self, value: u8) -> Result<(), ErrorCode> { + pub fn set_unicast_hop_limit( + &self, + value: u8, + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); @@ -6737,7 +6791,9 @@ pub mod wasi { /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. #[allow(async_fn_in_trait)] - pub fn receive_buffer_size(&self) -> Result { + pub fn receive_buffer_size( + &self, + ) -> ::core::result::Result { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 16]); @@ -6786,7 +6842,7 @@ pub mod wasi { pub fn set_receive_buffer_size( &self, value: u64, - ) -> Result<(), ErrorCode> { + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); @@ -6829,7 +6885,9 @@ pub mod wasi { impl UdpSocket { #[allow(unused_unsafe, clippy::all)] #[allow(async_fn_in_trait)] - pub fn send_buffer_size(&self) -> Result { + pub fn send_buffer_size( + &self, + ) -> ::core::result::Result { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 16]); @@ -6875,7 +6933,10 @@ pub mod wasi { impl UdpSocket { #[allow(unused_unsafe, clippy::all)] #[allow(async_fn_in_trait)] - pub fn set_send_buffer_size(&self, value: u64) -> Result<(), ErrorCode> { + pub fn set_send_buffer_size( + &self, + value: u64, + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); @@ -6970,7 +7031,7 @@ pub mod wasi { pub fn receive( &self, max_results: u64, - ) -> Result<_rt::Vec, ErrorCode> { + ) -> ::core::result::Result<_rt::Vec, ErrorCode> { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -7210,7 +7271,7 @@ pub mod wasi { /// /// Never returns `would-block`. #[allow(async_fn_in_trait)] - pub fn check_send(&self) -> Result { + pub fn check_send(&self) -> ::core::result::Result { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 16]); @@ -7293,7 +7354,7 @@ pub mod wasi { pub fn send( &self, datagrams: &[OutgoingDatagram], - ) -> Result { + ) -> ::core::result::Result { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 16]); @@ -7514,7 +7575,7 @@ pub mod wasi { #[allow(async_fn_in_trait)] pub fn create_udp_socket( address_family: IpAddressFamily, - ) -> Result { + ) -> ::core::result::Result { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); @@ -7718,7 +7779,7 @@ pub mod wasi { &self, network: &Network, local_address: IpSocketAddress, - ) -> Result<(), ErrorCode> { + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); @@ -7869,7 +7930,7 @@ pub mod wasi { impl TcpSocket { #[allow(unused_unsafe, clippy::all)] #[allow(async_fn_in_trait)] - pub fn finish_bind(&self) -> Result<(), ErrorCode> { + pub fn finish_bind(&self) -> ::core::result::Result<(), ErrorCode> { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); @@ -7958,7 +8019,7 @@ pub mod wasi { &self, network: &Network, remote_address: IpSocketAddress, - ) -> Result<(), ErrorCode> { + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); @@ -8111,7 +8172,7 @@ pub mod wasi { #[allow(async_fn_in_trait)] pub fn finish_connect( &self, - ) -> Result<(InputStream, OutputStream), ErrorCode> { + ) -> ::core::result::Result<(InputStream, OutputStream), ErrorCode> { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 12]); @@ -8190,7 +8251,7 @@ pub mod wasi { /// - /// - #[allow(async_fn_in_trait)] - pub fn start_listen(&self) -> Result<(), ErrorCode> { + pub fn start_listen(&self) -> ::core::result::Result<(), ErrorCode> { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); @@ -8233,7 +8294,7 @@ pub mod wasi { impl TcpSocket { #[allow(unused_unsafe, clippy::all)] #[allow(async_fn_in_trait)] - pub fn finish_listen(&self) -> Result<(), ErrorCode> { + pub fn finish_listen(&self) -> ::core::result::Result<(), ErrorCode> { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); @@ -8304,7 +8365,10 @@ pub mod wasi { #[allow(async_fn_in_trait)] pub fn accept( &self, - ) -> Result<(TcpSocket, InputStream, OutputStream), ErrorCode> { + ) -> ::core::result::Result< + (TcpSocket, InputStream, OutputStream), + ErrorCode, + > { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 16]); @@ -8376,7 +8440,9 @@ pub mod wasi { /// - /// - #[allow(async_fn_in_trait)] - pub fn local_address(&self) -> Result { + pub fn local_address( + &self, + ) -> ::core::result::Result { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 36]); @@ -8481,7 +8547,9 @@ pub mod wasi { /// - /// - #[allow(async_fn_in_trait)] - pub fn remote_address(&self) -> Result { + pub fn remote_address( + &self, + ) -> ::core::result::Result { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 36]); @@ -8636,7 +8704,7 @@ pub mod wasi { pub fn set_listen_backlog_size( &self, value: u64, - ) -> Result<(), ErrorCode> { + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); @@ -8688,7 +8756,9 @@ pub mod wasi { /// /// Equivalent to the SO_KEEPALIVE socket option. #[allow(async_fn_in_trait)] - pub fn keep_alive_enabled(&self) -> Result { + pub fn keep_alive_enabled( + &self, + ) -> ::core::result::Result { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); @@ -8737,7 +8807,7 @@ pub mod wasi { pub fn set_keep_alive_enabled( &self, value: bool, - ) -> Result<(), ErrorCode> { + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); @@ -8797,7 +8867,9 @@ pub mod wasi { /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. #[allow(async_fn_in_trait)] - pub fn keep_alive_idle_time(&self) -> Result { + pub fn keep_alive_idle_time( + &self, + ) -> ::core::result::Result { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 16]); @@ -8846,7 +8918,7 @@ pub mod wasi { pub fn set_keep_alive_idle_time( &self, value: Duration, - ) -> Result<(), ErrorCode> { + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); @@ -8899,7 +8971,9 @@ pub mod wasi { /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. #[allow(async_fn_in_trait)] - pub fn keep_alive_interval(&self) -> Result { + pub fn keep_alive_interval( + &self, + ) -> ::core::result::Result { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 16]); @@ -8948,7 +9022,7 @@ pub mod wasi { pub fn set_keep_alive_interval( &self, value: Duration, - ) -> Result<(), ErrorCode> { + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); @@ -9001,7 +9075,9 @@ pub mod wasi { /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. #[allow(async_fn_in_trait)] - pub fn keep_alive_count(&self) -> Result { + pub fn keep_alive_count( + &self, + ) -> ::core::result::Result { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); @@ -9047,7 +9123,10 @@ pub mod wasi { impl TcpSocket { #[allow(unused_unsafe, clippy::all)] #[allow(async_fn_in_trait)] - pub fn set_keep_alive_count(&self, value: u32) -> Result<(), ErrorCode> { + pub fn set_keep_alive_count( + &self, + value: u32, + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); @@ -9096,7 +9175,7 @@ pub mod wasi { /// # Typical errors /// - `invalid-argument`: (set) The TTL value must be 1 or higher. #[allow(async_fn_in_trait)] - pub fn hop_limit(&self) -> Result { + pub fn hop_limit(&self) -> ::core::result::Result { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); @@ -9142,7 +9221,10 @@ pub mod wasi { impl TcpSocket { #[allow(unused_unsafe, clippy::all)] #[allow(async_fn_in_trait)] - pub fn set_hop_limit(&self, value: u8) -> Result<(), ErrorCode> { + pub fn set_hop_limit( + &self, + value: u8, + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); @@ -9195,7 +9277,9 @@ pub mod wasi { /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. #[allow(async_fn_in_trait)] - pub fn receive_buffer_size(&self) -> Result { + pub fn receive_buffer_size( + &self, + ) -> ::core::result::Result { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 16]); @@ -9244,7 +9328,7 @@ pub mod wasi { pub fn set_receive_buffer_size( &self, value: u64, - ) -> Result<(), ErrorCode> { + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); @@ -9287,7 +9371,9 @@ pub mod wasi { impl TcpSocket { #[allow(unused_unsafe, clippy::all)] #[allow(async_fn_in_trait)] - pub fn send_buffer_size(&self) -> Result { + pub fn send_buffer_size( + &self, + ) -> ::core::result::Result { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 16]); @@ -9333,7 +9419,10 @@ pub mod wasi { impl TcpSocket { #[allow(unused_unsafe, clippy::all)] #[allow(async_fn_in_trait)] - pub fn set_send_buffer_size(&self, value: u64) -> Result<(), ErrorCode> { + pub fn set_send_buffer_size( + &self, + value: u64, + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); @@ -9441,7 +9530,7 @@ pub mod wasi { pub fn shutdown( &self, shutdown_type: ShutdownType, - ) -> Result<(), ErrorCode> { + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); @@ -9520,7 +9609,7 @@ pub mod wasi { #[allow(async_fn_in_trait)] pub fn create_tcp_socket( address_family: IpAddressFamily, - ) -> Result { + ) -> ::core::result::Result { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); @@ -9630,7 +9719,10 @@ pub mod wasi { #[allow(async_fn_in_trait)] pub fn resolve_next_address( &self, - ) -> Result, ErrorCode> { + ) -> ::core::result::Result< + ::core::option::Option, + ErrorCode, + > { unsafe { #[repr(align(2))] struct RetArea([::core::mem::MaybeUninit; 22]); @@ -9775,7 +9867,7 @@ pub mod wasi { pub fn resolve_addresses( network: &Network, name: &str, - ) -> Result { + ) -> ::core::result::Result { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); @@ -10027,8 +10119,8 @@ mod _rt { #[rustfmt::skip] #[cfg(target_arch = "wasm32")] -#[cfg_attr(feature = "rustc-dep-of-std", unsafe(link_section = "component-type:wit-bindgen:0.60.0:wasi:cli@0.2.12:imports:encoded worldrust-wasip2-1.0.4+wasi-0.2.12-from-crates-io-in-libstd"))] -#[cfg_attr(not(feature = "rustc-dep-of-std"), unsafe(link_section = "component-type:wit-bindgen:0.60.0:wasi:cli@0.2.12:imports:encoded worldrust-wasip2-1.0.4+wasi-0.2.12-from-crates-io"))] +#[cfg_attr(feature = "rustc-dep-of-std", unsafe(link_section = "component-type:wit-bindgen:0.61.0:wasi:cli@0.2.12:imports:encoded worldrust-wasip2-1.0.4+wasi-0.2.12-from-crates-io-in-libstd"))] +#[cfg_attr(not(feature = "rustc-dep-of-std"), unsafe(link_section = "component-type:wit-bindgen:0.61.0:wasi:cli@0.2.12:imports:encoded worldrust-wasip2-1.0.4+wasi-0.2.12-from-crates-io"))] #[doc(hidden)] #[allow(clippy::octal_escapes)] @@ -10249,8 +10341,8 @@ get-random-u64\x01\x02\x03\0\x19wasi:random/random@0.2.12\x05)\x01B\x05\x01p}\x0 get-insecure-random-u64\x01\x02\x03\0\x1bwasi:random/insecure@0.2.12\x05*\x01B\x03\ \x01o\x02ww\x01@\0\0\0\x04\0\x0dinsecure-seed\x01\x01\x03\0\x20wasi:random/insec\ ure-seed@0.2.12\x05+\x04\0\x17wasi:cli/imports@0.2.12\x04\0\x0b\x0d\x01\0\x07imp\ -orts\x03\0\0\0G\x09producers\x01\x0cprocessed-by\x02\x0dwit-component\x070.254.0\ -\x10wit-bindgen-rust\x060.60.0"; +orts\x03\0\0\0G\x09producers\x01\x0cprocessed-by\x02\x0dwit-component\x070.258.0\ +\x10wit-bindgen-rust\x060.61.0"; #[inline(never)] #[doc(hidden)] pub fn __link_custom_section_describing_imports() { diff --git a/crates/wasip2/src/proxy.rs b/crates/wasip2/src/proxy.rs index 6152cb8..6027051 100644 --- a/crates/wasip2/src/proxy.rs +++ b/crates/wasip2/src/proxy.rs @@ -1,4 +1,4 @@ -// Generated by `wit-bindgen` 0.60.0. DO NOT EDIT! +// Generated by `wit-bindgen` 0.61.0. DO NOT EDIT! // Options used: // * std_feature // * with "wasi:cli/stdin@0.2.12" = "crate::cli::stdin" @@ -109,8 +109,8 @@ pub mod wasi { /// Defines the case payload type for `DNS-error` above: #[derive(Clone)] pub struct DnsErrorPayload { - pub rcode: Option<_rt::String>, - pub info_code: Option, + pub rcode: ::core::option::Option<_rt::String>, + pub info_code: ::core::option::Option, } impl ::core::fmt::Debug for DnsErrorPayload { fn fmt( @@ -126,8 +126,8 @@ pub mod wasi { /// Defines the case payload type for `TLS-alert-received` above: #[derive(Clone)] pub struct TlsAlertReceivedPayload { - pub alert_id: Option, - pub alert_message: Option<_rt::String>, + pub alert_id: ::core::option::Option, + pub alert_message: ::core::option::Option<_rt::String>, } impl ::core::fmt::Debug for TlsAlertReceivedPayload { fn fmt( @@ -143,8 +143,8 @@ pub mod wasi { /// Defines the case payload type for `HTTP-response-{header,trailer}-size` above: #[derive(Clone)] pub struct FieldSizePayload { - pub field_name: Option<_rt::String>, - pub field_size: Option, + pub field_name: ::core::option::Option<_rt::String>, + pub field_size: ::core::option::Option, } impl ::core::fmt::Debug for FieldSizePayload { fn fmt( @@ -178,22 +178,22 @@ pub mod wasi { TlsAlertReceived(TlsAlertReceivedPayload), HttpRequestDenied, HttpRequestLengthRequired, - HttpRequestBodySize(Option), + HttpRequestBodySize(::core::option::Option), HttpRequestMethodInvalid, HttpRequestUriInvalid, HttpRequestUriTooLong, - HttpRequestHeaderSectionSize(Option), - HttpRequestHeaderSize(Option), - HttpRequestTrailerSectionSize(Option), + HttpRequestHeaderSectionSize(::core::option::Option), + HttpRequestHeaderSize(::core::option::Option), + HttpRequestTrailerSectionSize(::core::option::Option), HttpRequestTrailerSize(FieldSizePayload), HttpResponseIncomplete, - HttpResponseHeaderSectionSize(Option), + HttpResponseHeaderSectionSize(::core::option::Option), HttpResponseHeaderSize(FieldSizePayload), - HttpResponseBodySize(Option), - HttpResponseTrailerSectionSize(Option), + HttpResponseBodySize(::core::option::Option), + HttpResponseTrailerSectionSize(::core::option::Option), HttpResponseTrailerSize(FieldSizePayload), - HttpResponseTransferCoding(Option<_rt::String>), - HttpResponseContentCoding(Option<_rt::String>), + HttpResponseTransferCoding(::core::option::Option<_rt::String>), + HttpResponseContentCoding(::core::option::Option<_rt::String>), HttpResponseTimeout, HttpUpgradeFailed, HttpProtocolError, @@ -204,7 +204,7 @@ pub mod wasi { /// unstructured description of the error. Users should not depend on the /// string for diagnosing errors, as it's not required to be consistent /// between implementations. - InternalError(Option<_rt::String>), + InternalError(::core::option::Option<_rt::String>), } impl ::core::fmt::Debug for ErrorCode { fn fmt( @@ -965,7 +965,7 @@ pub mod wasi { #[allow(async_fn_in_trait)] pub fn from_list( entries: &[(FieldName, FieldValue)], - ) -> Result { + ) -> ::core::result::Result { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); @@ -1170,7 +1170,7 @@ pub mod wasi { &self, name: &str, value: &[FieldValue], - ) -> Result<(), HeaderError> { + ) -> ::core::result::Result<(), HeaderError> { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); @@ -1273,7 +1273,10 @@ pub mod wasi { /// Fails with `header-error.invalid-syntax` if the `field-name` is /// syntactically invalid. #[allow(async_fn_in_trait)] - pub fn delete(&self, name: &str) -> Result<(), HeaderError> { + pub fn delete( + &self, + name: &str, + ) -> ::core::result::Result<(), HeaderError> { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); @@ -1341,7 +1344,7 @@ pub mod wasi { &self, name: &str, value: &[u8], - ) -> Result<(), HeaderError> { + ) -> ::core::result::Result<(), HeaderError> { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); @@ -1590,7 +1593,7 @@ pub mod wasi { #[allow(unused_unsafe, clippy::all)] /// Returns the path with query parameters from the request, as a string. #[allow(async_fn_in_trait)] - pub fn path_with_query(&self) -> Option<_rt::String> { + pub fn path_with_query(&self) -> ::core::option::Option<_rt::String> { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -1646,7 +1649,7 @@ pub mod wasi { #[allow(unused_unsafe, clippy::all)] /// Returns the protocol scheme from the request. #[allow(async_fn_in_trait)] - pub fn scheme(&self) -> Option { + pub fn scheme(&self) -> ::core::option::Option { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -1716,7 +1719,7 @@ pub mod wasi { #[allow(unused_unsafe, clippy::all)] /// Returns the authority of the Request's target URI, if present. #[allow(async_fn_in_trait)] - pub fn authority(&self) -> Option<_rt::String> { + pub fn authority(&self) -> ::core::option::Option<_rt::String> { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -1801,7 +1804,7 @@ pub mod wasi { /// Gives the `incoming-body` associated with this request. Will only /// return success at most once, and subsequent calls will return error. #[allow(async_fn_in_trait)] - pub fn consume(&self) -> Result { + pub fn consume(&self) -> ::core::result::Result { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); @@ -1878,7 +1881,7 @@ pub mod wasi { /// this `outgoing-request` can be retrieved at most once. Subsequent /// calls will return error. #[allow(async_fn_in_trait)] - pub fn body(&self) -> Result { + pub fn body(&self) -> ::core::result::Result { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); @@ -1986,7 +1989,10 @@ pub mod wasi { /// Set the Method for the Request. Fails if the string present in a /// `method.other` argument is not a syntactically valid method. #[allow(async_fn_in_trait)] - pub fn set_method(&self, method: &Method) -> Result<(), ()> { + pub fn set_method( + &self, + method: &Method, + ) -> ::core::result::Result<(), ()> { unsafe { let (result1_0, result1_1, result1_2) = match method { Method::Get => (0i32, ::core::ptr::null_mut(), 0usize), @@ -2045,7 +2051,7 @@ pub mod wasi { /// Get the combination of the HTTP Path and Query for the Request. /// When `none`, this represents an empty Path and empty Query. #[allow(async_fn_in_trait)] - pub fn path_with_query(&self) -> Option<_rt::String> { + pub fn path_with_query(&self) -> ::core::option::Option<_rt::String> { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -2105,8 +2111,8 @@ pub mod wasi { #[allow(async_fn_in_trait)] pub fn set_path_with_query( &self, - path_with_query: Option<&str>, - ) -> Result<(), ()> { + path_with_query: ::core::option::Option<&str>, + ) -> ::core::result::Result<(), ()> { unsafe { let (result1_0, result1_1, result1_2) = match path_with_query { Some(e) => { @@ -2157,7 +2163,7 @@ pub mod wasi { /// Get the HTTP Related Scheme for the Request. When `none`, the /// implementation may choose an appropriate default scheme. #[allow(async_fn_in_trait)] - pub fn scheme(&self) -> Option { + pub fn scheme(&self) -> ::core::option::Option { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -2229,7 +2235,10 @@ pub mod wasi { /// implementation may choose an appropriate default scheme. Fails if the /// string given is not a syntactically valid uri scheme. #[allow(async_fn_in_trait)] - pub fn set_scheme(&self, scheme: Option<&Scheme>) -> Result<(), ()> { + pub fn set_scheme( + &self, + scheme: ::core::option::Option<&Scheme>, + ) -> ::core::result::Result<(), ()> { unsafe { let (result2_0, result2_1, result2_2, result2_3) = match scheme { Some(e) => { @@ -2296,7 +2305,7 @@ pub mod wasi { /// with Related Schemes which do not require an authority. The HTTP and /// HTTPS schemes always require an authority. #[allow(async_fn_in_trait)] - pub fn authority(&self) -> Option<_rt::String> { + pub fn authority(&self) -> ::core::option::Option<_rt::String> { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -2355,7 +2364,10 @@ pub mod wasi { /// HTTPS schemes always require an authority. Fails if the string given is /// not a syntactically valid URI authority. #[allow(async_fn_in_trait)] - pub fn set_authority(&self, authority: Option<&str>) -> Result<(), ()> { + pub fn set_authority( + &self, + authority: ::core::option::Option<&str>, + ) -> ::core::result::Result<(), ()> { unsafe { let (result1_0, result1_1, result1_2) = match authority { Some(e) => { @@ -2454,7 +2466,7 @@ pub mod wasi { #[allow(unused_unsafe, clippy::all)] /// The timeout for the initial connect to the HTTP Server. #[allow(async_fn_in_trait)] - pub fn connect_timeout(&self) -> Option { + pub fn connect_timeout(&self) -> ::core::option::Option { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 16]); @@ -2496,8 +2508,8 @@ pub mod wasi { #[allow(async_fn_in_trait)] pub fn set_connect_timeout( &self, - duration: Option, - ) -> Result<(), ()> { + duration: ::core::option::Option, + ) -> ::core::result::Result<(), ()> { unsafe { let (result0_0, result0_1) = match duration { Some(e) => (1i32, _rt::as_i64(e)), @@ -2536,7 +2548,7 @@ pub mod wasi { #[allow(unused_unsafe, clippy::all)] /// The timeout for receiving the first byte of the Response body. #[allow(async_fn_in_trait)] - pub fn first_byte_timeout(&self) -> Option { + pub fn first_byte_timeout(&self) -> ::core::option::Option { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 16]); @@ -2578,8 +2590,8 @@ pub mod wasi { #[allow(async_fn_in_trait)] pub fn set_first_byte_timeout( &self, - duration: Option, - ) -> Result<(), ()> { + duration: ::core::option::Option, + ) -> ::core::result::Result<(), ()> { unsafe { let (result0_0, result0_1) = match duration { Some(e) => (1i32, _rt::as_i64(e)), @@ -2619,7 +2631,7 @@ pub mod wasi { /// The timeout for receiving subsequent chunks of bytes in the Response /// body stream. #[allow(async_fn_in_trait)] - pub fn between_bytes_timeout(&self) -> Option { + pub fn between_bytes_timeout(&self) -> ::core::option::Option { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 16]); @@ -2662,8 +2674,8 @@ pub mod wasi { #[allow(async_fn_in_trait)] pub fn set_between_bytes_timeout( &self, - duration: Option, - ) -> Result<(), ()> { + duration: ::core::option::Option, + ) -> ::core::result::Result<(), ()> { unsafe { let (result0_0, result0_1) = match duration { Some(e) => (1i32, _rt::as_i64(e)), @@ -2712,7 +2724,7 @@ pub mod wasi { #[allow(async_fn_in_trait)] pub fn set( param: ResponseOutparam, - response: Result, + response: ::core::result::Result, ) -> () { unsafe { let ( @@ -3489,7 +3501,7 @@ pub mod wasi { /// Returns the incoming body. May be called at most once. Returns error /// if called additional times. #[allow(async_fn_in_trait)] - pub fn consume(&self) -> Result { + pub fn consume(&self) -> ::core::result::Result { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); @@ -3545,7 +3557,7 @@ pub mod wasi { /// and for that backpressure to not inhibit delivery of the trailers if /// the user does not read the entire body. #[allow(async_fn_in_trait)] - pub fn stream(&self) -> Result { + pub fn stream(&self) -> ::core::result::Result { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); @@ -3656,7 +3668,15 @@ pub mod wasi { #[allow(async_fn_in_trait)] pub fn get( &self, - ) -> Option, ErrorCode>, ()>> { + ) -> ::core::option::Option< + ::core::result::Result< + ::core::result::Result< + ::core::option::Option, + ErrorCode, + >, + (), + >, + > { unsafe { #[repr(align(8))] struct RetArea( @@ -4304,7 +4324,7 @@ pub mod wasi { pub fn set_status_code( &self, status_code: StatusCode, - ) -> Result<(), ()> { + ) -> ::core::result::Result<(), ()> { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.12")] @@ -4370,7 +4390,7 @@ pub mod wasi { /// this `outgoing-response` can be retrieved at most once. Subsequent /// calls will return error. #[allow(async_fn_in_trait)] - pub fn body(&self) -> Result { + pub fn body(&self) -> ::core::result::Result { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); @@ -4420,7 +4440,7 @@ pub mod wasi { /// this `outgoing-body` may be retrieved at most once. Subsequent calls /// will return error. #[allow(async_fn_in_trait)] - pub fn write(&self) -> Result { + pub fn write(&self) -> ::core::result::Result { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); @@ -4474,8 +4494,8 @@ pub mod wasi { #[allow(async_fn_in_trait)] pub fn finish( this: OutgoingBody, - trailers: Option, - ) -> Result<(), ErrorCode> { + trailers: ::core::option::Option, + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[repr(align(8))] struct RetArea( @@ -5091,7 +5111,12 @@ pub mod wasi { #[allow(async_fn_in_trait)] pub fn get( &self, - ) -> Option, ()>> { + ) -> ::core::option::Option< + ::core::result::Result< + ::core::result::Result, + (), + >, + > { unsafe { #[repr(align(8))] struct RetArea( @@ -5688,7 +5713,7 @@ pub mod wasi { /// Note that this function is fallible because not all io-errors are /// http-related errors. #[allow(async_fn_in_trait)] - pub fn http_error_code(err: &IoError) -> Option { + pub fn http_error_code(err: &IoError) -> ::core::option::Option { unsafe { #[repr(align(8))] struct RetArea( @@ -6269,8 +6294,8 @@ pub mod wasi { #[allow(async_fn_in_trait)] pub fn handle( request: OutgoingRequest, - options: Option, - ) -> Result { + options: ::core::option::Option, + ) -> ::core::result::Result { unsafe { #[repr(align(8))] struct RetArea( @@ -7147,7 +7172,7 @@ macro_rules! __export_proxy_impl { with_types_in $($path_to_types_root)*:: exports::wasi::http::incoming_handler); const _ : () = { #[rustfmt::skip] #[cfg(target_arch = "wasm32")] #[unsafe (link_section = - "component-type:wit-bindgen:0.60.0:wasi:http@0.2.12:proxy:imports and exportsrust-wasip2-1.0.4+wasi-0.2.12-from-crates-io-proxy-world")] + "component-type:wit-bindgen:0.61.0:wasi:http@0.2.12:proxy:imports and exportsrust-wasip2-1.0.4+wasi-0.2.12-from-crates-io-proxy-world")] #[doc(hidden)] #[allow(clippy::octal_escapes)] pub static __WIT_BINDGEN_COMPONENT_TYPE : [u8; 7053] = * b"\ @@ -7292,7 +7317,7 @@ ndler@0.2.12\x05\x13\x02\x03\0\x09\x10incoming-request\x02\x03\0\x09\x11response request\x04\x0cresponse-out\x05\x01\0\x04\0\x06handle\x01\x06\x04\0!wasi:http/in\ coming-handler@0.2.12\x05\x16\x04\0\x16wasi:http/proxy@0.2.12\x04\0\x0b\x0b\x01\0\ \x05proxy\x03\0\0\0G\x09producers\x01\x0cprocessed-by\x02\x0dwit-component\x070.\ -254.0\x10wit-bindgen-rust\x060.60.0"; +258.0\x10wit-bindgen-rust\x060.61.0"; }; }; } @@ -7301,8 +7326,8 @@ pub use __export_proxy_impl as _export_proxy; #[rustfmt::skip] #[cfg(target_arch = "wasm32")] -#[cfg_attr(feature = "rustc-dep-of-std", unsafe(link_section = "component-type:wit-bindgen:0.60.0:wasi:http@0.2.12:proxy-with-all-of-its-exports-removed:encoded worldrust-wasip2-1.0.4+wasi-0.2.12-from-crates-io-proxy-world-in-libstd"))] -#[cfg_attr(not(feature = "rustc-dep-of-std"), unsafe(link_section = "component-type:wit-bindgen:0.60.0:wasi:http@0.2.12:proxy-with-all-of-its-exports-removed:encoded worldrust-wasip2-1.0.4+wasi-0.2.12-from-crates-io-proxy-world"))] +#[cfg_attr(feature = "rustc-dep-of-std", unsafe(link_section = "component-type:wit-bindgen:0.61.0:wasi:http@0.2.12:proxy-with-all-of-its-exports-removed:encoded worldrust-wasip2-1.0.4+wasi-0.2.12-from-crates-io-proxy-world-in-libstd"))] +#[cfg_attr(not(feature = "rustc-dep-of-std"), unsafe(link_section = "component-type:wit-bindgen:0.61.0:wasi:http@0.2.12:proxy-with-all-of-its-exports-removed:encoded worldrust-wasip2-1.0.4+wasi-0.2.12-from-crates-io-proxy-world"))] #[doc(hidden)] #[allow(clippy::octal_escapes)] @@ -7444,7 +7469,7 @@ h\x07\x01k\x1b\x01@\x01\x03err\x8b\x01\0\x8c\x01\x04\0\x0fhttp-error-code\x01\x8 est\x08\x07options\x0a\0\x0c\x04\0\x06handle\x01\x0d\x03\0!wasi:http/outgoing-ha\ ndler@0.2.12\x05\x13\x04\06wasi:http/proxy-with-all-of-its-exports-removed@0.2.1\ 2\x04\0\x0b+\x01\0%proxy-with-all-of-its-exports-removed\x03\0\0\0G\x09producers\ -\x01\x0cprocessed-by\x02\x0dwit-component\x070.254.0\x10wit-bindgen-rust\x060.60\ +\x01\x0cprocessed-by\x02\x0dwit-component\x070.258.0\x10wit-bindgen-rust\x060.61\ .0"; #[inline(never)] #[doc(hidden)] diff --git a/crates/wasip3/examples/http-proxy.rs b/crates/wasip3/examples/http-proxy.rs index e9a93ed..8b53372 100644 --- a/crates/wasip3/examples/http-proxy.rs +++ b/crates/wasip3/examples/http-proxy.rs @@ -13,7 +13,7 @@ impl wasip3::exports::http::handler::Guest for Example { Response::new(Fields::new(), Some(body_rx), body_result_rx); drop(body_result_tx); - wit_bindgen::spawn(async move { + wit_bindgen::spawn_local(async move { let remaining = body_tx.write_all(b"Hello, WASI!".to_vec()).await; assert!(remaining.is_empty()); }); diff --git a/crates/wasip3/src/command.rs b/crates/wasip3/src/command.rs index a17ada6..b9bfee5 100644 --- a/crates/wasip3/src/command.rs +++ b/crates/wasip3/src/command.rs @@ -1,4 +1,4 @@ -// Generated by `wit-bindgen` 0.60.0. DO NOT EDIT! +// Generated by `wit-bindgen` 0.61.0. DO NOT EDIT! // Options used: // * std_feature // * with "wasi:cli/environment@0.3.0" = "crate::cli::environment" @@ -120,7 +120,7 @@ pub mod exports { pub trait Guest { /// Run the program. #[allow(async_fn_in_trait)] - async fn run() -> Result<(), ()>; + async fn run() -> ::core::result::Result<(), ()>; } #[doc(hidden)] #[macro_export] @@ -178,7 +178,7 @@ macro_rules! __export_command_impl { exports::wasi::cli::run::__export_wasi_cli_run_0_3_0_cabi!($ty with_types_in $($path_to_types_root)*:: exports::wasi::cli::run); const _ : () = { #[rustfmt::skip] #[cfg(target_arch = "wasm32")] #[unsafe (link_section = - "component-type:wit-bindgen:0.60.0:wasi:cli@0.3.0:command:imports and exportsrust-wasip3-0.7.1+wasi-0.3.0-from-crates-io-command-world")] + "component-type:wit-bindgen:0.61.0:wasi:cli@0.3.0:command:imports and exportsrust-wasip3-0.7.1+wasi-0.3.0-from-crates-io-command-world")] #[doc(hidden)] #[allow(clippy::octal_escapes)] pub static __WIT_BINDGEN_COMPONENT_TYPE : [u8; 7934] = * b"\ @@ -338,7 +338,7 @@ B\x05\x01p}\x01@\x01\x07max-lenw\0\0\x04\0\x19get-insecure-random-bytes\x01\x01\ \0\x1fwasi:random/insecure-seed@0.3.0\x05\x1b\x01B\x03\x01j\0\0\x01C\0\0\0\x04\0\ \x03run\x01\x01\x04\0\x12wasi:cli/run@0.3.0\x05\x1c\x04\0\x16wasi:cli/command@0.\ 3.0\x04\0\x0b\x0d\x01\0\x07command\x03\0\0\0G\x09producers\x01\x0cprocessed-by\x02\ -\x0dwit-component\x070.254.0\x10wit-bindgen-rust\x060.60.0"; +\x0dwit-component\x070.258.0\x10wit-bindgen-rust\x060.61.0"; }; }; } @@ -347,8 +347,8 @@ pub use __export_command_impl as _export_command; #[rustfmt::skip] #[cfg(target_arch = "wasm32")] -#[cfg_attr(feature = "rustc-dep-of-std", unsafe(link_section = "component-type:wit-bindgen:0.60.0:wasi:cli@0.3.0:command-with-all-of-its-exports-removed:encoded worldrust-wasip3-0.7.1+wasi-0.3.0-from-crates-io-command-world-in-libstd"))] -#[cfg_attr(not(feature = "rustc-dep-of-std"), unsafe(link_section = "component-type:wit-bindgen:0.60.0:wasi:cli@0.3.0:command-with-all-of-its-exports-removed:encoded worldrust-wasip3-0.7.1+wasi-0.3.0-from-crates-io-command-world"))] +#[cfg_attr(feature = "rustc-dep-of-std", unsafe(link_section = "component-type:wit-bindgen:0.61.0:wasi:cli@0.3.0:command-with-all-of-its-exports-removed:encoded worldrust-wasip3-0.7.1+wasi-0.3.0-from-crates-io-command-world-in-libstd"))] +#[cfg_attr(not(feature = "rustc-dep-of-std"), unsafe(link_section = "component-type:wit-bindgen:0.61.0:wasi:cli@0.3.0:command-with-all-of-its-exports-removed:encoded worldrust-wasip3-0.7.1+wasi-0.3.0-from-crates-io-command-world"))] #[doc(hidden)] #[allow(clippy::octal_escapes)] @@ -508,8 +508,8 @@ B\x05\x01p}\x01@\x01\x07max-lenw\0\0\x04\0\x19get-insecure-random-bytes\x01\x01\ 3.0\x05\x1a\x01B\x03\x01o\x02ww\x01@\0\0\0\x04\0\x11get-insecure-seed\x01\x01\x03\ \0\x1fwasi:random/insecure-seed@0.3.0\x05\x1b\x04\06wasi:cli/command-with-all-of\ -its-exports-removed@0.3.0\x04\0\x0b-\x01\0'command-with-all-of-its-exports-remo\ -ved\x03\0\0\0G\x09producers\x01\x0cprocessed-by\x02\x0dwit-component\x070.254.0\x10\ -wit-bindgen-rust\x060.60.0"; +ved\x03\0\0\0G\x09producers\x01\x0cprocessed-by\x02\x0dwit-component\x070.258.0\x10\ +wit-bindgen-rust\x060.61.0"; #[inline(never)] #[doc(hidden)] pub fn __link_custom_section_describing_imports() { diff --git a/crates/wasip3/src/http_compat/conversions.rs b/crates/wasip3/src/http_compat/conversions.rs index 619b583..ee73f00 100644 --- a/crates/wasip3/src/http_compat/conversions.rs +++ b/crates/wasip3/src/http_compat/conversions.rs @@ -46,7 +46,7 @@ where _ = response.set_status_code(resp.status().as_u16()); - wit_bindgen::spawn(async move { + wit_bindgen::spawn_local(async move { let mut body = std::pin::pin!(resp.into_body()); _ = body_writer.send_http_body(&mut body).await; }); @@ -153,7 +153,7 @@ where req.set_path_with_query(parts.uri.path_and_query().map(|pq| pq.as_str())) .map_err(|()| ErrorCode::HttpRequestUriInvalid)?; - wit_bindgen::spawn(async move { + wit_bindgen::spawn_local(async move { let mut body = std::pin::pin!(body); _ = body_writer.send_http_body(&mut body).await; }); diff --git a/crates/wasip3/src/imports.rs b/crates/wasip3/src/imports.rs index 16133a1..ac60e95 100644 --- a/crates/wasip3/src/imports.rs +++ b/crates/wasip3/src/imports.rs @@ -1,4 +1,4 @@ -// Generated by `wit-bindgen` 0.60.0. DO NOT EDIT! +// Generated by `wit-bindgen` 0.61.0. DO NOT EDIT! // Options used: // * std_feature // * type_section_suffix: "rust-wasip3-0.7.1+wasi-0.3.0-from-crates-io" @@ -147,7 +147,7 @@ pub mod wasi { /// Return a path that programs should use as their initial current working /// directory, interpreting `.` as shorthand for this. #[allow(async_fn_in_trait)] - pub fn get_initial_cwd() -> Option<_rt::String> { + pub fn get_initial_cwd() -> ::core::option::Option<_rt::String> { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -208,7 +208,7 @@ pub mod wasi { #[allow(unused_unsafe, clippy::all)] /// Exit the current instance and any linked instances. #[allow(async_fn_in_trait)] - pub fn exit(status: Result<(), ()>) -> () { + pub fn exit(status: ::core::result::Result<(), ()>) -> () { unsafe { let result0 = match status { Ok(_) => 0i32, @@ -321,7 +321,9 @@ pub mod wasi { #[allow(async_fn_in_trait)] pub fn read_via_stream() -> ( wit_bindgen::rt::async_support::StreamReader, - wit_bindgen::rt::async_support::FutureReader>, + wit_bindgen::rt::async_support::FutureReader< + ::core::result::Result<(), ErrorCode>, + >, ) { unsafe { #[repr(align(4))] @@ -348,7 +350,7 @@ pub mod wasi { ), wit_bindgen::rt::async_support::FutureReader::new( l3 as u32, - & as super::super::super::wit_future::FuturePayload>::VTABLE, @@ -376,7 +378,9 @@ pub mod wasi { #[allow(async_fn_in_trait)] pub fn write_via_stream( data: wit_bindgen::rt::async_support::StreamReader, - ) -> wit_bindgen::rt::async_support::FutureReader> { + ) -> wit_bindgen::rt::async_support::FutureReader< + ::core::result::Result<(), ErrorCode>, + > { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:cli/stdout@0.3.0")] @@ -391,7 +395,7 @@ pub mod wasi { let ret = wit_import0((&data).take_handle() as i32); wit_bindgen::rt::async_support::FutureReader::new( ret as u32, - & as super::super::super::wit_future::FuturePayload>::VTABLE, @@ -417,7 +421,9 @@ pub mod wasi { #[allow(async_fn_in_trait)] pub fn write_via_stream( data: wit_bindgen::rt::async_support::StreamReader, - ) -> wit_bindgen::rt::async_support::FutureReader> { + ) -> wit_bindgen::rt::async_support::FutureReader< + ::core::result::Result<(), ErrorCode>, + > { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:cli/stderr@0.3.0")] @@ -432,7 +438,7 @@ pub mod wasi { let ret = wit_import0((&data).take_handle() as i32); wit_bindgen::rt::async_support::FutureReader::new( ret as u32, - & as super::super::super::wit_future::FuturePayload>::VTABLE, @@ -557,7 +563,7 @@ pub mod wasi { /// If stdin is connected to a terminal, return a `terminal-input` handle /// allowing further interaction with it. #[allow(async_fn_in_trait)] - pub fn get_terminal_stdin() -> Option { + pub fn get_terminal_stdin() -> ::core::option::Option { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); @@ -605,7 +611,7 @@ pub mod wasi { /// If stdout is connected to a terminal, return a `terminal-output` handle /// allowing further interaction with it. #[allow(async_fn_in_trait)] - pub fn get_terminal_stdout() -> Option { + pub fn get_terminal_stdout() -> ::core::option::Option { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); @@ -653,7 +659,7 @@ pub mod wasi { /// If stderr is connected to a terminal, return a `terminal-output` handle /// allowing further interaction with it. #[allow(async_fn_in_trait)] - pub fn get_terminal_stderr() -> Option { + pub fn get_terminal_stderr() -> ::core::option::Option { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); @@ -1087,7 +1093,7 @@ pub mod wasi { Socket, /// The type of the descriptor or file is different from any of the /// other types specified. - Other(Option<_rt::String>), + Other(::core::option::Option<_rt::String>), } impl ::core::fmt::Debug for DescriptorType { fn fmt( @@ -1204,17 +1210,17 @@ pub mod wasi { /// /// If the `option` is none, the platform doesn't maintain an access /// timestamp for this file. - pub data_access_timestamp: Option, + pub data_access_timestamp: ::core::option::Option, /// Last data modification timestamp. /// /// If the `option` is none, the platform doesn't maintain a /// modification timestamp for this file. - pub data_modification_timestamp: Option, + pub data_modification_timestamp: ::core::option::Option, /// Last file status-change timestamp. /// /// If the `option` is none, the platform doesn't maintain a /// status-change timestamp for this file. - pub status_change_timestamp: Option, + pub status_change_timestamp: ::core::option::Option, } impl ::core::fmt::Debug for DescriptorStat { fn fmt( @@ -1361,7 +1367,7 @@ pub mod wasi { /// A catch-all for errors not captured by the existing variants. /// Implementations can use this to extend the error type without /// breaking existing code. - Other(Option<_rt::String>), + Other(::core::option::Option<_rt::String>), } impl ::core::fmt::Debug for ErrorCode { fn fmt( @@ -1619,7 +1625,9 @@ pub mod wasi { offset: Filesize, ) -> ( wit_bindgen::rt::async_support::StreamReader, - wit_bindgen::rt::async_support::FutureReader>, + wit_bindgen::rt::async_support::FutureReader< + ::core::result::Result<(), ErrorCode>, + >, ) { unsafe { #[repr(align(4))] @@ -1648,7 +1656,7 @@ pub mod wasi { ), wit_bindgen::rt::async_support::FutureReader::new( l3 as u32, - & as super::super::super::wit_future::FuturePayload>::VTABLE, @@ -1678,7 +1686,7 @@ pub mod wasi { data: wit_bindgen::rt::async_support::StreamReader, offset: Filesize, ) -> wit_bindgen::rt::async_support::FutureReader< - Result<(), ErrorCode>, + ::core::result::Result<(), ErrorCode>, > { unsafe { #[cfg(target_arch = "wasm32")] @@ -1698,7 +1706,7 @@ pub mod wasi { ); wit_bindgen::rt::async_support::FutureReader::new( ret as u32, - & as super::super::super::wit_future::FuturePayload>::VTABLE, @@ -1721,7 +1729,7 @@ pub mod wasi { &self, data: wit_bindgen::rt::async_support::StreamReader, ) -> wit_bindgen::rt::async_support::FutureReader< - Result<(), ErrorCode>, + ::core::result::Result<(), ErrorCode>, > { unsafe { #[cfg(target_arch = "wasm32")] @@ -1740,7 +1748,7 @@ pub mod wasi { ); wit_bindgen::rt::async_support::FutureReader::new( ret as u32, - & as super::super::super::wit_future::FuturePayload>::VTABLE, @@ -1759,7 +1767,7 @@ pub mod wasi { offset: Filesize, length: Filesize, advice: Advice, - ) -> Result<(), ErrorCode> { + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[derive(Copy, Clone)] struct ParamsLower(i32, i64, i64, i32); @@ -1771,7 +1779,7 @@ pub mod wasi { #[allow(unused_parens)] unsafe impl<'a> _Subtask for _MySubtask<'a> { type Params = (&'a Descriptor, Filesize, Filesize, Advice); - type Results = Result<(), ErrorCode>; + type Results = ::core::result::Result<(), ErrorCode>; type ParamsLower = ParamsLower; fn abi_layout(&mut self) -> ::core::alloc::Layout { unsafe { @@ -1949,7 +1957,7 @@ pub mod wasi { /// /// Note: This is similar to `fdatasync` in POSIX. #[allow(async_fn_in_trait)] - pub async fn sync_data(&self) -> Result<(), ErrorCode> { + pub async fn sync_data(&self) -> ::core::result::Result<(), ErrorCode> { unsafe { #[derive(Copy, Clone)] struct ParamsLower(i32); @@ -1961,7 +1969,7 @@ pub mod wasi { #[allow(unused_parens)] unsafe impl<'a> _Subtask for _MySubtask<'a> { type Params = (&'a Descriptor,); - type Results = Result<(), ErrorCode>; + type Results = ::core::result::Result<(), ErrorCode>; type ParamsLower = ParamsLower; fn abi_layout(&mut self) -> ::core::alloc::Layout { unsafe { @@ -2123,7 +2131,9 @@ pub mod wasi { /// Note: This returns the value that was the `fs_flags` value returned /// from `fdstat_get` in earlier versions of WASI. #[allow(async_fn_in_trait)] - pub async fn get_flags(&self) -> Result { + pub async fn get_flags( + &self, + ) -> ::core::result::Result { unsafe { #[derive(Copy, Clone)] struct ParamsLower(i32); @@ -2135,7 +2145,10 @@ pub mod wasi { #[allow(unused_parens)] unsafe impl<'a> _Subtask for _MySubtask<'a> { type Params = (&'a Descriptor,); - type Results = Result; + type Results = ::core::result::Result< + DescriptorFlags, + ErrorCode, + >; type ParamsLower = ParamsLower; fn abi_layout(&mut self) -> ::core::alloc::Layout { unsafe { @@ -2307,7 +2320,9 @@ pub mod wasi { /// Note: This returns the value that was the `fs_filetype` value returned /// from `fdstat_get` in earlier versions of WASI. #[allow(async_fn_in_trait)] - pub async fn get_type(&self) -> Result { + pub async fn get_type( + &self, + ) -> ::core::result::Result { unsafe { #[derive(Copy, Clone)] struct ParamsLower(i32); @@ -2319,7 +2334,10 @@ pub mod wasi { #[allow(unused_parens)] unsafe impl<'a> _Subtask for _MySubtask<'a> { type Params = (&'a Descriptor,); - type Results = Result; + type Results = ::core::result::Result< + DescriptorType, + ErrorCode, + >; type ParamsLower = ParamsLower; fn abi_layout(&mut self) -> ::core::alloc::Layout { unsafe { @@ -2526,7 +2544,10 @@ pub mod wasi { /// /// Note: This was called `fd_filestat_set_size` in earlier versions of WASI. #[allow(async_fn_in_trait)] - pub async fn set_size(&self, size: Filesize) -> Result<(), ErrorCode> { + pub async fn set_size( + &self, + size: Filesize, + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[derive(Copy, Clone)] struct ParamsLower(i32, i64); @@ -2538,7 +2559,7 @@ pub mod wasi { #[allow(unused_parens)] unsafe impl<'a> _Subtask for _MySubtask<'a> { type Params = (&'a Descriptor, Filesize); - type Results = Result<(), ErrorCode>; + type Results = ::core::result::Result<(), ErrorCode>; type ParamsLower = ParamsLower; fn abi_layout(&mut self) -> ::core::alloc::Layout { unsafe { @@ -2709,7 +2730,7 @@ pub mod wasi { &self, data_access_timestamp: NewTimestamp, data_modification_timestamp: NewTimestamp, - ) -> Result<(), ErrorCode> { + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[derive(Copy, Clone)] struct ParamsLower(*mut u8); @@ -2721,7 +2742,7 @@ pub mod wasi { #[allow(unused_parens)] unsafe impl<'a> _Subtask for _MySubtask<'a> { type Params = (&'a Descriptor, NewTimestamp, NewTimestamp); - type Results = Result<(), ErrorCode>; + type Results = ::core::result::Result<(), ErrorCode>; type ParamsLower = ParamsLower; fn abi_layout(&mut self) -> ::core::alloc::Layout { unsafe { @@ -2946,7 +2967,9 @@ pub mod wasi { &self, ) -> ( wit_bindgen::rt::async_support::StreamReader, - wit_bindgen::rt::async_support::FutureReader>, + wit_bindgen::rt::async_support::FutureReader< + ::core::result::Result<(), ErrorCode>, + >, ) { unsafe { #[repr(align(4))] @@ -2975,7 +2998,7 @@ pub mod wasi { ), wit_bindgen::rt::async_support::FutureReader::new( l3 as u32, - & as super::super::super::wit_future::FuturePayload>::VTABLE, @@ -2994,7 +3017,7 @@ pub mod wasi { /// /// Note: This is similar to `fsync` in POSIX. #[allow(async_fn_in_trait)] - pub async fn sync(&self) -> Result<(), ErrorCode> { + pub async fn sync(&self) -> ::core::result::Result<(), ErrorCode> { unsafe { #[derive(Copy, Clone)] struct ParamsLower(i32); @@ -3006,7 +3029,7 @@ pub mod wasi { #[allow(unused_parens)] unsafe impl<'a> _Subtask for _MySubtask<'a> { type Params = (&'a Descriptor,); - type Results = Result<(), ErrorCode>; + type Results = ::core::result::Result<(), ErrorCode>; type ParamsLower = ParamsLower; fn abi_layout(&mut self) -> ::core::alloc::Layout { unsafe { @@ -3168,7 +3191,7 @@ pub mod wasi { pub async fn create_directory_at( &self, path: _rt::String, - ) -> Result<(), ErrorCode> { + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[derive(Copy, Clone)] struct ParamsLower(i32, *mut u8, usize); @@ -3180,7 +3203,7 @@ pub mod wasi { #[allow(unused_parens)] unsafe impl<'a> _Subtask for _MySubtask<'a> { type Params = (&'a Descriptor, _rt::String); - type Results = Result<(), ErrorCode>; + type Results = ::core::result::Result<(), ErrorCode>; type ParamsLower = ParamsLower; fn abi_layout(&mut self) -> ::core::alloc::Layout { unsafe { @@ -3366,7 +3389,9 @@ pub mod wasi { /// /// Note: This was called `fd_filestat_get` in earlier versions of WASI. #[allow(async_fn_in_trait)] - pub async fn stat(&self) -> Result { + pub async fn stat( + &self, + ) -> ::core::result::Result { unsafe { #[derive(Copy, Clone)] struct ParamsLower(i32); @@ -3378,7 +3403,10 @@ pub mod wasi { #[allow(unused_parens)] unsafe impl<'a> _Subtask for _MySubtask<'a> { type Params = (&'a Descriptor,); - type Results = Result; + type Results = ::core::result::Result< + DescriptorStat, + ErrorCode, + >; type ParamsLower = ParamsLower; fn abi_layout(&mut self) -> ::core::alloc::Layout { unsafe { @@ -3670,7 +3698,7 @@ pub mod wasi { &self, path_flags: PathFlags, path: _rt::String, - ) -> Result { + ) -> ::core::result::Result { unsafe { #[derive(Copy, Clone)] struct ParamsLower(i32, i32, *mut u8, usize); @@ -3682,7 +3710,10 @@ pub mod wasi { #[allow(unused_parens)] unsafe impl<'a> _Subtask for _MySubtask<'a> { type Params = (&'a Descriptor, PathFlags, _rt::String); - type Results = Result; + type Results = ::core::result::Result< + DescriptorStat, + ErrorCode, + >; type ParamsLower = ParamsLower; fn abi_layout(&mut self) -> ::core::alloc::Layout { unsafe { @@ -4006,7 +4037,7 @@ pub mod wasi { path: _rt::String, data_access_timestamp: NewTimestamp, data_modification_timestamp: NewTimestamp, - ) -> Result<(), ErrorCode> { + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[derive(Copy, Clone)] struct ParamsLower(*mut u8); @@ -4024,7 +4055,7 @@ pub mod wasi { NewTimestamp, NewTimestamp, ); - type Results = Result<(), ErrorCode>; + type Results = ::core::result::Result<(), ErrorCode>; type ParamsLower = ParamsLower; fn abi_layout(&mut self) -> ::core::alloc::Layout { unsafe { @@ -4283,7 +4314,7 @@ pub mod wasi { old_path: _rt::String, new_descriptor: &Descriptor, new_path: _rt::String, - ) -> Result<(), ErrorCode> { + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[derive(Copy, Clone)] struct ParamsLower(*mut u8); @@ -4301,7 +4332,7 @@ pub mod wasi { &'a Descriptor, _rt::String, ); - type Results = Result<(), ErrorCode>; + type Results = ::core::result::Result<(), ErrorCode>; type ParamsLower = ParamsLower; fn abi_layout(&mut self) -> ::core::alloc::Layout { unsafe { @@ -4555,7 +4586,7 @@ pub mod wasi { path: _rt::String, open_flags: OpenFlags, flags: DescriptorFlags, - ) -> Result { + ) -> ::core::result::Result { unsafe { #[derive(Copy, Clone)] struct ParamsLower(*mut u8); @@ -4573,7 +4604,7 @@ pub mod wasi { OpenFlags, DescriptorFlags, ); - type Results = Result; + type Results = ::core::result::Result; type ParamsLower = ParamsLower; fn abi_layout(&mut self) -> ::core::alloc::Layout { unsafe { @@ -4795,7 +4826,7 @@ pub mod wasi { pub async fn readlink_at( &self, path: _rt::String, - ) -> Result<_rt::String, ErrorCode> { + ) -> ::core::result::Result<_rt::String, ErrorCode> { unsafe { #[derive(Copy, Clone)] struct ParamsLower(i32, *mut u8, usize); @@ -4807,7 +4838,10 @@ pub mod wasi { #[allow(unused_parens)] unsafe impl<'a> _Subtask for _MySubtask<'a> { type Params = (&'a Descriptor, _rt::String); - type Results = Result<_rt::String, ErrorCode>; + type Results = ::core::result::Result< + _rt::String, + ErrorCode, + >; type ParamsLower = ParamsLower; fn abi_layout(&mut self) -> ::core::alloc::Layout { unsafe { @@ -5006,7 +5040,7 @@ pub mod wasi { pub async fn remove_directory_at( &self, path: _rt::String, - ) -> Result<(), ErrorCode> { + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[derive(Copy, Clone)] struct ParamsLower(i32, *mut u8, usize); @@ -5018,7 +5052,7 @@ pub mod wasi { #[allow(unused_parens)] unsafe impl<'a> _Subtask for _MySubtask<'a> { type Params = (&'a Descriptor, _rt::String); - type Results = Result<(), ErrorCode>; + type Results = ::core::result::Result<(), ErrorCode>; type ParamsLower = ParamsLower; fn abi_layout(&mut self) -> ::core::alloc::Layout { unsafe { @@ -5203,7 +5237,7 @@ pub mod wasi { old_path: _rt::String, new_descriptor: &Descriptor, new_path: _rt::String, - ) -> Result<(), ErrorCode> { + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[derive(Copy, Clone)] struct ParamsLower(*mut u8); @@ -5220,7 +5254,7 @@ pub mod wasi { &'a Descriptor, _rt::String, ); - type Results = Result<(), ErrorCode>; + type Results = ::core::result::Result<(), ErrorCode>; type ParamsLower = ParamsLower; fn abi_layout(&mut self) -> ::core::alloc::Layout { unsafe { @@ -5462,7 +5496,7 @@ pub mod wasi { &self, old_path: _rt::String, new_path: _rt::String, - ) -> Result<(), ErrorCode> { + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[derive(Copy, Clone)] struct ParamsLower(*mut u8); @@ -5474,7 +5508,7 @@ pub mod wasi { #[allow(unused_parens)] unsafe impl<'a> _Subtask for _MySubtask<'a> { type Params = (&'a Descriptor, _rt::String, _rt::String); - type Results = Result<(), ErrorCode>; + type Results = ::core::result::Result<(), ErrorCode>; type ParamsLower = ParamsLower; fn abi_layout(&mut self) -> ::core::alloc::Layout { unsafe { @@ -5711,7 +5745,7 @@ pub mod wasi { pub async fn unlink_file_at( &self, path: _rt::String, - ) -> Result<(), ErrorCode> { + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[derive(Copy, Clone)] struct ParamsLower(i32, *mut u8, usize); @@ -5723,7 +5757,7 @@ pub mod wasi { #[allow(unused_parens)] unsafe impl<'a> _Subtask for _MySubtask<'a> { type Params = (&'a Descriptor, _rt::String); - type Results = Result<(), ErrorCode>; + type Results = ::core::result::Result<(), ErrorCode>; type ParamsLower = ParamsLower; fn abi_layout(&mut self) -> ::core::alloc::Layout { unsafe { @@ -6015,7 +6049,7 @@ pub mod wasi { #[allow(async_fn_in_trait)] pub async fn metadata_hash( &self, - ) -> Result { + ) -> ::core::result::Result { unsafe { #[derive(Copy, Clone)] struct ParamsLower(i32); @@ -6027,7 +6061,10 @@ pub mod wasi { #[allow(unused_parens)] unsafe impl<'a> _Subtask for _MySubtask<'a> { type Params = (&'a Descriptor,); - type Results = Result; + type Results = ::core::result::Result< + MetadataHashValue, + ErrorCode, + >; type ParamsLower = ParamsLower; fn abi_layout(&mut self) -> ::core::alloc::Layout { unsafe { @@ -6196,7 +6233,7 @@ pub mod wasi { &self, path_flags: PathFlags, path: _rt::String, - ) -> Result { + ) -> ::core::result::Result { unsafe { #[derive(Copy, Clone)] struct ParamsLower(i32, i32, *mut u8, usize); @@ -6208,7 +6245,10 @@ pub mod wasi { #[allow(unused_parens)] unsafe impl<'a> _Subtask for _MySubtask<'a> { type Params = (&'a Descriptor, PathFlags, _rt::String); - type Results = Result; + type Results = ::core::result::Result< + MetadataHashValue, + ErrorCode, + >; type ParamsLower = ParamsLower; fn abi_layout(&mut self) -> ::core::alloc::Layout { unsafe { @@ -6784,7 +6824,7 @@ pub mod wasi { /// A catch-all for errors not captured by the existing variants. /// Implementations can use this to extend the error type without /// breaking existing code. - Other(Option<_rt::String>), + Other(::core::option::Option<_rt::String>), } impl ::core::fmt::Debug for ErrorCode { fn fmt( @@ -7106,7 +7146,7 @@ pub mod wasi { #[allow(async_fn_in_trait)] pub fn create( address_family: IpAddressFamily, - ) -> Result { + ) -> ::core::result::Result { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -7245,7 +7285,7 @@ pub mod wasi { pub fn bind( &self, local_address: IpSocketAddress, - ) -> Result<(), ErrorCode> { + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -7481,7 +7521,7 @@ pub mod wasi { pub async fn connect( &self, remote_address: IpSocketAddress, - ) -> Result<(), ErrorCode> { + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[derive(Copy, Clone)] struct ParamsLower(*mut u8); @@ -7493,7 +7533,7 @@ pub mod wasi { #[allow(unused_parens)] unsafe impl<'a> _Subtask for _MySubtask<'a> { type Params = (&'a TcpSocket, IpSocketAddress); - type Results = Result<(), ErrorCode>; + type Results = ::core::result::Result<(), ErrorCode>; type ParamsLower = ParamsLower; fn abi_layout(&mut self) -> ::core::alloc::Layout { unsafe { @@ -7750,7 +7790,7 @@ pub mod wasi { #[allow(async_fn_in_trait)] pub fn listen( &self, - ) -> Result< + ) -> ::core::result::Result< wit_bindgen::rt::async_support::StreamReader, ErrorCode, > { @@ -7885,7 +7925,7 @@ pub mod wasi { &self, data: wit_bindgen::rt::async_support::StreamReader, ) -> wit_bindgen::rt::async_support::FutureReader< - Result<(), ErrorCode>, + ::core::result::Result<(), ErrorCode>, > { unsafe { #[cfg(target_arch = "wasm32")] @@ -7904,7 +7944,7 @@ pub mod wasi { ); wit_bindgen::rt::async_support::FutureReader::new( ret as u32, - & as super::super::super::wit_future::FuturePayload>::VTABLE, @@ -7946,7 +7986,9 @@ pub mod wasi { &self, ) -> ( wit_bindgen::rt::async_support::StreamReader, - wit_bindgen::rt::async_support::FutureReader>, + wit_bindgen::rt::async_support::FutureReader< + ::core::result::Result<(), ErrorCode>, + >, ) { unsafe { #[repr(align(4))] @@ -7975,7 +8017,7 @@ pub mod wasi { ), wit_bindgen::rt::async_support::FutureReader::new( l3 as u32, - & as super::super::super::wit_future::FuturePayload>::VTABLE, @@ -8005,7 +8047,9 @@ pub mod wasi { /// - /// - #[allow(async_fn_in_trait)] - pub fn get_local_address(&self) -> Result { + pub fn get_local_address( + &self, + ) -> ::core::result::Result { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -8226,7 +8270,9 @@ pub mod wasi { /// - /// - #[allow(async_fn_in_trait)] - pub fn get_remote_address(&self) -> Result { + pub fn get_remote_address( + &self, + ) -> ::core::result::Result { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -8499,7 +8545,7 @@ pub mod wasi { pub fn set_listen_backlog_size( &self, value: u64, - ) -> Result<(), ErrorCode> { + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -8607,7 +8653,9 @@ pub mod wasi { /// /// Equivalent to the SO_KEEPALIVE socket option. #[allow(async_fn_in_trait)] - pub fn get_keep_alive_enabled(&self) -> Result { + pub fn get_keep_alive_enabled( + &self, + ) -> ::core::result::Result { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -8713,7 +8761,7 @@ pub mod wasi { pub fn set_keep_alive_enabled( &self, value: bool, - ) -> Result<(), ErrorCode> { + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -8830,7 +8878,9 @@ pub mod wasi { /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. #[allow(async_fn_in_trait)] - pub fn get_keep_alive_idle_time(&self) -> Result { + pub fn get_keep_alive_idle_time( + &self, + ) -> ::core::result::Result { unsafe { #[repr(align(8))] struct RetArea( @@ -8931,7 +8981,7 @@ pub mod wasi { pub fn set_keep_alive_idle_time( &self, value: Duration, - ) -> Result<(), ErrorCode> { + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -9040,7 +9090,9 @@ pub mod wasi { /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. #[allow(async_fn_in_trait)] - pub fn get_keep_alive_interval(&self) -> Result { + pub fn get_keep_alive_interval( + &self, + ) -> ::core::result::Result { unsafe { #[repr(align(8))] struct RetArea( @@ -9141,7 +9193,7 @@ pub mod wasi { pub fn set_keep_alive_interval( &self, value: Duration, - ) -> Result<(), ErrorCode> { + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -9251,7 +9303,9 @@ pub mod wasi { /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. #[allow(async_fn_in_trait)] - pub fn get_keep_alive_count(&self) -> Result { + pub fn get_keep_alive_count( + &self, + ) -> ::core::result::Result { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -9354,7 +9408,10 @@ pub mod wasi { impl TcpSocket { #[allow(unused_unsafe, clippy::all)] #[allow(async_fn_in_trait)] - pub fn set_keep_alive_count(&self, value: u32) -> Result<(), ErrorCode> { + pub fn set_keep_alive_count( + &self, + value: u32, + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -9458,7 +9515,7 @@ pub mod wasi { /// # Typical errors /// - `invalid-argument`: (set) The TTL value must be 1 or higher. #[allow(async_fn_in_trait)] - pub fn get_hop_limit(&self) -> Result { + pub fn get_hop_limit(&self) -> ::core::result::Result { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -9561,7 +9618,10 @@ pub mod wasi { impl TcpSocket { #[allow(unused_unsafe, clippy::all)] #[allow(async_fn_in_trait)] - pub fn set_hop_limit(&self, value: u8) -> Result<(), ErrorCode> { + pub fn set_hop_limit( + &self, + value: u8, + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -9680,7 +9740,9 @@ pub mod wasi { /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. #[allow(async_fn_in_trait)] - pub fn get_receive_buffer_size(&self) -> Result { + pub fn get_receive_buffer_size( + &self, + ) -> ::core::result::Result { unsafe { #[repr(align(8))] struct RetArea( @@ -9781,7 +9843,7 @@ pub mod wasi { pub fn set_receive_buffer_size( &self, value: u64, - ) -> Result<(), ErrorCode> { + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -9879,7 +9941,9 @@ pub mod wasi { impl TcpSocket { #[allow(unused_unsafe, clippy::all)] #[allow(async_fn_in_trait)] - pub fn get_send_buffer_size(&self) -> Result { + pub fn get_send_buffer_size( + &self, + ) -> ::core::result::Result { unsafe { #[repr(align(8))] struct RetArea( @@ -9977,7 +10041,10 @@ pub mod wasi { impl TcpSocket { #[allow(unused_unsafe, clippy::all)] #[allow(async_fn_in_trait)] - pub fn set_send_buffer_size(&self, value: u64) -> Result<(), ErrorCode> { + pub fn set_send_buffer_size( + &self, + value: u64, + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -10092,7 +10159,7 @@ pub mod wasi { #[allow(async_fn_in_trait)] pub fn create( address_family: IpAddressFamily, - ) -> Result { + ) -> ::core::result::Result { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -10217,7 +10284,7 @@ pub mod wasi { pub fn bind( &self, local_address: IpSocketAddress, - ) -> Result<(), ErrorCode> { + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -10455,7 +10522,7 @@ pub mod wasi { pub fn connect( &self, remote_address: IpSocketAddress, - ) -> Result<(), ErrorCode> { + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -10669,7 +10736,7 @@ pub mod wasi { /// - /// - #[allow(async_fn_in_trait)] - pub fn disconnect(&self) -> Result<(), ErrorCode> { + pub fn disconnect(&self) -> ::core::result::Result<(), ErrorCode> { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -10812,8 +10879,8 @@ pub mod wasi { pub async fn send( &self, data: _rt::Vec, - remote_address: Option, - ) -> Result<(), ErrorCode> { + remote_address: ::core::option::Option, + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[derive(Copy, Clone)] struct ParamsLower(*mut u8); @@ -10827,9 +10894,9 @@ pub mod wasi { type Params = ( &'a UdpSocket, _rt::Vec, - Option, + ::core::option::Option, ); - type Results = Result<(), ErrorCode>; + type Results = ::core::result::Result<(), ErrorCode>; type ParamsLower = ParamsLower; fn abi_layout(&mut self) -> ::core::alloc::Layout { unsafe { @@ -11091,7 +11158,7 @@ pub mod wasi { #[allow(async_fn_in_trait)] pub async fn receive( &self, - ) -> Result<(_rt::Vec, IpSocketAddress), ErrorCode> { + ) -> ::core::result::Result<(_rt::Vec, IpSocketAddress), ErrorCode> { unsafe { #[derive(Copy, Clone)] struct ParamsLower(i32); @@ -11103,7 +11170,7 @@ pub mod wasi { #[allow(unused_parens)] unsafe impl<'a> _Subtask for _MySubtask<'a> { type Params = (&'a UdpSocket,); - type Results = Result< + type Results = ::core::result::Result< (_rt::Vec, IpSocketAddress), ErrorCode, >; @@ -11384,7 +11451,9 @@ pub mod wasi { /// - /// - #[allow(async_fn_in_trait)] - pub fn get_local_address(&self) -> Result { + pub fn get_local_address( + &self, + ) -> ::core::result::Result { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -11605,7 +11674,9 @@ pub mod wasi { /// - /// - #[allow(async_fn_in_trait)] - pub fn get_remote_address(&self) -> Result { + pub fn get_remote_address( + &self, + ) -> ::core::result::Result { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -11847,7 +11918,9 @@ pub mod wasi { /// # Typical errors /// - `invalid-argument`: (set) The TTL value must be 1 or higher. #[allow(async_fn_in_trait)] - pub fn get_unicast_hop_limit(&self) -> Result { + pub fn get_unicast_hop_limit( + &self, + ) -> ::core::result::Result { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -11950,7 +12023,10 @@ pub mod wasi { impl UdpSocket { #[allow(unused_unsafe, clippy::all)] #[allow(async_fn_in_trait)] - pub fn set_unicast_hop_limit(&self, value: u8) -> Result<(), ErrorCode> { + pub fn set_unicast_hop_limit( + &self, + value: u8, + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -12061,7 +12137,9 @@ pub mod wasi { /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. #[allow(async_fn_in_trait)] - pub fn get_receive_buffer_size(&self) -> Result { + pub fn get_receive_buffer_size( + &self, + ) -> ::core::result::Result { unsafe { #[repr(align(8))] struct RetArea( @@ -12162,7 +12240,7 @@ pub mod wasi { pub fn set_receive_buffer_size( &self, value: u64, - ) -> Result<(), ErrorCode> { + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -12260,7 +12338,9 @@ pub mod wasi { impl UdpSocket { #[allow(unused_unsafe, clippy::all)] #[allow(async_fn_in_trait)] - pub fn get_send_buffer_size(&self) -> Result { + pub fn get_send_buffer_size( + &self, + ) -> ::core::result::Result { unsafe { #[repr(align(8))] struct RetArea( @@ -12358,7 +12438,10 @@ pub mod wasi { impl UdpSocket { #[allow(unused_unsafe, clippy::all)] #[allow(async_fn_in_trait)] - pub fn set_send_buffer_size(&self, value: u64) -> Result<(), ErrorCode> { + pub fn set_send_buffer_size( + &self, + value: u64, + ) -> ::core::result::Result<(), ErrorCode> { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -12487,7 +12570,7 @@ pub mod wasi { /// A catch-all for errors not captured by the existing variants. /// Implementations can use this to extend the error type without /// breaking existing code. - Other(Option<_rt::String>), + Other(::core::option::Option<_rt::String>), } impl ::core::fmt::Debug for ErrorCode { fn fmt( @@ -12549,7 +12632,7 @@ pub mod wasi { #[allow(async_fn_in_trait)] pub async fn resolve_addresses( name: _rt::String, - ) -> Result<_rt::Vec, ErrorCode> { + ) -> ::core::result::Result<_rt::Vec, ErrorCode> { unsafe { #[derive(Copy, Clone)] struct ParamsLower(*mut u8, usize); @@ -12561,7 +12644,10 @@ pub mod wasi { #[allow(unused_parens)] unsafe impl<'a> _Subtask for _MySubtask<'a> { type Params = (_rt::String,); - type Results = Result<_rt::Vec, ErrorCode>; + type Results = ::core::result::Result< + _rt::Vec, + ErrorCode, + >; type ParamsLower = ParamsLower; fn abi_layout(&mut self) -> ::core::alloc::Layout { unsafe { @@ -13013,7 +13099,7 @@ pub mod wit_future { } unsafe fn lift( ptr: *mut u8, - ) -> Result<(), super::super::wasi::cli::stdin::ErrorCode> { + ) -> ::core::result::Result<(), super::super::wasi::cli::stdin::ErrorCode> { unsafe { let l0 = i32::from(*ptr.add(0).cast::()); match l0 { @@ -13033,7 +13119,7 @@ pub mod wit_future { } } unsafe fn lower( - value: Result<(), super::super::wasi::cli::stdin::ErrorCode>, + value: ::core::result::Result<(), super::super::wasi::cli::stdin::ErrorCode>, ptr: *mut u8, ) { unsafe { @@ -13052,9 +13138,9 @@ pub mod wit_future { unsafe {} } pub static VTABLE: wit_bindgen::rt::async_support::FutureVtable< - Result<(), super::super::wasi::cli::stdin::ErrorCode>, + ::core::result::Result<(), super::super::wasi::cli::stdin::ErrorCode>, > = wit_bindgen::rt::async_support::FutureVtable::< - Result<(), super::super::wasi::cli::stdin::ErrorCode>, + ::core::result::Result<(), super::super::wasi::cli::stdin::ErrorCode>, > { cancel_write, cancel_read, @@ -13069,7 +13155,7 @@ pub mod wit_future { start_write, }; impl super::FuturePayload - for Result<(), super::super::wasi::cli::stdin::ErrorCode> { + for ::core::result::Result<(), super::super::wasi::cli::stdin::ErrorCode> { const VTABLE: &'static wit_bindgen::rt::async_support::FutureVtable = &VTABLE; } } @@ -13124,7 +13210,10 @@ pub mod wit_future { } unsafe fn lift( ptr: *mut u8, - ) -> Result<(), super::super::wasi::filesystem::types::ErrorCode> { + ) -> ::core::result::Result< + (), + super::super::wasi::filesystem::types::ErrorCode, + > { unsafe { let l0 = i32::from(*ptr.add(0).cast::()); match l0 { @@ -13218,7 +13307,10 @@ pub mod wit_future { } } unsafe fn lower( - value: Result<(), super::super::wasi::filesystem::types::ErrorCode>, + value: ::core::result::Result< + (), + super::super::wasi::filesystem::types::ErrorCode, + >, ptr: *mut u8, ) { unsafe { @@ -13513,9 +13605,9 @@ pub mod wit_future { } } pub static VTABLE: wit_bindgen::rt::async_support::FutureVtable< - Result<(), super::super::wasi::filesystem::types::ErrorCode>, + ::core::result::Result<(), super::super::wasi::filesystem::types::ErrorCode>, > = wit_bindgen::rt::async_support::FutureVtable::< - Result<(), super::super::wasi::filesystem::types::ErrorCode>, + ::core::result::Result<(), super::super::wasi::filesystem::types::ErrorCode>, > { cancel_write, cancel_read, @@ -13530,7 +13622,10 @@ pub mod wit_future { start_write, }; impl super::FuturePayload - for Result<(), super::super::wasi::filesystem::types::ErrorCode> { + for ::core::result::Result< + (), + super::super::wasi::filesystem::types::ErrorCode, + > { const VTABLE: &'static wit_bindgen::rt::async_support::FutureVtable = &VTABLE; } } @@ -13585,7 +13680,7 @@ pub mod wit_future { } unsafe fn lift( ptr: *mut u8, - ) -> Result<(), super::super::wasi::sockets::types::ErrorCode> { + ) -> ::core::result::Result<(), super::super::wasi::sockets::types::ErrorCode> { unsafe { let l0 = i32::from(*ptr.add(0).cast::()); match l0 { @@ -13657,7 +13752,10 @@ pub mod wit_future { } } unsafe fn lower( - value: Result<(), super::super::wasi::sockets::types::ErrorCode>, + value: ::core::result::Result< + (), + super::super::wasi::sockets::types::ErrorCode, + >, ptr: *mut u8, ) { unsafe { @@ -13820,9 +13918,9 @@ pub mod wit_future { } } pub static VTABLE: wit_bindgen::rt::async_support::FutureVtable< - Result<(), super::super::wasi::sockets::types::ErrorCode>, + ::core::result::Result<(), super::super::wasi::sockets::types::ErrorCode>, > = wit_bindgen::rt::async_support::FutureVtable::< - Result<(), super::super::wasi::sockets::types::ErrorCode>, + ::core::result::Result<(), super::super::wasi::sockets::types::ErrorCode>, > { cancel_write, cancel_read, @@ -13837,7 +13935,7 @@ pub mod wit_future { start_write, }; impl super::FuturePayload - for Result<(), super::super::wasi::sockets::types::ErrorCode> { + for ::core::result::Result<(), super::super::wasi::sockets::types::ErrorCode> { const VTABLE: &'static wit_bindgen::rt::async_support::FutureVtable = &VTABLE; } } @@ -14265,8 +14363,8 @@ pub mod wit_stream { #[rustfmt::skip] #[cfg(target_arch = "wasm32")] -#[cfg_attr(feature = "rustc-dep-of-std", unsafe(link_section = "component-type:wit-bindgen:0.60.0:wasi:cli@0.3.0:imports:encoded worldrust-wasip3-0.7.1+wasi-0.3.0-from-crates-io-in-libstd"))] -#[cfg_attr(not(feature = "rustc-dep-of-std"), unsafe(link_section = "component-type:wit-bindgen:0.60.0:wasi:cli@0.3.0:imports:encoded worldrust-wasip3-0.7.1+wasi-0.3.0-from-crates-io"))] +#[cfg_attr(feature = "rustc-dep-of-std", unsafe(link_section = "component-type:wit-bindgen:0.61.0:wasi:cli@0.3.0:imports:encoded worldrust-wasip3-0.7.1+wasi-0.3.0-from-crates-io-in-libstd"))] +#[cfg_attr(not(feature = "rustc-dep-of-std"), unsafe(link_section = "component-type:wit-bindgen:0.61.0:wasi:cli@0.3.0:imports:encoded worldrust-wasip3-0.7.1+wasi-0.3.0-from-crates-io"))] #[doc(hidden)] #[allow(clippy::octal_escapes)] @@ -14426,7 +14524,7 @@ B\x05\x01p}\x01@\x01\x07max-lenw\0\0\x04\0\x19get-insecure-random-bytes\x01\x01\ 3.0\x05\x1a\x01B\x03\x01o\x02ww\x01@\0\0\0\x04\0\x11get-insecure-seed\x01\x01\x03\ \0\x1fwasi:random/insecure-seed@0.3.0\x05\x1b\x04\0\x16wasi:cli/imports@0.3.0\x04\ \0\x0b\x0d\x01\0\x07imports\x03\0\0\0G\x09producers\x01\x0cprocessed-by\x02\x0dw\ -it-component\x070.254.0\x10wit-bindgen-rust\x060.60.0"; +it-component\x070.258.0\x10wit-bindgen-rust\x060.61.0"; #[inline(never)] #[doc(hidden)] pub fn __link_custom_section_describing_imports() { diff --git a/crates/wasip3/src/lib.rs b/crates/wasip3/src/lib.rs index 826fb5d..72fccac 100644 --- a/crates/wasip3/src/lib.rs +++ b/crates/wasip3/src/lib.rs @@ -182,7 +182,7 @@ where pub use wit_bindgen; #[cfg(feature = "async-spawn")] -pub use wit_bindgen::spawn; +pub use wit_bindgen::spawn_local; // Expand the `cli` and `http` modules with `export!` macros for the // command/proxy worlds, but also retain all the contents defined in the diff --git a/crates/wasip3/src/service.rs b/crates/wasip3/src/service.rs index 3d302af..bfa9704 100644 --- a/crates/wasip3/src/service.rs +++ b/crates/wasip3/src/service.rs @@ -1,4 +1,4 @@ -// Generated by `wit-bindgen` 0.60.0. DO NOT EDIT! +// Generated by `wit-bindgen` 0.61.0. DO NOT EDIT! // Options used: // * std_feature // * with "wasi:cli/stdin@0.3.0" = "crate::cli::stdin" @@ -107,8 +107,8 @@ pub mod wasi { /// Defines the case payload type for `DNS-error` above: #[derive(Clone)] pub struct DnsErrorPayload { - pub rcode: Option<_rt::String>, - pub info_code: Option, + pub rcode: ::core::option::Option<_rt::String>, + pub info_code: ::core::option::Option, } impl ::core::fmt::Debug for DnsErrorPayload { fn fmt( @@ -124,8 +124,8 @@ pub mod wasi { /// Defines the case payload type for `TLS-alert-received` above: #[derive(Clone)] pub struct TlsAlertReceivedPayload { - pub alert_id: Option, - pub alert_message: Option<_rt::String>, + pub alert_id: ::core::option::Option, + pub alert_message: ::core::option::Option<_rt::String>, } impl ::core::fmt::Debug for TlsAlertReceivedPayload { fn fmt( @@ -141,8 +141,8 @@ pub mod wasi { /// Defines the case payload type for `HTTP-response-{header,trailer}-size` above: #[derive(Clone)] pub struct FieldSizePayload { - pub field_name: Option<_rt::String>, - pub field_size: Option, + pub field_name: ::core::option::Option<_rt::String>, + pub field_size: ::core::option::Option, } impl ::core::fmt::Debug for FieldSizePayload { fn fmt( @@ -176,22 +176,22 @@ pub mod wasi { TlsAlertReceived(TlsAlertReceivedPayload), HttpRequestDenied, HttpRequestLengthRequired, - HttpRequestBodySize(Option), + HttpRequestBodySize(::core::option::Option), HttpRequestMethodInvalid, HttpRequestUriInvalid, HttpRequestUriTooLong, - HttpRequestHeaderSectionSize(Option), - HttpRequestHeaderSize(Option), - HttpRequestTrailerSectionSize(Option), + HttpRequestHeaderSectionSize(::core::option::Option), + HttpRequestHeaderSize(::core::option::Option), + HttpRequestTrailerSectionSize(::core::option::Option), HttpRequestTrailerSize(FieldSizePayload), HttpResponseIncomplete, - HttpResponseHeaderSectionSize(Option), + HttpResponseHeaderSectionSize(::core::option::Option), HttpResponseHeaderSize(FieldSizePayload), - HttpResponseBodySize(Option), - HttpResponseTrailerSectionSize(Option), + HttpResponseBodySize(::core::option::Option), + HttpResponseTrailerSectionSize(::core::option::Option), HttpResponseTrailerSize(FieldSizePayload), - HttpResponseTransferCoding(Option<_rt::String>), - HttpResponseContentCoding(Option<_rt::String>), + HttpResponseTransferCoding(::core::option::Option<_rt::String>), + HttpResponseContentCoding(::core::option::Option<_rt::String>), HttpResponseTimeout, HttpUpgradeFailed, HttpProtocolError, @@ -202,7 +202,7 @@ pub mod wasi { /// unstructured description of the error. Users should not depend on the /// string for diagnosing errors, as it's not required to be consistent /// between implementations. - InternalError(Option<_rt::String>), + InternalError(::core::option::Option<_rt::String>), } impl ::core::fmt::Debug for ErrorCode { fn fmt( @@ -392,7 +392,7 @@ pub mod wasi { /// string for an unstructured description of the error. Users should not /// depend on the string for diagnosing errors, as it's not required to be /// consistent between implementations. - Other(Option<_rt::String>), + Other(::core::option::Option<_rt::String>), } impl ::core::fmt::Debug for HeaderError { fn fmt( @@ -443,7 +443,7 @@ pub mod wasi { /// string for an unstructured description of the error. Users should not /// depend on the string for diagnosing errors, as it's not required to be /// consistent between implementations. - Other(Option<_rt::String>), + Other(::core::option::Option<_rt::String>), } impl ::core::fmt::Debug for RequestOptionsError { fn fmt( @@ -715,7 +715,7 @@ pub mod wasi { #[allow(async_fn_in_trait)] pub fn from_list( entries: &[(FieldName, FieldValue)], - ) -> Result { + ) -> ::core::result::Result { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -961,7 +961,7 @@ pub mod wasi { &self, name: &str, value: &[FieldValue], - ) -> Result<(), HeaderError> { + ) -> ::core::result::Result<(), HeaderError> { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -1100,7 +1100,10 @@ pub mod wasi { /// /// Fails with `header-error.immutable` if the `fields` are immutable. #[allow(async_fn_in_trait)] - pub fn delete(&self, name: &str) -> Result<(), HeaderError> { + pub fn delete( + &self, + name: &str, + ) -> ::core::result::Result<(), HeaderError> { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -1205,7 +1208,7 @@ pub mod wasi { pub fn get_and_delete( &self, name: &str, - ) -> Result<_rt::Vec, HeaderError> { + ) -> ::core::result::Result<_rt::Vec, HeaderError> { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -1343,7 +1346,7 @@ pub mod wasi { &self, name: &str, value: &[u8], - ) -> Result<(), HeaderError> { + ) -> ::core::result::Result<(), HeaderError> { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -1588,14 +1591,21 @@ pub mod wasi { #[allow(async_fn_in_trait)] pub fn new( headers: Headers, - contents: Option>, + contents: ::core::option::Option< + wit_bindgen::rt::async_support::StreamReader, + >, trailers: wit_bindgen::rt::async_support::FutureReader< - Result, ErrorCode>, + ::core::result::Result< + ::core::option::Option, + ErrorCode, + >, >, - options: Option, + options: ::core::option::Option, ) -> ( Request, - wit_bindgen::rt::async_support::FutureReader>, + wit_bindgen::rt::async_support::FutureReader< + ::core::result::Result<(), ErrorCode>, + >, ) { unsafe { #[repr(align(4))] @@ -1653,7 +1663,7 @@ pub mod wasi { Request::from_handle(l4 as u32), wit_bindgen::rt::async_support::FutureReader::new( l5 as u32, - & as super::super::super::wit_future::FuturePayload>::VTABLE, @@ -1733,7 +1743,10 @@ pub mod wasi { /// Set the Method for the Request. Fails if the string present in a /// `method.other` argument is not a syntactically valid method. #[allow(async_fn_in_trait)] - pub fn set_method(&self, method: &Method) -> Result<(), ()> { + pub fn set_method( + &self, + method: &Method, + ) -> ::core::result::Result<(), ()> { unsafe { let (result1_0, result1_1, result1_2) = match method { Method::Get => (0i32, ::core::ptr::null_mut(), 0usize), @@ -1792,7 +1805,9 @@ pub mod wasi { /// Get the combination of the HTTP Path and Query for the Request. When /// `none`, this represents an empty Path and empty Query. #[allow(async_fn_in_trait)] - pub fn get_path_with_query(&self) -> Option<_rt::String> { + pub fn get_path_with_query( + &self, + ) -> ::core::option::Option<_rt::String> { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -1852,8 +1867,8 @@ pub mod wasi { #[allow(async_fn_in_trait)] pub fn set_path_with_query( &self, - path_with_query: Option<&str>, - ) -> Result<(), ()> { + path_with_query: ::core::option::Option<&str>, + ) -> ::core::result::Result<(), ()> { unsafe { let (result1_0, result1_1, result1_2) = match path_with_query { Some(e) => { @@ -1904,7 +1919,7 @@ pub mod wasi { /// Get the HTTP Related Scheme for the Request. When `none`, the /// implementation may choose an appropriate default scheme. #[allow(async_fn_in_trait)] - pub fn get_scheme(&self) -> Option { + pub fn get_scheme(&self) -> ::core::option::Option { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -1976,7 +1991,10 @@ pub mod wasi { /// implementation may choose an appropriate default scheme. Fails if the /// string given is not a syntactically valid uri scheme. #[allow(async_fn_in_trait)] - pub fn set_scheme(&self, scheme: Option<&Scheme>) -> Result<(), ()> { + pub fn set_scheme( + &self, + scheme: ::core::option::Option<&Scheme>, + ) -> ::core::result::Result<(), ()> { unsafe { let (result2_0, result2_1, result2_2, result2_3) = match scheme { Some(e) => { @@ -2043,7 +2061,7 @@ pub mod wasi { /// with Related Schemes which do not require an authority. The HTTP and /// HTTPS schemes always require an authority. #[allow(async_fn_in_trait)] - pub fn get_authority(&self) -> Option<_rt::String> { + pub fn get_authority(&self) -> ::core::option::Option<_rt::String> { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -2102,7 +2120,10 @@ pub mod wasi { /// HTTPS schemes always require an authority. Fails if the string given is /// not a syntactically valid URI authority. #[allow(async_fn_in_trait)] - pub fn set_authority(&self, authority: Option<&str>) -> Result<(), ()> { + pub fn set_authority( + &self, + authority: ::core::option::Option<&str>, + ) -> ::core::result::Result<(), ()> { unsafe { let (result1_0, result1_1, result1_2) = match authority { Some(e) => { @@ -2159,7 +2180,7 @@ pub mod wasi { /// the parent `request` is dropped, or its ownership is transferred to /// another component by e.g. `handler.handle`. #[allow(async_fn_in_trait)] - pub fn get_options(&self) -> Option { + pub fn get_options(&self) -> ::core::option::Option { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); @@ -2236,12 +2257,15 @@ pub mod wasi { pub fn consume_body( this: Request, res: wit_bindgen::rt::async_support::FutureReader< - Result<(), ErrorCode>, + ::core::result::Result<(), ErrorCode>, >, ) -> ( wit_bindgen::rt::async_support::StreamReader, wit_bindgen::rt::async_support::FutureReader< - Result, ErrorCode>, + ::core::result::Result< + ::core::option::Option, + ErrorCode, + >, >, ) { unsafe { @@ -2275,8 +2299,8 @@ pub mod wasi { ), wit_bindgen::rt::async_support::FutureReader::new( l3 as u32, - &, + &<::core::result::Result< + ::core::option::Option, ErrorCode, > as super::super::super::wit_future::FuturePayload>::VTABLE, ), @@ -2310,7 +2334,7 @@ pub mod wasi { #[allow(unused_unsafe, clippy::all)] /// The timeout for the initial connect to the HTTP Server. #[allow(async_fn_in_trait)] - pub fn get_connect_timeout(&self) -> Option { + pub fn get_connect_timeout(&self) -> ::core::option::Option { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 16]); @@ -2353,8 +2377,8 @@ pub mod wasi { #[allow(async_fn_in_trait)] pub fn set_connect_timeout( &self, - duration: Option, - ) -> Result<(), RequestOptionsError> { + duration: ::core::option::Option, + ) -> ::core::result::Result<(), RequestOptionsError> { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -2450,7 +2474,9 @@ pub mod wasi { #[allow(unused_unsafe, clippy::all)] /// The timeout for receiving the first byte of the Response body. #[allow(async_fn_in_trait)] - pub fn get_first_byte_timeout(&self) -> Option { + pub fn get_first_byte_timeout( + &self, + ) -> ::core::option::Option { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 16]); @@ -2493,8 +2519,8 @@ pub mod wasi { #[allow(async_fn_in_trait)] pub fn set_first_byte_timeout( &self, - duration: Option, - ) -> Result<(), RequestOptionsError> { + duration: ::core::option::Option, + ) -> ::core::result::Result<(), RequestOptionsError> { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -2591,7 +2617,9 @@ pub mod wasi { /// The timeout for receiving subsequent chunks of bytes in the Response /// body stream. #[allow(async_fn_in_trait)] - pub fn get_between_bytes_timeout(&self) -> Option { + pub fn get_between_bytes_timeout( + &self, + ) -> ::core::option::Option { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 16]); @@ -2634,8 +2662,8 @@ pub mod wasi { #[allow(async_fn_in_trait)] pub fn set_between_bytes_timeout( &self, - duration: Option, - ) -> Result<(), RequestOptionsError> { + duration: ::core::option::Option, + ) -> ::core::result::Result<(), RequestOptionsError> { unsafe { #[cfg_attr(target_pointer_width = "64", repr(align(8)))] #[cfg_attr(target_pointer_width = "32", repr(align(4)))] @@ -2767,13 +2795,20 @@ pub mod wasi { #[allow(async_fn_in_trait)] pub fn new( headers: Headers, - contents: Option>, + contents: ::core::option::Option< + wit_bindgen::rt::async_support::StreamReader, + >, trailers: wit_bindgen::rt::async_support::FutureReader< - Result, ErrorCode>, + ::core::result::Result< + ::core::option::Option, + ErrorCode, + >, >, ) -> ( Response, - wit_bindgen::rt::async_support::FutureReader>, + wit_bindgen::rt::async_support::FutureReader< + ::core::result::Result<(), ErrorCode>, + >, ) { unsafe { #[repr(align(4))] @@ -2815,7 +2850,7 @@ pub mod wasi { Response::from_handle(l3 as u32), wit_bindgen::rt::async_support::FutureReader::new( l4 as u32, - & as super::super::super::wit_future::FuturePayload>::VTABLE, @@ -2854,7 +2889,7 @@ pub mod wasi { pub fn set_status_code( &self, status_code: StatusCode, - ) -> Result<(), ()> { + ) -> ::core::result::Result<(), ()> { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.3.0")] @@ -2926,12 +2961,15 @@ pub mod wasi { pub fn consume_body( this: Response, res: wit_bindgen::rt::async_support::FutureReader< - Result<(), ErrorCode>, + ::core::result::Result<(), ErrorCode>, >, ) -> ( wit_bindgen::rt::async_support::StreamReader, wit_bindgen::rt::async_support::FutureReader< - Result, ErrorCode>, + ::core::result::Result< + ::core::option::Option, + ErrorCode, + >, >, ) { unsafe { @@ -2965,8 +3003,8 @@ pub mod wasi { ), wit_bindgen::rt::async_support::FutureReader::new( l3 as u32, - &, + &<::core::result::Result< + ::core::option::Option, ErrorCode, > as super::super::super::wit_future::FuturePayload>::VTABLE, ), @@ -2999,7 +3037,9 @@ pub mod wasi { /// This function may be used to either send an outgoing request over the /// network or to forward it to another component. #[allow(async_fn_in_trait)] - pub async fn send(request: Request) -> Result { + pub async fn send( + request: Request, + ) -> ::core::result::Result { unsafe { #[derive(Copy, Clone)] struct ParamsLower(i32); @@ -3011,7 +3051,7 @@ pub mod wasi { #[allow(unused_parens)] unsafe impl<'a> _Subtask for _MySubtask<'a> { type Params = (Request,); - type Results = Result; + type Results = ::core::result::Result; type ParamsLower = ParamsLower; fn abi_layout(&mut self) -> ::core::alloc::Layout { unsafe { @@ -4391,7 +4431,9 @@ pub mod exports { /// This function may be called with either an incoming request read from the /// network or a request synthesized or forwarded by another component. #[allow(async_fn_in_trait)] - async fn handle(request: Request) -> Result; + async fn handle( + request: Request, + ) -> ::core::result::Result; } #[doc(hidden)] #[macro_export] @@ -4673,8 +4715,8 @@ pub mod wit_future { } unsafe fn lift( ptr: *mut u8, - ) -> Result< - Option, + ) -> ::core::result::Result< + ::core::option::Option, super::super::wasi::http::types::ErrorCode, > { unsafe { @@ -5227,8 +5269,8 @@ pub mod wit_future { } } unsafe fn lower( - value: Result< - Option, + value: ::core::result::Result< + ::core::option::Option, super::super::wasi::http::types::ErrorCode, >, ptr: *mut u8, @@ -5907,13 +5949,13 @@ pub mod wit_future { } } pub static VTABLE: wit_bindgen::rt::async_support::FutureVtable< - Result< - Option, + ::core::result::Result< + ::core::option::Option, super::super::wasi::http::types::ErrorCode, >, > = wit_bindgen::rt::async_support::FutureVtable::< - Result< - Option, + ::core::result::Result< + ::core::option::Option, super::super::wasi::http::types::ErrorCode, >, > { @@ -5930,8 +5972,8 @@ pub mod wit_future { start_write, }; impl super::FuturePayload - for Result< - Option, + for ::core::result::Result< + ::core::option::Option, super::super::wasi::http::types::ErrorCode, > { const VTABLE: &'static wit_bindgen::rt::async_support::FutureVtable = &VTABLE; @@ -5988,7 +6030,7 @@ pub mod wit_future { } unsafe fn lift( ptr: *mut u8, - ) -> Result<(), super::super::wasi::http::types::ErrorCode> { + ) -> ::core::result::Result<(), super::super::wasi::http::types::ErrorCode> { unsafe { let l0 = i32::from(*ptr.add(0).cast::()); match l0 { @@ -6524,7 +6566,10 @@ pub mod wit_future { } } unsafe fn lower( - value: Result<(), super::super::wasi::http::types::ErrorCode>, + value: ::core::result::Result< + (), + super::super::wasi::http::types::ErrorCode, + >, ptr: *mut u8, ) { unsafe { @@ -7192,9 +7237,9 @@ pub mod wit_future { } } pub static VTABLE: wit_bindgen::rt::async_support::FutureVtable< - Result<(), super::super::wasi::http::types::ErrorCode>, + ::core::result::Result<(), super::super::wasi::http::types::ErrorCode>, > = wit_bindgen::rt::async_support::FutureVtable::< - Result<(), super::super::wasi::http::types::ErrorCode>, + ::core::result::Result<(), super::super::wasi::http::types::ErrorCode>, > { cancel_write, cancel_read, @@ -7209,7 +7254,7 @@ pub mod wit_future { start_write, }; impl super::FuturePayload - for Result<(), super::super::wasi::http::types::ErrorCode> { + for ::core::result::Result<(), super::super::wasi::http::types::ErrorCode> { const VTABLE: &'static wit_bindgen::rt::async_support::FutureVtable = &VTABLE; } } @@ -7335,7 +7380,7 @@ macro_rules! __export_service_impl { exports::wasi::http::handler::__export_wasi_http_handler_0_3_0_cabi!($ty with_types_in $($path_to_types_root)*:: exports::wasi::http::handler); const _ : () = { #[rustfmt::skip] #[cfg(target_arch = "wasm32")] #[unsafe (link_section = - "component-type:wit-bindgen:0.60.0:wasi:http@0.3.0:service:imports and exportsrust-wasip3-0.7.1+wasi-0.3.0-from-crates-io-service-world")] + "component-type:wit-bindgen:0.61.0:wasi:http@0.3.0:service:imports and exportsrust-wasip3-0.7.1+wasi-0.3.0-from-crates-io-service-world")] #[doc(hidden)] #[allow(clippy::octal_escapes)] pub static __WIT_BINDGEN_COMPONENT_TYPE : [u8; 4995] = * b"\ @@ -7439,7 +7484,7 @@ nse\x03\0\x02\x02\x03\x02\x01\x0a\x04\0\x0aerror-code\x03\0\x04\x01i\x01\x01i\x0 \x01j\x01\x07\x01\x05\x01C\x01\x07request\x06\0\x08\x04\0\x06handle\x01\x09\x04\0\ \x17wasi:http/handler@0.3.0\x05\x11\x04\0\x17wasi:http/service@0.3.0\x04\0\x0b\x0d\ \x01\0\x07service\x03\0\0\0G\x09producers\x01\x0cprocessed-by\x02\x0dwit-compone\ -nt\x070.254.0\x10wit-bindgen-rust\x060.60.0"; +nt\x070.258.0\x10wit-bindgen-rust\x060.61.0"; }; }; } @@ -7448,8 +7493,8 @@ pub use __export_service_impl as _export_service; #[rustfmt::skip] #[cfg(target_arch = "wasm32")] -#[cfg_attr(feature = "rustc-dep-of-std", unsafe(link_section = "component-type:wit-bindgen:0.60.0:wasi:http@0.3.0:service-with-all-of-its-exports-removed:encoded worldrust-wasip3-0.7.1+wasi-0.3.0-from-crates-io-service-world-in-libstd"))] -#[cfg_attr(not(feature = "rustc-dep-of-std"), unsafe(link_section = "component-type:wit-bindgen:0.60.0:wasi:http@0.3.0:service-with-all-of-its-exports-removed:encoded worldrust-wasip3-0.7.1+wasi-0.3.0-from-crates-io-service-world"))] +#[cfg_attr(feature = "rustc-dep-of-std", unsafe(link_section = "component-type:wit-bindgen:0.61.0:wasi:http@0.3.0:service-with-all-of-its-exports-removed:encoded worldrust-wasip3-0.7.1+wasi-0.3.0-from-crates-io-service-world-in-libstd"))] +#[cfg_attr(not(feature = "rustc-dep-of-std"), unsafe(link_section = "component-type:wit-bindgen:0.61.0:wasi:http@0.3.0:service-with-all-of-its-exports-removed:encoded worldrust-wasip3-0.7.1+wasi-0.3.0-from-crates-io-service-world"))] #[doc(hidden)] #[allow(clippy::octal_escapes)] @@ -7551,7 +7596,7 @@ cure-random-bytes\x01\x01\x01@\0\0w\x04\0\x17get-insecure-random-u64\x01\x02\x03 get-insecure-seed\x01\x01\x03\0\x1fwasi:random/insecure-seed@0.3.0\x05\x10\x04\0\ 7wasi:http/service-with-all-of-its-exports-removed@0.3.0\x04\0\x0b-\x01\0'servic\ e-with-all-of-its-exports-removed\x03\0\0\0G\x09producers\x01\x0cprocessed-by\x02\ -\x0dwit-component\x070.254.0\x10wit-bindgen-rust\x060.60.0"; +\x0dwit-component\x070.258.0\x10wit-bindgen-rust\x060.61.0"; #[inline(never)] #[doc(hidden)] pub fn __link_custom_section_describing_imports() {