diff --git a/Cargo.lock b/Cargo.lock index b7549d7..8a075f3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "hello-wasi-http" @@ -17,9 +17,9 @@ dependencies = [ [[package]] name = "wit-bindgen-rt" -version = "0.24.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b0780cf7046630ed70f689a098cd8d56c5c3b22f2a7379bbdb088879963ff96" +checksum = "605d5562e971a823cf5a550a9d69cb7144e9b4969a810043127175517a4e1865" dependencies = [ "bitflags", ] diff --git a/Cargo.toml b/Cargo.toml index a9a73e6..e142790 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,4 +29,4 @@ proxy = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -wit-bindgen-rt = { version = "0.24.0", features = ["bitflags"] } +wit-bindgen-rt = { version = "0.35.0", features = ["bitflags"] } diff --git a/src/bindings.rs b/src/bindings.rs index 686a8bc..7623b12 100644 --- a/src/bindings.rs +++ b/src/bindings.rs @@ -1,5 +1,3 @@ -// Generated by `wit-bindgen` 0.25.0. DO NOT EDIT! -// Options used: #[allow(dead_code)] pub mod wasi { #[allow(dead_code)] @@ -8,9 +6,7 @@ pub mod wasi { pub mod stdout { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::__link_custom_section_describing_imports; pub type OutputStream = super::super::super::wasi::io::streams::OutputStream; #[allow(unused_unsafe, clippy::all)] pub fn get_stdout() -> OutputStream { @@ -21,24 +17,22 @@ pub mod wasi { #[link_name = "get-stdout"] fn wit_import() -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import() -> i32 { unreachable!() } let ret = wit_import(); - super::super::super::wasi::io::streams::OutputStream::from_handle(ret as u32) + super::super::super::wasi::io::streams::OutputStream::from_handle( + ret as u32, + ) } } } - #[allow(dead_code, clippy::all)] pub mod stderr { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::__link_custom_section_describing_imports; pub type OutputStream = super::super::super::wasi::io::streams::OutputStream; #[allow(unused_unsafe, clippy::all)] pub fn get_stderr() -> OutputStream { @@ -49,24 +43,22 @@ pub mod wasi { #[link_name = "get-stderr"] fn wit_import() -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import() -> i32 { unreachable!() } let ret = wit_import(); - super::super::super::wasi::io::streams::OutputStream::from_handle(ret as u32) + super::super::super::wasi::io::streams::OutputStream::from_handle( + ret as u32, + ) } } } - #[allow(dead_code, clippy::all)] pub mod stdin { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::__link_custom_section_describing_imports; pub type InputStream = super::super::super::wasi::io::streams::InputStream; #[allow(unused_unsafe, clippy::all)] pub fn get_stdin() -> InputStream { @@ -77,13 +69,14 @@ pub mod wasi { #[link_name = "get-stdin"] fn wit_import() -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import() -> i32 { unreachable!() } let ret = wit_import(); - super::super::super::wasi::io::streams::InputStream::from_handle(ret as u32) + super::super::super::wasi::io::streams::InputStream::from_handle( + ret as u32, + ) } } } @@ -94,9 +87,7 @@ pub mod wasi { pub mod monotonic_clock { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::__link_custom_section_describing_imports; use super::super::super::_rt; pub type Pollable = super::super::super::wasi::io::poll::Pollable; /// An instant in time, in nanoseconds. An instant is relative to an @@ -118,7 +109,6 @@ pub mod wasi { #[link_name = "now"] fn wit_import() -> i64; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import() -> i64 { unreachable!() @@ -138,7 +128,6 @@ pub mod wasi { #[link_name = "resolution"] fn wit_import() -> i64; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import() -> i64 { unreachable!() @@ -158,13 +147,14 @@ pub mod wasi { #[link_name = "subscribe-instant"] fn wit_import(_: i64) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i64) -> i32 { unreachable!() } let ret = wit_import(_rt::as_i64(when)); - super::super::super::wasi::io::poll::Pollable::from_handle(ret as u32) + super::super::super::wasi::io::poll::Pollable::from_handle( + ret as u32, + ) } } #[allow(unused_unsafe, clippy::all)] @@ -179,24 +169,22 @@ pub mod wasi { #[link_name = "subscribe-duration"] fn wit_import(_: i64) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i64) -> i32 { unreachable!() } let ret = wit_import(_rt::as_i64(when)); - super::super::super::wasi::io::poll::Pollable::from_handle(ret as u32) + super::super::super::wasi::io::poll::Pollable::from_handle( + ret as u32, + ) } } } - #[allow(dead_code, clippy::all)] pub mod wall_clock { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::__link_custom_section_describing_imports; /// A time and date in seconds plus nanoseconds. #[repr(C)] #[derive(Clone, Copy)] @@ -205,7 +193,10 @@ pub mod wasi { pub nanoseconds: u32, } impl ::core::fmt::Debug for Datetime { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("Datetime") .field("seconds", &self.seconds) .field("nanoseconds", &self.nanoseconds) @@ -238,7 +229,6 @@ pub mod wasi { #[link_name = "now"] fn wit_import(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8) { unreachable!() @@ -268,7 +258,6 @@ pub mod wasi { #[link_name = "resolution"] fn wit_import(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8) { unreachable!() @@ -290,9 +279,7 @@ pub mod wasi { pub mod types { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::__link_custom_section_describing_imports; use super::super::super::_rt; pub type Duration = super::super::super::wasi::clocks::monotonic_clock::Duration; pub type InputStream = super::super::super::wasi::io::streams::InputStream; @@ -314,7 +301,10 @@ pub mod wasi { Other(_rt::String), } impl ::core::fmt::Debug for Method { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { Method::Get => f.debug_tuple("Method::Get").finish(), Method::Head => f.debug_tuple("Method::Head").finish(), @@ -325,7 +315,9 @@ pub mod wasi { Method::Options => f.debug_tuple("Method::Options").finish(), Method::Trace => f.debug_tuple("Method::Trace").finish(), Method::Patch => f.debug_tuple("Method::Patch").finish(), - Method::Other(e) => f.debug_tuple("Method::Other").field(e).finish(), + Method::Other(e) => { + f.debug_tuple("Method::Other").field(e).finish() + } } } } @@ -337,11 +329,16 @@ pub mod wasi { Other(_rt::String), } impl ::core::fmt::Debug for Scheme { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { Scheme::Http => f.debug_tuple("Scheme::Http").finish(), Scheme::Https => f.debug_tuple("Scheme::Https").finish(), - Scheme::Other(e) => f.debug_tuple("Scheme::Other").field(e).finish(), + Scheme::Other(e) => { + f.debug_tuple("Scheme::Other").field(e).finish() + } } } } @@ -352,7 +349,10 @@ pub mod wasi { pub info_code: Option, } impl ::core::fmt::Debug for DnsErrorPayload { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("DnsErrorPayload") .field("rcode", &self.rcode) .field("info-code", &self.info_code) @@ -366,7 +366,10 @@ pub mod wasi { pub alert_message: Option<_rt::String>, } impl ::core::fmt::Debug for TlsAlertReceivedPayload { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("TlsAlertReceivedPayload") .field("alert-id", &self.alert_id) .field("alert-message", &self.alert_message) @@ -380,7 +383,10 @@ pub mod wasi { pub field_size: Option, } impl ::core::fmt::Debug for FieldSizePayload { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("FieldSizePayload") .field("field-name", &self.field_name) .field("field-size", &self.field_size) @@ -437,9 +443,14 @@ pub mod wasi { InternalError(Option<_rt::String>), } impl ::core::fmt::Debug for ErrorCode { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { - ErrorCode::DnsTimeout => f.debug_tuple("ErrorCode::DnsTimeout").finish(), + ErrorCode::DnsTimeout => { + f.debug_tuple("ErrorCode::DnsTimeout").finish() + } ErrorCode::DnsError(e) => { f.debug_tuple("ErrorCode::DnsError").field(e).finish() } @@ -479,76 +490,90 @@ pub mod wasi { ErrorCode::TlsCertificateError => { f.debug_tuple("ErrorCode::TlsCertificateError").finish() } - ErrorCode::TlsAlertReceived(e) => f - .debug_tuple("ErrorCode::TlsAlertReceived") - .field(e) - .finish(), + ErrorCode::TlsAlertReceived(e) => { + f.debug_tuple("ErrorCode::TlsAlertReceived") + .field(e) + .finish() + } ErrorCode::HttpRequestDenied => { f.debug_tuple("ErrorCode::HttpRequestDenied").finish() } - ErrorCode::HttpRequestLengthRequired => f - .debug_tuple("ErrorCode::HttpRequestLengthRequired") - .finish(), - ErrorCode::HttpRequestBodySize(e) => f - .debug_tuple("ErrorCode::HttpRequestBodySize") - .field(e) - .finish(), - ErrorCode::HttpRequestMethodInvalid => f - .debug_tuple("ErrorCode::HttpRequestMethodInvalid") - .finish(), + ErrorCode::HttpRequestLengthRequired => { + f.debug_tuple("ErrorCode::HttpRequestLengthRequired") + .finish() + } + ErrorCode::HttpRequestBodySize(e) => { + f.debug_tuple("ErrorCode::HttpRequestBodySize") + .field(e) + .finish() + } + ErrorCode::HttpRequestMethodInvalid => { + f.debug_tuple("ErrorCode::HttpRequestMethodInvalid").finish() + } ErrorCode::HttpRequestUriInvalid => { f.debug_tuple("ErrorCode::HttpRequestUriInvalid").finish() } ErrorCode::HttpRequestUriTooLong => { f.debug_tuple("ErrorCode::HttpRequestUriTooLong").finish() } - ErrorCode::HttpRequestHeaderSectionSize(e) => f - .debug_tuple("ErrorCode::HttpRequestHeaderSectionSize") - .field(e) - .finish(), - ErrorCode::HttpRequestHeaderSize(e) => f - .debug_tuple("ErrorCode::HttpRequestHeaderSize") - .field(e) - .finish(), - ErrorCode::HttpRequestTrailerSectionSize(e) => f - .debug_tuple("ErrorCode::HttpRequestTrailerSectionSize") - .field(e) - .finish(), - ErrorCode::HttpRequestTrailerSize(e) => f - .debug_tuple("ErrorCode::HttpRequestTrailerSize") - .field(e) - .finish(), + ErrorCode::HttpRequestHeaderSectionSize(e) => { + f.debug_tuple("ErrorCode::HttpRequestHeaderSectionSize") + .field(e) + .finish() + } + ErrorCode::HttpRequestHeaderSize(e) => { + f.debug_tuple("ErrorCode::HttpRequestHeaderSize") + .field(e) + .finish() + } + ErrorCode::HttpRequestTrailerSectionSize(e) => { + f.debug_tuple("ErrorCode::HttpRequestTrailerSectionSize") + .field(e) + .finish() + } + ErrorCode::HttpRequestTrailerSize(e) => { + f.debug_tuple("ErrorCode::HttpRequestTrailerSize") + .field(e) + .finish() + } ErrorCode::HttpResponseIncomplete => { f.debug_tuple("ErrorCode::HttpResponseIncomplete").finish() } - ErrorCode::HttpResponseHeaderSectionSize(e) => f - .debug_tuple("ErrorCode::HttpResponseHeaderSectionSize") - .field(e) - .finish(), - ErrorCode::HttpResponseHeaderSize(e) => f - .debug_tuple("ErrorCode::HttpResponseHeaderSize") - .field(e) - .finish(), - ErrorCode::HttpResponseBodySize(e) => f - .debug_tuple("ErrorCode::HttpResponseBodySize") - .field(e) - .finish(), - ErrorCode::HttpResponseTrailerSectionSize(e) => f - .debug_tuple("ErrorCode::HttpResponseTrailerSectionSize") - .field(e) - .finish(), - ErrorCode::HttpResponseTrailerSize(e) => f - .debug_tuple("ErrorCode::HttpResponseTrailerSize") - .field(e) - .finish(), - ErrorCode::HttpResponseTransferCoding(e) => f - .debug_tuple("ErrorCode::HttpResponseTransferCoding") - .field(e) - .finish(), - ErrorCode::HttpResponseContentCoding(e) => f - .debug_tuple("ErrorCode::HttpResponseContentCoding") - .field(e) - .finish(), + ErrorCode::HttpResponseHeaderSectionSize(e) => { + f.debug_tuple("ErrorCode::HttpResponseHeaderSectionSize") + .field(e) + .finish() + } + ErrorCode::HttpResponseHeaderSize(e) => { + f.debug_tuple("ErrorCode::HttpResponseHeaderSize") + .field(e) + .finish() + } + ErrorCode::HttpResponseBodySize(e) => { + f.debug_tuple("ErrorCode::HttpResponseBodySize") + .field(e) + .finish() + } + ErrorCode::HttpResponseTrailerSectionSize(e) => { + f.debug_tuple("ErrorCode::HttpResponseTrailerSectionSize") + .field(e) + .finish() + } + ErrorCode::HttpResponseTrailerSize(e) => { + f.debug_tuple("ErrorCode::HttpResponseTrailerSize") + .field(e) + .finish() + } + ErrorCode::HttpResponseTransferCoding(e) => { + f.debug_tuple("ErrorCode::HttpResponseTransferCoding") + .field(e) + .finish() + } + ErrorCode::HttpResponseContentCoding(e) => { + f.debug_tuple("ErrorCode::HttpResponseContentCoding") + .field(e) + .finish() + } ErrorCode::HttpResponseTimeout => { f.debug_tuple("ErrorCode::HttpResponseTimeout").finish() } @@ -571,11 +596,13 @@ pub mod wasi { } } impl ::core::fmt::Display for ErrorCode { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { write!(f, "{:?}", self) } } - impl std::error::Error for ErrorCode {} /// This type enumerates the different kinds of errors that may occur when /// setting or appending to a `fields` resource. @@ -593,22 +620,31 @@ pub mod wasi { Immutable, } impl ::core::fmt::Debug for HeaderError { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { HeaderError::InvalidSyntax => { f.debug_tuple("HeaderError::InvalidSyntax").finish() } - HeaderError::Forbidden => f.debug_tuple("HeaderError::Forbidden").finish(), - HeaderError::Immutable => f.debug_tuple("HeaderError::Immutable").finish(), + HeaderError::Forbidden => { + f.debug_tuple("HeaderError::Forbidden").finish() + } + HeaderError::Immutable => { + f.debug_tuple("HeaderError::Immutable").finish() + } } } } impl ::core::fmt::Display for HeaderError { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { write!(f, "{:?}", self) } } - impl std::error::Error for HeaderError {} /// Field keys are always strings. pub type FieldKey = _rt::String; @@ -626,13 +662,11 @@ pub mod wasi { /// `incoming-request.headers`, `outgoing-request.headers`) might be be /// immutable. In an immutable fields, the `set`, `append`, and `delete` /// operations will fail with `header-error.immutable`. - #[derive(Debug)] #[repr(transparent)] pub struct Fields { handle: _rt::Resource, } - impl Fields { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { @@ -640,24 +674,20 @@ pub mod wasi { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for Fields { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:http/types@0.2.0")] @@ -665,24 +695,20 @@ pub mod wasi { #[link_name = "[resource-drop]fields"] fn drop(_: u32); } - drop(_handle); } } } - /// Headers is an alias for Fields. pub type Headers = Fields; /// Trailers is an alias for Fields. pub type Trailers = Fields; /// Represents an incoming HTTP Request. - #[derive(Debug)] #[repr(transparent)] pub struct IncomingRequest { handle: _rt::Resource, } - impl IncomingRequest { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { @@ -690,24 +716,20 @@ pub mod wasi { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for IncomingRequest { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:http/types@0.2.0")] @@ -715,20 +737,16 @@ pub mod wasi { #[link_name = "[resource-drop]incoming-request"] fn drop(_: u32); } - drop(_handle); } } } - /// Represents an outgoing HTTP Request. - #[derive(Debug)] #[repr(transparent)] pub struct OutgoingRequest { handle: _rt::Resource, } - impl OutgoingRequest { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { @@ -736,24 +754,20 @@ pub mod wasi { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for OutgoingRequest { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:http/types@0.2.0")] @@ -761,25 +775,21 @@ pub mod wasi { #[link_name = "[resource-drop]outgoing-request"] fn drop(_: u32); } - drop(_handle); } } } - /// Parameters for making an HTTP Request. Each of these parameters is /// currently an optional timeout applicable to the transport layer of the /// HTTP protocol. /// /// These timeouts are separate from any the user may use to bound a /// blocking call to `wasi:io/poll.poll`. - #[derive(Debug)] #[repr(transparent)] pub struct RequestOptions { handle: _rt::Resource, } - impl RequestOptions { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { @@ -787,24 +797,20 @@ pub mod wasi { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for RequestOptions { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:http/types@0.2.0")] @@ -812,24 +818,20 @@ pub mod wasi { #[link_name = "[resource-drop]request-options"] fn drop(_: u32); } - drop(_handle); } } } - /// Represents the ability to send an HTTP Response. /// /// This resource is used by the `wasi:http/incoming-handler` interface to /// allow a Response to be sent corresponding to the Request provided as the /// other argument to `incoming-handler.handle`. - #[derive(Debug)] #[repr(transparent)] pub struct ResponseOutparam { handle: _rt::Resource, } - impl ResponseOutparam { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { @@ -837,24 +839,20 @@ pub mod wasi { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for ResponseOutparam { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:http/types@0.2.0")] @@ -862,22 +860,18 @@ pub mod wasi { #[link_name = "[resource-drop]response-outparam"] fn drop(_: u32); } - drop(_handle); } } } - /// This type corresponds to the HTTP standard Status Code. pub type StatusCode = u16; /// Represents an incoming HTTP Response. - #[derive(Debug)] #[repr(transparent)] pub struct IncomingResponse { handle: _rt::Resource, } - impl IncomingResponse { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { @@ -885,24 +879,20 @@ pub mod wasi { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for IncomingResponse { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:http/types@0.2.0")] @@ -910,12 +900,10 @@ pub mod wasi { #[link_name = "[resource-drop]incoming-response"] fn drop(_: u32); } - drop(_handle); } } } - /// Represents an incoming HTTP Request or Response's Body. /// /// A body has both its contents - a stream of bytes - and a (possibly @@ -924,13 +912,11 @@ pub mod wasi { /// an `input-stream` and the delivery of trailers as a `future-trailers`, /// and ensures that the user of this interface may only be consuming either /// the body contents or waiting on trailers at any given time. - #[derive(Debug)] #[repr(transparent)] pub struct IncomingBody { handle: _rt::Resource, } - impl IncomingBody { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { @@ -938,24 +924,20 @@ pub mod wasi { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for IncomingBody { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:http/types@0.2.0")] @@ -963,24 +945,20 @@ pub mod wasi { #[link_name = "[resource-drop]incoming-body"] fn drop(_: u32); } - drop(_handle); } } } - /// Represents a future which may eventaully return trailers, or an error. /// /// In the case that the incoming HTTP Request or Response did not have any /// trailers, this future will resolve to the empty set of trailers once the /// complete Request or Response body has been received. - #[derive(Debug)] #[repr(transparent)] pub struct FutureTrailers { handle: _rt::Resource, } - impl FutureTrailers { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { @@ -988,24 +966,20 @@ pub mod wasi { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for FutureTrailers { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:http/types@0.2.0")] @@ -1013,20 +987,16 @@ pub mod wasi { #[link_name = "[resource-drop]future-trailers"] fn drop(_: u32); } - drop(_handle); } } } - /// Represents an outgoing HTTP Response. - #[derive(Debug)] #[repr(transparent)] pub struct OutgoingResponse { handle: _rt::Resource, } - impl OutgoingResponse { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { @@ -1034,24 +1004,20 @@ pub mod wasi { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for OutgoingResponse { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:http/types@0.2.0")] @@ -1059,12 +1025,10 @@ pub mod wasi { #[link_name = "[resource-drop]outgoing-response"] fn drop(_: u32); } - drop(_handle); } } } - /// Represents an outgoing HTTP Request or Response's Body. /// /// A body has both its contents - a stream of bytes - and a (possibly @@ -1081,13 +1045,11 @@ pub mod wasi { /// error to the HTTP protocol by whatever means it has available, /// including: corrupting the body on the wire, aborting the associated /// Request, or sending a late status code for the Response. - #[derive(Debug)] #[repr(transparent)] pub struct OutgoingBody { handle: _rt::Resource, } - impl OutgoingBody { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { @@ -1095,24 +1057,20 @@ pub mod wasi { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for OutgoingBody { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:http/types@0.2.0")] @@ -1120,24 +1078,20 @@ pub mod wasi { #[link_name = "[resource-drop]outgoing-body"] fn drop(_: u32); } - drop(_handle); } } } - /// Represents a future which may eventaully return an incoming HTTP /// Response, or an error. /// /// This resource is returned by the `wasi:http/outgoing-handler` interface to /// provide the HTTP Response corresponding to the sent Request. - #[derive(Debug)] #[repr(transparent)] pub struct FutureIncomingResponse { handle: _rt::Resource, } - impl FutureIncomingResponse { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { @@ -1145,24 +1099,20 @@ pub mod wasi { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for FutureIncomingResponse { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:http/types@0.2.0")] @@ -1170,12 +1120,10 @@ pub mod wasi { #[link_name = "[resource-drop]future-incoming-response"] fn drop(_: u32); } - drop(_handle); } } } - #[allow(unused_unsafe, clippy::all)] /// Attempts to extract a http-related `error` from the wasi:io `error` /// provided. @@ -1200,7 +1148,6 @@ pub mod wasi { #[link_name = "http-error-code"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -1218,14 +1165,12 @@ pub mod wasi { let e64 = { let l3 = i32::from(*ptr0.add(16).cast::()); let l7 = i32::from(*ptr0.add(28).cast::()); - DnsErrorPayload { rcode: match l3 { 0 => None, 1 => { let e = { - let l4 = - *ptr0.add(20).cast::<*mut u8>(); + let l4 = *ptr0.add(20).cast::<*mut u8>(); let l5 = *ptr0.add(24).cast::(); let len6 = l5; let bytes6 = _rt::Vec::from_raw_parts( @@ -1233,7 +1178,6 @@ pub mod wasi { len6, len6, ); - _rt::string_lift(bytes6) }; Some(e) @@ -1244,10 +1188,7 @@ pub mod wasi { 0 => None, 1 => { let e = { - let l8 = i32::from( - *ptr0.add(30).cast::(), - ); - + let l8 = i32::from(*ptr0.add(30).cast::()); l8 as u16 }; Some(e) @@ -1274,16 +1215,12 @@ pub mod wasi { let e64 = { let l9 = i32::from(*ptr0.add(16).cast::()); let l11 = i32::from(*ptr0.add(20).cast::()); - TlsAlertReceivedPayload { alert_id: match l9 { 0 => None, 1 => { let e = { - let l10 = i32::from( - *ptr0.add(17).cast::(), - ); - + let l10 = i32::from(*ptr0.add(17).cast::()); l10 as u8 }; Some(e) @@ -1294,8 +1231,7 @@ pub mod wasi { 0 => None, 1 => { let e = { - let l12 = - *ptr0.add(24).cast::<*mut u8>(); + let l12 = *ptr0.add(24).cast::<*mut u8>(); let l13 = *ptr0.add(28).cast::(); let len14 = l13; let bytes14 = _rt::Vec::from_raw_parts( @@ -1303,7 +1239,6 @@ pub mod wasi { len14, len14, ); - _rt::string_lift(bytes14) }; Some(e) @@ -1319,13 +1254,11 @@ pub mod wasi { 17 => { let e64 = { let l15 = i32::from(*ptr0.add(16).cast::()); - match l15 { 0 => None, 1 => { let e = { let l16 = *ptr0.add(24).cast::(); - l16 as u64 }; Some(e) @@ -1341,13 +1274,11 @@ pub mod wasi { 21 => { let e64 = { let l17 = i32::from(*ptr0.add(16).cast::()); - match l17 { 0 => None, 1 => { let e = { let l18 = *ptr0.add(20).cast::(); - l18 as u32 }; Some(e) @@ -1360,54 +1291,41 @@ pub mod wasi { 22 => { let e64 = { let l19 = i32::from(*ptr0.add(16).cast::()); - match l19 { 0 => None, 1 => { let e = { - let l20 = - i32::from(*ptr0.add(20).cast::()); - let l24 = - i32::from(*ptr0.add(32).cast::()); - + let l20 = i32::from(*ptr0.add(20).cast::()); + let l24 = i32::from(*ptr0.add(32).cast::()); FieldSizePayload { field_name: match l20 { 0 => None, 1 => { let e = { - let l21 = *ptr0 - .add(24) - .cast::<*mut u8>( - ); - let l22 = *ptr0 - .add(28) - .cast::(); + let l21 = *ptr0.add(24).cast::<*mut u8>(); + let l22 = *ptr0.add(28).cast::(); let len23 = l22; - let bytes23 = _rt::Vec::from_raw_parts(l21.cast(), len23, len23); - + let bytes23 = _rt::Vec::from_raw_parts( + l21.cast(), + len23, + len23, + ); _rt::string_lift(bytes23) }; Some(e) } - _ => { - _rt::invalid_enum_discriminant() - } + _ => _rt::invalid_enum_discriminant(), }, field_size: match l24 { 0 => None, 1 => { let e = { - let l25 = *ptr0 - .add(36) - .cast::(); - + let l25 = *ptr0.add(36).cast::(); l25 as u32 }; Some(e) } - _ => { - _rt::invalid_enum_discriminant() - } + _ => _rt::invalid_enum_discriminant(), }, } }; @@ -1421,13 +1339,11 @@ pub mod wasi { 23 => { let e64 = { let l26 = i32::from(*ptr0.add(16).cast::()); - match l26 { 0 => None, 1 => { let e = { let l27 = *ptr0.add(20).cast::(); - l27 as u32 }; Some(e) @@ -1441,14 +1357,12 @@ pub mod wasi { let e64 = { let l28 = i32::from(*ptr0.add(16).cast::()); let l32 = i32::from(*ptr0.add(28).cast::()); - FieldSizePayload { field_name: match l28 { 0 => None, 1 => { let e = { - let l29 = - *ptr0.add(20).cast::<*mut u8>(); + let l29 = *ptr0.add(20).cast::<*mut u8>(); let l30 = *ptr0.add(24).cast::(); let len31 = l30; let bytes31 = _rt::Vec::from_raw_parts( @@ -1456,7 +1370,6 @@ pub mod wasi { len31, len31, ); - _rt::string_lift(bytes31) }; Some(e) @@ -1468,7 +1381,6 @@ pub mod wasi { 1 => { let e = { let l33 = *ptr0.add(32).cast::(); - l33 as u32 }; Some(e) @@ -1483,13 +1395,11 @@ pub mod wasi { 26 => { let e64 = { let l34 = i32::from(*ptr0.add(16).cast::()); - match l34 { 0 => None, 1 => { let e = { let l35 = *ptr0.add(20).cast::(); - l35 as u32 }; Some(e) @@ -1503,14 +1413,12 @@ pub mod wasi { let e64 = { let l36 = i32::from(*ptr0.add(16).cast::()); let l40 = i32::from(*ptr0.add(28).cast::()); - FieldSizePayload { field_name: match l36 { 0 => None, 1 => { let e = { - let l37 = - *ptr0.add(20).cast::<*mut u8>(); + let l37 = *ptr0.add(20).cast::<*mut u8>(); let l38 = *ptr0.add(24).cast::(); let len39 = l38; let bytes39 = _rt::Vec::from_raw_parts( @@ -1518,7 +1426,6 @@ pub mod wasi { len39, len39, ); - _rt::string_lift(bytes39) }; Some(e) @@ -1530,7 +1437,6 @@ pub mod wasi { 1 => { let e = { let l41 = *ptr0.add(32).cast::(); - l41 as u32 }; Some(e) @@ -1544,13 +1450,11 @@ pub mod wasi { 28 => { let e64 = { let l42 = i32::from(*ptr0.add(16).cast::()); - match l42 { 0 => None, 1 => { let e = { let l43 = *ptr0.add(24).cast::(); - l43 as u64 }; Some(e) @@ -1563,13 +1467,11 @@ pub mod wasi { 29 => { let e64 = { let l44 = i32::from(*ptr0.add(16).cast::()); - match l44 { 0 => None, 1 => { let e = { let l45 = *ptr0.add(20).cast::(); - l45 as u32 }; Some(e) @@ -1583,14 +1485,12 @@ pub mod wasi { let e64 = { let l46 = i32::from(*ptr0.add(16).cast::()); let l50 = i32::from(*ptr0.add(28).cast::()); - FieldSizePayload { field_name: match l46 { 0 => None, 1 => { let e = { - let l47 = - *ptr0.add(20).cast::<*mut u8>(); + let l47 = *ptr0.add(20).cast::<*mut u8>(); let l48 = *ptr0.add(24).cast::(); let len49 = l48; let bytes49 = _rt::Vec::from_raw_parts( @@ -1598,7 +1498,6 @@ pub mod wasi { len49, len49, ); - _rt::string_lift(bytes49) }; Some(e) @@ -1610,7 +1509,6 @@ pub mod wasi { 1 => { let e = { let l51 = *ptr0.add(32).cast::(); - l51 as u32 }; Some(e) @@ -1624,7 +1522,6 @@ pub mod wasi { 31 => { let e64 = { let l52 = i32::from(*ptr0.add(16).cast::()); - match l52 { 0 => None, 1 => { @@ -1637,7 +1534,6 @@ pub mod wasi { len55, len55, ); - _rt::string_lift(bytes55) }; Some(e) @@ -1650,7 +1546,6 @@ pub mod wasi { 32 => { let e64 = { let l56 = i32::from(*ptr0.add(16).cast::()); - match l56 { 0 => None, 1 => { @@ -1663,7 +1558,6 @@ pub mod wasi { len59, len59, ); - _rt::string_lift(bytes59) }; Some(e) @@ -1682,7 +1576,6 @@ pub mod wasi { debug_assert_eq!(n, 38, "invalid enum discriminant"); let e64 = { let l60 = i32::from(*ptr0.add(16).cast::()); - match l60 { 0 => None, 1 => { @@ -1695,7 +1588,6 @@ pub mod wasi { len63, len63, ); - _rt::string_lift(bytes63) }; Some(e) @@ -1706,7 +1598,6 @@ pub mod wasi { ErrorCode::InternalError(e64) } }; - v64 }; Some(e) @@ -1728,7 +1619,6 @@ pub mod wasi { #[link_name = "[constructor]fields"] fn wit_import() -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import() -> i32 { unreachable!() @@ -1759,11 +1649,15 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 8], + ); let vec3 = entries; let len3 = vec3.len(); - let layout3 = - _rt::alloc::Layout::from_size_align_unchecked(vec3.len() * 16, 4); + let layout3 = _rt::alloc::Layout::from_size_align_unchecked( + vec3.len() * 16, + 4, + ); let result3 = if layout3.size() != 0 { let ptr = _rt::alloc::alloc(layout3).cast::(); if ptr.is_null() { @@ -1771,9 +1665,7 @@ pub mod wasi { } ptr } else { - { - ::core::ptr::null_mut() - } + ::core::ptr::null_mut() }; for (i, e) in vec3.into_iter().enumerate() { let base = result3.add(i * 16); @@ -1798,7 +1690,6 @@ pub mod wasi { #[link_name = "[static]fields.from-list"] fn wit_import(_: *mut u8, _: usize, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8, _: usize, _: *mut u8) { unreachable!() @@ -1812,7 +1703,6 @@ pub mod wasi { 0 => { let e = { let l6 = *ptr4.add(4).cast::(); - Fields::from_handle(l6 as u32) }; Ok(e) @@ -1828,7 +1718,6 @@ pub mod wasi { HeaderError::Immutable } }; - v8 }; Err(e) @@ -1848,7 +1737,9 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 8], + ); let vec0 = name; let ptr0 = vec0.as_ptr().cast::(); let len0 = vec0.len(); @@ -1859,7 +1750,6 @@ pub mod wasi { #[link_name = "[method]fields.get"] fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8) { unreachable!() @@ -1876,7 +1766,6 @@ pub mod wasi { let l4 = *base.add(0).cast::<*mut u8>(); let l5 = *base.add(4).cast::(); let len6 = l5; - _rt::Vec::from_raw_parts(l4.cast(), len6, len6) }; result7.push(e7); @@ -1895,19 +1784,21 @@ pub mod wasi { let vec0 = name; let ptr0 = vec0.as_ptr().cast::(); let len0 = vec0.len(); - #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] extern "C" { #[link_name = "[method]fields.has"] fn wit_import(_: i32, _: *mut u8, _: usize) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8, _: usize) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32, ptr0.cast_mut(), len0); + let ret = wit_import( + (self).handle() as i32, + ptr0.cast_mut(), + len0, + ); _rt::bool_lift(ret as u8) } } @@ -1929,14 +1820,18 @@ pub mod wasi { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 2]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 2], + ); let vec0 = name; let ptr0 = vec0.as_ptr().cast::(); let len0 = vec0.len(); let vec2 = value; let len2 = vec2.len(); - let layout2 = - _rt::alloc::Layout::from_size_align_unchecked(vec2.len() * 8, 4); + let layout2 = _rt::alloc::Layout::from_size_align_unchecked( + vec2.len() * 8, + 4, + ); let result2 = if layout2.size() != 0 { let ptr = _rt::alloc::alloc(layout2).cast::(); if ptr.is_null() { @@ -1944,9 +1839,7 @@ pub mod wasi { } ptr } else { - { - ::core::ptr::null_mut() - } + ::core::ptr::null_mut() }; for (i, e) in vec2.into_iter().enumerate() { let base = result2.add(i * 8); @@ -1972,7 +1865,6 @@ pub mod wasi { _: *mut u8, ); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import( _: i32, @@ -2012,7 +1904,6 @@ pub mod wasi { HeaderError::Immutable } }; - v6 }; Err(e) @@ -2035,7 +1926,9 @@ pub mod wasi { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 2]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 2], + ); let vec0 = name; let ptr0 = vec0.as_ptr().cast::(); let len0 = vec0.len(); @@ -2046,7 +1939,6 @@ pub mod wasi { #[link_name = "[method]fields.delete"] fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8) { unreachable!() @@ -2069,7 +1961,6 @@ pub mod wasi { HeaderError::Immutable } }; - v4 }; Err(e) @@ -2096,7 +1987,9 @@ pub mod wasi { unsafe { #[repr(align(1))] struct RetArea([::core::mem::MaybeUninit; 2]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 2]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 2], + ); let vec0 = name; let ptr0 = vec0.as_ptr().cast::(); let len0 = vec0.len(); @@ -2117,7 +2010,6 @@ pub mod wasi { _: *mut u8, ); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import( _: i32, @@ -2154,7 +2046,6 @@ pub mod wasi { HeaderError::Immutable } }; - v5 }; Err(e) @@ -2176,7 +2067,9 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 8], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] @@ -2184,7 +2077,6 @@ pub mod wasi { #[link_name = "[method]fields.entries"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -2201,11 +2093,14 @@ pub mod wasi { let l3 = *base.add(0).cast::<*mut u8>(); let l4 = *base.add(4).cast::(); let len5 = l4; - let bytes5 = _rt::Vec::from_raw_parts(l3.cast(), len5, len5); + let bytes5 = _rt::Vec::from_raw_parts( + l3.cast(), + len5, + len5, + ); let l6 = *base.add(8).cast::<*mut u8>(); let l7 = *base.add(12).cast::(); let len8 = l7; - ( _rt::string_lift(bytes5), _rt::Vec::from_raw_parts(l6.cast(), len8, len8), @@ -2231,7 +2126,6 @@ pub mod wasi { #[link_name = "[method]fields.clone"] fn wit_import(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) -> i32 { unreachable!() @@ -2248,7 +2142,9 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 12], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] @@ -2256,7 +2152,6 @@ pub mod wasi { #[link_name = "[method]incoming-request.method"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -2279,8 +2174,11 @@ pub mod wasi { let l2 = *ptr0.add(4).cast::<*mut u8>(); let l3 = *ptr0.add(8).cast::(); let len4 = l3; - let bytes4 = _rt::Vec::from_raw_parts(l2.cast(), len4, len4); - + let bytes4 = _rt::Vec::from_raw_parts( + l2.cast(), + len4, + len4, + ); _rt::string_lift(bytes4) }; Method::Other(e5) @@ -2297,7 +2195,9 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 12], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] @@ -2305,7 +2205,6 @@ pub mod wasi { #[link_name = "[method]incoming-request.path-with-query"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -2319,8 +2218,11 @@ pub mod wasi { let l2 = *ptr0.add(4).cast::<*mut u8>(); let l3 = *ptr0.add(8).cast::(); let len4 = l3; - let bytes4 = _rt::Vec::from_raw_parts(l2.cast(), len4, len4); - + let bytes4 = _rt::Vec::from_raw_parts( + l2.cast(), + len4, + len4, + ); _rt::string_lift(bytes4) }; Some(e) @@ -2337,7 +2239,9 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 16]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 16]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 16], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] @@ -2345,7 +2249,6 @@ pub mod wasi { #[link_name = "[method]incoming-request.scheme"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -2366,15 +2269,16 @@ pub mod wasi { let l3 = *ptr0.add(8).cast::<*mut u8>(); let l4 = *ptr0.add(12).cast::(); let len5 = l4; - let bytes5 = - _rt::Vec::from_raw_parts(l3.cast(), len5, len5); - + let bytes5 = _rt::Vec::from_raw_parts( + l3.cast(), + len5, + len5, + ); _rt::string_lift(bytes5) }; Scheme::Other(e6) } }; - v6 }; Some(e) @@ -2391,7 +2295,9 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 12], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] @@ -2399,7 +2305,6 @@ pub mod wasi { #[link_name = "[method]incoming-request.authority"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -2413,8 +2318,11 @@ pub mod wasi { let l2 = *ptr0.add(4).cast::<*mut u8>(); let l3 = *ptr0.add(8).cast::(); let len4 = l3; - let bytes4 = _rt::Vec::from_raw_parts(l2.cast(), len4, len4); - + let bytes4 = _rt::Vec::from_raw_parts( + l2.cast(), + len4, + len4, + ); _rt::string_lift(bytes4) }; Some(e) @@ -2442,7 +2350,6 @@ pub mod wasi { #[link_name = "[method]incoming-request.headers"] fn wit_import(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) -> i32 { unreachable!() @@ -2460,7 +2367,9 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 8], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] @@ -2468,7 +2377,6 @@ pub mod wasi { #[link_name = "[method]incoming-request.consume"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -2479,7 +2387,6 @@ pub mod wasi { 0 => { let e = { let l2 = *ptr0.add(4).cast::(); - IncomingBody::from_handle(l2 as u32) }; Ok(e) @@ -2513,7 +2420,6 @@ pub mod wasi { #[link_name = "[constructor]outgoing-request"] fn wit_import(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) -> i32 { unreachable!() @@ -2535,7 +2441,9 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 8], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] @@ -2543,7 +2451,6 @@ pub mod wasi { #[link_name = "[method]outgoing-request.body"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -2554,7 +2461,6 @@ pub mod wasi { 0 => { let e = { let l2 = *ptr0.add(4).cast::(); - OutgoingBody::from_handle(l2 as u32) }; Ok(e) @@ -2575,7 +2481,9 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 12], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] @@ -2583,7 +2491,6 @@ pub mod wasi { #[link_name = "[method]outgoing-request.method"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -2606,8 +2513,11 @@ pub mod wasi { let l2 = *ptr0.add(4).cast::<*mut u8>(); let l3 = *ptr0.add(8).cast::(); let len4 = l3; - let bytes4 = _rt::Vec::from_raw_parts(l2.cast(), len4, len4); - + let bytes4 = _rt::Vec::from_raw_parts( + l2.cast(), + len4, + len4, + ); _rt::string_lift(bytes4) }; Method::Other(e5) @@ -2637,24 +2547,25 @@ pub mod wasi { let vec0 = e; let ptr0 = vec0.as_ptr().cast::(); let len0 = vec0.len(); - (9i32, ptr0.cast_mut(), len0) } }; - #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] extern "C" { #[link_name = "[method]outgoing-request.set-method"] fn wit_import(_: i32, _: i32, _: *mut u8, _: usize) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i32, _: *mut u8, _: usize) -> i32 { unreachable!() } - let ret = - wit_import((self).handle() as i32, result1_0, result1_1, result1_2); + let ret = wit_import( + (self).handle() as i32, + result1_0, + result1_1, + result1_2, + ); match ret { 0 => { let e = (); @@ -2677,7 +2588,9 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 12], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] @@ -2685,7 +2598,6 @@ pub mod wasi { #[link_name = "[method]outgoing-request.path-with-query"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -2699,8 +2611,11 @@ pub mod wasi { let l2 = *ptr0.add(4).cast::<*mut u8>(); let l3 = *ptr0.add(8).cast::(); let len4 = l3; - let bytes4 = _rt::Vec::from_raw_parts(l2.cast(), len4, len4); - + let bytes4 = _rt::Vec::from_raw_parts( + l2.cast(), + len4, + len4, + ); _rt::string_lift(bytes4) }; Some(e) @@ -2715,14 +2630,16 @@ pub mod wasi { /// Set the combination of the HTTP Path and Query for the Request. /// When `none`, this represents an empty Path and empty Query. Fails is the /// string given is not a syntactically valid path and query uri component. - pub fn set_path_with_query(&self, path_with_query: Option<&str>) -> Result<(), ()> { + pub fn set_path_with_query( + &self, + path_with_query: Option<&str>, + ) -> Result<(), ()> { unsafe { let (result1_0, result1_1, result1_2) = match path_with_query { Some(e) => { let vec0 = e; let ptr0 = vec0.as_ptr().cast::(); let len0 = vec0.len(); - (1i32, ptr0.cast_mut(), len0) } None => (0i32, ::core::ptr::null_mut(), 0usize), @@ -2733,13 +2650,16 @@ pub mod wasi { #[link_name = "[method]outgoing-request.set-path-with-query"] fn wit_import(_: i32, _: i32, _: *mut u8, _: usize) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i32, _: *mut u8, _: usize) -> i32 { unreachable!() } - let ret = - wit_import((self).handle() as i32, result1_0, result1_1, result1_2); + let ret = wit_import( + (self).handle() as i32, + result1_0, + result1_1, + result1_2, + ); match ret { 0 => { let e = (); @@ -2762,7 +2682,9 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 16]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 16]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 16], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] @@ -2770,7 +2692,6 @@ pub mod wasi { #[link_name = "[method]outgoing-request.scheme"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -2791,15 +2712,16 @@ pub mod wasi { let l3 = *ptr0.add(8).cast::<*mut u8>(); let l4 = *ptr0.add(12).cast::(); let len5 = l4; - let bytes5 = - _rt::Vec::from_raw_parts(l3.cast(), len5, len5); - + let bytes5 = _rt::Vec::from_raw_parts( + l3.cast(), + len5, + len5, + ); _rt::string_lift(bytes5) }; Scheme::Other(e6) } }; - v6 }; Some(e) @@ -2825,11 +2747,9 @@ pub mod wasi { let vec0 = e; let ptr0 = vec0.as_ptr().cast::(); let len0 = vec0.len(); - (2i32, ptr0.cast_mut(), len0) } }; - (1i32, result1_0, result1_1, result1_2) } None => (0i32, 0i32, ::core::ptr::null_mut(), 0usize), @@ -2838,11 +2758,22 @@ pub mod wasi { #[link(wasm_import_module = "wasi:http/types@0.2.0")] extern "C" { #[link_name = "[method]outgoing-request.set-scheme"] - fn wit_import(_: i32, _: i32, _: i32, _: *mut u8, _: usize) -> i32; + fn wit_import( + _: i32, + _: i32, + _: i32, + _: *mut u8, + _: usize, + ) -> i32; } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: i32, _: i32, _: *mut u8, _: usize) -> i32 { + fn wit_import( + _: i32, + _: i32, + _: i32, + _: *mut u8, + _: usize, + ) -> i32 { unreachable!() } let ret = wit_import( @@ -2875,7 +2806,9 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 12], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] @@ -2883,7 +2816,6 @@ pub mod wasi { #[link_name = "[method]outgoing-request.authority"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -2897,8 +2829,11 @@ pub mod wasi { let l2 = *ptr0.add(4).cast::<*mut u8>(); let l3 = *ptr0.add(8).cast::(); let len4 = l3; - let bytes4 = _rt::Vec::from_raw_parts(l2.cast(), len4, len4); - + let bytes4 = _rt::Vec::from_raw_parts( + l2.cast(), + len4, + len4, + ); _rt::string_lift(bytes4) }; Some(e) @@ -2921,7 +2856,6 @@ pub mod wasi { let vec0 = e; let ptr0 = vec0.as_ptr().cast::(); let len0 = vec0.len(); - (1i32, ptr0.cast_mut(), len0) } None => (0i32, ::core::ptr::null_mut(), 0usize), @@ -2932,13 +2866,16 @@ pub mod wasi { #[link_name = "[method]outgoing-request.set-authority"] fn wit_import(_: i32, _: i32, _: *mut u8, _: usize) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i32, _: *mut u8, _: usize) -> i32 { unreachable!() } - let ret = - wit_import((self).handle() as i32, result1_0, result1_1, result1_2); + let ret = wit_import( + (self).handle() as i32, + result1_0, + result1_1, + result1_2, + ); match ret { 0 => { let e = (); @@ -2971,7 +2908,6 @@ pub mod wasi { #[link_name = "[method]outgoing-request.headers"] fn wit_import(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) -> i32 { unreachable!() @@ -2992,7 +2928,6 @@ pub mod wasi { #[link_name = "[constructor]request-options"] fn wit_import() -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import() -> i32 { unreachable!() @@ -3009,7 +2944,9 @@ pub mod wasi { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 16]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 16]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 16], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] @@ -3017,7 +2954,6 @@ pub mod wasi { #[link_name = "[method]request-options.connect-timeout"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -3029,7 +2965,6 @@ pub mod wasi { 1 => { let e = { let l2 = *ptr0.add(8).cast::(); - l2 as u64 }; Some(e) @@ -3043,7 +2978,10 @@ pub mod wasi { #[allow(unused_unsafe, clippy::all)] /// Set the timeout for the initial connect to the HTTP Server. An error /// return value indicates that this timeout is not supported. - pub fn set_connect_timeout(&self, duration: Option) -> Result<(), ()> { + pub fn set_connect_timeout( + &self, + duration: Option, + ) -> Result<(), ()> { unsafe { let (result0_0, result0_1) = match duration { Some(e) => (1i32, _rt::as_i64(e)), @@ -3055,12 +2993,15 @@ pub mod wasi { #[link_name = "[method]request-options.set-connect-timeout"] fn wit_import(_: i32, _: i32, _: i64) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i32, _: i64) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32, result0_0, result0_1); + let ret = wit_import( + (self).handle() as i32, + result0_0, + result0_1, + ); match ret { 0 => { let e = (); @@ -3082,7 +3023,9 @@ pub mod wasi { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 16]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 16]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 16], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] @@ -3090,7 +3033,6 @@ pub mod wasi { #[link_name = "[method]request-options.first-byte-timeout"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -3102,7 +3044,6 @@ pub mod wasi { 1 => { let e = { let l2 = *ptr0.add(8).cast::(); - l2 as u64 }; Some(e) @@ -3116,7 +3057,10 @@ pub mod wasi { #[allow(unused_unsafe, clippy::all)] /// Set the timeout for receiving the first byte of the Response body. An /// error return value indicates that this timeout is not supported. - pub fn set_first_byte_timeout(&self, duration: Option) -> Result<(), ()> { + pub fn set_first_byte_timeout( + &self, + duration: Option, + ) -> Result<(), ()> { unsafe { let (result0_0, result0_1) = match duration { Some(e) => (1i32, _rt::as_i64(e)), @@ -3128,12 +3072,15 @@ pub mod wasi { #[link_name = "[method]request-options.set-first-byte-timeout"] fn wit_import(_: i32, _: i32, _: i64) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i32, _: i64) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32, result0_0, result0_1); + let ret = wit_import( + (self).handle() as i32, + result0_0, + result0_1, + ); match ret { 0 => { let e = (); @@ -3156,7 +3103,9 @@ pub mod wasi { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 16]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 16]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 16], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] @@ -3164,7 +3113,6 @@ pub mod wasi { #[link_name = "[method]request-options.between-bytes-timeout"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -3176,7 +3124,6 @@ pub mod wasi { 1 => { let e = { let l2 = *ptr0.add(8).cast::(); - l2 as u64 }; Some(e) @@ -3206,12 +3153,15 @@ pub mod wasi { #[link_name = "[method]request-options.set-between-bytes-timeout"] fn wit_import(_: i32, _: i32, _: i64) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i32, _: i64) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32, result0_0, result0_1); + let ret = wit_import( + (self).handle() as i32, + result0_0, + result0_1, + ); match ret { 0 => { let e = (); @@ -3237,7 +3187,10 @@ pub mod wasi { /// /// The user may provide an `error` to `response` to allow the /// implementation determine how to respond with an HTTP error response. - pub fn set(param: ResponseOutparam, response: Result) { + pub fn set( + param: ResponseOutparam, + response: Result, + ) { unsafe { let ( result38_0, @@ -3249,16 +3202,18 @@ pub mod wasi { result38_6, result38_7, ) = match &response { - Ok(e) => ( - 0i32, - (e).take_handle() as i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), + Ok(e) => { + ( + 0i32, + (e).take_handle() as i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } Err(e) => { let ( result37_0, @@ -3269,15 +3224,17 @@ pub mod wasi { result37_5, result37_6, ) = match e { - ErrorCode::DnsTimeout => ( - 0i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), + ErrorCode::DnsTimeout => { + ( + 0i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } ErrorCode::DnsError(e) => { let DnsErrorPayload { rcode: rcode0, @@ -3288,7 +3245,6 @@ pub mod wasi { let vec1 = e; let ptr1 = vec1.as_ptr().cast::(); let len1 = vec1.len(); - (1i32, ptr1.cast_mut(), len1) } None => (0i32, ::core::ptr::null_mut(), 0usize), @@ -3301,8 +3257,7 @@ pub mod wasi { 1i32, result2_0, { - let mut t = - ::core::mem::MaybeUninit::::uninit(); + let mut t = ::core::mem::MaybeUninit::::uninit(); t.as_mut_ptr().cast::<*mut u8>().write(result2_1); t }, @@ -3312,114 +3267,138 @@ pub mod wasi { 0i32, ) } - ErrorCode::DestinationNotFound => ( - 2i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::DestinationUnavailable => ( - 3i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::DestinationIpProhibited => ( - 4i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::DestinationIpUnroutable => ( - 5i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::ConnectionRefused => ( - 6i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::ConnectionTerminated => ( - 7i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::ConnectionTimeout => ( - 8i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::ConnectionReadTimeout => ( - 9i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::ConnectionWriteTimeout => ( - 10i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::ConnectionLimitReached => ( - 11i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::TlsProtocolError => ( - 12i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::TlsCertificateError => ( - 13i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), + ErrorCode::DestinationNotFound => { + ( + 2i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::DestinationUnavailable => { + ( + 3i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::DestinationIpProhibited => { + ( + 4i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::DestinationIpUnroutable => { + ( + 5i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::ConnectionRefused => { + ( + 6i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::ConnectionTerminated => { + ( + 7i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::ConnectionTimeout => { + ( + 8i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::ConnectionReadTimeout => { + ( + 9i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::ConnectionWriteTimeout => { + ( + 10i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::ConnectionLimitReached => { + ( + 11i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::TlsProtocolError => { + ( + 12i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::TlsCertificateError => { + ( + 13i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } ErrorCode::TlsAlertReceived(e) => { let TlsAlertReceivedPayload { alert_id: alert_id4, @@ -3429,13 +3408,11 @@ pub mod wasi { Some(e) => (1i32, _rt::as_i32(e)), None => (0i32, 0i32), }; - let (result7_0, result7_1, result7_2) = match alert_message4 - { + let (result7_0, result7_1, result7_2) = match alert_message4 { Some(e) => { let vec6 = e; let ptr6 = vec6.as_ptr().cast::(); let len6 = vec6.len(); - (1i32, ptr6.cast_mut(), len6) } None => (0i32, ::core::ptr::null_mut(), 0usize), @@ -3443,33 +3420,35 @@ pub mod wasi { ( 14i32, result5_0, - ::core::mem::MaybeUninit::new( - i64::from(result5_1) as u64 - ), + ::core::mem::MaybeUninit::new(i64::from(result5_1) as u64), result7_0 as *mut u8, result7_1, result7_2, 0i32, ) } - ErrorCode::HttpRequestDenied => ( - 15i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::HttpRequestLengthRequired => ( - 16i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), + ErrorCode::HttpRequestDenied => { + ( + 15i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::HttpRequestLengthRequired => { + ( + 16i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } ErrorCode::HttpRequestBodySize(e) => { let (result8_0, result8_1) = match e { Some(e) => (1i32, _rt::as_i64(e)), @@ -3485,33 +3464,39 @@ pub mod wasi { 0i32, ) } - ErrorCode::HttpRequestMethodInvalid => ( - 18i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::HttpRequestUriInvalid => ( - 19i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::HttpRequestUriTooLong => ( - 20i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), + ErrorCode::HttpRequestMethodInvalid => { + ( + 18i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::HttpRequestUriInvalid => { + ( + 19i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::HttpRequestUriTooLong => { + ( + 20i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } ErrorCode::HttpRequestHeaderSectionSize(e) => { let (result9_0, result9_1) = match e { Some(e) => (1i32, _rt::as_i32(e)), @@ -3520,9 +3505,7 @@ pub mod wasi { ( 21i32, result9_0, - ::core::mem::MaybeUninit::new( - i64::from(result9_1) as u64 - ), + ::core::mem::MaybeUninit::new(i64::from(result9_1) as u64), ::core::ptr::null_mut(), ::core::ptr::null_mut(), 0usize, @@ -3543,43 +3526,36 @@ pub mod wasi { field_name: field_name10, field_size: field_size10, } = e; - let (result12_0, result12_1, result12_2) = - match field_name10 { - Some(e) => { - let vec11 = e; - let ptr11 = vec11.as_ptr().cast::(); - let len11 = vec11.len(); - - (1i32, ptr11.cast_mut(), len11) - } - None => { - (0i32, ::core::ptr::null_mut(), 0usize) - } - }; + let (result12_0, result12_1, result12_2) = match field_name10 { + Some(e) => { + let vec11 = e; + let ptr11 = vec11.as_ptr().cast::(); + let len11 = vec11.len(); + (1i32, ptr11.cast_mut(), len11) + } + None => (0i32, ::core::ptr::null_mut(), 0usize), + }; let (result13_0, result13_1) = match field_size10 { Some(e) => (1i32, _rt::as_i32(e)), None => (0i32, 0i32), }; ( - 1i32, result12_0, result12_1, result12_2, - result13_0, result13_1, + 1i32, + result12_0, + result12_1, + result12_2, + result13_0, + result13_1, ) } - None => ( - 0i32, - 0i32, - ::core::ptr::null_mut(), - 0usize, - 0i32, - 0i32, - ), + None => { + (0i32, 0i32, ::core::ptr::null_mut(), 0usize, 0i32, 0i32) + } }; ( 22i32, result14_0, - ::core::mem::MaybeUninit::new( - i64::from(result14_1) as u64 - ), + ::core::mem::MaybeUninit::new(i64::from(result14_1) as u64), result14_2, result14_3 as *mut u8, result14_4 as usize, @@ -3594,9 +3570,7 @@ pub mod wasi { ( 23i32, result15_0, - ::core::mem::MaybeUninit::new( - i64::from(result15_1) as u64 - ), + ::core::mem::MaybeUninit::new(i64::from(result15_1) as u64), ::core::ptr::null_mut(), ::core::ptr::null_mut(), 0usize, @@ -3608,17 +3582,15 @@ pub mod wasi { field_name: field_name16, field_size: field_size16, } = e; - let (result18_0, result18_1, result18_2) = - match field_name16 { - Some(e) => { - let vec17 = e; - let ptr17 = vec17.as_ptr().cast::(); - let len17 = vec17.len(); - - (1i32, ptr17.cast_mut(), len17) - } - None => (0i32, ::core::ptr::null_mut(), 0usize), - }; + let (result18_0, result18_1, result18_2) = match field_name16 { + Some(e) => { + let vec17 = e; + let ptr17 = vec17.as_ptr().cast::(); + let len17 = vec17.len(); + (1i32, ptr17.cast_mut(), len17) + } + None => (0i32, ::core::ptr::null_mut(), 0usize), + }; let (result19_0, result19_1) = match field_size16 { Some(e) => (1i32, _rt::as_i32(e)), None => (0i32, 0i32), @@ -3627,8 +3599,7 @@ pub mod wasi { 24i32, result18_0, { - let mut t = - ::core::mem::MaybeUninit::::uninit(); + let mut t = ::core::mem::MaybeUninit::::uninit(); t.as_mut_ptr().cast::<*mut u8>().write(result18_1); t }, @@ -3638,15 +3609,17 @@ pub mod wasi { 0i32, ) } - ErrorCode::HttpResponseIncomplete => ( - 25i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), + ErrorCode::HttpResponseIncomplete => { + ( + 25i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } ErrorCode::HttpResponseHeaderSectionSize(e) => { let (result20_0, result20_1) = match e { Some(e) => (1i32, _rt::as_i32(e)), @@ -3655,9 +3628,7 @@ pub mod wasi { ( 26i32, result20_0, - ::core::mem::MaybeUninit::new( - i64::from(result20_1) as u64 - ), + ::core::mem::MaybeUninit::new(i64::from(result20_1) as u64), ::core::ptr::null_mut(), ::core::ptr::null_mut(), 0usize, @@ -3669,17 +3640,15 @@ pub mod wasi { field_name: field_name21, field_size: field_size21, } = e; - let (result23_0, result23_1, result23_2) = - match field_name21 { - Some(e) => { - let vec22 = e; - let ptr22 = vec22.as_ptr().cast::(); - let len22 = vec22.len(); - - (1i32, ptr22.cast_mut(), len22) - } - None => (0i32, ::core::ptr::null_mut(), 0usize), - }; + let (result23_0, result23_1, result23_2) = match field_name21 { + Some(e) => { + let vec22 = e; + let ptr22 = vec22.as_ptr().cast::(); + let len22 = vec22.len(); + (1i32, ptr22.cast_mut(), len22) + } + None => (0i32, ::core::ptr::null_mut(), 0usize), + }; let (result24_0, result24_1) = match field_size21 { Some(e) => (1i32, _rt::as_i32(e)), None => (0i32, 0i32), @@ -3688,8 +3657,7 @@ pub mod wasi { 27i32, result23_0, { - let mut t = - ::core::mem::MaybeUninit::::uninit(); + let mut t = ::core::mem::MaybeUninit::::uninit(); t.as_mut_ptr().cast::<*mut u8>().write(result23_1); t }, @@ -3722,9 +3690,7 @@ pub mod wasi { ( 29i32, result26_0, - ::core::mem::MaybeUninit::new( - i64::from(result26_1) as u64 - ), + ::core::mem::MaybeUninit::new(i64::from(result26_1) as u64), ::core::ptr::null_mut(), ::core::ptr::null_mut(), 0usize, @@ -3736,17 +3702,15 @@ pub mod wasi { field_name: field_name27, field_size: field_size27, } = e; - let (result29_0, result29_1, result29_2) = - match field_name27 { - Some(e) => { - let vec28 = e; - let ptr28 = vec28.as_ptr().cast::(); - let len28 = vec28.len(); - - (1i32, ptr28.cast_mut(), len28) - } - None => (0i32, ::core::ptr::null_mut(), 0usize), - }; + let (result29_0, result29_1, result29_2) = match field_name27 { + Some(e) => { + let vec28 = e; + let ptr28 = vec28.as_ptr().cast::(); + let len28 = vec28.len(); + (1i32, ptr28.cast_mut(), len28) + } + None => (0i32, ::core::ptr::null_mut(), 0usize), + }; let (result30_0, result30_1) = match field_size27 { Some(e) => (1i32, _rt::as_i32(e)), None => (0i32, 0i32), @@ -3755,8 +3719,7 @@ pub mod wasi { 30i32, result29_0, { - let mut t = - ::core::mem::MaybeUninit::::uninit(); + let mut t = ::core::mem::MaybeUninit::::uninit(); t.as_mut_ptr().cast::<*mut u8>().write(result29_1); t }, @@ -3772,7 +3735,6 @@ pub mod wasi { let vec31 = e; let ptr31 = vec31.as_ptr().cast::(); let len31 = vec31.len(); - (1i32, ptr31.cast_mut(), len31) } None => (0i32, ::core::ptr::null_mut(), 0usize), @@ -3781,8 +3743,7 @@ pub mod wasi { 31i32, result32_0, { - let mut t = - ::core::mem::MaybeUninit::::uninit(); + let mut t = ::core::mem::MaybeUninit::::uninit(); t.as_mut_ptr().cast::<*mut u8>().write(result32_1); t }, @@ -3798,7 +3759,6 @@ pub mod wasi { let vec33 = e; let ptr33 = vec33.as_ptr().cast::(); let len33 = vec33.len(); - (1i32, ptr33.cast_mut(), len33) } None => (0i32, ::core::ptr::null_mut(), 0usize), @@ -3807,8 +3767,7 @@ pub mod wasi { 32i32, result34_0, { - let mut t = - ::core::mem::MaybeUninit::::uninit(); + let mut t = ::core::mem::MaybeUninit::::uninit(); t.as_mut_ptr().cast::<*mut u8>().write(result34_1); t }, @@ -3818,58 +3777,67 @@ pub mod wasi { 0i32, ) } - ErrorCode::HttpResponseTimeout => ( - 33i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::HttpUpgradeFailed => ( - 34i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::HttpProtocolError => ( - 35i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::LoopDetected => ( - 36i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), - ErrorCode::ConfigurationError => ( - 37i32, - 0i32, - ::core::mem::MaybeUninit::::zeroed(), - ::core::ptr::null_mut(), - ::core::ptr::null_mut(), - 0usize, - 0i32, - ), + ErrorCode::HttpResponseTimeout => { + ( + 33i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::HttpUpgradeFailed => { + ( + 34i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::HttpProtocolError => { + ( + 35i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::LoopDetected => { + ( + 36i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } + ErrorCode::ConfigurationError => { + ( + 37i32, + 0i32, + ::core::mem::MaybeUninit::::zeroed(), + ::core::ptr::null_mut(), + ::core::ptr::null_mut(), + 0usize, + 0i32, + ) + } ErrorCode::InternalError(e) => { let (result36_0, result36_1, result36_2) = match e { Some(e) => { let vec35 = e; let ptr35 = vec35.as_ptr().cast::(); let len35 = vec35.len(); - (1i32, ptr35.cast_mut(), len35) } None => (0i32, ::core::ptr::null_mut(), 0usize), @@ -3878,8 +3846,7 @@ pub mod wasi { 38i32, result36_0, { - let mut t = - ::core::mem::MaybeUninit::::uninit(); + let mut t = ::core::mem::MaybeUninit::::uninit(); t.as_mut_ptr().cast::<*mut u8>().write(result36_1); t }, @@ -3890,10 +3857,15 @@ pub mod wasi { ) } }; - ( - 1i32, result37_0, result37_1, result37_2, result37_3, - result37_4, result37_5, result37_6, + 1i32, + result37_0, + result37_1, + result37_2, + result37_3, + result37_4, + result37_5, + result37_6, ) } }; @@ -3913,7 +3885,6 @@ pub mod wasi { _: i32, ); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import( _: i32, @@ -3953,7 +3924,6 @@ pub mod wasi { #[link_name = "[method]incoming-response.status"] fn wit_import(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) -> i32 { unreachable!() @@ -3980,7 +3950,6 @@ pub mod wasi { #[link_name = "[method]incoming-response.headers"] fn wit_import(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) -> i32 { unreachable!() @@ -3998,7 +3967,9 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 8], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] @@ -4006,7 +3977,6 @@ pub mod wasi { #[link_name = "[method]incoming-response.consume"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -4017,7 +3987,6 @@ pub mod wasi { 0 => { let e = { let l2 = *ptr0.add(4).cast::(); - IncomingBody::from_handle(l2 as u32) }; Ok(e) @@ -4052,7 +4021,9 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 8], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] @@ -4060,7 +4031,6 @@ pub mod wasi { #[link_name = "[method]incoming-body.stream"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -4071,7 +4041,6 @@ pub mod wasi { 0 => { let e = { let l2 = *ptr0.add(4).cast::(); - super::super::super::wasi::io::streams::InputStream::from_handle( l2 as u32, ) @@ -4099,7 +4068,6 @@ pub mod wasi { #[link_name = "[static]incoming-body.finish"] fn wit_import(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) -> i32 { unreachable!() @@ -4122,13 +4090,14 @@ pub mod wasi { #[link_name = "[method]future-trailers.subscribe"] fn wit_import(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) -> i32 { unreachable!() } let ret = wit_import((self).handle() as i32); - super::super::super::wasi::io::poll::Pollable::from_handle(ret as u32) + super::super::super::wasi::io::poll::Pollable::from_handle( + ret as u32, + ) } } } @@ -4153,11 +4122,15 @@ pub mod wasi { /// resource is immutable, and a child. Use of the `set`, `append`, or /// `delete` methods will return an error, and the resource must be /// dropped before the parent `future-trailers` is dropped. - pub fn get(&self) -> Option, ErrorCode>, ()>> { + pub fn get( + &self, + ) -> Option, ErrorCode>, ()>> { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 56]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 56]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 56], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] @@ -4165,7 +4138,6 @@ pub mod wasi { #[link_name = "[method]future-trailers.get"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -4177,529 +4149,470 @@ pub mod wasi { 1 => { let e = { let l2 = i32::from(*ptr0.add(8).cast::()); - match l2 { 0 => { let e = { let l3 = i32::from(*ptr0.add(16).cast::()); - match l3 { 0 => { - let e = - { - let l4 = i32::from( - *ptr0.add(24).cast::(), - ); - - match l4 { - 0 => None, - 1 => { - let e = { - let l5 = *ptr0.add(28).cast::(); - - Fields::from_handle(l5 as u32) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; + let e = { + let l4 = i32::from(*ptr0.add(24).cast::()); + match l4 { + 0 => None, + 1 => { + let e = { + let l5 = *ptr0.add(28).cast::(); + Fields::from_handle(l5 as u32) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; Ok(e) } 1 => { let e = { - let l6 = i32::from( - *ptr0.add(24).cast::(), - ); + let l6 = i32::from(*ptr0.add(24).cast::()); let v68 = match l6 { - 0 => { - ErrorCode::DnsTimeout - } - 1 => { - let e68 = { - let l7 = i32::from(*ptr0.add(32).cast::()); - let l11 = i32::from(*ptr0.add(44).cast::()); - - DnsErrorPayload{ - rcode: match l7 { - 0 => None, - 1 => { - let e = { - let l8 = *ptr0.add(36).cast::<*mut u8>(); - let l9 = *ptr0.add(40).cast::(); - let len10 = l9; - let bytes10 = _rt::Vec::from_raw_parts(l8.cast(), len10, len10); - - _rt::string_lift(bytes10) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - info_code: match l11 { - 0 => None, - 1 => { - let e = { - let l12 = i32::from(*ptr0.add(46).cast::()); - - l12 as u16 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } - }; - ErrorCode::DnsError(e68) - } - 2 => { - ErrorCode::DestinationNotFound - } - 3 => { - ErrorCode::DestinationUnavailable - } - 4 => { - ErrorCode::DestinationIpProhibited - } - 5 => { - ErrorCode::DestinationIpUnroutable - } - 6 => { - ErrorCode::ConnectionRefused - } - 7 => { - ErrorCode::ConnectionTerminated - } - 8 => { - ErrorCode::ConnectionTimeout - } - 9 => { - ErrorCode::ConnectionReadTimeout - } - 10 => { - ErrorCode::ConnectionWriteTimeout - } - 11 => { - ErrorCode::ConnectionLimitReached - } - 12 => { - ErrorCode::TlsProtocolError - } - 13 => { - ErrorCode::TlsCertificateError - } - 14 => { - let e68 = { - let l13 = i32::from(*ptr0.add(32).cast::()); - let l15 = i32::from(*ptr0.add(36).cast::()); - - TlsAlertReceivedPayload{ - alert_id: match l13 { - 0 => None, - 1 => { - let e = { - let l14 = i32::from(*ptr0.add(33).cast::()); - - l14 as u8 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - alert_message: match l15 { - 0 => None, - 1 => { - let e = { - let l16 = *ptr0.add(40).cast::<*mut u8>(); - let l17 = *ptr0.add(44).cast::(); - let len18 = l17; - let bytes18 = _rt::Vec::from_raw_parts(l16.cast(), len18, len18); - - _rt::string_lift(bytes18) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } - }; - ErrorCode::TlsAlertReceived(e68) - } - 15 => { - ErrorCode::HttpRequestDenied - } - 16 => { - ErrorCode::HttpRequestLengthRequired - } - 17 => { - let e68 = { - let l19 = i32::from(*ptr0.add(32).cast::()); - - match l19 { - 0 => None, - 1 => { - let e = { - let l20 = *ptr0.add(40).cast::(); - - l20 as u64 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpRequestBodySize(e68) - } - 18 => { - ErrorCode::HttpRequestMethodInvalid - } - 19 => { - ErrorCode::HttpRequestUriInvalid - } - 20 => { - ErrorCode::HttpRequestUriTooLong - } - 21 => { - let e68 = { - let l21 = i32::from(*ptr0.add(32).cast::()); - - match l21 { - 0 => None, - 1 => { - let e = { - let l22 = *ptr0.add(36).cast::(); - - l22 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpRequestHeaderSectionSize(e68) - } - 22 => { - let e68 = { - let l23 = i32::from(*ptr0.add(32).cast::()); - - match l23 { - 0 => None, - 1 => { - let e = { - let l24 = i32::from(*ptr0.add(36).cast::()); - let l28 = i32::from(*ptr0.add(48).cast::()); - - FieldSizePayload{ - field_name: match l24 { - 0 => None, - 1 => { - let e = { - let l25 = *ptr0.add(40).cast::<*mut u8>(); - let l26 = *ptr0.add(44).cast::(); - let len27 = l26; - let bytes27 = _rt::Vec::from_raw_parts(l25.cast(), len27, len27); - - _rt::string_lift(bytes27) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - field_size: match l28 { - 0 => None, - 1 => { - let e = { - let l29 = *ptr0.add(52).cast::(); - - l29 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpRequestHeaderSize(e68) - } - 23 => { - let e68 = { - let l30 = i32::from(*ptr0.add(32).cast::()); - - match l30 { - 0 => None, - 1 => { - let e = { - let l31 = *ptr0.add(36).cast::(); - - l31 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpRequestTrailerSectionSize(e68) - } - 24 => { - let e68 = { - let l32 = i32::from(*ptr0.add(32).cast::()); - let l36 = i32::from(*ptr0.add(44).cast::()); - - FieldSizePayload{ - field_name: match l32 { - 0 => None, - 1 => { - let e = { - let l33 = *ptr0.add(36).cast::<*mut u8>(); - let l34 = *ptr0.add(40).cast::(); - let len35 = l34; - let bytes35 = _rt::Vec::from_raw_parts(l33.cast(), len35, len35); - - _rt::string_lift(bytes35) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - field_size: match l36 { - 0 => None, - 1 => { - let e = { - let l37 = *ptr0.add(48).cast::(); - - l37 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } - }; - ErrorCode::HttpRequestTrailerSize(e68) - } - 25 => { - ErrorCode::HttpResponseIncomplete - } - 26 => { - let e68 = { - let l38 = i32::from(*ptr0.add(32).cast::()); - - match l38 { - 0 => None, - 1 => { - let e = { - let l39 = *ptr0.add(36).cast::(); - - l39 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpResponseHeaderSectionSize(e68) - } - 27 => { - let e68 = { - let l40 = i32::from(*ptr0.add(32).cast::()); - let l44 = i32::from(*ptr0.add(44).cast::()); - - FieldSizePayload{ - field_name: match l40 { - 0 => None, - 1 => { - let e = { - let l41 = *ptr0.add(36).cast::<*mut u8>(); - let l42 = *ptr0.add(40).cast::(); - let len43 = l42; - let bytes43 = _rt::Vec::from_raw_parts(l41.cast(), len43, len43); - - _rt::string_lift(bytes43) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - field_size: match l44 { - 0 => None, - 1 => { - let e = { - let l45 = *ptr0.add(48).cast::(); - - l45 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } - }; - ErrorCode::HttpResponseHeaderSize(e68) - } - 28 => { - let e68 = { - let l46 = i32::from(*ptr0.add(32).cast::()); - - match l46 { - 0 => None, - 1 => { - let e = { - let l47 = *ptr0.add(40).cast::(); - - l47 as u64 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpResponseBodySize(e68) - } - 29 => { - let e68 = { - let l48 = i32::from(*ptr0.add(32).cast::()); - - match l48 { - 0 => None, - 1 => { - let e = { - let l49 = *ptr0.add(36).cast::(); - - l49 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpResponseTrailerSectionSize(e68) - } - 30 => { - let e68 = { - let l50 = i32::from(*ptr0.add(32).cast::()); - let l54 = i32::from(*ptr0.add(44).cast::()); - - FieldSizePayload{ - field_name: match l50 { - 0 => None, - 1 => { - let e = { - let l51 = *ptr0.add(36).cast::<*mut u8>(); - let l52 = *ptr0.add(40).cast::(); - let len53 = l52; - let bytes53 = _rt::Vec::from_raw_parts(l51.cast(), len53, len53); - - _rt::string_lift(bytes53) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - field_size: match l54 { - 0 => None, - 1 => { - let e = { - let l55 = *ptr0.add(48).cast::(); - - l55 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } - }; - ErrorCode::HttpResponseTrailerSize(e68) - } - 31 => { - let e68 = { - let l56 = i32::from(*ptr0.add(32).cast::()); - - match l56 { - 0 => None, - 1 => { - let e = { - let l57 = *ptr0.add(36).cast::<*mut u8>(); - let l58 = *ptr0.add(40).cast::(); - let len59 = l58; - let bytes59 = _rt::Vec::from_raw_parts(l57.cast(), len59, len59); - - _rt::string_lift(bytes59) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpResponseTransferCoding(e68) - } - 32 => { - let e68 = { - let l60 = i32::from(*ptr0.add(32).cast::()); - - match l60 { - 0 => None, - 1 => { - let e = { - let l61 = *ptr0.add(36).cast::<*mut u8>(); - let l62 = *ptr0.add(40).cast::(); - let len63 = l62; - let bytes63 = _rt::Vec::from_raw_parts(l61.cast(), len63, len63); - - _rt::string_lift(bytes63) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpResponseContentCoding(e68) - } - 33 => { - ErrorCode::HttpResponseTimeout - } - 34 => { - ErrorCode::HttpUpgradeFailed - } - 35 => { - ErrorCode::HttpProtocolError - } - 36 => { - ErrorCode::LoopDetected - } - 37 => { - ErrorCode::ConfigurationError - } - n => { - debug_assert_eq!(n, 38, "invalid enum discriminant"); - let e68 = { - let l64 = i32::from(*ptr0.add(32).cast::()); - - match l64 { - 0 => None, - 1 => { - let e = { - let l65 = *ptr0.add(36).cast::<*mut u8>(); - let l66 = *ptr0.add(40).cast::(); - let len67 = l66; - let bytes67 = _rt::Vec::from_raw_parts(l65.cast(), len67, len67); - - _rt::string_lift(bytes67) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::InternalError(e68) - } - }; - + 0 => ErrorCode::DnsTimeout, + 1 => { + let e68 = { + let l7 = i32::from(*ptr0.add(32).cast::()); + let l11 = i32::from(*ptr0.add(44).cast::()); + DnsErrorPayload { + rcode: match l7 { + 0 => None, + 1 => { + let e = { + let l8 = *ptr0.add(36).cast::<*mut u8>(); + let l9 = *ptr0.add(40).cast::(); + let len10 = l9; + let bytes10 = _rt::Vec::from_raw_parts( + l8.cast(), + len10, + len10, + ); + _rt::string_lift(bytes10) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + info_code: match l11 { + 0 => None, + 1 => { + let e = { + let l12 = i32::from(*ptr0.add(46).cast::()); + l12 as u16 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } + }; + ErrorCode::DnsError(e68) + } + 2 => ErrorCode::DestinationNotFound, + 3 => ErrorCode::DestinationUnavailable, + 4 => ErrorCode::DestinationIpProhibited, + 5 => ErrorCode::DestinationIpUnroutable, + 6 => ErrorCode::ConnectionRefused, + 7 => ErrorCode::ConnectionTerminated, + 8 => ErrorCode::ConnectionTimeout, + 9 => ErrorCode::ConnectionReadTimeout, + 10 => ErrorCode::ConnectionWriteTimeout, + 11 => ErrorCode::ConnectionLimitReached, + 12 => ErrorCode::TlsProtocolError, + 13 => ErrorCode::TlsCertificateError, + 14 => { + let e68 = { + let l13 = i32::from(*ptr0.add(32).cast::()); + let l15 = i32::from(*ptr0.add(36).cast::()); + TlsAlertReceivedPayload { + alert_id: match l13 { + 0 => None, + 1 => { + let e = { + let l14 = i32::from(*ptr0.add(33).cast::()); + l14 as u8 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + alert_message: match l15 { + 0 => None, + 1 => { + let e = { + let l16 = *ptr0.add(40).cast::<*mut u8>(); + let l17 = *ptr0.add(44).cast::(); + let len18 = l17; + let bytes18 = _rt::Vec::from_raw_parts( + l16.cast(), + len18, + len18, + ); + _rt::string_lift(bytes18) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } + }; + ErrorCode::TlsAlertReceived(e68) + } + 15 => ErrorCode::HttpRequestDenied, + 16 => ErrorCode::HttpRequestLengthRequired, + 17 => { + let e68 = { + let l19 = i32::from(*ptr0.add(32).cast::()); + match l19 { + 0 => None, + 1 => { + let e = { + let l20 = *ptr0.add(40).cast::(); + l20 as u64 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpRequestBodySize(e68) + } + 18 => ErrorCode::HttpRequestMethodInvalid, + 19 => ErrorCode::HttpRequestUriInvalid, + 20 => ErrorCode::HttpRequestUriTooLong, + 21 => { + let e68 = { + let l21 = i32::from(*ptr0.add(32).cast::()); + match l21 { + 0 => None, + 1 => { + let e = { + let l22 = *ptr0.add(36).cast::(); + l22 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpRequestHeaderSectionSize(e68) + } + 22 => { + let e68 = { + let l23 = i32::from(*ptr0.add(32).cast::()); + match l23 { + 0 => None, + 1 => { + let e = { + let l24 = i32::from(*ptr0.add(36).cast::()); + let l28 = i32::from(*ptr0.add(48).cast::()); + FieldSizePayload { + field_name: match l24 { + 0 => None, + 1 => { + let e = { + let l25 = *ptr0.add(40).cast::<*mut u8>(); + let l26 = *ptr0.add(44).cast::(); + let len27 = l26; + let bytes27 = _rt::Vec::from_raw_parts( + l25.cast(), + len27, + len27, + ); + _rt::string_lift(bytes27) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + field_size: match l28 { + 0 => None, + 1 => { + let e = { + let l29 = *ptr0.add(52).cast::(); + l29 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpRequestHeaderSize(e68) + } + 23 => { + let e68 = { + let l30 = i32::from(*ptr0.add(32).cast::()); + match l30 { + 0 => None, + 1 => { + let e = { + let l31 = *ptr0.add(36).cast::(); + l31 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpRequestTrailerSectionSize(e68) + } + 24 => { + let e68 = { + let l32 = i32::from(*ptr0.add(32).cast::()); + let l36 = i32::from(*ptr0.add(44).cast::()); + FieldSizePayload { + field_name: match l32 { + 0 => None, + 1 => { + let e = { + let l33 = *ptr0.add(36).cast::<*mut u8>(); + let l34 = *ptr0.add(40).cast::(); + let len35 = l34; + let bytes35 = _rt::Vec::from_raw_parts( + l33.cast(), + len35, + len35, + ); + _rt::string_lift(bytes35) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + field_size: match l36 { + 0 => None, + 1 => { + let e = { + let l37 = *ptr0.add(48).cast::(); + l37 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } + }; + ErrorCode::HttpRequestTrailerSize(e68) + } + 25 => ErrorCode::HttpResponseIncomplete, + 26 => { + let e68 = { + let l38 = i32::from(*ptr0.add(32).cast::()); + match l38 { + 0 => None, + 1 => { + let e = { + let l39 = *ptr0.add(36).cast::(); + l39 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpResponseHeaderSectionSize(e68) + } + 27 => { + let e68 = { + let l40 = i32::from(*ptr0.add(32).cast::()); + let l44 = i32::from(*ptr0.add(44).cast::()); + FieldSizePayload { + field_name: match l40 { + 0 => None, + 1 => { + let e = { + let l41 = *ptr0.add(36).cast::<*mut u8>(); + let l42 = *ptr0.add(40).cast::(); + let len43 = l42; + let bytes43 = _rt::Vec::from_raw_parts( + l41.cast(), + len43, + len43, + ); + _rt::string_lift(bytes43) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + field_size: match l44 { + 0 => None, + 1 => { + let e = { + let l45 = *ptr0.add(48).cast::(); + l45 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } + }; + ErrorCode::HttpResponseHeaderSize(e68) + } + 28 => { + let e68 = { + let l46 = i32::from(*ptr0.add(32).cast::()); + match l46 { + 0 => None, + 1 => { + let e = { + let l47 = *ptr0.add(40).cast::(); + l47 as u64 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpResponseBodySize(e68) + } + 29 => { + let e68 = { + let l48 = i32::from(*ptr0.add(32).cast::()); + match l48 { + 0 => None, + 1 => { + let e = { + let l49 = *ptr0.add(36).cast::(); + l49 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpResponseTrailerSectionSize(e68) + } + 30 => { + let e68 = { + let l50 = i32::from(*ptr0.add(32).cast::()); + let l54 = i32::from(*ptr0.add(44).cast::()); + FieldSizePayload { + field_name: match l50 { + 0 => None, + 1 => { + let e = { + let l51 = *ptr0.add(36).cast::<*mut u8>(); + let l52 = *ptr0.add(40).cast::(); + let len53 = l52; + let bytes53 = _rt::Vec::from_raw_parts( + l51.cast(), + len53, + len53, + ); + _rt::string_lift(bytes53) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + field_size: match l54 { + 0 => None, + 1 => { + let e = { + let l55 = *ptr0.add(48).cast::(); + l55 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } + }; + ErrorCode::HttpResponseTrailerSize(e68) + } + 31 => { + let e68 = { + let l56 = i32::from(*ptr0.add(32).cast::()); + match l56 { + 0 => None, + 1 => { + let e = { + let l57 = *ptr0.add(36).cast::<*mut u8>(); + let l58 = *ptr0.add(40).cast::(); + let len59 = l58; + let bytes59 = _rt::Vec::from_raw_parts( + l57.cast(), + len59, + len59, + ); + _rt::string_lift(bytes59) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpResponseTransferCoding(e68) + } + 32 => { + let e68 = { + let l60 = i32::from(*ptr0.add(32).cast::()); + match l60 { + 0 => None, + 1 => { + let e = { + let l61 = *ptr0.add(36).cast::<*mut u8>(); + let l62 = *ptr0.add(40).cast::(); + let len63 = l62; + let bytes63 = _rt::Vec::from_raw_parts( + l61.cast(), + len63, + len63, + ); + _rt::string_lift(bytes63) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpResponseContentCoding(e68) + } + 33 => ErrorCode::HttpResponseTimeout, + 34 => ErrorCode::HttpUpgradeFailed, + 35 => ErrorCode::HttpProtocolError, + 36 => ErrorCode::LoopDetected, + 37 => ErrorCode::ConfigurationError, + n => { + debug_assert_eq!(n, 38, "invalid enum discriminant"); + let e68 = { + let l64 = i32::from(*ptr0.add(32).cast::()); + match l64 { + 0 => None, + 1 => { + let e = { + let l65 = *ptr0.add(36).cast::<*mut u8>(); + let l66 = *ptr0.add(40).cast::(); + let len67 = l66; + let bytes67 = _rt::Vec::from_raw_parts( + l65.cast(), + len67, + len67, + ); + _rt::string_lift(bytes67) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::InternalError(e68) + } + }; v68 }; Err(e) @@ -4738,7 +4651,6 @@ pub mod wasi { #[link_name = "[constructor]outgoing-response"] fn wit_import(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) -> i32 { unreachable!() @@ -4759,7 +4671,6 @@ pub mod wasi { #[link_name = "[method]outgoing-response.status-code"] fn wit_import(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) -> i32 { unreachable!() @@ -4773,7 +4684,10 @@ pub mod wasi { #[allow(unused_unsafe, clippy::all)] /// Set the HTTP Status Code for the Response. Fails if the status-code /// given is not a valid http status code. - pub fn set_status_code(&self, status_code: StatusCode) -> Result<(), ()> { + pub fn set_status_code( + &self, + status_code: StatusCode, + ) -> Result<(), ()> { unsafe { #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] @@ -4781,12 +4695,14 @@ pub mod wasi { #[link_name = "[method]outgoing-response.set-status-code"] fn wit_import(_: i32, _: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i32) -> i32 { unreachable!() } - let ret = wit_import((self).handle() as i32, _rt::as_i32(status_code)); + let ret = wit_import( + (self).handle() as i32, + _rt::as_i32(status_code), + ); match ret { 0 => { let e = (); @@ -4819,7 +4735,6 @@ pub mod wasi { #[link_name = "[method]outgoing-response.headers"] fn wit_import(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) -> i32 { unreachable!() @@ -4840,7 +4755,9 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 8], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] @@ -4848,7 +4765,6 @@ pub mod wasi { #[link_name = "[method]outgoing-response.body"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -4859,7 +4775,6 @@ pub mod wasi { 0 => { let e = { let l2 = *ptr0.add(4).cast::(); - OutgoingBody::from_handle(l2 as u32) }; Ok(e) @@ -4888,7 +4803,9 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 8]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 8], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] @@ -4896,7 +4813,6 @@ pub mod wasi { #[link_name = "[method]outgoing-body.write"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -4907,8 +4823,9 @@ pub mod wasi { 0 => { let e = { let l2 = *ptr0.add(4).cast::(); - - super::super::super::wasi::io::streams::OutputStream::from_handle(l2 as u32) + super::super::super::wasi::io::streams::OutputStream::from_handle( + l2 as u32, + ) }; Ok(e) } @@ -4939,7 +4856,9 @@ pub mod wasi { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 40]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 40]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 40], + ); let (result0_0, result0_1) = match &trailers { Some(e) => (1i32, (e).take_handle() as i32), None => (0i32, 0i32), @@ -4951,12 +4870,16 @@ pub mod wasi { #[link_name = "[static]outgoing-body.finish"] fn wit_import(_: i32, _: i32, _: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i32, _: i32, _: *mut u8) { unreachable!() } - wit_import((&this).take_handle() as i32, result0_0, result0_1, ptr1); + wit_import( + (&this).take_handle() as i32, + result0_0, + result0_1, + ptr1, + ); let l2 = i32::from(*ptr1.add(0).cast::()); match l2 { 0 => { @@ -4972,24 +4895,19 @@ pub mod wasi { let e65 = { let l4 = i32::from(*ptr1.add(16).cast::()); let l8 = i32::from(*ptr1.add(28).cast::()); - DnsErrorPayload { rcode: match l4 { 0 => None, 1 => { let e = { - let l5 = - *ptr1.add(20).cast::<*mut u8>(); - let l6 = - *ptr1.add(24).cast::(); + let l5 = *ptr1.add(20).cast::<*mut u8>(); + let l6 = *ptr1.add(24).cast::(); let len7 = l6; - let bytes7 = - _rt::Vec::from_raw_parts( - l5.cast(), - len7, - len7, - ); - + let bytes7 = _rt::Vec::from_raw_parts( + l5.cast(), + len7, + len7, + ); _rt::string_lift(bytes7) }; Some(e) @@ -5000,10 +4918,7 @@ pub mod wasi { 0 => None, 1 => { let e = { - let l9 = i32::from( - *ptr1.add(30).cast::(), - ); - + let l9 = i32::from(*ptr1.add(30).cast::()); l9 as u16 }; Some(e) @@ -5030,16 +4945,12 @@ pub mod wasi { let e65 = { let l10 = i32::from(*ptr1.add(16).cast::()); let l12 = i32::from(*ptr1.add(20).cast::()); - TlsAlertReceivedPayload { alert_id: match l10 { 0 => None, 1 => { let e = { - let l11 = i32::from( - *ptr1.add(17).cast::(), - ); - + let l11 = i32::from(*ptr1.add(17).cast::()); l11 as u8 }; Some(e) @@ -5050,18 +4961,14 @@ pub mod wasi { 0 => None, 1 => { let e = { - let l13 = - *ptr1.add(24).cast::<*mut u8>(); - let l14 = - *ptr1.add(28).cast::(); + let l13 = *ptr1.add(24).cast::<*mut u8>(); + let l14 = *ptr1.add(28).cast::(); let len15 = l14; - let bytes15 = - _rt::Vec::from_raw_parts( - l13.cast(), - len15, - len15, - ); - + let bytes15 = _rt::Vec::from_raw_parts( + l13.cast(), + len15, + len15, + ); _rt::string_lift(bytes15) }; Some(e) @@ -5077,13 +4984,11 @@ pub mod wasi { 17 => { let e65 = { let l16 = i32::from(*ptr1.add(16).cast::()); - match l16 { 0 => None, 1 => { let e = { let l17 = *ptr1.add(24).cast::(); - l17 as u64 }; Some(e) @@ -5099,13 +5004,11 @@ pub mod wasi { 21 => { let e65 = { let l18 = i32::from(*ptr1.add(16).cast::()); - match l18 { 0 => None, 1 => { let e = { let l19 = *ptr1.add(20).cast::(); - l19 as u32 }; Some(e) @@ -5118,47 +5021,43 @@ pub mod wasi { 22 => { let e65 = { let l20 = i32::from(*ptr1.add(16).cast::()); - match l20 { 0 => None, 1 => { let e = { - let l21 = i32::from( - *ptr1.add(20).cast::(), - ); - let l25 = i32::from( - *ptr1.add(32).cast::(), - ); - - FieldSizePayload{ - field_name: match l21 { - 0 => None, - 1 => { - let e = { - let l22 = *ptr1.add(24).cast::<*mut u8>(); - let l23 = *ptr1.add(28).cast::(); - let len24 = l23; - let bytes24 = _rt::Vec::from_raw_parts(l22.cast(), len24, len24); - - _rt::string_lift(bytes24) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - field_size: match l25 { - 0 => None, - 1 => { - let e = { - let l26 = *ptr1.add(36).cast::(); - - l26 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } + let l21 = i32::from(*ptr1.add(20).cast::()); + let l25 = i32::from(*ptr1.add(32).cast::()); + FieldSizePayload { + field_name: match l21 { + 0 => None, + 1 => { + let e = { + let l22 = *ptr1.add(24).cast::<*mut u8>(); + let l23 = *ptr1.add(28).cast::(); + let len24 = l23; + let bytes24 = _rt::Vec::from_raw_parts( + l22.cast(), + len24, + len24, + ); + _rt::string_lift(bytes24) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + field_size: match l25 { + 0 => None, + 1 => { + let e = { + let l26 = *ptr1.add(36).cast::(); + l26 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } }; Some(e) } @@ -5170,13 +5069,11 @@ pub mod wasi { 23 => { let e65 = { let l27 = i32::from(*ptr1.add(16).cast::()); - match l27 { 0 => None, 1 => { let e = { let l28 = *ptr1.add(20).cast::(); - l28 as u32 }; Some(e) @@ -5190,24 +5087,19 @@ pub mod wasi { let e65 = { let l29 = i32::from(*ptr1.add(16).cast::()); let l33 = i32::from(*ptr1.add(28).cast::()); - FieldSizePayload { field_name: match l29 { 0 => None, 1 => { let e = { - let l30 = - *ptr1.add(20).cast::<*mut u8>(); - let l31 = - *ptr1.add(24).cast::(); + let l30 = *ptr1.add(20).cast::<*mut u8>(); + let l31 = *ptr1.add(24).cast::(); let len32 = l31; - let bytes32 = - _rt::Vec::from_raw_parts( - l30.cast(), - len32, - len32, - ); - + let bytes32 = _rt::Vec::from_raw_parts( + l30.cast(), + len32, + len32, + ); _rt::string_lift(bytes32) }; Some(e) @@ -5218,9 +5110,7 @@ pub mod wasi { 0 => None, 1 => { let e = { - let l34 = - *ptr1.add(32).cast::(); - + let l34 = *ptr1.add(32).cast::(); l34 as u32 }; Some(e) @@ -5235,13 +5125,11 @@ pub mod wasi { 26 => { let e65 = { let l35 = i32::from(*ptr1.add(16).cast::()); - match l35 { 0 => None, 1 => { let e = { let l36 = *ptr1.add(20).cast::(); - l36 as u32 }; Some(e) @@ -5255,24 +5143,19 @@ pub mod wasi { let e65 = { let l37 = i32::from(*ptr1.add(16).cast::()); let l41 = i32::from(*ptr1.add(28).cast::()); - FieldSizePayload { field_name: match l37 { 0 => None, 1 => { let e = { - let l38 = - *ptr1.add(20).cast::<*mut u8>(); - let l39 = - *ptr1.add(24).cast::(); + let l38 = *ptr1.add(20).cast::<*mut u8>(); + let l39 = *ptr1.add(24).cast::(); let len40 = l39; - let bytes40 = - _rt::Vec::from_raw_parts( - l38.cast(), - len40, - len40, - ); - + let bytes40 = _rt::Vec::from_raw_parts( + l38.cast(), + len40, + len40, + ); _rt::string_lift(bytes40) }; Some(e) @@ -5283,9 +5166,7 @@ pub mod wasi { 0 => None, 1 => { let e = { - let l42 = - *ptr1.add(32).cast::(); - + let l42 = *ptr1.add(32).cast::(); l42 as u32 }; Some(e) @@ -5299,13 +5180,11 @@ pub mod wasi { 28 => { let e65 = { let l43 = i32::from(*ptr1.add(16).cast::()); - match l43 { 0 => None, 1 => { let e = { let l44 = *ptr1.add(24).cast::(); - l44 as u64 }; Some(e) @@ -5318,13 +5197,11 @@ pub mod wasi { 29 => { let e65 = { let l45 = i32::from(*ptr1.add(16).cast::()); - match l45 { 0 => None, 1 => { let e = { let l46 = *ptr1.add(20).cast::(); - l46 as u32 }; Some(e) @@ -5338,24 +5215,19 @@ pub mod wasi { let e65 = { let l47 = i32::from(*ptr1.add(16).cast::()); let l51 = i32::from(*ptr1.add(28).cast::()); - FieldSizePayload { field_name: match l47 { 0 => None, 1 => { let e = { - let l48 = - *ptr1.add(20).cast::<*mut u8>(); - let l49 = - *ptr1.add(24).cast::(); + let l48 = *ptr1.add(20).cast::<*mut u8>(); + let l49 = *ptr1.add(24).cast::(); let len50 = l49; - let bytes50 = - _rt::Vec::from_raw_parts( - l48.cast(), - len50, - len50, - ); - + let bytes50 = _rt::Vec::from_raw_parts( + l48.cast(), + len50, + len50, + ); _rt::string_lift(bytes50) }; Some(e) @@ -5366,9 +5238,7 @@ pub mod wasi { 0 => None, 1 => { let e = { - let l52 = - *ptr1.add(32).cast::(); - + let l52 = *ptr1.add(32).cast::(); l52 as u32 }; Some(e) @@ -5382,13 +5252,11 @@ pub mod wasi { 31 => { let e65 = { let l53 = i32::from(*ptr1.add(16).cast::()); - match l53 { 0 => None, 1 => { let e = { - let l54 = - *ptr1.add(20).cast::<*mut u8>(); + let l54 = *ptr1.add(20).cast::<*mut u8>(); let l55 = *ptr1.add(24).cast::(); let len56 = l55; let bytes56 = _rt::Vec::from_raw_parts( @@ -5396,7 +5264,6 @@ pub mod wasi { len56, len56, ); - _rt::string_lift(bytes56) }; Some(e) @@ -5409,13 +5276,11 @@ pub mod wasi { 32 => { let e65 = { let l57 = i32::from(*ptr1.add(16).cast::()); - match l57 { 0 => None, 1 => { let e = { - let l58 = - *ptr1.add(20).cast::<*mut u8>(); + let l58 = *ptr1.add(20).cast::<*mut u8>(); let l59 = *ptr1.add(24).cast::(); let len60 = l59; let bytes60 = _rt::Vec::from_raw_parts( @@ -5423,7 +5288,6 @@ pub mod wasi { len60, len60, ); - _rt::string_lift(bytes60) }; Some(e) @@ -5442,13 +5306,11 @@ pub mod wasi { debug_assert_eq!(n, 38, "invalid enum discriminant"); let e65 = { let l61 = i32::from(*ptr1.add(16).cast::()); - match l61 { 0 => None, 1 => { let e = { - let l62 = - *ptr1.add(20).cast::<*mut u8>(); + let l62 = *ptr1.add(20).cast::<*mut u8>(); let l63 = *ptr1.add(24).cast::(); let len64 = l63; let bytes64 = _rt::Vec::from_raw_parts( @@ -5456,7 +5318,6 @@ pub mod wasi { len64, len64, ); - _rt::string_lift(bytes64) }; Some(e) @@ -5467,7 +5328,6 @@ pub mod wasi { ErrorCode::InternalError(e65) } }; - v65 }; Err(e) @@ -5490,13 +5350,14 @@ pub mod wasi { #[link_name = "[method]future-incoming-response.subscribe"] fn wit_import(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) -> i32 { unreachable!() } let ret = wit_import((self).handle() as i32); - super::super::super::wasi::io::poll::Pollable::from_handle(ret as u32) + super::super::super::wasi::io::poll::Pollable::from_handle( + ret as u32, + ) } } } @@ -5516,11 +5377,15 @@ pub mod wasi { /// occured. Errors may also occur while consuming the response body, /// but those will be reported by the `incoming-body` and its /// `output-stream` child. - pub fn get(&self) -> Option, ()>> { + pub fn get( + &self, + ) -> Option, ()>> { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 56]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 56]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 56], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:http/types@0.2.0")] @@ -5528,7 +5393,6 @@ pub mod wasi { #[link_name = "[method]future-incoming-response.get"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -5540,515 +5404,460 @@ pub mod wasi { 1 => { let e = { let l2 = i32::from(*ptr0.add(8).cast::()); - match l2 { 0 => { let e = { let l3 = i32::from(*ptr0.add(16).cast::()); - match l3 { 0 => { let e = { let l4 = *ptr0.add(24).cast::(); - IncomingResponse::from_handle(l4 as u32) }; Ok(e) } 1 => { let e = { - let l5 = i32::from( - *ptr0.add(24).cast::(), - ); + let l5 = i32::from(*ptr0.add(24).cast::()); let v67 = match l5 { - 0 => { - ErrorCode::DnsTimeout - } - 1 => { - let e67 = { - let l6 = i32::from(*ptr0.add(32).cast::()); - let l10 = i32::from(*ptr0.add(44).cast::()); - - DnsErrorPayload{ - rcode: match l6 { - 0 => None, - 1 => { - let e = { - let l7 = *ptr0.add(36).cast::<*mut u8>(); - let l8 = *ptr0.add(40).cast::(); - let len9 = l8; - let bytes9 = _rt::Vec::from_raw_parts(l7.cast(), len9, len9); - - _rt::string_lift(bytes9) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - info_code: match l10 { - 0 => None, - 1 => { - let e = { - let l11 = i32::from(*ptr0.add(46).cast::()); - - l11 as u16 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } - }; - ErrorCode::DnsError(e67) - } - 2 => { - ErrorCode::DestinationNotFound - } - 3 => { - ErrorCode::DestinationUnavailable - } - 4 => { - ErrorCode::DestinationIpProhibited - } - 5 => { - ErrorCode::DestinationIpUnroutable - } - 6 => { - ErrorCode::ConnectionRefused - } - 7 => { - ErrorCode::ConnectionTerminated - } - 8 => { - ErrorCode::ConnectionTimeout - } - 9 => { - ErrorCode::ConnectionReadTimeout - } - 10 => { - ErrorCode::ConnectionWriteTimeout - } - 11 => { - ErrorCode::ConnectionLimitReached - } - 12 => { - ErrorCode::TlsProtocolError - } - 13 => { - ErrorCode::TlsCertificateError - } - 14 => { - let e67 = { - let l12 = i32::from(*ptr0.add(32).cast::()); - let l14 = i32::from(*ptr0.add(36).cast::()); - - TlsAlertReceivedPayload{ - alert_id: match l12 { - 0 => None, - 1 => { - let e = { - let l13 = i32::from(*ptr0.add(33).cast::()); - - l13 as u8 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - alert_message: match l14 { - 0 => None, - 1 => { - let e = { - let l15 = *ptr0.add(40).cast::<*mut u8>(); - let l16 = *ptr0.add(44).cast::(); - let len17 = l16; - let bytes17 = _rt::Vec::from_raw_parts(l15.cast(), len17, len17); - - _rt::string_lift(bytes17) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } - }; - ErrorCode::TlsAlertReceived(e67) - } - 15 => { - ErrorCode::HttpRequestDenied - } - 16 => { - ErrorCode::HttpRequestLengthRequired - } - 17 => { - let e67 = { - let l18 = i32::from(*ptr0.add(32).cast::()); - - match l18 { - 0 => None, - 1 => { - let e = { - let l19 = *ptr0.add(40).cast::(); - - l19 as u64 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpRequestBodySize(e67) - } - 18 => { - ErrorCode::HttpRequestMethodInvalid - } - 19 => { - ErrorCode::HttpRequestUriInvalid - } - 20 => { - ErrorCode::HttpRequestUriTooLong - } - 21 => { - let e67 = { - let l20 = i32::from(*ptr0.add(32).cast::()); - - match l20 { - 0 => None, - 1 => { - let e = { - let l21 = *ptr0.add(36).cast::(); - - l21 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpRequestHeaderSectionSize(e67) - } - 22 => { - let e67 = { - let l22 = i32::from(*ptr0.add(32).cast::()); - - match l22 { - 0 => None, - 1 => { - let e = { - let l23 = i32::from(*ptr0.add(36).cast::()); - let l27 = i32::from(*ptr0.add(48).cast::()); - - FieldSizePayload{ - field_name: match l23 { - 0 => None, - 1 => { - let e = { - let l24 = *ptr0.add(40).cast::<*mut u8>(); - let l25 = *ptr0.add(44).cast::(); - let len26 = l25; - let bytes26 = _rt::Vec::from_raw_parts(l24.cast(), len26, len26); - - _rt::string_lift(bytes26) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - field_size: match l27 { - 0 => None, - 1 => { - let e = { - let l28 = *ptr0.add(52).cast::(); - - l28 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpRequestHeaderSize(e67) - } - 23 => { - let e67 = { - let l29 = i32::from(*ptr0.add(32).cast::()); - - match l29 { - 0 => None, - 1 => { - let e = { - let l30 = *ptr0.add(36).cast::(); - - l30 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpRequestTrailerSectionSize(e67) - } - 24 => { - let e67 = { - let l31 = i32::from(*ptr0.add(32).cast::()); - let l35 = i32::from(*ptr0.add(44).cast::()); - - FieldSizePayload{ - field_name: match l31 { - 0 => None, - 1 => { - let e = { - let l32 = *ptr0.add(36).cast::<*mut u8>(); - let l33 = *ptr0.add(40).cast::(); - let len34 = l33; - let bytes34 = _rt::Vec::from_raw_parts(l32.cast(), len34, len34); - - _rt::string_lift(bytes34) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - field_size: match l35 { - 0 => None, - 1 => { - let e = { - let l36 = *ptr0.add(48).cast::(); - - l36 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } - }; - ErrorCode::HttpRequestTrailerSize(e67) - } - 25 => { - ErrorCode::HttpResponseIncomplete - } - 26 => { - let e67 = { - let l37 = i32::from(*ptr0.add(32).cast::()); - - match l37 { - 0 => None, - 1 => { - let e = { - let l38 = *ptr0.add(36).cast::(); - - l38 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpResponseHeaderSectionSize(e67) - } - 27 => { - let e67 = { - let l39 = i32::from(*ptr0.add(32).cast::()); - let l43 = i32::from(*ptr0.add(44).cast::()); - - FieldSizePayload{ - field_name: match l39 { - 0 => None, - 1 => { - let e = { - let l40 = *ptr0.add(36).cast::<*mut u8>(); - let l41 = *ptr0.add(40).cast::(); - let len42 = l41; - let bytes42 = _rt::Vec::from_raw_parts(l40.cast(), len42, len42); - - _rt::string_lift(bytes42) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - field_size: match l43 { - 0 => None, - 1 => { - let e = { - let l44 = *ptr0.add(48).cast::(); - - l44 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } - }; - ErrorCode::HttpResponseHeaderSize(e67) - } - 28 => { - let e67 = { - let l45 = i32::from(*ptr0.add(32).cast::()); - - match l45 { - 0 => None, - 1 => { - let e = { - let l46 = *ptr0.add(40).cast::(); - - l46 as u64 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpResponseBodySize(e67) - } - 29 => { - let e67 = { - let l47 = i32::from(*ptr0.add(32).cast::()); - - match l47 { - 0 => None, - 1 => { - let e = { - let l48 = *ptr0.add(36).cast::(); - - l48 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpResponseTrailerSectionSize(e67) - } - 30 => { - let e67 = { - let l49 = i32::from(*ptr0.add(32).cast::()); - let l53 = i32::from(*ptr0.add(44).cast::()); - - FieldSizePayload{ - field_name: match l49 { - 0 => None, - 1 => { - let e = { - let l50 = *ptr0.add(36).cast::<*mut u8>(); - let l51 = *ptr0.add(40).cast::(); - let len52 = l51; - let bytes52 = _rt::Vec::from_raw_parts(l50.cast(), len52, len52); - - _rt::string_lift(bytes52) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - field_size: match l53 { - 0 => None, - 1 => { - let e = { - let l54 = *ptr0.add(48).cast::(); - - l54 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } - }; - ErrorCode::HttpResponseTrailerSize(e67) - } - 31 => { - let e67 = { - let l55 = i32::from(*ptr0.add(32).cast::()); - - match l55 { - 0 => None, - 1 => { - let e = { - let l56 = *ptr0.add(36).cast::<*mut u8>(); - let l57 = *ptr0.add(40).cast::(); - let len58 = l57; - let bytes58 = _rt::Vec::from_raw_parts(l56.cast(), len58, len58); - - _rt::string_lift(bytes58) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpResponseTransferCoding(e67) - } - 32 => { - let e67 = { - let l59 = i32::from(*ptr0.add(32).cast::()); - - match l59 { - 0 => None, - 1 => { - let e = { - let l60 = *ptr0.add(36).cast::<*mut u8>(); - let l61 = *ptr0.add(40).cast::(); - let len62 = l61; - let bytes62 = _rt::Vec::from_raw_parts(l60.cast(), len62, len62); - - _rt::string_lift(bytes62) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::HttpResponseContentCoding(e67) - } - 33 => { - ErrorCode::HttpResponseTimeout - } - 34 => { - ErrorCode::HttpUpgradeFailed - } - 35 => { - ErrorCode::HttpProtocolError - } - 36 => { - ErrorCode::LoopDetected - } - 37 => { - ErrorCode::ConfigurationError - } - n => { - debug_assert_eq!(n, 38, "invalid enum discriminant"); - let e67 = { - let l63 = i32::from(*ptr0.add(32).cast::()); - - match l63 { - 0 => None, - 1 => { - let e = { - let l64 = *ptr0.add(36).cast::<*mut u8>(); - let l65 = *ptr0.add(40).cast::(); - let len66 = l65; - let bytes66 = _rt::Vec::from_raw_parts(l64.cast(), len66, len66); - - _rt::string_lift(bytes66) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - } - }; - ErrorCode::InternalError(e67) - } - }; - + 0 => ErrorCode::DnsTimeout, + 1 => { + let e67 = { + let l6 = i32::from(*ptr0.add(32).cast::()); + let l10 = i32::from(*ptr0.add(44).cast::()); + DnsErrorPayload { + rcode: match l6 { + 0 => None, + 1 => { + let e = { + let l7 = *ptr0.add(36).cast::<*mut u8>(); + let l8 = *ptr0.add(40).cast::(); + let len9 = l8; + let bytes9 = _rt::Vec::from_raw_parts( + l7.cast(), + len9, + len9, + ); + _rt::string_lift(bytes9) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + info_code: match l10 { + 0 => None, + 1 => { + let e = { + let l11 = i32::from(*ptr0.add(46).cast::()); + l11 as u16 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } + }; + ErrorCode::DnsError(e67) + } + 2 => ErrorCode::DestinationNotFound, + 3 => ErrorCode::DestinationUnavailable, + 4 => ErrorCode::DestinationIpProhibited, + 5 => ErrorCode::DestinationIpUnroutable, + 6 => ErrorCode::ConnectionRefused, + 7 => ErrorCode::ConnectionTerminated, + 8 => ErrorCode::ConnectionTimeout, + 9 => ErrorCode::ConnectionReadTimeout, + 10 => ErrorCode::ConnectionWriteTimeout, + 11 => ErrorCode::ConnectionLimitReached, + 12 => ErrorCode::TlsProtocolError, + 13 => ErrorCode::TlsCertificateError, + 14 => { + let e67 = { + let l12 = i32::from(*ptr0.add(32).cast::()); + let l14 = i32::from(*ptr0.add(36).cast::()); + TlsAlertReceivedPayload { + alert_id: match l12 { + 0 => None, + 1 => { + let e = { + let l13 = i32::from(*ptr0.add(33).cast::()); + l13 as u8 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + alert_message: match l14 { + 0 => None, + 1 => { + let e = { + let l15 = *ptr0.add(40).cast::<*mut u8>(); + let l16 = *ptr0.add(44).cast::(); + let len17 = l16; + let bytes17 = _rt::Vec::from_raw_parts( + l15.cast(), + len17, + len17, + ); + _rt::string_lift(bytes17) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } + }; + ErrorCode::TlsAlertReceived(e67) + } + 15 => ErrorCode::HttpRequestDenied, + 16 => ErrorCode::HttpRequestLengthRequired, + 17 => { + let e67 = { + let l18 = i32::from(*ptr0.add(32).cast::()); + match l18 { + 0 => None, + 1 => { + let e = { + let l19 = *ptr0.add(40).cast::(); + l19 as u64 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpRequestBodySize(e67) + } + 18 => ErrorCode::HttpRequestMethodInvalid, + 19 => ErrorCode::HttpRequestUriInvalid, + 20 => ErrorCode::HttpRequestUriTooLong, + 21 => { + let e67 = { + let l20 = i32::from(*ptr0.add(32).cast::()); + match l20 { + 0 => None, + 1 => { + let e = { + let l21 = *ptr0.add(36).cast::(); + l21 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpRequestHeaderSectionSize(e67) + } + 22 => { + let e67 = { + let l22 = i32::from(*ptr0.add(32).cast::()); + match l22 { + 0 => None, + 1 => { + let e = { + let l23 = i32::from(*ptr0.add(36).cast::()); + let l27 = i32::from(*ptr0.add(48).cast::()); + FieldSizePayload { + field_name: match l23 { + 0 => None, + 1 => { + let e = { + let l24 = *ptr0.add(40).cast::<*mut u8>(); + let l25 = *ptr0.add(44).cast::(); + let len26 = l25; + let bytes26 = _rt::Vec::from_raw_parts( + l24.cast(), + len26, + len26, + ); + _rt::string_lift(bytes26) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + field_size: match l27 { + 0 => None, + 1 => { + let e = { + let l28 = *ptr0.add(52).cast::(); + l28 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpRequestHeaderSize(e67) + } + 23 => { + let e67 = { + let l29 = i32::from(*ptr0.add(32).cast::()); + match l29 { + 0 => None, + 1 => { + let e = { + let l30 = *ptr0.add(36).cast::(); + l30 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpRequestTrailerSectionSize(e67) + } + 24 => { + let e67 = { + let l31 = i32::from(*ptr0.add(32).cast::()); + let l35 = i32::from(*ptr0.add(44).cast::()); + FieldSizePayload { + field_name: match l31 { + 0 => None, + 1 => { + let e = { + let l32 = *ptr0.add(36).cast::<*mut u8>(); + let l33 = *ptr0.add(40).cast::(); + let len34 = l33; + let bytes34 = _rt::Vec::from_raw_parts( + l32.cast(), + len34, + len34, + ); + _rt::string_lift(bytes34) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + field_size: match l35 { + 0 => None, + 1 => { + let e = { + let l36 = *ptr0.add(48).cast::(); + l36 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } + }; + ErrorCode::HttpRequestTrailerSize(e67) + } + 25 => ErrorCode::HttpResponseIncomplete, + 26 => { + let e67 = { + let l37 = i32::from(*ptr0.add(32).cast::()); + match l37 { + 0 => None, + 1 => { + let e = { + let l38 = *ptr0.add(36).cast::(); + l38 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpResponseHeaderSectionSize(e67) + } + 27 => { + let e67 = { + let l39 = i32::from(*ptr0.add(32).cast::()); + let l43 = i32::from(*ptr0.add(44).cast::()); + FieldSizePayload { + field_name: match l39 { + 0 => None, + 1 => { + let e = { + let l40 = *ptr0.add(36).cast::<*mut u8>(); + let l41 = *ptr0.add(40).cast::(); + let len42 = l41; + let bytes42 = _rt::Vec::from_raw_parts( + l40.cast(), + len42, + len42, + ); + _rt::string_lift(bytes42) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + field_size: match l43 { + 0 => None, + 1 => { + let e = { + let l44 = *ptr0.add(48).cast::(); + l44 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } + }; + ErrorCode::HttpResponseHeaderSize(e67) + } + 28 => { + let e67 = { + let l45 = i32::from(*ptr0.add(32).cast::()); + match l45 { + 0 => None, + 1 => { + let e = { + let l46 = *ptr0.add(40).cast::(); + l46 as u64 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpResponseBodySize(e67) + } + 29 => { + let e67 = { + let l47 = i32::from(*ptr0.add(32).cast::()); + match l47 { + 0 => None, + 1 => { + let e = { + let l48 = *ptr0.add(36).cast::(); + l48 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpResponseTrailerSectionSize(e67) + } + 30 => { + let e67 = { + let l49 = i32::from(*ptr0.add(32).cast::()); + let l53 = i32::from(*ptr0.add(44).cast::()); + FieldSizePayload { + field_name: match l49 { + 0 => None, + 1 => { + let e = { + let l50 = *ptr0.add(36).cast::<*mut u8>(); + let l51 = *ptr0.add(40).cast::(); + let len52 = l51; + let bytes52 = _rt::Vec::from_raw_parts( + l50.cast(), + len52, + len52, + ); + _rt::string_lift(bytes52) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + field_size: match l53 { + 0 => None, + 1 => { + let e = { + let l54 = *ptr0.add(48).cast::(); + l54 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } + }; + ErrorCode::HttpResponseTrailerSize(e67) + } + 31 => { + let e67 = { + let l55 = i32::from(*ptr0.add(32).cast::()); + match l55 { + 0 => None, + 1 => { + let e = { + let l56 = *ptr0.add(36).cast::<*mut u8>(); + let l57 = *ptr0.add(40).cast::(); + let len58 = l57; + let bytes58 = _rt::Vec::from_raw_parts( + l56.cast(), + len58, + len58, + ); + _rt::string_lift(bytes58) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpResponseTransferCoding(e67) + } + 32 => { + let e67 = { + let l59 = i32::from(*ptr0.add(32).cast::()); + match l59 { + 0 => None, + 1 => { + let e = { + let l60 = *ptr0.add(36).cast::<*mut u8>(); + let l61 = *ptr0.add(40).cast::(); + let len62 = l61; + let bytes62 = _rt::Vec::from_raw_parts( + l60.cast(), + len62, + len62, + ); + _rt::string_lift(bytes62) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::HttpResponseContentCoding(e67) + } + 33 => ErrorCode::HttpResponseTimeout, + 34 => ErrorCode::HttpUpgradeFailed, + 35 => ErrorCode::HttpProtocolError, + 36 => ErrorCode::LoopDetected, + 37 => ErrorCode::ConfigurationError, + n => { + debug_assert_eq!(n, 38, "invalid enum discriminant"); + let e67 = { + let l63 = i32::from(*ptr0.add(32).cast::()); + match l63 { + 0 => None, + 1 => { + let e = { + let l64 = *ptr0.add(36).cast::<*mut u8>(); + let l65 = *ptr0.add(40).cast::(); + let len66 = l65; + let bytes66 = _rt::Vec::from_raw_parts( + l64.cast(), + len66, + len66, + ); + _rt::string_lift(bytes66) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + } + }; + ErrorCode::InternalError(e67) + } + }; v67 }; Err(e) @@ -6073,19 +5882,15 @@ pub mod wasi { } } } - #[allow(dead_code, clippy::all)] pub mod outgoing_handler { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::__link_custom_section_describing_imports; use super::super::super::_rt; pub type OutgoingRequest = super::super::super::wasi::http::types::OutgoingRequest; pub type RequestOptions = super::super::super::wasi::http::types::RequestOptions; - pub type FutureIncomingResponse = - super::super::super::wasi::http::types::FutureIncomingResponse; + pub type FutureIncomingResponse = super::super::super::wasi::http::types::FutureIncomingResponse; pub type ErrorCode = super::super::super::wasi::http::types::ErrorCode; #[allow(unused_unsafe, clippy::all)] /// This function is invoked with an outgoing HTTP Request, and it returns @@ -6117,19 +5922,24 @@ pub mod wasi { #[link_name = "handle"] fn wit_import(_: i32, _: i32, _: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i32, _: i32, _: *mut u8) { unreachable!() } - wit_import((&request).take_handle() as i32, result0_0, result0_1, ptr1); + wit_import( + (&request).take_handle() as i32, + result0_0, + result0_1, + ptr1, + ); let l2 = i32::from(*ptr1.add(0).cast::()); match l2 { 0 => { let e = { let l3 = *ptr1.add(8).cast::(); - - super::super::super::wasi::http::types::FutureIncomingResponse::from_handle(l3 as u32) + super::super::super::wasi::http::types::FutureIncomingResponse::from_handle( + l3 as u32, + ) }; Ok(e) } @@ -6143,36 +5953,37 @@ pub mod wasi { let e66 = { let l5 = i32::from(*ptr1.add(16).cast::()); let l9 = i32::from(*ptr1.add(28).cast::()); - - super::super::super::wasi::http::types::DnsErrorPayload{ - rcode: match l5 { - 0 => None, - 1 => { - let e = { - let l6 = *ptr1.add(20).cast::<*mut u8>(); - let l7 = *ptr1.add(24).cast::(); - let len8 = l7; - let bytes8 = _rt::Vec::from_raw_parts(l6.cast(), len8, len8); - - _rt::string_lift(bytes8) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - info_code: match l9 { - 0 => None, - 1 => { - let e = { - let l10 = i32::from(*ptr1.add(30).cast::()); - - l10 as u16 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } + super::super::super::wasi::http::types::DnsErrorPayload { + rcode: match l5 { + 0 => None, + 1 => { + let e = { + let l6 = *ptr1.add(20).cast::<*mut u8>(); + let l7 = *ptr1.add(24).cast::(); + let len8 = l7; + let bytes8 = _rt::Vec::from_raw_parts( + l6.cast(), + len8, + len8, + ); + _rt::string_lift(bytes8) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + info_code: match l9 { + 0 => None, + 1 => { + let e = { + let l10 = i32::from(*ptr1.add(30).cast::()); + l10 as u16 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } }; V66::DnsError(e66) } @@ -6192,36 +6003,37 @@ pub mod wasi { let e66 = { let l11 = i32::from(*ptr1.add(16).cast::()); let l13 = i32::from(*ptr1.add(20).cast::()); - - super::super::super::wasi::http::types::TlsAlertReceivedPayload{ - alert_id: match l11 { - 0 => None, - 1 => { - let e = { - let l12 = i32::from(*ptr1.add(17).cast::()); - - l12 as u8 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - alert_message: match l13 { - 0 => None, - 1 => { - let e = { - let l14 = *ptr1.add(24).cast::<*mut u8>(); - let l15 = *ptr1.add(28).cast::(); - let len16 = l15; - let bytes16 = _rt::Vec::from_raw_parts(l14.cast(), len16, len16); - - _rt::string_lift(bytes16) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } + super::super::super::wasi::http::types::TlsAlertReceivedPayload { + alert_id: match l11 { + 0 => None, + 1 => { + let e = { + let l12 = i32::from(*ptr1.add(17).cast::()); + l12 as u8 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + alert_message: match l13 { + 0 => None, + 1 => { + let e = { + let l14 = *ptr1.add(24).cast::<*mut u8>(); + let l15 = *ptr1.add(28).cast::(); + let len16 = l15; + let bytes16 = _rt::Vec::from_raw_parts( + l14.cast(), + len16, + len16, + ); + _rt::string_lift(bytes16) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } }; V66::TlsAlertReceived(e66) } @@ -6230,13 +6042,11 @@ pub mod wasi { 17 => { let e66 = { let l17 = i32::from(*ptr1.add(16).cast::()); - match l17 { 0 => None, 1 => { let e = { let l18 = *ptr1.add(24).cast::(); - l18 as u64 }; Some(e) @@ -6252,13 +6062,11 @@ pub mod wasi { 21 => { let e66 = { let l19 = i32::from(*ptr1.add(16).cast::()); - match l19 { 0 => None, 1 => { let e = { let l20 = *ptr1.add(20).cast::(); - l20 as u32 }; Some(e) @@ -6271,45 +6079,43 @@ pub mod wasi { 22 => { let e66 = { let l21 = i32::from(*ptr1.add(16).cast::()); - match l21 { 0 => None, 1 => { let e = { - let l22 = - i32::from(*ptr1.add(20).cast::()); - let l26 = - i32::from(*ptr1.add(32).cast::()); - - super::super::super::wasi::http::types::FieldSizePayload{ - field_name: match l22 { - 0 => None, - 1 => { - let e = { - let l23 = *ptr1.add(24).cast::<*mut u8>(); - let l24 = *ptr1.add(28).cast::(); - let len25 = l24; - let bytes25 = _rt::Vec::from_raw_parts(l23.cast(), len25, len25); - - _rt::string_lift(bytes25) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - field_size: match l26 { - 0 => None, - 1 => { - let e = { - let l27 = *ptr1.add(36).cast::(); - - l27 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } + let l22 = i32::from(*ptr1.add(20).cast::()); + let l26 = i32::from(*ptr1.add(32).cast::()); + super::super::super::wasi::http::types::FieldSizePayload { + field_name: match l22 { + 0 => None, + 1 => { + let e = { + let l23 = *ptr1.add(24).cast::<*mut u8>(); + let l24 = *ptr1.add(28).cast::(); + let len25 = l24; + let bytes25 = _rt::Vec::from_raw_parts( + l23.cast(), + len25, + len25, + ); + _rt::string_lift(bytes25) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + field_size: match l26 { + 0 => None, + 1 => { + let e = { + let l27 = *ptr1.add(36).cast::(); + l27 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } }; Some(e) } @@ -6321,13 +6127,11 @@ pub mod wasi { 23 => { let e66 = { let l28 = i32::from(*ptr1.add(16).cast::()); - match l28 { 0 => None, 1 => { let e = { let l29 = *ptr1.add(20).cast::(); - l29 as u32 }; Some(e) @@ -6341,36 +6145,37 @@ pub mod wasi { let e66 = { let l30 = i32::from(*ptr1.add(16).cast::()); let l34 = i32::from(*ptr1.add(28).cast::()); - - super::super::super::wasi::http::types::FieldSizePayload{ - field_name: match l30 { - 0 => None, - 1 => { - let e = { - let l31 = *ptr1.add(20).cast::<*mut u8>(); - let l32 = *ptr1.add(24).cast::(); - let len33 = l32; - let bytes33 = _rt::Vec::from_raw_parts(l31.cast(), len33, len33); - - _rt::string_lift(bytes33) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - field_size: match l34 { - 0 => None, - 1 => { - let e = { - let l35 = *ptr1.add(32).cast::(); - - l35 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } + super::super::super::wasi::http::types::FieldSizePayload { + field_name: match l30 { + 0 => None, + 1 => { + let e = { + let l31 = *ptr1.add(20).cast::<*mut u8>(); + let l32 = *ptr1.add(24).cast::(); + let len33 = l32; + let bytes33 = _rt::Vec::from_raw_parts( + l31.cast(), + len33, + len33, + ); + _rt::string_lift(bytes33) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + field_size: match l34 { + 0 => None, + 1 => { + let e = { + let l35 = *ptr1.add(32).cast::(); + l35 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } }; V66::HttpRequestTrailerSize(e66) } @@ -6378,13 +6183,11 @@ pub mod wasi { 26 => { let e66 = { let l36 = i32::from(*ptr1.add(16).cast::()); - match l36 { 0 => None, 1 => { let e = { let l37 = *ptr1.add(20).cast::(); - l37 as u32 }; Some(e) @@ -6398,49 +6201,48 @@ pub mod wasi { let e66 = { let l38 = i32::from(*ptr1.add(16).cast::()); let l42 = i32::from(*ptr1.add(28).cast::()); - - super::super::super::wasi::http::types::FieldSizePayload{ - field_name: match l38 { - 0 => None, - 1 => { - let e = { - let l39 = *ptr1.add(20).cast::<*mut u8>(); - let l40 = *ptr1.add(24).cast::(); - let len41 = l40; - let bytes41 = _rt::Vec::from_raw_parts(l39.cast(), len41, len41); - - _rt::string_lift(bytes41) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - field_size: match l42 { - 0 => None, - 1 => { - let e = { - let l43 = *ptr1.add(32).cast::(); - - l43 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } + super::super::super::wasi::http::types::FieldSizePayload { + field_name: match l38 { + 0 => None, + 1 => { + let e = { + let l39 = *ptr1.add(20).cast::<*mut u8>(); + let l40 = *ptr1.add(24).cast::(); + let len41 = l40; + let bytes41 = _rt::Vec::from_raw_parts( + l39.cast(), + len41, + len41, + ); + _rt::string_lift(bytes41) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + field_size: match l42 { + 0 => None, + 1 => { + let e = { + let l43 = *ptr1.add(32).cast::(); + l43 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } }; V66::HttpResponseHeaderSize(e66) } 28 => { let e66 = { let l44 = i32::from(*ptr1.add(16).cast::()); - match l44 { 0 => None, 1 => { let e = { let l45 = *ptr1.add(24).cast::(); - l45 as u64 }; Some(e) @@ -6453,13 +6255,11 @@ pub mod wasi { 29 => { let e66 = { let l46 = i32::from(*ptr1.add(16).cast::()); - match l46 { 0 => None, 1 => { let e = { let l47 = *ptr1.add(20).cast::(); - l47 as u32 }; Some(e) @@ -6473,43 +6273,43 @@ pub mod wasi { let e66 = { let l48 = i32::from(*ptr1.add(16).cast::()); let l52 = i32::from(*ptr1.add(28).cast::()); - - super::super::super::wasi::http::types::FieldSizePayload{ - field_name: match l48 { - 0 => None, - 1 => { - let e = { - let l49 = *ptr1.add(20).cast::<*mut u8>(); - let l50 = *ptr1.add(24).cast::(); - let len51 = l50; - let bytes51 = _rt::Vec::from_raw_parts(l49.cast(), len51, len51); - - _rt::string_lift(bytes51) - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - field_size: match l52 { - 0 => None, - 1 => { - let e = { - let l53 = *ptr1.add(32).cast::(); - - l53 as u32 - }; - Some(e) - } - _ => _rt::invalid_enum_discriminant(), - }, - } + super::super::super::wasi::http::types::FieldSizePayload { + field_name: match l48 { + 0 => None, + 1 => { + let e = { + let l49 = *ptr1.add(20).cast::<*mut u8>(); + let l50 = *ptr1.add(24).cast::(); + let len51 = l50; + let bytes51 = _rt::Vec::from_raw_parts( + l49.cast(), + len51, + len51, + ); + _rt::string_lift(bytes51) + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + field_size: match l52 { + 0 => None, + 1 => { + let e = { + let l53 = *ptr1.add(32).cast::(); + l53 as u32 + }; + Some(e) + } + _ => _rt::invalid_enum_discriminant(), + }, + } }; V66::HttpResponseTrailerSize(e66) } 31 => { let e66 = { let l54 = i32::from(*ptr1.add(16).cast::()); - match l54 { 0 => None, 1 => { @@ -6522,7 +6322,6 @@ pub mod wasi { len57, len57, ); - _rt::string_lift(bytes57) }; Some(e) @@ -6535,7 +6334,6 @@ pub mod wasi { 32 => { let e66 = { let l58 = i32::from(*ptr1.add(16).cast::()); - match l58 { 0 => None, 1 => { @@ -6548,7 +6346,6 @@ pub mod wasi { len61, len61, ); - _rt::string_lift(bytes61) }; Some(e) @@ -6567,7 +6364,6 @@ pub mod wasi { debug_assert_eq!(n, 38, "invalid enum discriminant"); let e66 = { let l62 = i32::from(*ptr1.add(16).cast::()); - match l62 { 0 => None, 1 => { @@ -6580,7 +6376,6 @@ pub mod wasi { len65, len65, ); - _rt::string_lift(bytes65) }; Some(e) @@ -6591,35 +6386,129 @@ pub mod wasi { V66::InternalError(e66) } }; - v66 }; Err(e) } - _ => _rt::invalid_enum_discriminant(), + _ => _rt::invalid_enum_discriminant(), + } + } + } + } + } + #[allow(dead_code)] + pub mod io { + #[allow(dead_code, clippy::all)] + pub mod error { + #[used] + #[doc(hidden)] + static __FORCE_SECTION_REF: fn() = super::super::super::__link_custom_section_describing_imports; + use super::super::super::_rt; + /// A resource which represents some error information. + /// + /// The only method provided by this resource is `to-debug-string`, + /// which provides some human-readable information about the error. + /// + /// In the `wasi:io` package, this resource is returned through the + /// `wasi:io/streams/stream-error` type. + /// + /// To provide more specific error information, other interfaces may + /// provide functions to further "downcast" this error into more specific + /// error information. For example, `error`s returned in streams derived + /// from filesystem types to be described using the filesystem's own + /// error-code type, using the function + /// `wasi:filesystem/types/filesystem-error-code`, which takes a parameter + /// `borrow` and returns + /// `option`. + /// + /// The set of functions which can "downcast" an `error` into a more + /// concrete type is open. + #[derive(Debug)] + #[repr(transparent)] + pub struct Error { + handle: _rt::Resource, + } + impl Error { + #[doc(hidden)] + pub unsafe fn from_handle(handle: u32) -> Self { + Self { + handle: _rt::Resource::from_handle(handle), + } + } + #[doc(hidden)] + pub fn take_handle(&self) -> u32 { + _rt::Resource::take_handle(&self.handle) + } + #[doc(hidden)] + pub fn handle(&self) -> u32 { + _rt::Resource::handle(&self.handle) + } + } + unsafe impl _rt::WasmResource for Error { + #[inline] + unsafe fn drop(_handle: u32) { + #[cfg(not(target_arch = "wasm32"))] + unreachable!(); + #[cfg(target_arch = "wasm32")] + { + #[link(wasm_import_module = "wasi:io/error@0.2.0")] + extern "C" { + #[link_name = "[resource-drop]error"] + fn drop(_: u32); + } + drop(_handle); + } + } + } + impl Error { + #[allow(unused_unsafe, clippy::all)] + /// Returns a string that is suitable to assist humans in debugging + /// this error. + /// + /// WARNING: The returned string should not be consumed mechanically! + /// It may change across platforms, hosts, or other implementation + /// details. Parsing this string is a major platform-compatibility + /// hazard. + pub fn to_debug_string(&self) -> _rt::String { + unsafe { + #[repr(align(4))] + struct RetArea([::core::mem::MaybeUninit; 8]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 8], + ); + let ptr0 = ret_area.0.as_mut_ptr().cast::(); + #[cfg(target_arch = "wasm32")] + #[link(wasm_import_module = "wasi:io/error@0.2.0")] + extern "C" { + #[link_name = "[method]error.to-debug-string"] + fn wit_import(_: i32, _: *mut u8); + } + #[cfg(not(target_arch = "wasm32"))] + fn wit_import(_: i32, _: *mut u8) { + unreachable!() + } + wit_import((self).handle() as i32, ptr0); + let l1 = *ptr0.add(0).cast::<*mut u8>(); + let l2 = *ptr0.add(4).cast::(); + let len3 = l2; + let bytes3 = _rt::Vec::from_raw_parts(l1.cast(), len3, len3); + _rt::string_lift(bytes3) } } } } - } - #[allow(dead_code)] - pub mod io { #[allow(dead_code, clippy::all)] pub mod poll { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::__link_custom_section_describing_imports; use super::super::super::_rt; /// `pollable` epresents a single I/O event which may be ready, or not. - #[derive(Debug)] #[repr(transparent)] pub struct Pollable { handle: _rt::Resource, } - impl Pollable { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { @@ -6627,24 +6516,20 @@ pub mod wasi { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for Pollable { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:io/poll@0.2.0")] @@ -6652,12 +6537,10 @@ pub mod wasi { #[link_name = "[resource-drop]pollable"] fn drop(_: u32); } - drop(_handle); } } } - impl Pollable { #[allow(unused_unsafe, clippy::all)] /// Return the readiness of a pollable. This function never blocks. @@ -6671,7 +6554,6 @@ pub mod wasi { #[link_name = "[method]pollable.ready"] fn wit_import(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) -> i32 { unreachable!() @@ -6696,7 +6578,6 @@ pub mod wasi { #[link_name = "[method]pollable.block"] fn wit_import(_: i32); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) { unreachable!() @@ -6731,7 +6612,10 @@ pub mod wasi { let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); let vec0 = in_; let len0 = vec0.len(); - let layout0 = _rt::alloc::Layout::from_size_align_unchecked(vec0.len() * 4, 4); + let layout0 = _rt::alloc::Layout::from_size_align_unchecked( + vec0.len() * 4, + 4, + ); let result0 = if layout0.size() != 0 { let ptr = _rt::alloc::alloc(layout0).cast::(); if ptr.is_null() { @@ -6739,9 +6623,7 @@ pub mod wasi { } ptr } else { - { - ::core::ptr::null_mut() - } + ::core::ptr::null_mut() }; for (i, e) in vec0.into_iter().enumerate() { let base = result0.add(i * 4); @@ -6756,7 +6638,6 @@ pub mod wasi { #[link_name = "poll"] fn wit_import(_: *mut u8, _: usize, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8, _: usize, _: *mut u8) { unreachable!() @@ -6772,123 +6653,11 @@ pub mod wasi { } } } - - #[allow(dead_code, clippy::all)] - pub mod error { - #[used] - #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::__link_custom_section_describing_imports; - use super::super::super::_rt; - /// A resource which represents some error information. - /// - /// The only method provided by this resource is `to-debug-string`, - /// which provides some human-readable information about the error. - /// - /// In the `wasi:io` package, this resource is returned through the - /// `wasi:io/streams/stream-error` type. - /// - /// To provide more specific error information, other interfaces may - /// provide functions to further "downcast" this error into more specific - /// error information. For example, `error`s returned in streams derived - /// from filesystem types to be described using the filesystem's own - /// error-code type, using the function - /// `wasi:filesystem/types/filesystem-error-code`, which takes a parameter - /// `borrow` and returns - /// `option`. - /// - /// The set of functions which can "downcast" an `error` into a more - /// concrete type is open. - - #[derive(Debug)] - #[repr(transparent)] - pub struct Error { - handle: _rt::Resource, - } - - impl Error { - #[doc(hidden)] - pub unsafe fn from_handle(handle: u32) -> Self { - Self { - handle: _rt::Resource::from_handle(handle), - } - } - - #[doc(hidden)] - pub fn take_handle(&self) -> u32 { - _rt::Resource::take_handle(&self.handle) - } - - #[doc(hidden)] - pub fn handle(&self) -> u32 { - _rt::Resource::handle(&self.handle) - } - } - - unsafe impl _rt::WasmResource for Error { - #[inline] - unsafe fn drop(_handle: u32) { - #[cfg(not(target_arch = "wasm32"))] - unreachable!(); - - #[cfg(target_arch = "wasm32")] - { - #[link(wasm_import_module = "wasi:io/error@0.2.0")] - extern "C" { - #[link_name = "[resource-drop]error"] - fn drop(_: u32); - } - - drop(_handle); - } - } - } - - impl Error { - #[allow(unused_unsafe, clippy::all)] - /// Returns a string that is suitable to assist humans in debugging - /// this error. - /// - /// WARNING: The returned string should not be consumed mechanically! - /// It may change across platforms, hosts, or other implementation - /// details. Parsing this string is a major platform-compatibility - /// hazard. - pub fn to_debug_string(&self) -> _rt::String { - unsafe { - #[repr(align(4))] - struct RetArea([::core::mem::MaybeUninit; 8]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); - let ptr0 = ret_area.0.as_mut_ptr().cast::(); - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "wasi:io/error@0.2.0")] - extern "C" { - #[link_name = "[method]error.to-debug-string"] - fn wit_import(_: i32, _: *mut u8); - } - - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: *mut u8) { - unreachable!() - } - wit_import((self).handle() as i32, ptr0); - let l1 = *ptr0.add(0).cast::<*mut u8>(); - let l2 = *ptr0.add(4).cast::(); - let len3 = l2; - let bytes3 = _rt::Vec::from_raw_parts(l1.cast(), len3, len3); - _rt::string_lift(bytes3) - } - } - } - } - #[allow(dead_code, clippy::all)] pub mod streams { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::__link_custom_section_describing_imports; use super::super::super::_rt; pub type Error = super::super::super::wasi::io::error::Error; pub type Pollable = super::super::super::wasi::io::poll::Pollable; @@ -6904,22 +6673,30 @@ pub mod wasi { Closed, } impl ::core::fmt::Debug for StreamError { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { - StreamError::LastOperationFailed(e) => f - .debug_tuple("StreamError::LastOperationFailed") - .field(e) - .finish(), - StreamError::Closed => f.debug_tuple("StreamError::Closed").finish(), + StreamError::LastOperationFailed(e) => { + f.debug_tuple("StreamError::LastOperationFailed") + .field(e) + .finish() + } + StreamError::Closed => { + f.debug_tuple("StreamError::Closed").finish() + } } } } impl ::core::fmt::Display for StreamError { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { write!(f, "{:?}", self) } } - impl std::error::Error for StreamError {} /// An input bytestream. /// @@ -6929,13 +6706,11 @@ pub mod wasi { /// available, which could even be zero. To wait for data to be available, /// use the `subscribe` function to obtain a `pollable` which can be polled /// for using `wasi:io/poll`. - #[derive(Debug)] #[repr(transparent)] pub struct InputStream { handle: _rt::Resource, } - impl InputStream { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { @@ -6943,24 +6718,20 @@ pub mod wasi { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for InputStream { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:io/streams@0.2.0")] @@ -6968,12 +6739,10 @@ pub mod wasi { #[link_name = "[resource-drop]input-stream"] fn drop(_: u32); } - drop(_handle); } } } - /// An output bytestream. /// /// `output-stream`s are *non-blocking* to the extent practical on @@ -6982,13 +6751,11 @@ pub mod wasi { /// promptly, which could even be zero. To wait for the stream to be ready to /// accept data, the `subscribe` function to obtain a `pollable` which can be /// polled for using `wasi:io/poll`. - #[derive(Debug)] #[repr(transparent)] pub struct OutputStream { handle: _rt::Resource, } - impl OutputStream { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { @@ -6996,24 +6763,20 @@ pub mod wasi { handle: _rt::Resource::from_handle(handle), } } - #[doc(hidden)] pub fn take_handle(&self) -> u32 { _rt::Resource::take_handle(&self.handle) } - #[doc(hidden)] pub fn handle(&self) -> u32 { _rt::Resource::handle(&self.handle) } } - unsafe impl _rt::WasmResource for OutputStream { #[inline] unsafe fn drop(_handle: u32) { #[cfg(not(target_arch = "wasm32"))] unreachable!(); - #[cfg(target_arch = "wasm32")] { #[link(wasm_import_module = "wasi:io/streams@0.2.0")] @@ -7021,12 +6784,10 @@ pub mod wasi { #[link_name = "[resource-drop]output-stream"] fn drop(_: u32); } - drop(_handle); } } } - impl InputStream { #[allow(unused_unsafe, clippy::all)] /// Perform a non-blocking read from the stream. @@ -7054,7 +6815,9 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 12], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] @@ -7062,7 +6825,6 @@ pub mod wasi { #[link_name = "[method]input-stream.read"] fn wit_import(_: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i64, _: *mut u8) { unreachable!() @@ -7075,7 +6837,6 @@ pub mod wasi { let l2 = *ptr0.add(4).cast::<*mut u8>(); let l3 = *ptr0.add(8).cast::(); let len4 = l3; - _rt::Vec::from_raw_parts(l2.cast(), len4, len4) }; Ok(e) @@ -7087,8 +6848,9 @@ pub mod wasi { 0 => { let e7 = { let l6 = *ptr0.add(8).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l6 as u32) + super::super::super::wasi::io::error::Error::from_handle( + l6 as u32, + ) }; StreamError::LastOperationFailed(e7) } @@ -7097,7 +6859,6 @@ pub mod wasi { StreamError::Closed } }; - v7 }; Err(e) @@ -7111,11 +6872,16 @@ pub mod wasi { #[allow(unused_unsafe, clippy::all)] /// Read bytes from a stream, after blocking until at least one byte can /// be read. Except for blocking, behavior is identical to `read`. - pub fn blocking_read(&self, len: u64) -> Result<_rt::Vec, StreamError> { + pub fn blocking_read( + &self, + len: u64, + ) -> Result<_rt::Vec, StreamError> { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 12], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] @@ -7123,7 +6889,6 @@ pub mod wasi { #[link_name = "[method]input-stream.blocking-read"] fn wit_import(_: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i64, _: *mut u8) { unreachable!() @@ -7136,7 +6901,6 @@ pub mod wasi { let l2 = *ptr0.add(4).cast::<*mut u8>(); let l3 = *ptr0.add(8).cast::(); let len4 = l3; - _rt::Vec::from_raw_parts(l2.cast(), len4, len4) }; Ok(e) @@ -7148,8 +6912,9 @@ pub mod wasi { 0 => { let e7 = { let l6 = *ptr0.add(8).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l6 as u32) + super::super::super::wasi::io::error::Error::from_handle( + l6 as u32, + ) }; StreamError::LastOperationFailed(e7) } @@ -7158,7 +6923,6 @@ pub mod wasi { StreamError::Closed } }; - v7 }; Err(e) @@ -7178,7 +6942,9 @@ pub mod wasi { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 16]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 16]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 16], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] @@ -7186,7 +6952,6 @@ pub mod wasi { #[link_name = "[method]input-stream.skip"] fn wit_import(_: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i64, _: *mut u8) { unreachable!() @@ -7197,7 +6962,6 @@ pub mod wasi { 0 => { let e = { let l2 = *ptr0.add(8).cast::(); - l2 as u64 }; Ok(e) @@ -7209,8 +6973,9 @@ pub mod wasi { 0 => { let e5 = { let l4 = *ptr0.add(12).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l4 as u32) + super::super::super::wasi::io::error::Error::from_handle( + l4 as u32, + ) }; StreamError::LastOperationFailed(e5) } @@ -7219,7 +6984,6 @@ pub mod wasi { StreamError::Closed } }; - v5 }; Err(e) @@ -7237,7 +7001,9 @@ pub mod wasi { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 16]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 16]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 16], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] @@ -7245,7 +7011,6 @@ pub mod wasi { #[link_name = "[method]input-stream.blocking-skip"] fn wit_import(_: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i64, _: *mut u8) { unreachable!() @@ -7256,7 +7021,6 @@ pub mod wasi { 0 => { let e = { let l2 = *ptr0.add(8).cast::(); - l2 as u64 }; Ok(e) @@ -7268,8 +7032,9 @@ pub mod wasi { 0 => { let e5 = { let l4 = *ptr0.add(12).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l4 as u32) + super::super::super::wasi::io::error::Error::from_handle( + l4 as u32, + ) }; StreamError::LastOperationFailed(e5) } @@ -7278,7 +7043,6 @@ pub mod wasi { StreamError::Closed } }; - v5 }; Err(e) @@ -7304,13 +7068,14 @@ pub mod wasi { #[link_name = "[method]input-stream.subscribe"] fn wit_import(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) -> i32 { unreachable!() } let ret = wit_import((self).handle() as i32); - super::super::super::wasi::io::poll::Pollable::from_handle(ret as u32) + super::super::super::wasi::io::poll::Pollable::from_handle( + ret as u32, + ) } } } @@ -7329,7 +7094,9 @@ pub mod wasi { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 16]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 16]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 16], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] @@ -7337,7 +7104,6 @@ pub mod wasi { #[link_name = "[method]output-stream.check-write"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -7348,7 +7114,6 @@ pub mod wasi { 0 => { let e = { let l2 = *ptr0.add(8).cast::(); - l2 as u64 }; Ok(e) @@ -7360,8 +7125,9 @@ pub mod wasi { 0 => { let e5 = { let l4 = *ptr0.add(12).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l4 as u32) + super::super::super::wasi::io::error::Error::from_handle( + l4 as u32, + ) }; StreamError::LastOperationFailed(e5) } @@ -7370,7 +7136,6 @@ pub mod wasi { StreamError::Closed } }; - v5 }; Err(e) @@ -7393,7 +7158,9 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 12], + ); let vec0 = contents; let ptr0 = vec0.as_ptr().cast::(); let len0 = vec0.len(); @@ -7404,7 +7171,6 @@ pub mod wasi { #[link_name = "[method]output-stream.write"] fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8) { unreachable!() @@ -7423,8 +7189,9 @@ pub mod wasi { 0 => { let e5 = { let l4 = *ptr1.add(8).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l4 as u32) + super::super::super::wasi::io::error::Error::from_handle( + l4 as u32, + ) }; StreamError::LastOperationFailed(e5) } @@ -7433,7 +7200,6 @@ pub mod wasi { StreamError::Closed } }; - v5 }; Err(e) @@ -7469,11 +7235,16 @@ pub mod wasi { /// // Check for any errors that arose during `flush` /// let _ = this.check-write(); // eliding error handling /// ``` - pub fn blocking_write_and_flush(&self, contents: &[u8]) -> Result<(), StreamError> { + pub fn blocking_write_and_flush( + &self, + contents: &[u8], + ) -> Result<(), StreamError> { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 12], + ); let vec0 = contents; let ptr0 = vec0.as_ptr().cast::(); let len0 = vec0.len(); @@ -7484,7 +7255,6 @@ pub mod wasi { #[link_name = "[method]output-stream.blocking-write-and-flush"] fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8, _: usize, _: *mut u8) { unreachable!() @@ -7503,8 +7273,9 @@ pub mod wasi { 0 => { let e5 = { let l4 = *ptr1.add(8).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l4 as u32) + super::super::super::wasi::io::error::Error::from_handle( + l4 as u32, + ) }; StreamError::LastOperationFailed(e5) } @@ -7513,7 +7284,6 @@ pub mod wasi { StreamError::Closed } }; - v5 }; Err(e) @@ -7539,7 +7309,9 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 12], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] @@ -7547,7 +7319,6 @@ pub mod wasi { #[link_name = "[method]output-stream.flush"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -7566,8 +7337,9 @@ pub mod wasi { 0 => { let e4 = { let l3 = *ptr0.add(8).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l3 as u32) + super::super::super::wasi::io::error::Error::from_handle( + l3 as u32, + ) }; StreamError::LastOperationFailed(e4) } @@ -7576,7 +7348,6 @@ pub mod wasi { StreamError::Closed } }; - v4 }; Err(e) @@ -7594,7 +7365,9 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 12], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] @@ -7602,7 +7375,6 @@ pub mod wasi { #[link_name = "[method]output-stream.blocking-flush"] fn wit_import(_: i32, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: *mut u8) { unreachable!() @@ -7621,8 +7393,9 @@ pub mod wasi { 0 => { let e4 = { let l3 = *ptr0.add(8).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l3 as u32) + super::super::super::wasi::io::error::Error::from_handle( + l3 as u32, + ) }; StreamError::LastOperationFailed(e4) } @@ -7631,7 +7404,6 @@ pub mod wasi { StreamError::Closed } }; - v4 }; Err(e) @@ -7661,13 +7433,14 @@ pub mod wasi { #[link_name = "[method]output-stream.subscribe"] fn wit_import(_: i32) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32) -> i32 { unreachable!() } let ret = wit_import((self).handle() as i32); - super::super::super::wasi::io::poll::Pollable::from_handle(ret as u32) + super::super::super::wasi::io::poll::Pollable::from_handle( + ret as u32, + ) } } } @@ -7683,7 +7456,9 @@ pub mod wasi { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 12], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] @@ -7691,7 +7466,6 @@ pub mod wasi { #[link_name = "[method]output-stream.write-zeroes"] fn wit_import(_: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i64, _: *mut u8) { unreachable!() @@ -7710,8 +7484,9 @@ pub mod wasi { 0 => { let e4 = { let l3 = *ptr0.add(8).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l3 as u32) + super::super::super::wasi::io::error::Error::from_handle( + l3 as u32, + ) }; StreamError::LastOperationFailed(e4) } @@ -7720,7 +7495,6 @@ pub mod wasi { StreamError::Closed } }; - v4 }; Err(e) @@ -7756,11 +7530,16 @@ pub mod wasi { /// // Check for any errors that arose during `flush` /// let _ = this.check-write(); // eliding error handling /// ``` - pub fn blocking_write_zeroes_and_flush(&self, len: u64) -> Result<(), StreamError> { + pub fn blocking_write_zeroes_and_flush( + &self, + len: u64, + ) -> Result<(), StreamError> { unsafe { #[repr(align(4))] struct RetArea([::core::mem::MaybeUninit; 12]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 12]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 12], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] @@ -7768,7 +7547,6 @@ pub mod wasi { #[link_name = "[method]output-stream.blocking-write-zeroes-and-flush"] fn wit_import(_: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i64, _: *mut u8) { unreachable!() @@ -7787,8 +7565,9 @@ pub mod wasi { 0 => { let e4 = { let l3 = *ptr0.add(8).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l3 as u32) + super::super::super::wasi::io::error::Error::from_handle( + l3 as u32, + ) }; StreamError::LastOperationFailed(e4) } @@ -7797,7 +7576,6 @@ pub mod wasi { StreamError::Closed } }; - v4 }; Err(e) @@ -7822,11 +7600,17 @@ pub mod wasi { /// /// This function returns the number of bytes transferred; it may be less /// than `len`. - pub fn splice(&self, src: &InputStream, len: u64) -> Result { + pub fn splice( + &self, + src: &InputStream, + len: u64, + ) -> Result { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 16]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 16]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 16], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] @@ -7834,7 +7618,6 @@ pub mod wasi { #[link_name = "[method]output-stream.splice"] fn wit_import(_: i32, _: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i32, _: i64, _: *mut u8) { unreachable!() @@ -7850,7 +7633,6 @@ pub mod wasi { 0 => { let e = { let l2 = *ptr0.add(8).cast::(); - l2 as u64 }; Ok(e) @@ -7862,8 +7644,9 @@ pub mod wasi { 0 => { let e5 = { let l4 = *ptr0.add(12).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l4 as u32) + super::super::super::wasi::io::error::Error::from_handle( + l4 as u32, + ) }; StreamError::LastOperationFailed(e5) } @@ -7872,7 +7655,6 @@ pub mod wasi { StreamError::Closed } }; - v5 }; Err(e) @@ -7897,7 +7679,9 @@ pub mod wasi { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 16]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 16]); + let mut ret_area = RetArea( + [::core::mem::MaybeUninit::uninit(); 16], + ); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "wasi:io/streams@0.2.0")] @@ -7905,7 +7689,6 @@ pub mod wasi { #[link_name = "[method]output-stream.blocking-splice"] fn wit_import(_: i32, _: i32, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i32, _: i32, _: i64, _: *mut u8) { unreachable!() @@ -7921,7 +7704,6 @@ pub mod wasi { 0 => { let e = { let l2 = *ptr0.add(8).cast::(); - l2 as u64 }; Ok(e) @@ -7933,8 +7715,9 @@ pub mod wasi { 0 => { let e5 = { let l4 = *ptr0.add(12).cast::(); - - super::super::super::wasi::io::error::Error::from_handle(l4 as u32) + super::super::super::wasi::io::error::Error::from_handle( + l4 as u32, + ) }; StreamError::LastOperationFailed(e5) } @@ -7943,7 +7726,6 @@ pub mod wasi { StreamError::Closed } }; - v5 }; Err(e) @@ -7961,9 +7743,7 @@ pub mod wasi { pub mod random { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::__link_custom_section_describing_imports; use super::super::super::_rt; #[allow(unused_unsafe, clippy::all)] /// Return `len` cryptographically-secure random or pseudo-random bytes. @@ -7990,7 +7770,6 @@ pub mod wasi { #[link_name = "get-random-bytes"] fn wit_import(_: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i64, _: *mut u8) { unreachable!() @@ -8015,7 +7794,6 @@ pub mod wasi { #[link_name = "get-random-u64"] fn wit_import() -> i64; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import() -> i64 { unreachable!() @@ -8037,20 +7815,22 @@ pub mod exports { pub mod incoming_handler { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; - pub type IncomingRequest = - super::super::super::super::wasi::http::types::IncomingRequest; - pub type ResponseOutparam = - super::super::super::super::wasi::http::types::ResponseOutparam; + pub type IncomingRequest = super::super::super::super::wasi::http::types::IncomingRequest; + pub type ResponseOutparam = super::super::super::super::wasi::http::types::ResponseOutparam; #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_handle_cabi(arg0: i32, arg1: i32) { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - T::handle(super::super::super::super::wasi::http::types::IncomingRequest::from_handle(arg0 as u32), super::super::super::super::wasi::http::types::ResponseOutparam::from_handle(arg1 as u32)); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + T::handle( + super::super::super::super::wasi::http::types::IncomingRequest::from_handle( + arg0 as u32, + ), + super::super::super::super::wasi::http::types::ResponseOutparam::from_handle( + arg1 as u32, + ), + ); } pub trait Guest { /// This function is invoked with an incoming HTTP Request, and a resource @@ -8066,16 +7846,14 @@ pub mod exports { fn handle(request: IncomingRequest, response_out: ResponseOutparam); } #[doc(hidden)] - - macro_rules! __export_wasi_http_incoming_handler_0_2_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "wasi:http/incoming-handler@0.2.0#handle"] - unsafe extern "C" fn export_handle(arg0: i32,arg1: i32,) { - $($path_to_types)*::_export_handle_cabi::<$ty>(arg0, arg1) - } - };); - } + macro_rules! __export_wasi_http_incoming_handler_0_2_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[export_name = + "wasi:http/incoming-handler@0.2.0#handle"] unsafe extern "C" fn + export_handle(arg0 : i32, arg1 : i32,) { $($path_to_types)*:: + _export_handle_cabi::<$ty > (arg0, arg1) } }; + }; + } #[doc(hidden)] pub(crate) use __export_wasi_http_incoming_handler_0_2_0_cabi; } @@ -8083,11 +7861,33 @@ pub mod exports { } } mod _rt { - + pub use alloc_crate::vec::Vec; + pub fn as_i64(t: T) -> i64 { + t.as_i64() + } + pub trait AsI64 { + fn as_i64(self) -> i64; + } + impl<'a, T: Copy + AsI64> AsI64 for &'a T { + fn as_i64(self) -> i64 { + (*self).as_i64() + } + } + impl AsI64 for i64 { + #[inline] + fn as_i64(self) -> i64 { + self as i64 + } + } + impl AsI64 for u64 { + #[inline] + fn as_i64(self) -> i64 { + self as i64 + } + } use core::fmt; use core::marker; use core::sync::atomic::{AtomicU32, Ordering::Relaxed}; - /// A type which represents a component model resource, either imported or /// exported into this component. /// @@ -8102,16 +7902,9 @@ mod _rt { /// resources. #[repr(transparent)] pub struct Resource { - // NB: This would ideally be `u32` but it is not. The fact that this has - // interior mutability is not exposed in the API of this type except for the - // `take_handle` method which is supposed to in theory be private. - // - // This represents, almost all the time, a valid handle value. When it's - // invalid it's stored as `u32::MAX`. handle: AtomicU32, _marker: marker::PhantomData, } - /// A trait which all wasm resources implement, namely providing the ability to /// drop a resource. /// @@ -8121,7 +7914,6 @@ mod _rt { /// Invokes the `[resource-drop]...` intrinsic. unsafe fn drop(handle: u32); } - impl Resource { #[doc(hidden)] pub unsafe fn from_handle(handle: u32) -> Self { @@ -8131,7 +7923,6 @@ mod _rt { _marker: marker::PhantomData, } } - /// Takes ownership of the handle owned by `resource`. /// /// Note that this ideally would be `into_handle` taking `Resource` by @@ -8148,36 +7939,34 @@ mod _rt { pub fn take_handle(resource: &Resource) -> u32 { resource.handle.swap(u32::MAX, Relaxed) } - #[doc(hidden)] pub fn handle(resource: &Resource) -> u32 { resource.handle.load(Relaxed) } } - impl fmt::Debug for Resource { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("Resource") - .field("handle", &self.handle) - .finish() + f.debug_struct("Resource").field("handle", &self.handle).finish() } } - impl Drop for Resource { fn drop(&mut self) { unsafe { match self.handle.load(Relaxed) { - // If this handle was "taken" then don't do anything in the - // destructor. u32::MAX => {} - - // ... but otherwise do actually destroy it with the imported - // component model intrinsic as defined through `T`. other => T::drop(other), } } } } + pub use alloc_crate::string::String; + pub unsafe fn string_lift(bytes: Vec) -> String { + if cfg!(debug_assertions) { + String::from_utf8(bytes).unwrap() + } else { + String::from_utf8_unchecked(bytes) + } + } pub unsafe fn bool_lift(val: u8) -> bool { if cfg!(debug_assertions) { match val { @@ -8190,43 +7979,6 @@ mod _rt { } } pub use alloc_crate::alloc; - pub use alloc_crate::vec::Vec; - - pub fn as_i64(t: T) -> i64 { - t.as_i64() - } - - pub trait AsI64 { - fn as_i64(self) -> i64; - } - - impl<'a, T: Copy + AsI64> AsI64 for &'a T { - fn as_i64(self) -> i64 { - (*self).as_i64() - } - } - - impl AsI64 for i64 { - #[inline] - fn as_i64(self) -> i64 { - self as i64 - } - } - - impl AsI64 for u64 { - #[inline] - fn as_i64(self) -> i64 { - self as i64 - } - } - pub use alloc_crate::string::String; - pub unsafe fn string_lift(bytes: Vec) -> String { - if cfg!(debug_assertions) { - String::from_utf8(bytes).unwrap() - } else { - String::from_utf8_unchecked(bytes) - } - } pub unsafe fn invalid_enum_discriminant() -> T { if cfg!(debug_assertions) { panic!("invalid enum discriminant") @@ -8239,86 +7991,73 @@ mod _rt { return; } let layout = alloc::Layout::from_size_align_unchecked(size, align); - alloc::dealloc(ptr as *mut u8, layout); + alloc::dealloc(ptr, layout); } - pub fn as_i32(t: T) -> i32 { t.as_i32() } - pub trait AsI32 { fn as_i32(self) -> i32; } - impl<'a, T: Copy + AsI32> AsI32 for &'a T { fn as_i32(self) -> i32 { (*self).as_i32() } } - impl AsI32 for i32 { #[inline] fn as_i32(self) -> i32 { self as i32 } } - impl AsI32 for u32 { #[inline] fn as_i32(self) -> i32 { self as i32 } } - impl AsI32 for i16 { #[inline] fn as_i32(self) -> i32 { self as i32 } } - impl AsI32 for u16 { #[inline] fn as_i32(self) -> i32 { self as i32 } } - impl AsI32 for i8 { #[inline] fn as_i32(self) -> i32 { self as i32 } } - impl AsI32 for u8 { #[inline] fn as_i32(self) -> i32 { self as i32 } } - impl AsI32 for char { #[inline] fn as_i32(self) -> i32 { self as i32 } } - impl AsI32 for usize { #[inline] fn as_i32(self) -> i32 { self as i32 } } - #[cfg(target_arch = "wasm32")] pub fn run_ctors_once() { wit_bindgen_rt::run_ctors_once(); } extern crate alloc as alloc_crate; } - /// Generates `#[no_mangle]` functions to export the specified type as the /// root implementation of all generated traits. /// @@ -8337,166 +8076,166 @@ mod _rt { /// ``` #[allow(unused_macros)] #[doc(hidden)] - macro_rules! __export_target_world_impl { - ($ty:ident) => (self::export!($ty with_types_in self);); - ($ty:ident with_types_in $($path_to_types_root:tt)*) => ( - $($path_to_types_root)*::exports::wasi::http::incoming_handler::__export_wasi_http_incoming_handler_0_2_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::wasi::http::incoming_handler); - ) + ($ty:ident) => { + self::export!($ty with_types_in self); + }; + ($ty:ident with_types_in $($path_to_types_root:tt)*) => { + $($path_to_types_root)*:: + exports::wasi::http::incoming_handler::__export_wasi_http_incoming_handler_0_2_0_cabi!($ty + with_types_in $($path_to_types_root)*:: exports::wasi::http::incoming_handler); + }; } #[doc(inline)] pub(crate) use __export_target_world_impl as export; - #[cfg(target_arch = "wasm32")] -#[link_section = "component-type:wit-bindgen:0.25.0:target-world:encoded world"] +#[link_section = "component-type:wit-bindgen:0.35.0:sunfishcode:hello-wasi-http:target-world:encoded world"] #[doc(hidden)] pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 7050] = *b"\ \0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\x876\x01A\x02\x01A#\x01\ -B\x0a\x04\0\x08pollable\x03\x01\x01h\0\x01@\x01\x04self\x01\0\x7f\x04\0\x16[meth\ -od]pollable.ready\x01\x02\x01@\x01\x04self\x01\x01\0\x04\0\x16[method]pollable.b\ -lock\x01\x03\x01p\x01\x01py\x01@\x01\x02in\x04\0\x05\x04\0\x04poll\x01\x06\x03\x01\ -\x12wasi:io/poll@0.2.0\x05\0\x02\x03\0\0\x08pollable\x01B\x0f\x02\x03\x02\x01\x01\ -\x04\0\x08pollable\x03\0\0\x01w\x04\0\x07instant\x03\0\x02\x01w\x04\0\x08duratio\ -n\x03\0\x04\x01@\0\0\x03\x04\0\x03now\x01\x06\x01@\0\0\x05\x04\0\x0aresolution\x01\ -\x07\x01i\x01\x01@\x01\x04when\x03\0\x08\x04\0\x11subscribe-instant\x01\x09\x01@\ -\x01\x04when\x05\0\x08\x04\0\x12subscribe-duration\x01\x0a\x03\x01!wasi:clocks/m\ -onotonic-clock@0.2.0\x05\x02\x01B\x04\x04\0\x05error\x03\x01\x01h\0\x01@\x01\x04\ -self\x01\0s\x04\0\x1d[method]error.to-debug-string\x01\x02\x03\x01\x13wasi:io/er\ -ror@0.2.0\x05\x03\x02\x03\0\x02\x05error\x01B(\x02\x03\x02\x01\x04\x04\0\x05erro\ -r\x03\0\0\x02\x03\x02\x01\x01\x04\0\x08pollable\x03\0\x02\x01i\x01\x01q\x02\x15l\ -ast-operation-failed\x01\x04\0\x06closed\0\0\x04\0\x0cstream-error\x03\0\x05\x04\ -\0\x0cinput-stream\x03\x01\x04\0\x0doutput-stream\x03\x01\x01h\x07\x01p}\x01j\x01\ -\x0a\x01\x06\x01@\x02\x04self\x09\x03lenw\0\x0b\x04\0\x19[method]input-stream.re\ -ad\x01\x0c\x04\0\"[method]input-stream.blocking-read\x01\x0c\x01j\x01w\x01\x06\x01\ -@\x02\x04self\x09\x03lenw\0\x0d\x04\0\x19[method]input-stream.skip\x01\x0e\x04\0\ -\"[method]input-stream.blocking-skip\x01\x0e\x01i\x03\x01@\x01\x04self\x09\0\x0f\ -\x04\0\x1e[method]input-stream.subscribe\x01\x10\x01h\x08\x01@\x01\x04self\x11\0\ -\x0d\x04\0![method]output-stream.check-write\x01\x12\x01j\0\x01\x06\x01@\x02\x04\ -self\x11\x08contents\x0a\0\x13\x04\0\x1b[method]output-stream.write\x01\x14\x04\0\ -.[method]output-stream.blocking-write-and-flush\x01\x14\x01@\x01\x04self\x11\0\x13\ -\x04\0\x1b[method]output-stream.flush\x01\x15\x04\0$[method]output-stream.blocki\ -ng-flush\x01\x15\x01@\x01\x04self\x11\0\x0f\x04\0\x1f[method]output-stream.subsc\ -ribe\x01\x16\x01@\x02\x04self\x11\x03lenw\0\x13\x04\0\"[method]output-stream.wri\ -te-zeroes\x01\x17\x04\05[method]output-stream.blocking-write-zeroes-and-flush\x01\ -\x17\x01@\x03\x04self\x11\x03src\x09\x03lenw\0\x0d\x04\0\x1c[method]output-strea\ -m.splice\x01\x18\x04\0%[method]output-stream.blocking-splice\x01\x18\x03\x01\x15\ -wasi:io/streams@0.2.0\x05\x05\x02\x03\0\x01\x08duration\x02\x03\0\x03\x0cinput-s\ -tream\x02\x03\0\x03\x0doutput-stream\x01B\xc0\x01\x02\x03\x02\x01\x06\x04\0\x08d\ -uration\x03\0\0\x02\x03\x02\x01\x07\x04\0\x0cinput-stream\x03\0\x02\x02\x03\x02\x01\ -\x08\x04\0\x0doutput-stream\x03\0\x04\x02\x03\x02\x01\x04\x04\0\x08io-error\x03\0\ -\x06\x02\x03\x02\x01\x01\x04\0\x08pollable\x03\0\x08\x01q\x0a\x03get\0\0\x04head\ -\0\0\x04post\0\0\x03put\0\0\x06delete\0\0\x07connect\0\0\x07options\0\0\x05trace\ -\0\0\x05patch\0\0\x05other\x01s\0\x04\0\x06method\x03\0\x0a\x01q\x03\x04HTTP\0\0\ -\x05HTTPS\0\0\x05other\x01s\0\x04\0\x06scheme\x03\0\x0c\x01ks\x01k{\x01r\x02\x05\ -rcode\x0e\x09info-code\x0f\x04\0\x11DNS-error-payload\x03\0\x10\x01k}\x01r\x02\x08\ -alert-id\x12\x0dalert-message\x0e\x04\0\x1aTLS-alert-received-payload\x03\0\x13\x01\ -ky\x01r\x02\x0afield-name\x0e\x0afield-size\x15\x04\0\x12field-size-payload\x03\0\ -\x16\x01kw\x01k\x17\x01q'\x0bDNS-timeout\0\0\x09DNS-error\x01\x11\0\x15destinati\ -on-not-found\0\0\x17destination-unavailable\0\0\x19destination-IP-prohibited\0\0\ -\x19destination-IP-unroutable\0\0\x12connection-refused\0\0\x15connection-termin\ -ated\0\0\x12connection-timeout\0\0\x17connection-read-timeout\0\0\x18connection-\ -write-timeout\0\0\x18connection-limit-reached\0\0\x12TLS-protocol-error\0\0\x15T\ -LS-certificate-error\0\0\x12TLS-alert-received\x01\x14\0\x13HTTP-request-denied\0\ -\0\x1cHTTP-request-length-required\0\0\x16HTTP-request-body-size\x01\x18\0\x1bHT\ -TP-request-method-invalid\0\0\x18HTTP-request-URI-invalid\0\0\x19HTTP-request-UR\ -I-too-long\0\0\x20HTTP-request-header-section-size\x01\x15\0\x18HTTP-request-hea\ -der-size\x01\x19\0!HTTP-request-trailer-section-size\x01\x15\0\x19HTTP-request-t\ -railer-size\x01\x17\0\x18HTTP-response-incomplete\0\0!HTTP-response-header-secti\ -on-size\x01\x15\0\x19HTTP-response-header-size\x01\x17\0\x17HTTP-response-body-s\ -ize\x01\x18\0\"HTTP-response-trailer-section-size\x01\x15\0\x1aHTTP-response-tra\ -iler-size\x01\x17\0\x1dHTTP-response-transfer-coding\x01\x0e\0\x1cHTTP-response-\ -content-coding\x01\x0e\0\x15HTTP-response-timeout\0\0\x13HTTP-upgrade-failed\0\0\ -\x13HTTP-protocol-error\0\0\x0dloop-detected\0\0\x13configuration-error\0\0\x0ei\ -nternal-error\x01\x0e\0\x04\0\x0aerror-code\x03\0\x1a\x01q\x03\x0einvalid-syntax\ -\0\0\x09forbidden\0\0\x09immutable\0\0\x04\0\x0cheader-error\x03\0\x1c\x01s\x04\0\ -\x09field-key\x03\0\x1e\x01p}\x04\0\x0bfield-value\x03\0\x20\x04\0\x06fields\x03\ -\x01\x04\0\x07headers\x03\0\"\x04\0\x08trailers\x03\0\"\x04\0\x10incoming-reques\ -t\x03\x01\x04\0\x10outgoing-request\x03\x01\x04\0\x0frequest-options\x03\x01\x04\ -\0\x11response-outparam\x03\x01\x01{\x04\0\x0bstatus-code\x03\0)\x04\0\x11incomi\ -ng-response\x03\x01\x04\0\x0dincoming-body\x03\x01\x04\0\x0ffuture-trailers\x03\x01\ -\x04\0\x11outgoing-response\x03\x01\x04\0\x0doutgoing-body\x03\x01\x04\0\x18futu\ -re-incoming-response\x03\x01\x01i\"\x01@\0\01\x04\0\x13[constructor]fields\x012\x01\ -o\x02\x1f!\x01p3\x01j\x011\x01\x1d\x01@\x01\x07entries4\05\x04\0\x18[static]fiel\ -ds.from-list\x016\x01h\"\x01p!\x01@\x02\x04self7\x04name\x1f\08\x04\0\x12[method\ -]fields.get\x019\x01@\x02\x04self7\x04name\x1f\0\x7f\x04\0\x12[method]fields.has\ -\x01:\x01j\0\x01\x1d\x01@\x03\x04self7\x04name\x1f\x05value8\0;\x04\0\x12[method\ -]fields.set\x01<\x01@\x02\x04self7\x04name\x1f\0;\x04\0\x15[method]fields.delete\ -\x01=\x01@\x03\x04self7\x04name\x1f\x05value!\0;\x04\0\x15[method]fields.append\x01\ ->\x01@\x01\x04self7\04\x04\0\x16[method]fields.entries\x01?\x01@\x01\x04self7\01\ -\x04\0\x14[method]fields.clone\x01@\x01h%\x01@\x01\x04self\xc1\0\0\x0b\x04\0\x1f\ -[method]incoming-request.method\x01B\x01@\x01\x04self\xc1\0\0\x0e\x04\0([method]\ -incoming-request.path-with-query\x01C\x01k\x0d\x01@\x01\x04self\xc1\0\0\xc4\0\x04\ -\0\x1f[method]incoming-request.scheme\x01E\x04\0\"[method]incoming-request.autho\ -rity\x01C\x01i#\x01@\x01\x04self\xc1\0\0\xc6\0\x04\0\x20[method]incoming-request\ -.headers\x01G\x01i,\x01j\x01\xc8\0\0\x01@\x01\x04self\xc1\0\0\xc9\0\x04\0\x20[me\ -thod]incoming-request.consume\x01J\x01i&\x01@\x01\x07headers\xc6\0\0\xcb\0\x04\0\ -\x1d[constructor]outgoing-request\x01L\x01h&\x01i/\x01j\x01\xce\0\0\x01@\x01\x04\ -self\xcd\0\0\xcf\0\x04\0\x1d[method]outgoing-request.body\x01P\x01@\x01\x04self\xcd\ -\0\0\x0b\x04\0\x1f[method]outgoing-request.method\x01Q\x01j\0\0\x01@\x02\x04self\ -\xcd\0\x06method\x0b\0\xd2\0\x04\0#[method]outgoing-request.set-method\x01S\x01@\ -\x01\x04self\xcd\0\0\x0e\x04\0([method]outgoing-request.path-with-query\x01T\x01\ -@\x02\x04self\xcd\0\x0fpath-with-query\x0e\0\xd2\0\x04\0,[method]outgoing-reques\ -t.set-path-with-query\x01U\x01@\x01\x04self\xcd\0\0\xc4\0\x04\0\x1f[method]outgo\ -ing-request.scheme\x01V\x01@\x02\x04self\xcd\0\x06scheme\xc4\0\0\xd2\0\x04\0#[me\ -thod]outgoing-request.set-scheme\x01W\x04\0\"[method]outgoing-request.authority\x01\ -T\x01@\x02\x04self\xcd\0\x09authority\x0e\0\xd2\0\x04\0&[method]outgoing-request\ -.set-authority\x01X\x01@\x01\x04self\xcd\0\0\xc6\0\x04\0\x20[method]outgoing-req\ -uest.headers\x01Y\x01i'\x01@\0\0\xda\0\x04\0\x1c[constructor]request-options\x01\ -[\x01h'\x01k\x01\x01@\x01\x04self\xdc\0\0\xdd\0\x04\0'[method]request-options.co\ -nnect-timeout\x01^\x01@\x02\x04self\xdc\0\x08duration\xdd\0\0\xd2\0\x04\0+[metho\ -d]request-options.set-connect-timeout\x01_\x04\0*[method]request-options.first-b\ -yte-timeout\x01^\x04\0.[method]request-options.set-first-byte-timeout\x01_\x04\0\ --[method]request-options.between-bytes-timeout\x01^\x04\01[method]request-option\ -s.set-between-bytes-timeout\x01_\x01i(\x01i.\x01j\x01\xe1\0\x01\x1b\x01@\x02\x05\ -param\xe0\0\x08response\xe2\0\x01\0\x04\0\x1d[static]response-outparam.set\x01c\x01\ -h+\x01@\x01\x04self\xe4\0\0*\x04\0\x20[method]incoming-response.status\x01e\x01@\ -\x01\x04self\xe4\0\0\xc6\0\x04\0![method]incoming-response.headers\x01f\x01@\x01\ -\x04self\xe4\0\0\xc9\0\x04\0![method]incoming-response.consume\x01g\x01h,\x01i\x03\ -\x01j\x01\xe9\0\0\x01@\x01\x04self\xe8\0\0\xea\0\x04\0\x1c[method]incoming-body.\ -stream\x01k\x01i-\x01@\x01\x04this\xc8\0\0\xec\0\x04\0\x1c[static]incoming-body.\ -finish\x01m\x01h-\x01i\x09\x01@\x01\x04self\xee\0\0\xef\0\x04\0![method]future-t\ -railers.subscribe\x01p\x01i$\x01k\xf1\0\x01j\x01\xf2\0\x01\x1b\x01j\x01\xf3\0\0\x01\ -k\xf4\0\x01@\x01\x04self\xee\0\0\xf5\0\x04\0\x1b[method]future-trailers.get\x01v\ -\x01@\x01\x07headers\xc6\0\0\xe1\0\x04\0\x1e[constructor]outgoing-response\x01w\x01\ -h.\x01@\x01\x04self\xf8\0\0*\x04\0%[method]outgoing-response.status-code\x01y\x01\ -@\x02\x04self\xf8\0\x0bstatus-code*\0\xd2\0\x04\0)[method]outgoing-response.set-\ -status-code\x01z\x01@\x01\x04self\xf8\0\0\xc6\0\x04\0![method]outgoing-response.\ -headers\x01{\x01@\x01\x04self\xf8\0\0\xcf\0\x04\0\x1e[method]outgoing-response.b\ -ody\x01|\x01h/\x01i\x05\x01j\x01\xfe\0\0\x01@\x01\x04self\xfd\0\0\xff\0\x04\0\x1b\ -[method]outgoing-body.write\x01\x80\x01\x01j\0\x01\x1b\x01@\x02\x04this\xce\0\x08\ -trailers\xf2\0\0\x81\x01\x04\0\x1c[static]outgoing-body.finish\x01\x82\x01\x01h0\ -\x01@\x01\x04self\x83\x01\0\xef\0\x04\0*[method]future-incoming-response.subscri\ -be\x01\x84\x01\x01i+\x01j\x01\x85\x01\x01\x1b\x01j\x01\x86\x01\0\x01k\x87\x01\x01\ -@\x01\x04self\x83\x01\0\x88\x01\x04\0$[method]future-incoming-response.get\x01\x89\ -\x01\x01h\x07\x01k\x1b\x01@\x01\x03err\x8a\x01\0\x8b\x01\x04\0\x0fhttp-error-cod\ -e\x01\x8c\x01\x03\x01\x15wasi:http/types@0.2.0\x05\x09\x01B\x05\x01p}\x01@\x01\x03\ -lenw\0\0\x04\0\x10get-random-bytes\x01\x01\x01@\0\0w\x04\0\x0eget-random-u64\x01\ -\x02\x03\x01\x18wasi:random/random@0.2.0\x05\x0a\x01B\x05\x02\x03\x02\x01\x08\x04\ -\0\x0doutput-stream\x03\0\0\x01i\x01\x01@\0\0\x02\x04\0\x0aget-stdout\x01\x03\x03\ -\x01\x15wasi:cli/stdout@0.2.0\x05\x0b\x01B\x05\x02\x03\x02\x01\x08\x04\0\x0doutp\ -ut-stream\x03\0\0\x01i\x01\x01@\0\0\x02\x04\0\x0aget-stderr\x01\x03\x03\x01\x15w\ -asi:cli/stderr@0.2.0\x05\x0c\x01B\x05\x02\x03\x02\x01\x07\x04\0\x0cinput-stream\x03\ -\0\0\x01i\x01\x01@\0\0\x02\x04\0\x09get-stdin\x01\x03\x03\x01\x14wasi:cli/stdin@\ -0.2.0\x05\x0d\x02\x03\0\x04\x10outgoing-request\x02\x03\0\x04\x0frequest-options\ -\x02\x03\0\x04\x18future-incoming-response\x02\x03\0\x04\x0aerror-code\x01B\x0f\x02\ -\x03\x02\x01\x0e\x04\0\x10outgoing-request\x03\0\0\x02\x03\x02\x01\x0f\x04\0\x0f\ -request-options\x03\0\x02\x02\x03\x02\x01\x10\x04\0\x18future-incoming-response\x03\ -\0\x04\x02\x03\x02\x01\x11\x04\0\x0aerror-code\x03\0\x06\x01i\x01\x01i\x03\x01k\x09\ -\x01i\x05\x01j\x01\x0b\x01\x07\x01@\x02\x07request\x08\x07options\x0a\0\x0c\x04\0\ -\x06handle\x01\x0d\x03\x01\x20wasi:http/outgoing-handler@0.2.0\x05\x12\x01B\x05\x01\ -r\x02\x07secondsw\x0bnanosecondsy\x04\0\x08datetime\x03\0\0\x01@\0\0\x01\x04\0\x03\ -now\x01\x02\x04\0\x0aresolution\x01\x02\x03\x01\x1cwasi:clocks/wall-clock@0.2.0\x05\ -\x13\x02\x03\0\x04\x10incoming-request\x02\x03\0\x04\x11response-outparam\x01B\x08\ -\x02\x03\x02\x01\x14\x04\0\x10incoming-request\x03\0\0\x02\x03\x02\x01\x15\x04\0\ -\x11response-outparam\x03\0\x02\x01i\x01\x01i\x03\x01@\x02\x07request\x04\x0cres\ -ponse-out\x05\x01\0\x04\0\x06handle\x01\x06\x04\x01\x20wasi:http/incoming-handle\ -r@0.2.0\x05\x16\x04\x01(sunfishcode:hello-wasi-http/target-world\x04\0\x0b\x12\x01\ -\0\x0ctarget-world\x03\0\0\0G\x09producers\x01\x0cprocessed-by\x02\x0dwit-compon\ -ent\x070.208.1\x10wit-bindgen-rust\x060.25.0"; - +B\x05\x01p}\x01@\x01\x03lenw\0\0\x04\0\x10get-random-bytes\x01\x01\x01@\0\0w\x04\ +\0\x0eget-random-u64\x01\x02\x03\0\x18wasi:random/random@0.2.0\x05\0\x01B\x04\x04\ +\0\x05error\x03\x01\x01h\0\x01@\x01\x04self\x01\0s\x04\0\x1d[method]error.to-deb\ +ug-string\x01\x02\x03\0\x13wasi:io/error@0.2.0\x05\x01\x01B\x0a\x04\0\x08pollabl\ +e\x03\x01\x01h\0\x01@\x01\x04self\x01\0\x7f\x04\0\x16[method]pollable.ready\x01\x02\ +\x01@\x01\x04self\x01\x01\0\x04\0\x16[method]pollable.block\x01\x03\x01p\x01\x01\ +py\x01@\x01\x02in\x04\0\x05\x04\0\x04poll\x01\x06\x03\0\x12wasi:io/poll@0.2.0\x05\ +\x02\x02\x03\0\x01\x05error\x02\x03\0\x02\x08pollable\x01B(\x02\x03\x02\x01\x03\x04\ +\0\x05error\x03\0\0\x02\x03\x02\x01\x04\x04\0\x08pollable\x03\0\x02\x01i\x01\x01\ +q\x02\x15last-operation-failed\x01\x04\0\x06closed\0\0\x04\0\x0cstream-error\x03\ +\0\x05\x04\0\x0cinput-stream\x03\x01\x04\0\x0doutput-stream\x03\x01\x01h\x07\x01\ +p}\x01j\x01\x0a\x01\x06\x01@\x02\x04self\x09\x03lenw\0\x0b\x04\0\x19[method]inpu\ +t-stream.read\x01\x0c\x04\0\"[method]input-stream.blocking-read\x01\x0c\x01j\x01\ +w\x01\x06\x01@\x02\x04self\x09\x03lenw\0\x0d\x04\0\x19[method]input-stream.skip\x01\ +\x0e\x04\0\"[method]input-stream.blocking-skip\x01\x0e\x01i\x03\x01@\x01\x04self\ +\x09\0\x0f\x04\0\x1e[method]input-stream.subscribe\x01\x10\x01h\x08\x01@\x01\x04\ +self\x11\0\x0d\x04\0![method]output-stream.check-write\x01\x12\x01j\0\x01\x06\x01\ +@\x02\x04self\x11\x08contents\x0a\0\x13\x04\0\x1b[method]output-stream.write\x01\ +\x14\x04\0.[method]output-stream.blocking-write-and-flush\x01\x14\x01@\x01\x04se\ +lf\x11\0\x13\x04\0\x1b[method]output-stream.flush\x01\x15\x04\0$[method]output-s\ +tream.blocking-flush\x01\x15\x01@\x01\x04self\x11\0\x0f\x04\0\x1f[method]output-\ +stream.subscribe\x01\x16\x01@\x02\x04self\x11\x03lenw\0\x13\x04\0\"[method]outpu\ +t-stream.write-zeroes\x01\x17\x04\05[method]output-stream.blocking-write-zeroes-\ +and-flush\x01\x17\x01@\x03\x04self\x11\x03src\x09\x03lenw\0\x0d\x04\0\x1c[method\ +]output-stream.splice\x01\x18\x04\0%[method]output-stream.blocking-splice\x01\x18\ +\x03\0\x15wasi:io/streams@0.2.0\x05\x05\x02\x03\0\x03\x0doutput-stream\x01B\x05\x02\ +\x03\x02\x01\x06\x04\0\x0doutput-stream\x03\0\0\x01i\x01\x01@\0\0\x02\x04\0\x0ag\ +et-stdout\x01\x03\x03\0\x15wasi:cli/stdout@0.2.0\x05\x07\x01B\x05\x02\x03\x02\x01\ +\x06\x04\0\x0doutput-stream\x03\0\0\x01i\x01\x01@\0\0\x02\x04\0\x0aget-stderr\x01\ +\x03\x03\0\x15wasi:cli/stderr@0.2.0\x05\x08\x02\x03\0\x03\x0cinput-stream\x01B\x05\ +\x02\x03\x02\x01\x09\x04\0\x0cinput-stream\x03\0\0\x01i\x01\x01@\0\0\x02\x04\0\x09\ +get-stdin\x01\x03\x03\0\x14wasi:cli/stdin@0.2.0\x05\x0a\x01B\x0f\x02\x03\x02\x01\ +\x04\x04\0\x08pollable\x03\0\0\x01w\x04\0\x07instant\x03\0\x02\x01w\x04\0\x08dur\ +ation\x03\0\x04\x01@\0\0\x03\x04\0\x03now\x01\x06\x01@\0\0\x05\x04\0\x0aresoluti\ +on\x01\x07\x01i\x01\x01@\x01\x04when\x03\0\x08\x04\0\x11subscribe-instant\x01\x09\ +\x01@\x01\x04when\x05\0\x08\x04\0\x12subscribe-duration\x01\x0a\x03\0!wasi:clock\ +s/monotonic-clock@0.2.0\x05\x0b\x02\x03\0\x07\x08duration\x01B\xc0\x01\x02\x03\x02\ +\x01\x0c\x04\0\x08duration\x03\0\0\x02\x03\x02\x01\x09\x04\0\x0cinput-stream\x03\ +\0\x02\x02\x03\x02\x01\x06\x04\0\x0doutput-stream\x03\0\x04\x02\x03\x02\x01\x03\x04\ +\0\x08io-error\x03\0\x06\x02\x03\x02\x01\x04\x04\0\x08pollable\x03\0\x08\x01q\x0a\ +\x03get\0\0\x04head\0\0\x04post\0\0\x03put\0\0\x06delete\0\0\x07connect\0\0\x07o\ +ptions\0\0\x05trace\0\0\x05patch\0\0\x05other\x01s\0\x04\0\x06method\x03\0\x0a\x01\ +q\x03\x04HTTP\0\0\x05HTTPS\0\0\x05other\x01s\0\x04\0\x06scheme\x03\0\x0c\x01ks\x01\ +k{\x01r\x02\x05rcode\x0e\x09info-code\x0f\x04\0\x11DNS-error-payload\x03\0\x10\x01\ +k}\x01r\x02\x08alert-id\x12\x0dalert-message\x0e\x04\0\x1aTLS-alert-received-pay\ +load\x03\0\x13\x01ky\x01r\x02\x0afield-name\x0e\x0afield-size\x15\x04\0\x12field\ +-size-payload\x03\0\x16\x01kw\x01k\x17\x01q'\x0bDNS-timeout\0\0\x09DNS-error\x01\ +\x11\0\x15destination-not-found\0\0\x17destination-unavailable\0\0\x19destinatio\ +n-IP-prohibited\0\0\x19destination-IP-unroutable\0\0\x12connection-refused\0\0\x15\ +connection-terminated\0\0\x12connection-timeout\0\0\x17connection-read-timeout\0\ +\0\x18connection-write-timeout\0\0\x18connection-limit-reached\0\0\x12TLS-protoc\ +ol-error\0\0\x15TLS-certificate-error\0\0\x12TLS-alert-received\x01\x14\0\x13HTT\ +P-request-denied\0\0\x1cHTTP-request-length-required\0\0\x16HTTP-request-body-si\ +ze\x01\x18\0\x1bHTTP-request-method-invalid\0\0\x18HTTP-request-URI-invalid\0\0\x19\ +HTTP-request-URI-too-long\0\0\x20HTTP-request-header-section-size\x01\x15\0\x18H\ +TTP-request-header-size\x01\x19\0!HTTP-request-trailer-section-size\x01\x15\0\x19\ +HTTP-request-trailer-size\x01\x17\0\x18HTTP-response-incomplete\0\0!HTTP-respons\ +e-header-section-size\x01\x15\0\x19HTTP-response-header-size\x01\x17\0\x17HTTP-r\ +esponse-body-size\x01\x18\0\"HTTP-response-trailer-section-size\x01\x15\0\x1aHTT\ +P-response-trailer-size\x01\x17\0\x1dHTTP-response-transfer-coding\x01\x0e\0\x1c\ +HTTP-response-content-coding\x01\x0e\0\x15HTTP-response-timeout\0\0\x13HTTP-upgr\ +ade-failed\0\0\x13HTTP-protocol-error\0\0\x0dloop-detected\0\0\x13configuration-\ +error\0\0\x0einternal-error\x01\x0e\0\x04\0\x0aerror-code\x03\0\x1a\x01q\x03\x0e\ +invalid-syntax\0\0\x09forbidden\0\0\x09immutable\0\0\x04\0\x0cheader-error\x03\0\ +\x1c\x01s\x04\0\x09field-key\x03\0\x1e\x01p}\x04\0\x0bfield-value\x03\0\x20\x04\0\ +\x06fields\x03\x01\x04\0\x07headers\x03\0\"\x04\0\x08trailers\x03\0\"\x04\0\x10i\ +ncoming-request\x03\x01\x04\0\x10outgoing-request\x03\x01\x04\0\x0frequest-optio\ +ns\x03\x01\x04\0\x11response-outparam\x03\x01\x01{\x04\0\x0bstatus-code\x03\0)\x04\ +\0\x11incoming-response\x03\x01\x04\0\x0dincoming-body\x03\x01\x04\0\x0ffuture-t\ +railers\x03\x01\x04\0\x11outgoing-response\x03\x01\x04\0\x0doutgoing-body\x03\x01\ +\x04\0\x18future-incoming-response\x03\x01\x01i\"\x01@\0\01\x04\0\x13[constructo\ +r]fields\x012\x01o\x02\x1f!\x01p3\x01j\x011\x01\x1d\x01@\x01\x07entries4\05\x04\0\ +\x18[static]fields.from-list\x016\x01h\"\x01p!\x01@\x02\x04self7\x04name\x1f\08\x04\ +\0\x12[method]fields.get\x019\x01@\x02\x04self7\x04name\x1f\0\x7f\x04\0\x12[meth\ +od]fields.has\x01:\x01j\0\x01\x1d\x01@\x03\x04self7\x04name\x1f\x05value8\0;\x04\ +\0\x12[method]fields.set\x01<\x01@\x02\x04self7\x04name\x1f\0;\x04\0\x15[method]\ +fields.delete\x01=\x01@\x03\x04self7\x04name\x1f\x05value!\0;\x04\0\x15[method]f\ +ields.append\x01>\x01@\x01\x04self7\04\x04\0\x16[method]fields.entries\x01?\x01@\ +\x01\x04self7\01\x04\0\x14[method]fields.clone\x01@\x01h%\x01@\x01\x04self\xc1\0\ +\0\x0b\x04\0\x1f[method]incoming-request.method\x01B\x01@\x01\x04self\xc1\0\0\x0e\ +\x04\0([method]incoming-request.path-with-query\x01C\x01k\x0d\x01@\x01\x04self\xc1\ +\0\0\xc4\0\x04\0\x1f[method]incoming-request.scheme\x01E\x04\0\"[method]incoming\ +-request.authority\x01C\x01i#\x01@\x01\x04self\xc1\0\0\xc6\0\x04\0\x20[method]in\ +coming-request.headers\x01G\x01i,\x01j\x01\xc8\0\0\x01@\x01\x04self\xc1\0\0\xc9\0\ +\x04\0\x20[method]incoming-request.consume\x01J\x01i&\x01@\x01\x07headers\xc6\0\0\ +\xcb\0\x04\0\x1d[constructor]outgoing-request\x01L\x01h&\x01i/\x01j\x01\xce\0\0\x01\ +@\x01\x04self\xcd\0\0\xcf\0\x04\0\x1d[method]outgoing-request.body\x01P\x01@\x01\ +\x04self\xcd\0\0\x0b\x04\0\x1f[method]outgoing-request.method\x01Q\x01j\0\0\x01@\ +\x02\x04self\xcd\0\x06method\x0b\0\xd2\0\x04\0#[method]outgoing-request.set-meth\ +od\x01S\x01@\x01\x04self\xcd\0\0\x0e\x04\0([method]outgoing-request.path-with-qu\ +ery\x01T\x01@\x02\x04self\xcd\0\x0fpath-with-query\x0e\0\xd2\0\x04\0,[method]out\ +going-request.set-path-with-query\x01U\x01@\x01\x04self\xcd\0\0\xc4\0\x04\0\x1f[\ +method]outgoing-request.scheme\x01V\x01@\x02\x04self\xcd\0\x06scheme\xc4\0\0\xd2\ +\0\x04\0#[method]outgoing-request.set-scheme\x01W\x04\0\"[method]outgoing-reques\ +t.authority\x01T\x01@\x02\x04self\xcd\0\x09authority\x0e\0\xd2\0\x04\0&[method]o\ +utgoing-request.set-authority\x01X\x01@\x01\x04self\xcd\0\0\xc6\0\x04\0\x20[meth\ +od]outgoing-request.headers\x01Y\x01i'\x01@\0\0\xda\0\x04\0\x1c[constructor]requ\ +est-options\x01[\x01h'\x01k\x01\x01@\x01\x04self\xdc\0\0\xdd\0\x04\0'[method]req\ +uest-options.connect-timeout\x01^\x01@\x02\x04self\xdc\0\x08duration\xdd\0\0\xd2\ +\0\x04\0+[method]request-options.set-connect-timeout\x01_\x04\0*[method]request-\ +options.first-byte-timeout\x01^\x04\0.[method]request-options.set-first-byte-tim\ +eout\x01_\x04\0-[method]request-options.between-bytes-timeout\x01^\x04\01[method\ +]request-options.set-between-bytes-timeout\x01_\x01i(\x01i.\x01j\x01\xe1\0\x01\x1b\ +\x01@\x02\x05param\xe0\0\x08response\xe2\0\x01\0\x04\0\x1d[static]response-outpa\ +ram.set\x01c\x01h+\x01@\x01\x04self\xe4\0\0*\x04\0\x20[method]incoming-response.\ +status\x01e\x01@\x01\x04self\xe4\0\0\xc6\0\x04\0![method]incoming-response.heade\ +rs\x01f\x01@\x01\x04self\xe4\0\0\xc9\0\x04\0![method]incoming-response.consume\x01\ +g\x01h,\x01i\x03\x01j\x01\xe9\0\0\x01@\x01\x04self\xe8\0\0\xea\0\x04\0\x1c[metho\ +d]incoming-body.stream\x01k\x01i-\x01@\x01\x04this\xc8\0\0\xec\0\x04\0\x1c[stati\ +c]incoming-body.finish\x01m\x01h-\x01i\x09\x01@\x01\x04self\xee\0\0\xef\0\x04\0!\ +[method]future-trailers.subscribe\x01p\x01i$\x01k\xf1\0\x01j\x01\xf2\0\x01\x1b\x01\ +j\x01\xf3\0\0\x01k\xf4\0\x01@\x01\x04self\xee\0\0\xf5\0\x04\0\x1b[method]future-\ +trailers.get\x01v\x01@\x01\x07headers\xc6\0\0\xe1\0\x04\0\x1e[constructor]outgoi\ +ng-response\x01w\x01h.\x01@\x01\x04self\xf8\0\0*\x04\0%[method]outgoing-response\ +.status-code\x01y\x01@\x02\x04self\xf8\0\x0bstatus-code*\0\xd2\0\x04\0)[method]o\ +utgoing-response.set-status-code\x01z\x01@\x01\x04self\xf8\0\0\xc6\0\x04\0![meth\ +od]outgoing-response.headers\x01{\x01@\x01\x04self\xf8\0\0\xcf\0\x04\0\x1e[metho\ +d]outgoing-response.body\x01|\x01h/\x01i\x05\x01j\x01\xfe\0\0\x01@\x01\x04self\xfd\ +\0\0\xff\0\x04\0\x1b[method]outgoing-body.write\x01\x80\x01\x01j\0\x01\x1b\x01@\x02\ +\x04this\xce\0\x08trailers\xf2\0\0\x81\x01\x04\0\x1c[static]outgoing-body.finish\ +\x01\x82\x01\x01h0\x01@\x01\x04self\x83\x01\0\xef\0\x04\0*[method]future-incomin\ +g-response.subscribe\x01\x84\x01\x01i+\x01j\x01\x85\x01\x01\x1b\x01j\x01\x86\x01\ +\0\x01k\x87\x01\x01@\x01\x04self\x83\x01\0\x88\x01\x04\0$[method]future-incoming\ +-response.get\x01\x89\x01\x01h\x07\x01k\x1b\x01@\x01\x03err\x8a\x01\0\x8b\x01\x04\ +\0\x0fhttp-error-code\x01\x8c\x01\x03\0\x15wasi:http/types@0.2.0\x05\x0d\x02\x03\ +\0\x08\x10outgoing-request\x02\x03\0\x08\x0frequest-options\x02\x03\0\x08\x18fut\ +ure-incoming-response\x02\x03\0\x08\x0aerror-code\x01B\x0f\x02\x03\x02\x01\x0e\x04\ +\0\x10outgoing-request\x03\0\0\x02\x03\x02\x01\x0f\x04\0\x0frequest-options\x03\0\ +\x02\x02\x03\x02\x01\x10\x04\0\x18future-incoming-response\x03\0\x04\x02\x03\x02\ +\x01\x11\x04\0\x0aerror-code\x03\0\x06\x01i\x01\x01i\x03\x01k\x09\x01i\x05\x01j\x01\ +\x0b\x01\x07\x01@\x02\x07request\x08\x07options\x0a\0\x0c\x04\0\x06handle\x01\x0d\ +\x03\0\x20wasi:http/outgoing-handler@0.2.0\x05\x12\x01B\x05\x01r\x02\x07secondsw\ +\x0bnanosecondsy\x04\0\x08datetime\x03\0\0\x01@\0\0\x01\x04\0\x03now\x01\x02\x04\ +\0\x0aresolution\x01\x02\x03\0\x1cwasi:clocks/wall-clock@0.2.0\x05\x13\x02\x03\0\ +\x08\x10incoming-request\x02\x03\0\x08\x11response-outparam\x01B\x08\x02\x03\x02\ +\x01\x14\x04\0\x10incoming-request\x03\0\0\x02\x03\x02\x01\x15\x04\0\x11response\ +-outparam\x03\0\x02\x01i\x01\x01i\x03\x01@\x02\x07request\x04\x0cresponse-out\x05\ +\x01\0\x04\0\x06handle\x01\x06\x04\0\x20wasi:http/incoming-handler@0.2.0\x05\x16\ +\x04\0(sunfishcode:hello-wasi-http/target-world\x04\0\x0b\x12\x01\0\x0ctarget-wo\ +rld\x03\0\0\0G\x09producers\x01\x0cprocessed-by\x02\x0dwit-component\x070.220.0\x10\ +wit-bindgen-rust\x060.35.0"; #[inline(never)] #[doc(hidden)] -#[cfg(target_arch = "wasm32")] pub fn __link_custom_section_describing_imports() { wit_bindgen_rt::maybe_link_cabi_realloc(); }