From 36f410254d797bd50064bd7b8e2e18a0f51d324f Mon Sep 17 00:00:00 2001 From: xlem Date: Sun, 3 Mar 2024 20:37:23 -0330 Subject: [PATCH] uprev to wasmtime 18 --- Cargo.lock | 1322 +- cli/Cargo.toml | 3 +- .../wasm/wasi_snapshot_preview1.command.wasm | Bin 105117 -> 96949 bytes core/Cargo.toml | 25 +- core/guest/Cargo.toml | 2 +- core/guest/src/assemblylift.rs | 403 +- core/guest/src/command.rs | 22758 ++++++++-------- core/guest/src/jwt.rs | 204 +- core/guest/src/lib.rs | 8 +- core/guest/src/opa.rs | 223 +- core/guest/src/secrets.rs | 310 +- core/src/wasm/mod.rs | 62 +- core/wit/assemblylift/assemblylift.wit | 22 +- core/wit/jwt/jwt.wit | 6 +- core/wit/opa/opa.wit | 8 +- core/wit/secrets/secrets.wit | 10 +- 16 files changed, 12611 insertions(+), 12755 deletions(-) mode change 100755 => 100644 cli/src/commands/cast/wasm/wasi_snapshot_preview1.command.wasm diff --git a/Cargo.lock b/Cargo.lock index f4c172f1..b2ba7efa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11,21 +11,6 @@ dependencies = [ "gimli 0.27.3", ] -[[package]] -name = "addr2line" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" -dependencies = [ - "cpp_demangle 0.4.3", - "fallible-iterator", - "gimli 0.27.3", - "memmap2", - "object 0.31.1", - "rustc-demangle", - "smallvec", -] - [[package]] name = "addr2line" version = "0.21.0" @@ -129,9 +114,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.4" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" [[package]] name = "anstyle-parse" @@ -172,21 +157,6 @@ name = "arbitrary" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" -dependencies = [ - "derive_arbitrary", -] - -[[package]] -name = "arrayref" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "asml-iomod-registry-common" @@ -257,7 +227,7 @@ dependencies = [ "tracing", "tracing-subscriber", "walkdir", - "wasmtime", + "wasmtime 18.0.2", "z85", "zip", ] @@ -283,14 +253,13 @@ dependencies = [ "tokio-test", "tracing", "uuid", - "wasm-encoder 0.29.0 (git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f)", - "wasm-tools", - "wasmtime", + "wasm-encoder 0.41.2", + "wasmtime 18.0.2", "wasmtime-wasi", - "wast 60.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wat 1.0.84", - "wit-component 0.11.0 (git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f)", - "wit-parser 0.8.0 (git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f)", + "wast 70.0.2", + "wat", + "wit-component 0.20.3", + "wit-parser", ] [[package]] @@ -583,19 +552,6 @@ version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" -[[package]] -name = "blake3" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0231f06152bf547e9c2b5194f247cd97aacf6dcd8b15d8e5ec0663f64580da87" -dependencies = [ - "arrayref", - "arrayvec", - "cc", - "cfg-if", - "constant_time_eq 0.3.0", -] - [[package]] name = "block-buffer" version = "0.10.4" @@ -652,38 +608,50 @@ dependencies = [ [[package]] name = "cap-fs-ext" -version = "1.0.15" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58bc48200a1a0fa6fba138b1802ad7def18ec1cdd92f7b2a04e21f1bd887f7b9" +checksum = "88e341d15ac1029aadce600be764a1a1edafe40e03cde23285bc1d261b3a4866" dependencies = [ "cap-primitives", "cap-std", - "io-lifetimes 1.0.11", - "windows-sys 0.48.0", + "io-lifetimes 2.0.3", + "windows-sys 0.52.0", +] + +[[package]] +name = "cap-net-ext" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "434168fe6533055f0f4204039abe3ff6d7db338ef46872a5fa39e9d5ad5ab7a9" +dependencies = [ + "cap-primitives", + "cap-std", + "rustix 0.38.30", + "smallvec", ] [[package]] name = "cap-primitives" -version = "1.0.15" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4b6df5b295dca8d56f35560be8c391d59f0420f72e546997154e24e765e6451" +checksum = "fe16767ed8eee6d3f1f00d6a7576b81c226ab917eb54b96e5f77a5216ef67abb" dependencies = [ "ambient-authority", "fs-set-times", "io-extras", - "io-lifetimes 1.0.11", + "io-lifetimes 2.0.3", "ipnet", "maybe-owned", - "rustix 0.37.27", - "windows-sys 0.48.0", - "winx 0.35.1", + "rustix 0.38.30", + "windows-sys 0.52.0", + "winx", ] [[package]] name = "cap-rand" -version = "1.0.15" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d25555efacb0b5244cf1d35833d55d21abc916fff0eaad254b8e2453ea9b8ab" +checksum = "20e5695565f0cd7106bc3c7170323597540e772bb73e0be2cd2c662a0f8fa4ca" dependencies = [ "ambient-authority", "rand", @@ -691,26 +659,28 @@ dependencies = [ [[package]] name = "cap-std" -version = "1.0.15" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3373a62accd150b4fcba056d4c5f3b552127f0ec86d3c8c102d60b978174a012" +checksum = "593db20e4c51f62d3284bae7ee718849c3214f93a3b94ea1899ad85ba119d330" dependencies = [ "cap-primitives", "io-extras", - "io-lifetimes 1.0.11", - "rustix 0.37.27", + "io-lifetimes 2.0.3", + "rustix 0.38.30", ] [[package]] name = "cap-time-ext" -version = "1.0.15" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e95002993b7baee6b66c8950470e59e5226a23b3af39fc59c47fe416dd39821a" +checksum = "03261630f291f425430a36f38c847828265bc928f517cdd2004c56f4b02f002b" dependencies = [ + "ambient-authority", "cap-primitives", + "iana-time-zone", "once_cell", - "rustix 0.37.27", - "winx 0.35.1", + "rustix 0.38.30", + "winx", ] [[package]] @@ -852,7 +822,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" dependencies = [ "clap_builder", - "clap_derive", ] [[package]] @@ -867,18 +836,6 @@ dependencies = [ "strsim 0.10.0", ] -[[package]] -name = "clap_derive" -version = "4.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn 2.0.48", -] - [[package]] name = "clap_lex" version = "0.2.4" @@ -919,12 +876,6 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" -[[package]] -name = "constant_time_eq" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" - [[package]] name = "core-foundation" version = "0.9.4" @@ -950,15 +901,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "cpp_demangle" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8227005286ec39567949b33df9896bcadfa6051bccca2488129f108ca23119" -dependencies = [ - "cfg-if", -] - [[package]] name = "cpufeatures" version = "0.2.12" @@ -974,7 +916,16 @@ version = "0.98.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ebf2f2c0abc3a31cda70b20bae56b9aeb6ad0de00c3620bfef1a7e26220edfb" dependencies = [ - "cranelift-entity", + "cranelift-entity 0.98.2", +] + +[[package]] +name = "cranelift-bforest" +version = "0.105.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9515fcc42b6cb5137f76b84c1a6f819782d0cf12473d145d3bc5cd67eedc8bc2" +dependencies = [ + "cranelift-entity 0.105.2", ] [[package]] @@ -984,12 +935,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46d414ddd870ebce9b55eed9e803ef063436bd4d64160dd8e811ccbeb2c914f0" dependencies = [ "bumpalo", - "cranelift-bforest", - "cranelift-codegen-meta", - "cranelift-codegen-shared", - "cranelift-control", - "cranelift-entity", - "cranelift-isle", + "cranelift-bforest 0.98.2", + "cranelift-codegen-meta 0.98.2", + "cranelift-codegen-shared 0.98.2", + "cranelift-control 0.98.2", + "cranelift-entity 0.98.2", + "cranelift-isle 0.98.2", "gimli 0.27.3", "hashbrown 0.13.2", "log", @@ -998,13 +949,43 @@ dependencies = [ "target-lexicon", ] +[[package]] +name = "cranelift-codegen" +version = "0.105.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad827c6071bfe6d22de1bc331296a29f9ddc506ff926d8415b435ec6a6efce0" +dependencies = [ + "bumpalo", + "cranelift-bforest 0.105.2", + "cranelift-codegen-meta 0.105.2", + "cranelift-codegen-shared 0.105.2", + "cranelift-control 0.105.2", + "cranelift-entity 0.105.2", + "cranelift-isle 0.105.2", + "gimli 0.28.1", + "hashbrown 0.14.3", + "log", + "regalloc2", + "smallvec", + "target-lexicon", +] + [[package]] name = "cranelift-codegen-meta" version = "0.98.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d1b0065250c0c1fae99748aadc6003725e588542650886d76dd234eca8498598" dependencies = [ - "cranelift-codegen-shared", + "cranelift-codegen-shared 0.98.2", +] + +[[package]] +name = "cranelift-codegen-meta" +version = "0.105.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10e6b36237a9ca2ce2fb4cc7741d418a080afa1327402138412ef85d5367bef1" +dependencies = [ + "cranelift-codegen-shared 0.105.2", ] [[package]] @@ -1013,6 +994,12 @@ version = "0.98.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "27320b5159cfa5eadcbebceda66ac145c0aa5cb7a31948550b9636f77924081b" +[[package]] +name = "cranelift-codegen-shared" +version = "0.105.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c36bf4bfb86898a94ccfa773a1f86e8a5346b1983ff72059bdd2db4600325251" + [[package]] name = "cranelift-control" version = "0.98.2" @@ -1022,6 +1009,15 @@ dependencies = [ "arbitrary", ] +[[package]] +name = "cranelift-control" +version = "0.105.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cbf36560e7a6bd1409ca91e7b43b2cc7ed8429f343d7605eadf9046e8fac0d0" +dependencies = [ + "arbitrary", +] + [[package]] name = "cranelift-entity" version = "0.98.2" @@ -1031,13 +1027,35 @@ dependencies = [ "serde", ] +[[package]] +name = "cranelift-entity" +version = "0.105.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a71e11061a75b1184c09bea97c026a88f08b59ade96a7bb1f259d4ea0df2e942" +dependencies = [ + "serde", + "serde_derive", +] + [[package]] name = "cranelift-frontend" version = "0.98.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f5321dc54f0f4e19f85d8e68543c63edfc255171cc5910c8b9a48e6210ffcdf2" dependencies = [ - "cranelift-codegen", + "cranelift-codegen 0.98.2", + "log", + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cranelift-frontend" +version = "0.105.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af5d4da63143ee3485c7bcedde0a818727d737d1083484a0ceedb8950c89e495" +dependencies = [ + "cranelift-codegen 0.105.2", "log", "smallvec", "target-lexicon", @@ -1049,13 +1067,30 @@ version = "0.98.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adff1f9152fd9970ad9cc14e0d4e1b0089a75d19f8538c4dc9e19aebbd53fe60" +[[package]] +name = "cranelift-isle" +version = "0.105.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "457a9832b089e26f5eea70dcf49bed8ec6edafed630ce7c83161f24d46ab8085" + [[package]] name = "cranelift-native" version = "0.98.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "809bfa1db0b982b1796bc8c0002ab6bab959664df16095c289e567bdd22ade6f" dependencies = [ - "cranelift-codegen", + "cranelift-codegen 0.98.2", + "libc", + "target-lexicon", +] + +[[package]] +name = "cranelift-native" +version = "0.105.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b490d579df1ce365e1ea359e24ed86d82289fa785153327c2f6a69a59a731e4" +dependencies = [ + "cranelift-codegen 0.105.2", "libc", "target-lexicon", ] @@ -1066,14 +1101,30 @@ version = "0.98.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "892f9273ee0c7709e839fcee769f9db1630789be5dbdfa429d84e0de8ec3dd41" dependencies = [ - "cranelift-codegen", - "cranelift-entity", - "cranelift-frontend", + "cranelift-codegen 0.98.2", + "cranelift-entity 0.98.2", + "cranelift-frontend 0.98.2", + "itertools 0.10.5", + "log", + "smallvec", + "wasmparser 0.107.0", + "wasmtime-types 11.0.2", +] + +[[package]] +name = "cranelift-wasm" +version = "0.105.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cd747ed7f9a461dda9c388415392f6bb95d1a6ef3b7694d17e0817eb74b7798" +dependencies = [ + "cranelift-codegen 0.105.2", + "cranelift-entity 0.105.2", + "cranelift-frontend 0.105.2", "itertools 0.10.5", "log", "smallvec", - "wasmparser 0.107.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmtime-types", + "wasmparser 0.121.2", + "wasmtime-types 18.0.2", ] [[package]] @@ -1148,17 +1199,6 @@ dependencies = [ "powerfmt", ] -[[package]] -name = "derive_arbitrary" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - [[package]] name = "dialoguer" version = "0.10.4" @@ -1232,20 +1272,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "egg" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05a6c0bbc92278f84e742f08c0ab9cb16a987376cd2bc39d228ef9c74d98d6f7" -dependencies = [ - "indexmap 1.9.3", - "instant", - "log", - "once_cell", - "smallvec", - "symbolic_expressions", -] - [[package]] name = "either" version = "1.9.0" @@ -1267,32 +1293,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "env_logger" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" -dependencies = [ - "atty", - "humantime", - "log", - "regex", - "termcolor", -] - -[[package]] -name = "env_logger" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" -dependencies = [ - "humantime", - "is-terminal", - "log", - "regex", - "termcolor", -] - [[package]] name = "equivalent" version = "1.0.1" @@ -1324,6 +1324,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" +[[package]] +name = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + [[package]] name = "fastrand" version = "2.0.1" @@ -1341,16 +1347,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "file-per-thread-logger" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a3cc21c33af89af0930c8cae4ade5e6fdc17b5d2c97b3d2e2edb67a1cf683f3" -dependencies = [ - "env_logger 0.10.2", - "log", -] - [[package]] name = "filetime" version = "0.2.23" @@ -1363,21 +1359,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "fixedbitset" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" - -[[package]] -name = "flagset" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a7e408202050813e6f1d9addadcaafef3dca7530c7ddfb005d4081cce6779" -dependencies = [ - "serde", -] - [[package]] name = "flate2" version = "1.0.28" @@ -1420,13 +1401,13 @@ dependencies = [ [[package]] name = "fs-set-times" -version = "0.19.2" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d167b646a876ba8fda6b50ac645cfd96242553cbaf0ca4fccaa39afcbf0801f" +checksum = "033b337d725b97690d86893f9de22b67b80dcc4e9ad815f348254c38119db8fb" dependencies = [ - "io-lifetimes 1.0.11", + "io-lifetimes 2.0.3", "rustix 0.38.30", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1567,7 +1548,7 @@ version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" dependencies = [ - "fallible-iterator", + "fallible-iterator 0.2.0", "indexmap 1.9.3", "stable_deref_trait", ] @@ -1577,6 +1558,11 @@ name = "gimli" version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +dependencies = [ + "fallible-iterator 0.3.0", + "indexmap 2.2.1", + "stable_deref_trait", +] [[package]] name = "h2" @@ -1645,6 +1631,9 @@ name = "hashbrown" version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash", +] [[package]] name = "heck" @@ -1732,12 +1721,6 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" -[[package]] -name = "humantime" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" - [[package]] name = "hyper" version = "0.14.28" @@ -1845,15 +1828,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] - [[package]] name = "inventory" version = "0.3.15" @@ -1862,12 +1836,12 @@ checksum = "f958d3d68f4167080a18141e10381e7634563984a537f2a49a30fd8e53ac5767" [[package]] name = "io-extras" -version = "0.17.4" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fde93d48f0d9277f977a333eca8313695ddd5301dc96f7e02aeddcb0dd99096f" +checksum = "c301e73fb90e8a29e600a9f402d095765f74310d582916a952f618836a1bd1ed" dependencies = [ - "io-lifetimes 1.0.11", - "windows-sys 0.48.0", + "io-lifetimes 2.0.3", + "windows-sys 0.52.0", ] [[package]] @@ -1893,26 +1867,6 @@ version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" -[[package]] -name = "is-terminal" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" -dependencies = [ - "hermit-abi 0.3.4", - "rustix 0.38.30", - "windows-sys 0.52.0", -] - -[[package]] -name = "is_executable" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa9acdc6d67b75e626ad644734e8bc6df893d9cd2a834129065d3dd6158ea9c8" -dependencies = [ - "winapi", -] - [[package]] name = "itertools" version = "0.10.5" @@ -1939,9 +1893,9 @@ checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "ittapi" -version = "0.3.5" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a5c0b993601cad796222ea076565c5d9f337d35592f8622c753724f06d7271" +checksum = "6b996fe614c41395cdaedf3cf408a9534851090959d90d54a535f675550b64b1" dependencies = [ "anyhow", "ittapi-sys", @@ -1950,9 +1904,9 @@ dependencies = [ [[package]] name = "ittapi-sys" -version = "0.3.5" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7b5e473765060536a660eed127f758cf1a810c73e49063264959c60d1727d9" +checksum = "52f5385394064fa2c886205dba02598013ce83d3e92d33dbdc0c52fe0e7bf4fc" dependencies = [ "cc", ] @@ -2051,12 +2005,6 @@ dependencies = [ "redox_syscall", ] -[[package]] -name = "linked-hash-map" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" - [[package]] name = "linux-raw-sys" version = "0.3.8" @@ -2116,19 +2064,19 @@ dependencies = [ ] [[package]] -name = "memmap2" -version = "0.5.10" +name = "memoffset" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" dependencies = [ - "libc", + "autocfg", ] [[package]] name = "memoffset" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" dependencies = [ "autocfg", ] @@ -2218,23 +2166,15 @@ dependencies = [ "memchr", ] -[[package]] -name = "object" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" -dependencies = [ - "flate2", - "memchr", - "ruzstd", -] - [[package]] name = "object" version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ + "crc32fast", + "hashbrown 0.14.3", + "indexmap 2.2.1", "memchr", ] @@ -2258,7 +2198,7 @@ dependencies = [ "tempfile", "thiserror", "walkdir", - "wasmtime", + "wasmtime 11.0.2", "which", ] @@ -2439,16 +2379,6 @@ dependencies = [ "sha2", ] -[[package]] -name = "petgraph" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" -dependencies = [ - "fixedbitset", - "indexmap 2.2.1", -] - [[package]] name = "pin-project" version = "1.1.4" @@ -2528,28 +2458,6 @@ dependencies = [ "cc", ] -[[package]] -name = "pulldown-cmark" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffade02495f22453cd593159ea2f59827aae7f53fa8323f756799b670881dcf8" -dependencies = [ - "bitflags 1.3.2", - "memchr", - "unicase", -] - -[[package]] -name = "pulldown-cmark" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57206b407293d2bcd3af849ce869d52068623f19e1b5ff8e8778e3309439682b" -dependencies = [ - "bitflags 2.4.2", - "memchr", - "unicase", -] - [[package]] name = "quick-error" version = "2.0.1" @@ -2760,10 +2668,8 @@ dependencies = [ "bitflags 1.3.2", "errno", "io-lifetimes 1.0.11", - "itoa", "libc", "linux-raw-sys 0.3.8", - "once_cell", "windows-sys 0.48.0", ] @@ -2775,22 +2681,13 @@ checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" dependencies = [ "bitflags 2.4.2", "errno", + "itoa", "libc", "linux-raw-sys 0.4.13", + "once_cell", "windows-sys 0.52.0", ] -[[package]] -name = "ruzstd" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a15e661f0f9dac21f3494fe5d23a6338c0ac116a2d22c2b63010acd89467ffe" -dependencies = [ - "byteorder", - "thiserror", - "twox-hash", -] - [[package]] name = "ryu" version = "1.0.16" @@ -2913,18 +2810,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_yaml" -version = "0.8.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578a7433b776b56a35785ed5ce9a7e777ac0598aac5a6dd1b4b18a307c7fc71b" -dependencies = [ - "indexmap 1.9.3", - "ryu", - "serde", - "yaml-rust", -] - [[package]] name = "sha1" version = "0.10.6" @@ -3011,6 +2896,15 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "spdx" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29ef1a0fa1e39ac22972c8db23ff89aea700ab96aa87114e1fb55937a631a0c9" +dependencies = [ + "smallvec", +] + [[package]] name = "spin" version = "0.5.2" @@ -3029,12 +2923,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - [[package]] name = "std_prelude" version = "0.2.12" @@ -3065,12 +2953,6 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" -[[package]] -name = "symbolic_expressions" -version = "5.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c68d531d83ec6c531150584c42a4290911964d5f0d79132b193b67252a23b71" - [[package]] name = "syn" version = "1.0.109" @@ -3116,9 +2998,9 @@ dependencies = [ [[package]] name = "system-interface" -version = "0.25.9" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10081a99cbecbc363d381b9503563785f0b02735fccbb0d4c1a2cb3d39f7e7fe" +checksum = "0682e006dd35771e392a6623ac180999a9a854b1d4a6c12fb2e804941c2b1f58" dependencies = [ "bitflags 2.4.2", "cap-fs-ext", @@ -3126,8 +3008,8 @@ dependencies = [ "fd-lock", "io-lifetimes 2.0.3", "rustix 0.38.30", - "windows-sys 0.48.0", - "winx 0.36.3", + "windows-sys 0.52.0", + "winx", ] [[package]] @@ -3483,16 +3365,6 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" -[[package]] -name = "twox-hash" -version = "1.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" -dependencies = [ - "cfg-if", - "static_assertions", -] - [[package]] name = "typenum" version = "1.17.0" @@ -3529,15 +3401,6 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" -[[package]] -name = "unicase" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check", -] - [[package]] name = "unicode-bidi" version = "0.3.15" @@ -3670,47 +3533,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] -name = "wasi-cap-std-sync" -version = "11.0.2" +name = "wasi-common" +version = "18.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b22cf4595ee2af2c728a3ad5e90961556df7870e027bb054c59e0747f3533edb" +checksum = "880c1461417b2bf90262591bf8a5f04358fb86dac8a585a49b87024971296763" dependencies = [ "anyhow", - "async-trait", + "bitflags 2.4.2", "cap-fs-ext", "cap-rand", "cap-std", "cap-time-ext", "fs-set-times", "io-extras", - "io-lifetimes 1.0.11", - "is-terminal", + "io-lifetimes 2.0.3", + "log", "once_cell", - "rustix 0.37.27", + "rustix 0.38.30", "system-interface", - "tracing", - "wasi-common", - "windows-sys 0.48.0", -] - -[[package]] -name = "wasi-common" -version = "11.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe8dbf50f7f86c73af7eeb9a00d342fe20a6a2460bd7737d8db6b65e9a8216cd" -dependencies = [ - "anyhow", - "bitflags 1.3.2", - "cap-rand", - "cap-std", - "io-extras", - "log", - "rustix 0.37.27", "thiserror", "tracing", - "wasmtime", + "wasmtime 18.0.2", "wiggle", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -3779,154 +3624,47 @@ version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" -[[package]] -name = "wasm-compose" -version = "0.2.17" -source = "git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f#0263c2f2e0a33fe97569535aa2784b7989cb1dd0" -dependencies = [ - "anyhow", - "clap 4.4.18", - "heck", - "indexmap 2.2.1", - "log", - "petgraph", - "serde", - "serde_yaml", - "smallvec", - "wasm-encoder 0.29.0 (git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f)", - "wasmparser 0.107.0 (git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f)", - "wat 1.0.66", -] - [[package]] name = "wasm-encoder" -version = "0.29.0" +version = "0.38.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18c41dbd92eaebf3612a39be316540b8377c871cb9bde6b064af962984912881" +checksum = "0ad2b51884de9c7f4fe2fd1043fccb8dcad4b1e29558146ee57a144d15779f3f" dependencies = [ "leb128", ] [[package]] name = "wasm-encoder" -version = "0.29.0" -source = "git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f#0263c2f2e0a33fe97569535aa2784b7989cb1dd0" +version = "0.41.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "972f97a5d8318f908dded23594188a90bcd09365986b1163e66d70170e5287ae" dependencies = [ "leb128", ] [[package]] name = "wasm-encoder" -version = "0.40.0" +version = "0.201.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d162eb64168969ae90e8668ca0593b0e47667e315aa08e717a9c9574d700d826" +checksum = "b9c7d2731df60006819b013f64ccc2019691deccf6e11a1804bc850cd6748f1a" dependencies = [ "leb128", ] [[package]] name = "wasm-metadata" -version = "0.8.0" +version = "0.10.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36e5156581ff4a302405c44ca7c85347563ca431d15f1a773f12c9c7b9a6cdc9" -dependencies = [ - "anyhow", - "indexmap 1.9.3", - "serde", - "wasm-encoder 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmparser 0.107.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "wasm-metadata" -version = "0.8.0" -source = "git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f#0263c2f2e0a33fe97569535aa2784b7989cb1dd0" -dependencies = [ - "anyhow", - "clap 4.4.18", - "indexmap 2.2.1", - "serde", - "wasm-encoder 0.29.0 (git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f)", - "wasmparser 0.107.0 (git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f)", -] - -[[package]] -name = "wasm-mutate" -version = "0.2.27" -source = "git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f#0263c2f2e0a33fe97569535aa2784b7989cb1dd0" -dependencies = [ - "clap 4.4.18", - "egg", - "log", - "rand", - "thiserror", - "wasm-encoder 0.29.0 (git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f)", - "wasmparser 0.107.0 (git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f)", -] - -[[package]] -name = "wasm-shrink" -version = "0.1.28" -source = "git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f#0263c2f2e0a33fe97569535aa2784b7989cb1dd0" +checksum = "18ebaa7bd0f9e7a5e5dd29b9a998acf21c4abed74265524dd7e85934597bfb10" dependencies = [ "anyhow", - "blake3", - "clap 4.4.18", - "log", - "rand", - "wasm-mutate", - "wasmparser 0.107.0 (git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f)", -] - -[[package]] -name = "wasm-smith" -version = "0.12.10" -source = "git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f#0263c2f2e0a33fe97569535aa2784b7989cb1dd0" -dependencies = [ - "arbitrary", - "flagset", "indexmap 2.2.1", - "leb128", - "serde", - "wasm-encoder 0.29.0 (git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f)", - "wasmparser 0.107.0 (git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f)", -] - -[[package]] -name = "wasm-tools" -version = "1.0.35" -source = "git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f#0263c2f2e0a33fe97569535aa2784b7989cb1dd0" -dependencies = [ - "addr2line 0.20.0", - "anyhow", - "arbitrary", - "atty", - "clap 4.4.18", - "cpp_demangle 0.4.3", - "env_logger 0.9.3", - "gimli 0.27.3", - "is_executable", - "log", - "rayon", - "regex", - "rustc-demangle", "serde", + "serde_derive", "serde_json", - "tempfile", - "termcolor", - "wasm-compose", - "wasm-encoder 0.29.0 (git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f)", - "wasm-metadata 0.8.0 (git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f)", - "wasm-mutate", - "wasm-shrink", - "wasm-smith", - "wasmparser 0.107.0 (git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f)", - "wasmprinter 0.2.59", - "wast 60.0.0 (git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f)", - "wat 1.0.66", - "wit-component 0.11.0 (git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f)", - "wit-parser 0.8.0 (git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f)", - "wit-smith", + "spdx", + "wasm-encoder 0.41.2", + "wasmparser 0.121.2", ] [[package]] @@ -3941,8 +3679,9 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.107.0" -source = "git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f#0263c2f2e0a33fe97569535aa2784b7989cb1dd0" +version = "0.118.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77f1154f1ab868e2a01d9834a805faca7bf8b50d041b4ca714d005d0dab1c50c" dependencies = [ "indexmap 2.2.1", "semver", @@ -3950,9 +3689,9 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.120.0" +version = "0.121.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9148127f39cbffe43efee8d5442b16ecdba21567785268daa1ec9e134389705" +checksum = "9dbe55c8f9d0dbd25d9447a5a889ff90c0cc3feaa7395310d3d826b2c703eaab" dependencies = [ "bitflags 2.4.2", "indexmap 2.2.1", @@ -3961,29 +3700,50 @@ dependencies = [ [[package]] name = "wasmprinter" -version = "0.2.59" -source = "git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f#0263c2f2e0a33fe97569535aa2784b7989cb1dd0" +version = "0.2.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60e73986a6b7fdfedb7c5bf9e7eb71135486507c8fbc4c0c42cffcb6532988b7" dependencies = [ "anyhow", - "wasmparser 0.107.0 (git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f)", + "wasmparser 0.121.2", ] [[package]] -name = "wasmprinter" -version = "0.2.77" +name = "wasmtime" +version = "11.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8389a95eb0b3165fea0537a6988960cc23a33d9be650e63fc3d63065fe20dcb" +checksum = "028253baf4df6e0823481845a380117de2b7f42166261551db7d097d60cfc685" dependencies = [ "anyhow", - "wasmparser 0.120.0", + "bincode", + "bumpalo", + "cfg-if", + "fxprof-processed-profile", + "indexmap 1.9.3", + "libc", + "log", + "object 0.30.4", + "once_cell", + "paste", + "psm", + "serde", + "serde_json", + "target-lexicon", + "wasmparser 0.107.0", + "wasmtime-cranelift 11.0.2", + "wasmtime-environ 11.0.2", + "wasmtime-jit", + "wasmtime-runtime 11.0.2", + "windows-sys 0.48.0", ] [[package]] name = "wasmtime" -version = "11.0.2" +version = "18.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "028253baf4df6e0823481845a380117de2b7f42166261551db7d097d60cfc685" +checksum = "4c843b8bc4dd4f3a76173ba93405c71111d570af0d90ea5f6299c705d0c2add2" dependencies = [ + "addr2line 0.21.0", "anyhow", "async-trait", "bincode", @@ -3991,29 +3751,34 @@ dependencies = [ "cfg-if", "encoding_rs", "fxprof-processed-profile", - "indexmap 1.9.3", + "gimli 0.28.1", + "indexmap 2.2.1", + "ittapi", "libc", "log", - "object 0.30.4", + "object 0.32.2", "once_cell", "paste", - "psm", "rayon", + "rustix 0.38.30", "serde", + "serde_derive", "serde_json", "target-lexicon", - "wasmparser 0.107.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-encoder 0.41.2", + "wasmparser 0.121.2", "wasmtime-cache", "wasmtime-component-macro", "wasmtime-component-util", - "wasmtime-cranelift", - "wasmtime-environ", + "wasmtime-cranelift 18.0.2", + "wasmtime-environ 18.0.2", "wasmtime-fiber", - "wasmtime-jit", - "wasmtime-runtime", + "wasmtime-jit-debug 18.0.2", + "wasmtime-jit-icache-coherence 18.0.2", + "wasmtime-runtime 18.0.2", "wasmtime-winch", - "wat 1.0.84", - "windows-sys 0.48.0", + "wat", + "windows-sys 0.52.0", ] [[package]] @@ -4025,46 +3790,55 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "wasmtime-asm-macros" +version = "18.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b9d329c718b3a18412a6a017c912b539baa8fe1210d21b651f6b4dbafed743" +dependencies = [ + "cfg-if", +] + [[package]] name = "wasmtime-cache" -version = "11.0.2" +version = "18.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34308e5033adb530c18de06f6f2d1de2c0cb6dc19e9c13451acf97ec4e07b30a" +checksum = "6fb4fc2bbf9c790a57875eba65588fa97acf57a7d784dc86d057e648d9a1ed91" dependencies = [ "anyhow", "base64 0.21.7", "bincode", "directories-next", - "file-per-thread-logger", "log", - "rustix 0.37.27", + "rustix 0.38.30", "serde", + "serde_derive", "sha2", "toml 0.5.11", - "windows-sys 0.48.0", + "windows-sys 0.52.0", "zstd", ] [[package]] name = "wasmtime-component-macro" -version = "11.0.2" +version = "18.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1631a5fed4e162edf7e0604845e6150903f17099970e1a0020f540831d0f8479" +checksum = "d8d55ddfd02898885c39638eae9631cd430c83a368f5996ed0f7bfb181d02157" dependencies = [ "anyhow", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.48", "wasmtime-component-util", "wasmtime-wit-bindgen", - "wit-parser 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wit-parser", ] [[package]] name = "wasmtime-component-util" -version = "11.0.2" +version = "18.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31bd6b1c6d8ece2aa852bf5dad0ea91be63e81c7571d7bcf24238b05405adb70" +checksum = "1d6d69c430cddc70ec42159506962c66983ce0192ebde4eb125b7aabc49cff88" [[package]] name = "wasmtime-cranelift" @@ -4073,20 +3847,45 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "696333ffdbd9fabb486d8a5ee82c75fcd22d199446d3df04935a286fcbb40100" dependencies = [ "anyhow", - "cranelift-codegen", - "cranelift-control", - "cranelift-entity", - "cranelift-frontend", - "cranelift-native", - "cranelift-wasm", + "cranelift-codegen 0.98.2", + "cranelift-control 0.98.2", + "cranelift-entity 0.98.2", + "cranelift-frontend 0.98.2", + "cranelift-native 0.98.2", + "cranelift-wasm 0.98.2", "gimli 0.27.3", "log", "object 0.30.4", "target-lexicon", "thiserror", - "wasmparser 0.107.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmtime-cranelift-shared", - "wasmtime-environ", + "wasmparser 0.107.0", + "wasmtime-cranelift-shared 11.0.2", + "wasmtime-environ 11.0.2", +] + +[[package]] +name = "wasmtime-cranelift" +version = "18.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31ca62f519225492bd555d0ec85a2dacb0c10315db3418c8b9aeb3824bf54a24" +dependencies = [ + "anyhow", + "cfg-if", + "cranelift-codegen 0.105.2", + "cranelift-control 0.105.2", + "cranelift-entity 0.105.2", + "cranelift-frontend 0.105.2", + "cranelift-native 0.105.2", + "cranelift-wasm 0.105.2", + "gimli 0.28.1", + "log", + "object 0.32.2", + "target-lexicon", + "thiserror", + "wasmparser 0.121.2", + "wasmtime-cranelift-shared 18.0.2", + "wasmtime-environ 18.0.2", + "wasmtime-versioned-export-macros", ] [[package]] @@ -4096,13 +3895,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "434899162f65339ae7710f6fba91083b86e707cb618a8f4e8b037b8d46223d56" dependencies = [ "anyhow", - "cranelift-codegen", - "cranelift-control", - "cranelift-native", + "cranelift-codegen 0.98.2", + "cranelift-control 0.98.2", + "cranelift-native 0.98.2", "gimli 0.27.3", "object 0.30.4", "target-lexicon", - "wasmtime-environ", + "wasmtime-environ 11.0.2", +] + +[[package]] +name = "wasmtime-cranelift-shared" +version = "18.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd5f2071f42e61490bf7cb95b9acdbe6a29dd577a398019304a960585f28b844" +dependencies = [ + "anyhow", + "cranelift-codegen 0.105.2", + "cranelift-control 0.105.2", + "cranelift-native 0.105.2", + "gimli 0.28.1", + "object 0.32.2", + "target-lexicon", + "wasmtime-environ 18.0.2", ] [[package]] @@ -4112,7 +3927,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1189b2fa0e7fbf71a06c7c909ae7f8f0085f8f4e4365926d6ff1052e024effe9" dependencies = [ "anyhow", - "cranelift-entity", + "cranelift-entity 0.98.2", "gimli 0.27.3", "indexmap 1.9.3", "log", @@ -4120,24 +3935,49 @@ dependencies = [ "serde", "target-lexicon", "thiserror", - "wasm-encoder 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmparser 0.107.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmprinter 0.2.77", + "wasmparser 0.107.0", + "wasmtime-types 11.0.2", +] + +[[package]] +name = "wasmtime-environ" +version = "18.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82bf1a47f384610da19f58b0fd392ca6a3b720974315c08afb0392c0f3951fed" +dependencies = [ + "anyhow", + "bincode", + "cpp_demangle", + "cranelift-entity 0.105.2", + "gimli 0.28.1", + "indexmap 2.2.1", + "log", + "object 0.32.2", + "rustc-demangle", + "serde", + "serde_derive", + "target-lexicon", + "thiserror", + "wasm-encoder 0.41.2", + "wasmparser 0.121.2", + "wasmprinter", "wasmtime-component-util", - "wasmtime-types", + "wasmtime-types 18.0.2", ] [[package]] name = "wasmtime-fiber" -version = "11.0.2" +version = "18.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0e22d42113a1181fee3477f96639fd88c757b303f7083e866691f47a06065c5" +checksum = "0e31aecada2831e067ebfe93faa3001cc153d506f8af40bbea58aa1d20fe4820" dependencies = [ + "anyhow", "cc", "cfg-if", - "rustix 0.37.27", - "wasmtime-asm-macros", - "windows-sys 0.48.0", + "rustix 0.38.30", + "wasmtime-asm-macros 18.0.2", + "wasmtime-versioned-export-macros", + "windows-sys 0.52.0", ] [[package]] @@ -4150,19 +3990,17 @@ dependencies = [ "anyhow", "bincode", "cfg-if", - "cpp_demangle 0.3.5", + "cpp_demangle", "gimli 0.27.3", - "ittapi", "log", "object 0.30.4", "rustc-demangle", "rustix 0.37.27", "serde", "target-lexicon", - "wasmtime-environ", - "wasmtime-jit-debug", - "wasmtime-jit-icache-coherence", - "wasmtime-runtime", + "wasmtime-environ 11.0.2", + "wasmtime-jit-icache-coherence 11.0.2", + "wasmtime-runtime 11.0.2", "windows-sys 0.48.0", ] @@ -4172,9 +4010,19 @@ version = "11.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7228ed7aaedec75d6bd298f857e42f4626cffdb7b577c018eb2075c65d44dcf" dependencies = [ - "object 0.30.4", "once_cell", - "rustix 0.37.27", +] + +[[package]] +name = "wasmtime-jit-debug" +version = "18.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "833dae95bc7a4f9177bf93f9497419763535b74e37eb8c37be53937d3281e287" +dependencies = [ + "object 0.32.2", + "once_cell", + "rustix 0.38.30", + "wasmtime-versioned-export-macros", ] [[package]] @@ -4188,6 +4036,17 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "wasmtime-jit-icache-coherence" +version = "18.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33f4121cb29dda08139b2824a734dd095d83ce843f2d613a84eb580b9cfc17ac" +dependencies = [ + "cfg-if", + "libc", + "windows-sys 0.52.0", +] + [[package]] name = "wasmtime-runtime" version = "11.0.2" @@ -4197,150 +4056,198 @@ dependencies = [ "anyhow", "cc", "cfg-if", - "encoding_rs", "indexmap 1.9.3", "libc", "log", "mach", "memfd", - "memoffset", + "memoffset 0.8.0", "paste", "rand", "rustix 0.37.27", "sptr", - "wasmtime-asm-macros", - "wasmtime-environ", - "wasmtime-fiber", - "wasmtime-jit-debug", + "wasmtime-asm-macros 11.0.2", + "wasmtime-environ 11.0.2", + "wasmtime-jit-debug 11.0.2", "windows-sys 0.48.0", ] +[[package]] +name = "wasmtime-runtime" +version = "18.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e517f2b996bb3b0e34a82a2bce194f850d9bcfc25c08328ef5fb71b071066b8" +dependencies = [ + "anyhow", + "cc", + "cfg-if", + "encoding_rs", + "indexmap 2.2.1", + "libc", + "log", + "mach", + "memfd", + "memoffset 0.9.0", + "paste", + "psm", + "rustix 0.38.30", + "sptr", + "wasm-encoder 0.41.2", + "wasmtime-asm-macros 18.0.2", + "wasmtime-environ 18.0.2", + "wasmtime-fiber", + "wasmtime-jit-debug 18.0.2", + "wasmtime-versioned-export-macros", + "wasmtime-wmemcheck", + "windows-sys 0.52.0", +] + [[package]] name = "wasmtime-types" version = "11.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2ac19aadf941ad333cbb0307121482700d925a99624d4110859d69b7f658b69d" dependencies = [ - "cranelift-entity", + "cranelift-entity 0.98.2", "serde", "thiserror", - "wasmparser 0.107.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmparser 0.107.0", +] + +[[package]] +name = "wasmtime-types" +version = "18.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54a327d7a0ef57bd52a507d28b4561a74126c7a8535a2fc6f2025716bc6a52e8" +dependencies = [ + "cranelift-entity 0.105.2", + "serde", + "serde_derive", + "thiserror", + "wasmparser 0.121.2", +] + +[[package]] +name = "wasmtime-versioned-export-macros" +version = "18.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ef32eea9fc7035a55159a679d1e89b43ece5ae45d24eed4808e6a92c99a0da4" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", ] [[package]] name = "wasmtime-wasi" -version = "11.0.2" +version = "18.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2214bfed500d91f2cf020c085bbdac431b27ab5e683000a65ede93c9b1fd7c14" +checksum = "d04d2fb2257245aa05ff799ded40520ae4d8cd31b0d14972afac89061f12fe12" dependencies = [ "anyhow", "async-trait", - "bitflags 1.3.2", + "bitflags 2.4.2", + "bytes 1.5.0", "cap-fs-ext", + "cap-net-ext", "cap-rand", "cap-std", "cap-time-ext", "fs-set-times", + "futures", "io-extras", - "libc", - "rustix 0.37.27", + "io-lifetimes 2.0.3", + "log", + "once_cell", + "rustix 0.38.30", "system-interface", "thiserror", + "tokio", "tracing", - "wasi-cap-std-sync", + "url", "wasi-common", - "wasmtime", + "wasmtime 18.0.2", "wiggle", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "wasmtime-winch" -version = "11.0.2" +version = "18.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa0f80e89ec9671a6efc1507c37a3748a63b2566033d7d0993fa711696c4b24" +checksum = "db3378c0e808a744b5d4df2a9a9d2746a53b151811926731f04fc401707f7d54" dependencies = [ "anyhow", - "cranelift-codegen", - "gimli 0.27.3", - "object 0.30.4", + "cranelift-codegen 0.105.2", + "gimli 0.28.1", + "object 0.32.2", "target-lexicon", - "wasmparser 0.107.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmtime-cranelift-shared", - "wasmtime-environ", + "wasmparser 0.121.2", + "wasmtime-cranelift-shared 18.0.2", + "wasmtime-environ 18.0.2", "winch-codegen", ] [[package]] name = "wasmtime-wit-bindgen" -version = "11.0.2" +version = "18.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aed98de4b3e68b1abe60f0dc59ecd74b757d70a39459d500a727a8cab3311bbb" +checksum = "ca677c36869e45602617b25a9968ec0d895ad9a0aee3756d9dee1ddd89456f91" dependencies = [ "anyhow", "heck", - "wit-parser 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "indexmap 2.2.1", + "wit-parser", ] [[package]] -name = "wast" -version = "35.0.2" +name = "wasmtime-wmemcheck" +version = "18.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ef140f1b49946586078353a453a1d28ba90adfc54dde75710bc1931de204d68" -dependencies = [ - "leb128", -] +checksum = "7f4cbfb052d66f03603a9b77f18171ea245c7805714caad370a549a6344bf86b" [[package]] name = "wast" -version = "60.0.0" +version = "35.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd06cc744b536e30387e72a48fdd492105b9c938bb4f415c39c616a7a0a697ad" +checksum = "2ef140f1b49946586078353a453a1d28ba90adfc54dde75710bc1931de204d68" dependencies = [ "leb128", - "memchr", - "unicode-width", - "wasm-encoder 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wast" -version = "60.0.0" -source = "git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f#0263c2f2e0a33fe97569535aa2784b7989cb1dd0" +version = "70.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3d5061300042ff5065123dae1e27d00c03f567d34a2937c8472255148a216dc" dependencies = [ + "bumpalo", "leb128", "memchr", "unicode-width", - "wasm-encoder 0.29.0 (git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f)", + "wasm-encoder 0.41.2", ] [[package]] name = "wast" -version = "70.0.1" +version = "201.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5d415036fe747a32b30c76c8bd6c73f69b7705fb7ebca5f16e852eef0c95802" +checksum = "1ef6e1ef34d7da3e2b374fd2b1a9c0227aff6cad596e1b24df9b58d0f6222faa" dependencies = [ + "bumpalo", "leb128", "memchr", "unicode-width", - "wasm-encoder 0.40.0", + "wasm-encoder 0.201.0", ] [[package]] name = "wat" -version = "1.0.66" -source = "git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f#0263c2f2e0a33fe97569535aa2784b7989cb1dd0" -dependencies = [ - "wast 60.0.0 (git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f)", -] - -[[package]] -name = "wat" -version = "1.0.84" +version = "1.201.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8241f34599d413d2243a21015ab43aef68bfb32a0e447c54eef8d423525ca15e" +checksum = "453d5b37a45b98dee4f4cb68015fc73634d7883bbef1c65e6e9c78d454cf3f32" dependencies = [ - "wast 70.0.1", + "wast 201.0.0", ] [[package]] @@ -4367,43 +4274,43 @@ dependencies = [ [[package]] name = "wiggle" -version = "11.0.2" +version = "18.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "947e89009051ddc4e58a2d653103165147e1aee5737603044160d9bc4847aab1" +checksum = "b69812e493f8a43d8551abfaaf9539e1aff0cf56a58cdd276845fc4af035d0cd" dependencies = [ "anyhow", "async-trait", - "bitflags 1.3.2", + "bitflags 2.4.2", "thiserror", "tracing", - "wasmtime", + "wasmtime 18.0.2", "wiggle-macro", ] [[package]] name = "wiggle-generate" -version = "11.0.2" +version = "18.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7344729841849d8841ef22164fe848ed6fce8b5eb74ab8b3739296146e10af5" +checksum = "0446357a5a7af0172848b6eca7b2aa1ab7d90065cd2ab02b633a322e1a52f636" dependencies = [ "anyhow", "heck", "proc-macro2", "quote", "shellexpand", - "syn 1.0.109", + "syn 2.0.48", "witx", ] [[package]] name = "wiggle-macro" -version = "11.0.2" +version = "18.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93acdd0b56b3e78a272fa937135d515ea9b690f94cb452b5165ac3ae614341ca" +checksum = "9498ef53a12cf25dc6de9baef6ccd8b58d159202c412a19f4d72b218393086c5" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.48", "wiggle-generate", ] @@ -4440,18 +4347,18 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "winch-codegen" -version = "0.9.2" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1a1a53444157fc27c3f3e98e5e19a1717efad8749959a3d493d0f6bbf0f0b3d" +checksum = "8197ed4a2ebf612f0624ddda10de71f8cd2d3a4ecf8ffac0586a264599708d63" dependencies = [ "anyhow", - "cranelift-codegen", - "gimli 0.27.3", + "cranelift-codegen 0.105.2", + "gimli 0.28.1", "regalloc2", "smallvec", "target-lexicon", - "wasmparser 0.107.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmtime-environ", + "wasmparser 0.121.2", + "wasmtime-environ 18.0.2", ] [[package]] @@ -4614,17 +4521,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "winx" -version = "0.35.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c52a121f0fbf9320d5f2a9a5d82f6cb7557eda5e8b47fc3e7f359ec866ae960" -dependencies = [ - "bitflags 1.3.2", - "io-lifetimes 1.0.11", - "windows-sys 0.48.0", -] - [[package]] name = "winx" version = "0.36.3" @@ -4637,9 +4533,9 @@ dependencies = [ [[package]] name = "wit-bindgen" -version = "0.8.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "392d16e9e46cc7ca98125bc288dd5e4db469efe8323d3e0dac815ca7f2398522" +checksum = "d0e367a0bdb6b9f6db939a21749dfcd398b62a23f58afa5c44e7de16289dbeba" dependencies = [ "bitflags 2.4.2", "wit-bindgen-rust-macro", @@ -4647,127 +4543,96 @@ dependencies = [ [[package]] name = "wit-bindgen-core" -version = "0.8.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d422d36cbd78caa0e18c3371628447807c66ee72466b69865ea7e33682598158" +checksum = "147bee3fde39f80da448dc971d3357c34f5810605e0ba59345ebe576002371c8" dependencies = [ "anyhow", - "wit-component 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wit-parser 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wit-component 0.18.2", + "wit-parser", ] [[package]] name = "wit-bindgen-rust" -version = "0.8.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b76db68264f5d2089dc4652581236d8e75c5b89338de6187716215fd0e68ba3" -dependencies = [ - "heck", - "wasm-metadata 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wit-bindgen-core", - "wit-bindgen-rust-lib", - "wit-component 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "wit-bindgen-rust-lib" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c50f334bc08b0903a43387f6eea6ef6aa9eb2a085729f1677b29992ecef20ba" +checksum = "3033046c0f9112a67dc6c1e4281347c8d5f1e01d4cafc01321c259d45e3b8e4f" dependencies = [ + "anyhow", "heck", + "wasm-metadata", "wit-bindgen-core", + "wit-component 0.18.2", ] [[package]] name = "wit-bindgen-rust-macro" -version = "0.8.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced38a5e174940c6a41ae587babeadfd2e2c2dc32f3b6488bcdca0e8922cf3f3" +checksum = "f191047320b2c8bd05a5d367a28c7fe0ad409d43153efc8881aa775a652ca112" dependencies = [ "anyhow", "proc-macro2", + "quote", "syn 2.0.48", "wit-bindgen-core", "wit-bindgen-rust", - "wit-component 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wit-component 0.18.2", ] [[package]] name = "wit-component" -version = "0.11.0" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cbd4c7f8f400327c482c88571f373844b7889e61460650d650fc5881bb3575c" +checksum = "5b8a35a2a9992898c9d27f1664001860595a4bc99d32dd3599d547412e17d7e2" dependencies = [ "anyhow", - "bitflags 1.3.2", - "indexmap 1.9.3", + "bitflags 2.4.2", + "indexmap 2.2.1", "log", - "wasm-encoder 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-metadata 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmparser 0.107.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wit-parser 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder 0.38.1", + "wasm-metadata", + "wasmparser 0.118.2", + "wit-parser", ] [[package]] name = "wit-component" -version = "0.11.0" -source = "git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f#0263c2f2e0a33fe97569535aa2784b7989cb1dd0" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4436190e87b4e539807bcdcf5b817e79d2e29e16bc5ddb6445413fe3d1f5716" dependencies = [ "anyhow", - "bitflags 1.3.2", + "bitflags 2.4.2", "indexmap 2.2.1", "log", - "wasm-encoder 0.29.0 (git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f)", - "wasm-metadata 0.8.0 (git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f)", - "wasmparser 0.107.0 (git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f)", - "wat 1.0.66", - "wit-parser 0.8.0 (git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f)", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder 0.41.2", + "wasm-metadata", + "wasmparser 0.121.2", + "wit-parser", ] [[package]] name = "wit-parser" -version = "0.8.0" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6daec9f093dbaea0e94043eeb92ece327bbbe70c86b1f41aca9bbfefd7f050f0" -dependencies = [ - "anyhow", - "id-arena", - "indexmap 1.9.3", - "log", - "pulldown-cmark 0.8.0", - "semver", - "unicode-xid", - "url", -] - -[[package]] -name = "wit-parser" -version = "0.8.0" -source = "git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f#0263c2f2e0a33fe97569535aa2784b7989cb1dd0" +checksum = "316b36a9f0005f5aa4b03c39bc3728d045df136f8c13a73b7db4510dec725e08" dependencies = [ "anyhow", "id-arena", "indexmap 2.2.1", "log", - "pulldown-cmark 0.9.6", "semver", + "serde", + "serde_derive", + "serde_json", "unicode-xid", - "url", -] - -[[package]] -name = "wit-smith" -version = "0.1.5" -source = "git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f#0263c2f2e0a33fe97569535aa2784b7989cb1dd0" -dependencies = [ - "arbitrary", - "clap 4.4.18", - "indexmap 2.2.1", - "log", - "semver", - "wit-component 0.11.0 (git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f)", - "wit-parser 0.8.0 (git+https://github.com/bytecodealliance/wasm-tools.git?rev=0263c2f)", ] [[package]] @@ -4793,15 +4658,6 @@ dependencies = [ "rustix 0.38.30", ] -[[package]] -name = "yaml-rust" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" -dependencies = [ - "linked-hash-map", -] - [[package]] name = "z85" version = "3.0.5" @@ -4843,7 +4699,7 @@ dependencies = [ "aes", "byteorder", "bzip2", - "constant_time_eq 0.1.5", + "constant_time_eq", "crc32fast", "crossbeam-utils", "flate2", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index e916c6f2..d7272578 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -36,8 +36,7 @@ walkdir = "2.3" z85 = "3" zip = "0.6" -wasmtime = "11.0" -#wasmtime = { git = "https://github.com/bytecodealliance/wasmtime.git", package = "wasmtime", rev = "a330867" } +wasmtime = "18.0" assemblylift-core = { version = "0.4.0-beta.0", path = "../core" } assemblylift-core-iomod = { version = "0.4.0-beta.0", path = "../core/iomod" } diff --git a/cli/src/commands/cast/wasm/wasi_snapshot_preview1.command.wasm b/cli/src/commands/cast/wasm/wasi_snapshot_preview1.command.wasm old mode 100755 new mode 100644 index 3467e0e9d807a98c4d813e69d56ad10bcdb33321..8b1587a3acb176eb86c92503697f6f31b9ed11c3 GIT binary patch literal 96949 zcmeFa3!G$ESueU*?dq!TuI`?inV!iclfdqp2~J45r`}ba2{6@CBmp@Dh!Q2(smHFF z>gn$4R8`MpAju365d@U?TMcg&g8@;IgV*S}m%~NyaP)T+6%{<7sEA&l=Xmty{{L&O zz4zMH)jc!GG=XzF&{O-d9^d-bx4!pU+p6_egk@RcU6E_=vaGwrIqNP<+<(`|x%=-w zhwBLcvCrL)e@D)plfO~?;x^77{Ab-2^De~w;v8DQKel`kVKrGCk49OW|K}q#t{UWR zLe}?QqMZ7VfT))6132W({rr*j)h&CBoa4U=JoQ!<<^y>lAw`dP=K+n&G5MOK#El+; ztPS8e@F_G7JL0#w{KZb zI#cVlZ)~-f-QL+=-(5Mn)^$5;?rQINdM-Pc-gUz5&o_R>jA=Zm+Yv-fwqSEiq%3TBEIXmmF z_Pb|id;P9kTd~AeZCpL1@7~$f#%#0JuUXNpsvaCtm2<<9U3$$PYWCVMb*+)D`aCeC z&okY2-?d^}RofR()2!R=cDl2TP7^@xm9x_B9F-3h!AuWeRleF9i8Di>0_vMSnVz+x z`@F8ytmvsfIM7*pb!{DZ&=WVj&ea2TI_rJ2(pGr5VhEs|?X9QlDMM;CFup$MPOrnW zv$ehz->T~?2cQmUeQVqf>%0pda{5v_A4cU}ceS?S67JEh;J#+a;Cp9RmfNeRSa)oz zy2I#VeN|Q^K}wumm?iD$t=GvH>KO5QwPIz} zB)d@$X6tABkOh;2Qe~o1tG5?HtjiD&*3?z9sm5~qC}dH)+gV)!t5l6ixnexE#1@4o z*>kOXVx9FNg0`Z9l!vB(SIwOl*V+nRq2t4em?Z?9m=c5Q{bVGN77vyzuu3oD?%HJDcoK@w|mneN`IJAeHc z6YP(VwfAgQdsw#~ciDTX6{#n&$1Pc!zith9iBzxGE%~@J1WQm~YSb5IPu6-Tw?^_X zS`JmeAhvTp0KV)o)g8680=XpLS&&KVbESZF}qb&UsPihfi^YQIO#S{%_-dl=?hb(m_PUNGwMjERTi>J^RXJ+kb7nd*9ZgtM`zEILNB8spR~(35nMmy4 zf93wG4jkOS@8DG8V08c0iTzW%_g(X(Cp$CyX0F*cB@)y7aj}0ox-S*oJ@e$zcyxC( z8W&%(Dto<$u=0AYe)`P4u!Y?IqW6xB z+qJ5DrTA~JtaZA5UkiAadg|U2dV1?9H2Y2x?jcBj>56Obw6E-02trzbz3-Ym&%XbninBEY! zFPT!8ep5e8NbpWR0Iyx7Ds3%th--@Q?~3DER<4cfE0nVu93V9B^_9BYwOkhJx$Y^e zC9i0SoZwa8h2D3P0I1g5`_^jxlZ(peSoE2@b!xYK9vbHI72#*Wh*rkr8;Ut=Rb7*= ztj?r-PH5%3HPxH4GK}8tPUv!SwA~4Lr)>eNmz1|ky_bl$`U&cxl3 zIpRnpIuqfKHDf!X5-CQK_!(Vtc$ZvCe(>ce#)chnRE(l6S!be%=22rpB=~%M#!fg9 zc4Jk<65gTiBi53F%CRetK5E~+3neSgjaD8%-~63l{Yb26r5&;G)zALOEC2IH-}$Rf z$vT4DfBME--~Xx)yyH{2b#VJPvA+n~waW*yy)P|qxDn}>0J`r9;&86nPrTz;N7OIedv^8b~DVUTcep zM`aJDPo*LOm62eQAO=x6rwHc2(u_?Ssk|q>L@H2ZM>-OfDF1o*i`G)|19F0FCxRE1 zcchcQ%=@d@*n85I$g?IR=oV#@AfYI(Y*JFB@?ct15=baQ61o9DnuLxx5tD=*+!`cw z0JkOyCHdMQp-}~iM?!z;;XXoQ(JzgO-`39mX6w#B^mvy%uxhUQX|8%XKbT3!N`6RA zja#rxC|^bKLM&CzErE0+r|wRn*is54{yY?aqoRGlJj#~%T=>tQGdY46KvOi~ zL@OREaw1?xQ8J^W_|b%ay%RN=(IMO#%;+F)O=h&0uMK9z_7VZ%e^O{c5G6CxFAZ|t z*3Nxl8dbtnckit_2@=O+t~!p#Ty?sRx9XmVVfd@=yL%Y#i}<7;R({)fNz=6F#K;cx%yzrOPCzwpjC z{7o=~DXqp0AHq8#AwFb#e25yz64}Q2hiuI+1o#Db&nYLel!{dF{5j;R4)`Okq2BsT zL4YaPiYeFuQ?SEK!45M8dw?n6b%-h0CR6x5k15#Rx|FZIb!k@=X6yhn_Cgplvb={G zTTQNf7OZI7-VZX&Ah)ssQ@b`~A@aEtD z{2x6$PWrYNzW&Gq|M1VR|H)5$UD7vD@Xfcr`Coqf%fIrEk~rjW4`|{Tj)LtS&g(BQ zoXX#R_N~8bk*+};dTA=UmY`2;4SFOAadsY)M4>fmkZ0l_q9KwGiQY>QyJ(u~ydi2W zEJlA7SlcZcAMx-vd}RZcZIsJ9qR}^(FG|9H0d7V^-!qIzt>M{*h6l4Eq~R%b?zc$K z;6Cs#L{s24V7*lMY)rJ>Uz!=Qk3;WcGa&ZpQYwloWm@k);9uYNrFbEN6Qt`azv4nZ*yMnglx`3xDBa!VViR=Uxzq)#N_BcIYm5< zE?;{bU0R|C(L`9&0sw~Ff*?Y3^fWD5M?VX=`t}aP*R-~K7$B#R>&u|0$Z^mJd>^XrjQE0}_I?60jLkq!>ssDEpF~kv5`}uz6uAC*LbsDBR!0 z$OK3Q^fsM}7TKJ-OQztQKu1Kgbe2VvKOwCMl$-!TNfI5E*08Ue)w=cVUSbU#dT@iNpd8(Oys_Qlj!SiZ%galB5K}!Y`N`7@Zb^BIF+2 zcfQ&BM5#4dk>if78l_?e(b%6EfdHI< zIAl+dknHUq>57#ehowq{GSULGg2WuDtSzNRw5Ze}q8)wxJC$#}T|^@1BKK>DzvD*{ zD+n-=)c8Ngnu=IL@)W4vuaGPVdiZsAa=}_S|CYc0vb|s>KOsr-X`lnV7+tVlKvn%Z z+e%TlKCo1XSofwtMn5zuCL)RCE7{1*2!gfF2*MGhE3z!dk4Yys0A?!>AOMSQ0E}`n z`G5or4!_}m!IJO+!<7YSY!9%QGok_e5eZlfz&J4l7~%?c09Z8f*I|`Zdub|H&x~kn z*_9DEAoVgFfp8DvBe)AK!>BWo{9Oq)?BM8349g7G3T~0O%j^RwkCM&H|9$ znH%uR58;NQCJy}3hV65J?r9?nAj#K;?F08ChO{vYKzsc4YtQzP4kI>cn$v93G^ceP z&zzQZ^fSW_+SXzCn(THD|D6sVu!OL zwAdkoov2>yurH(ZY)IFHTI^Q`Yu&NsO0V2FLvhZ#@fn7FBwx_^J4R3gsWmEn2V9D% z@go~Y;GQ-#AP2Xhg&U4+B>6hDa0%YVg{xisbX?=Lw{WGK{s5W?FI)g%_`!4?Z{f;1 z`kAqCw{;l)!rks+d~8I-J-6y(N&$mJLq3QS4zLiR*dG<=)1VsMOwWu!48|hIE07b( zHTZ zjJ~-@<@2gw@<%CMm{kSIWTd4{Kq(XiW)vX!*(nh~gzOaS;0#2l**EG38D}w%WVbb^ z!*|{4jI(Xa>A={q^1ka+Q+_YZ-h|S(sC{Vm1`EMpZ@4pb8IXcWt}##eu{pUx)Eop`4H#FfYCi6UttN#eq) z93d5U*$b@FkxCTLX07WEQtgY+jM7RTE!l{UIq{MWHsK)059xAF3?5_9CMXP6ucU67 z+-=0N93^TK{}>e`o;ni5QDC&%k>mUyINZNNi}cM_a~%%%9;y6viiDK02w}r2&%xj_ zggT6In#+)4L9ae4Dv%L!Dcb7h2$Pb<-8wE@iQZkk(Yg*}g_|I3!bSoU*7hQIM}y^a zJ*hXyVP_D^SU#8NmGLzSO?O`-0HImoINa?ViKxXmC@erBCr~r>BGLx&}X5=5t#5Xsc;vg8C{Pt*I zHC+!QCPXkHtBKi5CckA0kjZb^o{=Q#6U-)wQOxgRlVO4hTTQx2k6@mNgeae2wtE<# z8-=Pc<#{6?6dP0pO*bZcg3Yr*O(=)dgtEz@ZW^v8z&KZg~l#0)kz zTxY*Q%#88=yqFp1{XH{SrPtYOGZTDza%Pfucg;-k=Z=|O{JCug`zNlmZ<*N*wxqgx zHM>%Z$#JX=`F78OHM7^TJh_CsX_VM?8{b0^Ia7m9-Gy_`B>qqtyE(42)9~#cyf?MW z+2u^$esE?wf!Y(Q_JJiQF{Jjms*T+q*V&G$J?Tt35~r>&b*r%< z?To5+B!1v}CKM32&M4Z!BA3FkjGw(FJB^>|65th1vSdTucXpR-=;U&K@UusX(FLJA zyh@{+g}&$MY|0sZqtyg3S`WL6d^`{&ci`3#B)8$#IQHC|71B9CVpg9{+<}7p}&ofVh_QyO`UwP%FL5q^`k!x$vQZ5zgK$7~x0t-np?i!f=U z8%^5CabM3dqd-tm2IQ3ua{wa4mZl@(PS^}1R9x*mBt!DmkO=V)Q>MVSkm0ub@B8q~ z*g|AROn^~sYoNm?jqMI}Z0|69(%AN4#9-w;Gy^FXbw-~qZp5&jzT}K9IIn)1pb0cq zgtUt~v16i)AIP6HrhQb+K5QJMKE^1Az1bIP_Qi+Ee>|e#?8oHnM-sH)=qZa;Y@^#f z=yt!^ZLAnURL!xE2?W#FE#hTxQ5c~|M)*Gq^+d-W4SyX&iMQw^1HAn{6ilNWS=@Q5 z7b);tSjX2si@Txv~f@qu~3@(29Rs1th#66WPf7bNVM5IEB- zkQ(Rjc@~^hfB*vJ=1KVF>HY^_c+Mm&9tT6N93*_R)-*9+og5>zVYiD#L`=Y4FhXf@ z6MnSrQg%j6-6f4%Lw7lXTT^#&_}b824#<&jR9!|?MzntIiTe@SG;Gq87Hra#7P^in zEo2@2%#aq_It-sBe0LAy-@F}1TMQ$G3H;jU#4$@w!`I&W4{v+jXMdUd={3p|dc(>S zG7a8dkuBgSz5e|pul~qieEttU{`UZz)MaKCb693(u^!fy7Z}!2ag~ywSV(#<%iPo~pH19)Fl8}3 zAW(3WNl^>VtFSd2jGLOA5#gs99E{ZWY;IR#zpv+M698UJ?kn(^y0k2>cfuwBeW@l> z*L6ImF6-!L22+nvHf`51e5StL!}vQRKa(_f$*xV(myr%a`eH%_ZQ3N`@u07fFntwe zh)L5IiXrYErY}76=&N!qVq$u`d@ANdkdH=^gHi$&O`Ylil0&q~Bsl;OP~3>;8hr*H zYc=8+Je7tEBuC$85Jjcq)Knu5@wK5wz|U#!g7GO%`xNzSkK&}8lTDgx1e**~oNUsg zI9W%xV^Ex}C~kX(;Zxjp596VcU}F^`I9ut+sn~_JWToZCJw;io$W(oU@GI^@;aBLS zrbY~9mlO+P1$Xna6{!-BDn(d&L*j_nVCNo6CSOaB2sBv8TZaFk@M0Ap6Z7d>b46U0 zPY??8r7_J1<@)fISqevk3Mu>zDunD0QDKs=4JsU!plqtl>en6>dKyuP3fZJdg}RPM zg|d!*W>Dd_4#THHtyFB|FzCUela?aR^72SWf*_n0%3q$0#LfxNlTQ}8iHC$1O~}GS z?)YXlp6%Iqih5&13_C%%45~$R-M8at+os|&iUj+Y7TOr3w%{6|fYymrmNUvY6660v z!<93%HDL*oy(ZtQ9qh1m51^7~2O^P|c3_;qL}?B>u>9Z=n1mJi5FPq*;mBNjj2|cy z2)&}&i6!(qo_sf3rI*lu@*X~+PC!EuRnYu|G8LJ|g}Y>R64(K33P;YEGv?0^gAXj? z#BQFH1D{U8e0i>o*5VYrb=Rn)u5hiU4SjpG39I7NecW5N>%7obE zrRjWS&=czEYQe9Te{x5Mf0!ih4EYD2tjh7F5j`^s?mgxppN(8SCR2Q8nB6uGU}NFb zU=+n8970A7&9R@K8b3G#N26>8N*U}3C3p56pe zI0h#uYs;d^9}jdvS%$k`uST=+Vq}`F^Vq@>M%AIppvFyCbIO@BlHyL zpK#{OS1frWGMi8d4NozpPpWfw;z!G@JE#-};o;k;b_O!*7TlUL3t)w0R#^^Zqs-Fk zoPO=eEU96#NmFLANmFL&I-bmub@VesW^L;*e3|ua7=}>flVG4@fQlR&RD^k(g#H9A zi3{T2?Iq+)kbFQqOq-aAZzLyYgv3NrlSGu-O)>()mT0>tmFWU4Nj-ugltf!tEAo+( zlvfUG-ia&?=v%0Wm3M%D@B-~oX1KFw$=MB^Z_laJ9%stIAKnS|4p|y|9C3;2 zyforbfVMo=IMVY0xC{;)DDsXEkT3}@5wGeKb8DNF8HgcX*=;#U@eS6?8Px%Q2*l9 zN$x_!f{}}jO9Tis9}73DhqiXV>Bi36V;w{b+{{lkti!8{5~Y|35`_okvilH$d{p!k7F zdE?k0o{9(yx;xZzaxY6}nLxWf40jsYE)yLqwoGiK0;!)RmsAQ7wQyQDqZJ(DNS7yd zZEm3C!-=F!=wa^A0mcgPd!=V8OZ{CjcFPgRgx9m;f{;Da#Hk>koeqG~o#FHWt_cYq z%J7&-Nx$?lf!KvSEK<`pM}jA$1WZ|K#2XWyeN#PCPZ%sC{N%!zK8`6hqT^&(G!z@4 zUXa(r>7^9dK3r265*-DV^A4MkMv^?__{T_Jcm=YJF2GglNkHjlRc6rAR0L=TsxVOI zgL@c*6oU;mK_?hJYa;m?C7b|}!Xnd-WVn*aNitliGov7coH)+BMO!kO=4S$x9r!&1 zR-eYL!Rn9T)@1b#Ux&;S!sfI34~=WhOM5JlXCbLV$1bE3l}(zgo=uvpUf1zhy{x03 z8LS?|^`jgch-E===#Y}2X_|{0iPt-viCoN|@)3`Wy|*A1*@Pt8ZA6=IM{I$%6i}({ z2;eJZM@SrdcEo1*+RkY|@7WPsz)!*o+Y#Xdbw~zbJ3C-SC8JO-Nh86)M&h{Qy&{IrC0#HQq z!;%xoG%DdR?`j4#8%_lC!2v@8xAl)fmdkj%0uR2IVY>qlzz3Gqb`8VV*tUBZe;qUT z1pVDc_n@X1hzWyUa2KK%CZRYZ`lx((xJFYk>D|M&3-EloNs?wv;Mt2m4_>m*zzza$ z54-nl-21x`5Q#w%V@HCGJeyIHvG+eGGGz-Z0)q&tzb`~lhXOM-=0GnPcg9}WgWQ0h zl+~Q^1?vYVcBHTgsh*GpN$5>|sN0G^^@_=QVxOLDL8Whg>3wx0FvVn;a zuN|~%OV{44mDF0msGks)58P?=M;P*o&Mre<(br|lE13Qvd4+@_!0F2?pU|}fM8Eb- z6Y0EQlcv04lcv1Vbv$_`>*!~Oypry;?HYzp=-WOFc@`^)3Casd2x=(QFa(9Alk_KO zwnEwh!>Lh_I*d{fEW|4cLUU$8>{W$QhbxEzGy^?=3L-e67o~+R zAc;L1sDm5g^rmv41NHyS4q_RDc_rS8apboYGL2Ym*L7S@`OUDU7@;zbl+X8|AVFpc7uq9CJ_3#Zqis^&!8O zLSHP{mRB%bfFtzeUSeSPlYJO$B(`;2QU>pgDB?|Y2h*9vwNQr9F2jg2ZXh|1e)CN1`Q*s}u!^zZ zldqI42N`9@XRrX}X4+92(O^7sGwm23Vl(YH@6U@FED~;}MZl7qX(##gB;qr;yNeMa zZl*=xk(+6E^XC?XQxs6>Rd%TT$4p{7PL9Pgdl#^Y77(kW9_Uft2i}w9rdY06XV;L; ztW(&`ipod$kKR(7bdt^#HnZ*{$D35O!Ph2+)W(q$tcX|_gn-%#JB9dB0=2mz7xhQ= zmfBISH<_q6KBS#7)eeHJ^3X(XsU5}Mlrgje!x9-wCA*9t?4?cPXCJrJM!A<3CO$XO z!m@WPYyPUR6QB~1XMW2Sd8WEnWp?_f|gh?z2kYC0wu z@HBPT<7#4j<<-|pbhOcX?`f|x0?I~B*903iwO6l_r@qQc-orqDMc3Oo6n`y$TZVE} zET}!HUfLy83iFH&3^v$Yt9WwazYW;}86RW=q(h$>(7h3;+qetK8z=~OBQpV!OYCQg zAXfk~!P^8k&P{L$XB>MTL1*K^7RU)~f@28KiE}n?z>g-ZBiJZu5SD{mgRl^S4G~t7 zuZ;)|c3YZ8kxy4~wckm<_Q)#E{Z4GsBr7&)l9jIGQI)KtpBY58t;6tXYTJh~CbvLB zr-?fWZh?$*3uHoXfs8x&HYuE2&KS2q!cj}kf-_^(?5i!1W8|CO>_^q?N4WtOn-qiD z=LXm)Y(02YV>J238Up{vR^dtYzCXbTDc1J;j3|D zC!`KN|C6z;0Lu8liqe|f)+=eqpx`9unBblEgem}Hjy9f7Kr(U!$kU8!iK|{h1GgNw zpZ&3-EG8h9{1G`+btDoteNt0Y$0o>7^|sRR&QkOZ&x__VEOm_Ly8zxPb>eup68)xuWnE78za|ODbB~ zg(I>)oU$q-JSB@3&S{Wf7f|Eatf;!^gJ1B8kmqM5UnO(v*w3Nlz}yI{KL*7ss}97`|NG{$b2oyS>@O#2N(3 zbrS4~*DBUm26n~A1{Y;Wy&{7T)GOSDmL>$3UYD@RDCuIDNp&otClU}jJphq__gBwY zs%b2dDEvFz&qzsu%?tR!rU}SToa>K8h1~>Fc5rE+N$g&LI|MG4AC;7iTuGKfi~d#x zxP}7nRGcmr*)W>%8jdp^NHxwxRX-W%F|6Pc}C8UAMFBgicdxiUg~u6g3Vsj_{i_=wMkH!B;ei?$>n?=N0m zfz?ja0CECLcn}n1G>S#u2-q*G@ zbJwpuZQEnaA*F#$no5JN6H*%Vvq7a{yM{5SG;G^2z8ua?83~kUO@XAQKw-vRNMWX< z!`R=%$OI@5fe8!htqe>k6`A1)(jUWjd`UWkM?@A+zD-h>-0hBB0c-+ef1PcxHXcGzztH%pG$$Jv?*rRJQF z)=Q}=a3SosoU$zufn#e5t~Go;2Clf7T`YzN@*52N{v6EmDcH$Kk(o*2%`T?L%Hss| zhu`F(3`s9+u$$>I$L~`m&B!EWgU+r~58azWTenXFDCAyqHDX&RBBnlsgfE77@6_*5Fv?JHLW>n7 zT-<=SOZ)Xc;@2Z$jzpe`At&FZy2n|~ zyKt)_4-Czs`31}|Th}GuJ**^RYi3ROsj9$JNr21eT;}rzK3<;!@3vrG|6Nb z11q2+mCDS*&J;aGab)drLomN_JBEXxsZ6C}IP(zjaJVwG>YoO27lJ;927Cu@4K?aE z+?pEjEqrbGUXCji`_7lQOoey4d+$9_CzH|Hs442$sHsSKl{{G|D|rtMVYj_Q@ui*4 zVfO&|E*y%l-G28E<~S5HnUeS0Dt`X?0)yg8z@AEObkNe8u^}lZ6=n-9cIYyg3O1$FiF`wDL=|=JG&r+xsHOYo^j90++KBFR$-HiS?`h z`wZp07dO~S_)_gMHzQL;GSA?pie!4IH7~1pk%K2jMe<_@TMg~mSPC+xBh@@3rsIvl z3+ik#hBrop|0w_@?FenFS=hsoe3w+p1$oLG7N__kcc+q0#4}SK8@Bj0^dCjMslEu!y z{^kGr+RuFS4}axbI9!>%|KlSc`0H2w_#b`zZ*b4vzwswuc>j-n;GLiTOWf<`pP~;a zkY6s;&jKm=Mllp65)VfMJY0{q4Llset$_!8uQP-PoG22)1NQZp-&%TKfCor!{W1V4 ziup*qeJn_H3GZ0*)Q<4xBke0hcDwH@gnut&{UQljYg}>*n#`5w`6|$+kd4Azcy%^{ zcnHQZGR1yMDqP_2*g%BWvZUbGSYegHde$MDiUo&qM7jL@gC~wS5ffbwZVhx@;$AOb z<=*bSUfVki-w68d9){1Twiw19U{dlax#iB_Q+j)y$EJpFx!dMx@MOpq@RMFm5ki7B zMF@vwiV!_4Pl7xV!}@iPr))7S4#RX7Jf;ni0}NAd*8zWk;MlH@(|yq!oIE#~dnWPa zx`1I0fTUx1Fxn(Yew6Ea2AP5+{zKs?*FoHxvTQG38}1oK&5ZBm{iz3%jA!YWn}Rf= zC9RAp9EC-t#q0Iq(8wX&8hrBLKxkwyUxz>%F+utp40B<-tBgV){WA99;rJ_DqIn)v2DgEiyC5JKEk%P?FyU612CeXfTLUzR*P#iw z%nASLX{}FLDm{zc0l%I;WidVLAWqOS*F3(b7jh8lI-Y+}*3r)bYJN_jBPIP09m>7R zm{FV~`9Y;A;0#G<3Wz)6_{bYAUI8sP)7ay2IcjnfZ!#1vH0JRS75RqtlA=M3qsw>@ zMda2LPQ_s}(*1%Xa-_ML!qoBfUw(!fMFfkm2h?^1PgMsU)0Ig!MVgkkbx7=jIQuVys)VZS+8;TGH^Fxo+6xW3VvkT=S4k9=AHj(74C zK+vt|L{ay$EV2~w-#v26q|&yyi&~@R?;;MCI&f2#_2# z+Eph*%h3Y&jPgb*U$VHTHBy1+fhBkv8DlGIA1@H7wjx*yk&=B2y$KQc*f3tW;i%iu z?S)TFb1OguUI}=}cw!Uc4Zt5xA(LIn#CkZvCZ6V5n) zCe?(fL!<%1l&bp;RhQ6yMb+Jfy6`UG@Q`BU4*cvY*|*_m3b5h_Nu0;=li-do_^-Gx z1FrfaA`>_fn>)S`u;Gp`%bDP}h%ILlJHFT&j$R~c{9{KF{~C$$06l^8zeO119>>-g z$FbKzwESl!?)3riGZ79-4ot?+0g%K!4~R2x&$xVmd+E;!aL)~f#2$mt3io3`0Gw@* z7jkE^!oBdP8U!W};wJt^0^E<7xX0Al8*r}=@b+*&Qqj04w1c<@Enf)tKr?Yas&GH1 zaE~uP55awexF0ca|DN!oi)j(57y*Z;mLBjT*E@V<=6dI{!7HwJ<~pQ6-`p8E3e12d zM9C63K`au5XeUefIZm6LD7a}AOJE#_iN3o?sdVycAVw04A(j{495_dwzQ^`I;P=VB_HxT1J8^4JWo!D$L1v0GuWJrk=|%+$>xl{onfr)qkg}d znaPtKp5Ifu~6c_;}R@G!BIe3-AmuH<(n!YqCQv!RwU zjy1r45Gdr~Rt2ik`Fp4WNoL1QXK3JRE`yYK2w(8Q-2r~g=K(1jrj=+Qgi$5OY-&=d zEB&tI{EF}sFAk1gFf@Qj@)rqX3S1fib+oPW>ecBAk>gTWQy3wO1bil|zS02t7Q zmrqsF-NDxB3i6x$n86?60n&;RuqptWt@KJi`SN-vlzhq0&x8z#aPs8^z6Jg&?@MjN z%`FZOtFL*|lbxB=Au0GG#{`awht|s_b5u<2N>t+b8^zx^{*w6H zi@$07?Z@Ah_`3>!2l00`{;t8_lkw-^FNMED_`4Q=*W>R7{LSGnjlUfJiufzxuZ+JN z@plY=H{tJT_|AWRQ_G-}&+ z)Dn>>h5}y!&TEgVMCfhh0pHy1$Ha!kf*d&zLwZFLu=70PS0Q1!%2)P+buEJ*W(>{c-N~FMmwAP~8u956MQNSGbM=9qem&GJPyw3q z6mdOfQxW$DKU5JnM!aYNXEgmQ0#09bJ>>jZz5rdJ995tVN6z}kBJEhPCS+7wtdD1ed&lW*X?KI$IjC51^7 z&+lKZKz0G(R9=vVj6^1nV>1x^naCyxn9vAdx9})%Cf@xsxhz7ZYo zABqm<^~$oOnB)iiGW_NV7eaVQ%ChCKrS-MpJ->$|KlJ9K8~jTSC&2fF!Z$Wt4aN89 zP<#)=qp6gEkVIfIdYI$Ei7HK8N=gjySL6T%Xo3S|aDtTiF+SzkmGhXdEH zz*~{w;~OnUy~XA|674kZK(yGp#~(0VatppqPo-V~bd$0rQvV;IfL-|{vaF-mS;*nwvp<*5K7eP~k|fVPl>L|S3XsOS0G&h|XzGok0wTk;eN4QXP{CLp2HnfK|4M`RCMH+}@WFaV z^y)!`r04^!JP5!)E9V{w9S^4EXLfM)fpki;$WeT^d4>%D`xVjUsRuI=8zM+@9Q9lu zC;}be;WSTd9V5?pyJRsE3()7j1XvmH`XVt1f8po(i|?X*mSe#5JfeR;$zNdn;WQ~8 z-W2Z8#rIOq3#O048*ohg9E*?^9%K(#p3=`MGfZSMsd`&U>oW~hKg1DQ6PS7;t|Gts z%O#CmQ2=sGaB58?iAsNohioDf->$p^=bpd~4FDJk09g|h>`Ht`&`ISho-vwucN8ZB zhQ9gfyI1^W3w-j7a%m+!_|x)wney z)mhoDqa(^Z~hKaz8?7UuQ26{pndamfBEu1 z`}~(b{&n0Fw7>kr-}qm@{H-s4;?Hoe`_AcgILFj5Q=C&TPr}Ex+$dsg;yTO@LOOOO)`bs0wp4klH-j;Tsi-vK%n`+0q&DyX zW6&TXy4Og^pn32S^${CeQ36F09!Ky4%HcfvH2q_CBpw1=d-VY}oYp*4T9Yy&d;nb1 zERIKc4#%KL7tl(omn>u)ECk0Y(zS~NRLJk4gb*;5f{Rn2AGMf(FK~E2i4P>G$A=#A zc?p!mS{^6uu}m=nX6Ox5H-YW}3D&O!2_lUY3|#Wuu+%ue8#PK?qA`g}`gMWJ(GV_i zhLFM~wiaxPOALUx#F=~;fQJa#Ir;<+(WlT$O|B(95K3pg1c^m1HSadf&?w?6YA!G( z^eg*w@fLwzy#EcO7NFU}*S8`x2m*~Vd?!_dK&2(vaOHz>Z_q@k7vkjs9!JAvuJk0x zp9sMA7k%Ot0`6`(?~*}DGC%>T{{jyR_k>I;;b_oL;%6HYOkiXK97fN!($$LSS;F8A zP1!v_QsP-ajDZl|ggRE=_kHj;esdX`xf&oYPgNlQU`LQKM5SGV;0oeySU(V?m@ldq zI4^QZDjZl7SlJK`AbSMlohS~^tK55c3a7+-6A{JcG_=X4Mk_eb5Bt$7Ha1CC4%`h{ zh|Ozvr^acxz^K9j)_e-W#y?obt!k zvD;-v09J4;)EQoyOB4{XcZbK>lL&a$Jq8%Tz~xAx-^!6I9=ySeKI7eF#j>yD#{+_=Mf+?_Xy&Z9hBAG}IK zFe;y8K+yorF`N}g#GwiH0fMOCdVp`U4kkvT$VY_AApsbQ(riU( zwxTo`k_rXJ=z)JSYv5mjp()MwP#_TvBw&&TkbtisZbX8nw2er>_&rJ^CWcTNCqPn~ zL;@nvTT+^yF48_I4QFYP(nx1mB_5q&ykR;s#wpRw+9@3U&Y^I5khoCk6eIjL2}5B1 zG{FQ-@p(WnR^pcgd_m!9*m}XEQ7n38NSK7LmpJJ-MM9SpE?1q5-&S7!iU&rQrMixi zTztkF#k`U1;mTyK!R5BGFDo$xBH@ZkevF(hu_|Ks3YN5zF`EW$bntKE|t8KX5Nj@r&R7(7nX#{bT|6 z-;0m1j|RPeT=wn*^RT?NKJr#Vw~{n`H6HTOo`uGChWwiVY`R;{-(X$dQS z4^q3t!no)}dOfjbiQ|?fqSmexZhzKYJ>BkhR#(u9h={cw-@$V`$#=ExiFLl{iKsXw z-;6}9M0>T}Z`YP*8)up#78O^WsrA}7HkR8*ji!#L=dyF@5i7A9Qp$L4TUNX*fw9FB zfH*E2jgTsj~C-uVjD1yXM-5WBYWJ!u1vC5 zEWfF~+g)j|f;q~Ci4`fX@fS(>oo>oXOp6WGCan0=ye4<~)zs2vn@`%KLo95eR(L{Qsw#n6A;dz|m(W6-q*4;? zxyvnK^`h1_FJ5u`Cp*oTV0fMGT)#8hbnELUD017YCm{KUYYt!s<1A~sw>u|e?>rR(6z_O%bO zaD>Y@7`{?a(41dnyA>31GA`Ec6H8)T#KiH4MEsb&?5>`%5>e|)4@;(=BQb@5p_Ll? zR$>TqGfRZRd9x(WY-oCNv!;8e+G}F!f=#PpqHTM#HD>LKT2C4ZPj9{6YjoRnS0u&B zQLn;o3oy)h6%_Z@dfZ&&q}w<(d#2m&yJ8R2)PQ3 z{QkU>o2uXtomO<13LYO+>`k4}RKe{{RB(K$37G^TbZLEaY=enlwjI(pJ-9dMo8y<% z7UhXO&{iNulo>XlRnX45fZ8-6m6#2p`XZ$NBycl2(4iLoSoZ@j24(+HHD)NVrW&&g zU5*XHs{2gB4EOaSHDiOF4p%sa>Nz2WWB23eg0mLgtczg!_J{=xP8yAd#IVE}SlR7W zSoW)Z3J~0mHrJJ93(6EqC$v{Pk~710j#}egx7S%-r|m1^(gG6EGbi0uOjgv|?ehod z)v{GFMz+ENBP_5dDB$%Y#%(d9^<;?5-qDrLYNy{>Z8v6NQ8!L$t!yudS#%@uo(s;} z?43!h)>dI}%bT+VyViI6?G=}k0da(ngEMAtpBzFh0hvgKG0 zD0KTE-lj|GwuVa531wU3Vl@_}>>ZIDdM}G(+WPJZ2(+`ay|b&0y})X1;MsK7y?fp5 z_1&hDe6nD2WgXrjcQ$~_N*W!umTM<^HZnC<#S~yAl(Q}9K^+j>_*$)h5^_zJm=dee zSOY-y-C&Gk?mZ2Nz4mE$v=2{F120hxE*N-URJ9~AIWC)Rbk<4Bd&H@@=*FV-w zd!xkl*giS1TBG6idb1=O5bMg?^g;P}rPFM;+USPdOe;*PWsUi*i8!>z$yN7E(2i|g0RmSLM^|fri4A)b4gX)id)BtD6f4)p z6yS+7o%QABtfZ89ZCUE2Q}tRCMB+_#w7%XuJKDq~lg3BxUhnj4Bk;`i`crbc`<>1# zNacjPuf4qNo`5}EKZ|MXaf(+PE?kJSYu(NXtoa_UL4e)$HOxGC#_8H}yBTSBCfYq? z)|We-wJA0V|K?dqjlBsBq*nvNi1=1Yipe@fRCYze*f$g zetPSTlO6;t+5$z&CgI*&Y4=e$y4GHE$B5e5&g$}6XaREIz>s?iGU%SZTxGLF^F*WD z0X3-sfgFJ>thGj`iKTr|ti;f7ccr#Gu8>R5Y^)2FuCp?B2FRaXb=~Gz6I!FZB0{?E zdJmKyt2N04Z0j13#|R*FyJto)82m)7y|8*}l4?)ZdM9TA+&W4=8Qlj&K!4-@0YcI$ ztPOi-hFp9}92Qr5D&3)2r`77Y{W0rWL#qoKl#2cA>2^)GBA!AGdr5rHuqKW~twWv$ zW;CI+LZglAJpJ>Kg(|+zYE-FV%us=iI!~q24X~q9G4#QX!7Mq^KRKo`_ay6j!;CN+ z1Y&!xxFP5n1$}+eC`ev7ODv0740DoQD%10jH8;EleGig3A?Ca!5@wCGVGkI6NN)wW zmB{$hpm-Ib_YDZ60wzeVDUtOw<3q#Q+JUXu+5t8{bj)-Fku!=M4Zlt#e-0xla3o3( zKjfp?qn2XSx?;#wbM=T4Dvz0!>sa1yH}8{LIcgmkQd!c8m>2C78o1HK<1xc7GteT} zs!#3Wrr|JgMlqS%kUbQo5b6;XPZY zl=nU!hYd*zXtcf{+A~1kf0Ao=)4>@Me)ou6OOw|B38^`(WvL9HXL3?3r`ra)Acu$c+ z1Gf%e3hS$Ka8lBv)YE*ljCA@Z-R>a^{w?3NVYCd9-lLrE)R&-Tif03y%4-UN|n-!&Rqd>VV5Cl z#X_8VKD-XbLv1H^A`!%N;fX?s5SktNy~n27;Ibp06=!s{)^$nQUT;^5h21dNR^9%Y zPWKdK_sTxcUYOLnY|~wByG^OX_zF+bQ(C+*F+C2mot9Rs;#~E3G7Vd*vEBt)HqK)7 zt1TE5eW^&9TA-nGPI~QU28U}IL=ZRtG8F1RK%vdhiDVp%^of< zD4gr7m?|jND6t1!uY&BTe0SXz3N@3VM_^QDnOa?Hb$ckDPjnG=^>y0aa(%IBSgfbn z_Enf(D1o)^Sv1Xuu&5ZoUGKVAQRS=282#X@0bLGgk3`#Rr}O*=B5!wlZPpuAtG3c! zhL&!NPV_$fM+Xr~dhcy(M07@9rvFnfi^0n{;>)sS5wm3DVicq~9<&el1Wg3$u`i43 zK4VY#L^rC6j#00L8Q1EZ^=gfd_8K6q*>)4gGwT<G<@8A%l1tEQe6WP> z2(0%sJYiztnOwGTZU-Qyl%b4F>@4zB`F=x!|H6P<7sxXQ-Yo8FYs5;(A-Vc!rLwPBy2Vqj~@6I93Q^O3c8=e)OHmwfbOJK=)ElL3umKn z3;8QBX~;Rm6{5XcwD&*@J#ZyN!BvDoiTJ$(sGGDfWqvrqXilY7K#VQHZ-wegknFWE zpS~WzOy+I;sBi$^?hXjG+Ix3M~v=`&`>hYanLy(eYXC;2FZzwXdNl4r9YwA0*`(PGWv|t)NX7&AT2C=d8nXvK!t*`iu(2MeisZG6NrBzToLcvWaxiy9xTHy$7IYY_UJYnt^N0jU6!B zy$0tI3lkgIsZ6pOWT%qHZo)DptDOmRG%F_Bam?c=LJG%)uU@DHHez8N?$+j8KnQd> zA07mJRu@xZMh_!}VNCiiaj|ea2XTo`;ILGYW5DG2joOx!5+Ol@xKKn4VrHBVHxV=v zxtm~ZO03v%O{XvoKRjN=}7^g#j1k zl7@JZ5l!52tIb)#y#i5Lp)DGCIwps0bz*}2c!joJg92QA!Sh-9O@*&99b z5dQ*xD_`UoMF*Sqir;{NoiztGYe;0HzR{Hot3cX>2X&T%8itaAo>gsnLhm!Xg(uW^ zj2PVpT8{4u)zl-koM8)%{RP#s=;(~uQEoUYhbbrd%~3h5I3%X8%NRr0pr4@G&G59L zEWGK4ep(ogq(BN6{YeRP^xd2s-*IdLr}@4p4a#p6(t__W1m8YG99%y64eifp7t-%y z<##ZGjq;oChRN@z(B3l)XtA)LQZy`*r5+NJzndF+;66rkfF7Y0?Jw}GAH!lArNPFO zDStl4tc2mV8eS7hrSwg}1V(&GGgKrmH#TVO$=TEWBwl84NChBwbr7 zv?ardJ#4^((+kn6DdWw0G0&{L15yuDrH`r~O@h~LZ23yohyCxuPvs8p;)-EKbYE%* zgzn30M)&qqrX+SEXU-5*3y0P3(&iPc|V9z12-zAJytGGjZB>JT=T07a7L$`S{uv2O^a1Q-U&>^EIFoj=FTIS_A&F=^*_VizAKHkRo$SjX zm(@>YF<8t__T^6Y`wOOPWC0waoNef+{wN~uJ=y%B~Bm-63ynAm#~w4DYqaS z@#vlGOBiJ||dCZmWTmM{iS%_jo7!av-nsJ3RZ+&uWzUn_C?+eS?{(sgK}Rxsf_i z(>tL1fMtC!Ie~*_PVoSnW~b4!UY3&Q;Iwe~OfPlg%TmUf*}QGxd?NXrA*j&1)Xi?+ z!M1znw&%U@);mCKXO~^aDB+y0b=%yy(3`t+_0H8QwnGnn?X-Ii&g41WZn{mU)^lpk zTCLr6IxR;Xb?LX`Fj=>EC(g-g2Cr~DjBNh7*af}3eD(%H)N`F$7k{XU*N)0ky}_xk z_Z^(2)LsrfM~5tX8oQ zzHt^hYQI4BPt^6%;mKN`DCO?)o(CfKofEr250I;CJ8FA;-{JOqY=^mX)!V=iL`t&2 zhW$QXICst6#o8Ed7p-FgTAi-M$Xx2a`))|_Z1fPds0XPko=eERj*w<7cSAdD14k-3 zJkSC2?mh3R_HZgzs5yC`dcnFvv5y9J?Vn*M6FOOoWDT6$u1`cp+c=n963MNqerp}G zk`cY{O{+U=}z z#^o^$9N*?6#$r@p^{|+@f@+Ren0Pg@h24vI=wpO!7v} zqBw}!s?%BH>aQ(3cX^{gS`+Yjmn0n7j$~zbssl?T2dJ$hs?U??IGG`~>bIc*NZm@_ zhqLY_%TT9B0B2wV!F=A}@toR57`Q;m$-rznX9#g?9jn&mvPV}qcaNOwOdFh{-B;_) zgaGJztT<4Z_K|?w$A|?9gGK{eA?v&ZJa}+CK14tdy-bKeOOFu|5(bS3w(@O4#C`W! z&l&@pZLT-mZcj|$k|zt|h{XEY$RtPy=c#D%7)#G(%5&KyAM$8}6F9}NyWZ>bd0{SX z{mI>OQ;zk6cW}GOA_U6mwtFVC=r^#4)_5IFrkRQcGxxqD4 zI$11aTJ>hloiAtW#d^W5ij^(uW->vLyqC#5(?5!^m&x%g8+Ibkw8_jvru%n`N>f00 zh0J^@Q_B_#jgmW`&ttLJzcIh@zZEkqjx=?f#qP2^xNe9Op6{LvHqyri$ z@~Fd}J20$5rdiH5TD5vUUvCr(&1(F;0v%?ug~h|)ce~ukzqo;h=jJ@hn42SM%*_QI z&&|o6=jNX29UE2U;hHa$Uu`+Oo=qRF_2du9MK991xfkIhJukq{y!CFwJ$&=+hx5&D zXHEVCs!f-2nR>3_wrcYjM6*^Mz56oZWS&RWE%IcC0kmY(*+R2b%3^z(TPnKc>e$+4 z>axt0NfZtASWagf^NsR+txznMTD3xT{Id0kK-nS{n}Hs4tz0^j&!h{bQazKOPgfHc zzeKktwSqiYaG<+-({1H5{SjrVkd8}6q zv{`JV8`a4llhmEgUJ`Y;J9BfgkGZ)jyLxP7T+f%YO*hZ+mx|@$e0A!~<3ND9v@>}o zA};y{(;((cpyssO%-2f!R;k&l?s}8NLMDC5SWw$vdvkNQQpJ2ci@E`(xna2*)^Q0m1c%aJV>Wxf!e!iK@<%^iF>h9&sG)H-|nt_R_l?ug1yZK?WfM2*Sjvr4k;{N9 zWZhEQEvHLvzER!ZyIh2j*2$C`J1x}H^MzWvQEq1IbqM_G6_<}6snanR$)h)R>}Kcl z5ahL7EmJ7v)AQ8>>lZy*PYWGXr7~rIOa7vF`uzaC7c;qfsg%hT)8&E-WxaZ3|M7QQ z3c6K(qrp{{D>w5HL&aRKm9A%8w|dpZbChhmQ_>talQo&!yx;4<7@KY`?}CW3G*$A& zT=n3oiyoudTgKq;n|4;KmFLU3a1RhtX^|si?L@i>~j%cj>HMe+4ADy^-}$?{0F8@4?ZtkH~FA>SQquJ zD7TTxmYWUyG%~qnzFd7$dy9?+Y#Vh#LQ(x>iqrUUeDfAv6<)~0LUTAQG?Q)A>g`3S1@OBxphJTQ!Al#Z63m!Fw%)2bKYYQ4G6h0s zxY4uOfd_%Tmru9Aw82jbZmw7;H>)$xyI}iL6^3KEr#j+Q&|uLmHs_&)!xGBOm+Pf! z>Ygnc3?q4K?KD%6+7gaBhZ)Xfp#hv{=G|g$KA)Y3GF~jy=BtO!Uap>tQZZiKwCjAP z*equ9*?b?yl>ujtz2lO)AP+@p`On|QLSEk*~A{HMs67zz;wRZ zgdUu(m-D$CbmB(!DVMEF+B|f14lby2G3%BK^Z8P(mc~HK)$h4@cDyxNNgaG(fQ@o_ zK37g-;kx-|wvewLxoo|`gES~=3Wef)({<~mT)B{IG#b_GI+uxhAcboEjeS;*w>h+gxoD2bN?6BO*l-zV{ z-p$oYtulz_hRfEWblYv1$!xt`%Ga~`T(Q=eZ^1B_y?9mS0*K9!`3)Z?RFq~RmrfUo zE$A!FY<2GRWul)<&O3X2k)P5SSS4_@)Swc=7J(#Yrg-2`v3E5VoQA@XKP%R3XQmIwVyhkci z*-JChaVil!a5~($C<8%rbGPezsnk6-<*HUJm+ILP{3zx5G`!W->`y81F3pn?22aIC z0{E1Q``7@?mBAAlP(t$cbTgZ4R&y8c0nP!eBBEUI@nq5zR^D|;7i$$^o@H|L*<7KJ zE5MnQf6+yg3VX;i5H0^1nEHIHS%>D-NayNMo|=Vf;U$;Ua6ty>q|0Ak4K!cMk=G&2Wb=(yq3jkBS;)es%T!AjFUN_QOx~whH2~!#^{9B* zprEMK@@Z({#X<=olv1^P@fNe}vS4<}AxZoVJ{-`-Yqff-1tE~j&%<|j@ zUbmiax(J6sp2D;DjEi@*Z`yk%=zUn9AelnmEf#>*T&XypuO3&&S7Uh}MaWa7fE~hB zWseT3E=t`8-&AWg7v{GhX>HZ6^}DcR8@c%m1W_Z?gun*7tbXsaE?6~FFv6yb_?jNt zsUg+^+kJjMTQB4bb+`J=y&hP!|J_9iS9LD}oRA0JE2_cnv-V2cTDb!}6Z__8Yyrmn z!urZuh0ec%XOF{6;X;TW+|e z60A2j4Ih8?Rt2AX4-ZN7;CuF{G_N7tp7ZoAI#Rd}408nEpbzHCrADii$rsb)@ov&7~*{4!Uabdj-&&Lx%rw~YPE{3Od(e)m#ViX*c{P~8UOxK z+(@$c0X}BDkly?kP2#52l(rEdxMOc{OQMk$?+;FgA9mX(PWF30w2M#qRUFz?sQY4B z%zMDv9QU33%woPp^b&%DP=BrY!&Bvyhd~5iG zrm6omI$d{e4&Q+8LaXi8+I@tcc*k-GLU}b9F=k3JK+Kf#xmKoJYh+t>H(M%JT}~O+ z%KAzj=~F}iPq;ZDFEEKGd4c@5!?d|%(Y4Rl(Wb;cdLE|!y4U$ zE+rFHk!A~6bR?jkly`=Uem!CMLQgZY+9nF3NTa&9?a zJ$La*7hBuGQt?tgDX^b11OXBY+-44GE460zytr)r__K-OKvQj`=kw|Md?Q;c&KIjM z7Zqvr1HygE5^_8Nr#e%tz z&1?p;eLoY{amGy-=HYokE(9`S-0B13;=Sx!<7&XUR61EM&F2~|w^)aLH(y6;!jD|O z5qYi_awgXW_iRGeAyAQatFO9zy?AaUu;@%Zlc{Bpx8kOYIf&996&J7MUI1?)-w|{u z=331oU!{pGwrsXueYIG+OoTA#FoNP&MyL{$mxCGGf`hvHnk`f1E`{nc#SLB};1LTo zpM&mRMqm~hY}FqVFMAw=yClyLmT{q+&C_BpxCjR{%hlJ4o3`k^xKiT>atmun|K<{P z8wgL;)1_>4zKpfnsJ>1-He)ViT5Vx}luqWdaC8@-)#eH?BkQ^9>%~@Tn1(o$b|uV< z>$xo8Mm7jk40u>t2(iIQU;S~hRs3>TBZZ(r29uWAD%V`5P^>o#FxwH(nOj~yy)uVb za5^(zOiOQ0A%~d%Pl(r2g_&0xjM6<+diC7g^JJPebK-7if|{wM3{UigTdRwh3vA!- zUp<4Xpem|o3eaZc%f)s17GS2E#d5vnA|z5SW@`Cn^$kxbIN4&W*+Q~o$<53+8}&@} zjZY{zwRE~xE0u~sOg2|X64RT+8>GIORtZCDwxIgr15LukL=sJ{7$hbfD!s#2|x1>dNr>%~&_El)g5g&KHRz5zd0E7Q!?($%*<@h~A_ zdp?VV#3Fpgg-pIsecKZc6M~X?x6mr(>SZ{P5ZHSA6Au$4V5ym_=bEKbtwqD;9pb-m z-E9^k$rMyXfV@{SNwqMsWda`r#manEx3ls%GmERt!TerWU;eVj4lvo5N=9C8*I`qy z(n`bzH>PZ^c33puLf>Gtb%dJAH3WgnRFX=i>N~~nZ#kr*iotB-kb*Sr+mRZ4apQUx z+yzV|HiuRy%ojj7%`_Z;u$a=-cZuh0Fx}T~3w0LYmfKc-r zJi6E*f~^g81iFh&Bv=>G(SzbVmqwneI0qMOvCPbT1Qr+9mVwQ!R38ngj zMFyqRZL&VliKOulW8ga2aytl~nSt&M2af#LMw1 zoy-=IV<}@85FKg#d=b zwb|~J=?{{d0$_M>Cr|@(1GOsyg}VCxb#^T~4FXZLw^7?oQ)Aqkbg8KrUw*9SO%r^?#)bdm`~Cht&!ue)O+>@0Eijim4`$|`drrBa!GGN>X@UwK80;wy1n`JS z44>H5!6oh1vL`vnQEP!`_p~swxz;Y4*or2X@el)B^Xv+o0CLD;_qBOXt zgIW$x35^TS2jn|K_+FGDloncx;DI_^F~*b95R=LybqdIP{`-m6`TPuiheC9E=`*eK zWs8Sj$bqkxVig}c=`@Vb#yOPY6Oc|05!xRnC+BEDQ#r_Pg0N}3scn04@JjCQ zQ5*#`8=2S0@=Zr;&?i;!_SX&JCCVYYlt`Jx+63t=LFVM0S~II3)DDq|f|ufxR&Wp{ zzKSpKwdLWx_aRpqu<8lK-axr&t@wb9_NUdFtBWns82kt&o9#S08lB<46=-P)4P>Jv zoTO#eMJ5~8j&gU*-lnOrID)_#^+1P_hG`q7+-huh@lI*(iMi;x+3zBK#uQy+lpn`Y OKIyk7a#n=G= literal 105117 zcmeIb3xH%-SuVO)?Rs@rKWd(t%p|b8W&(quXR5lp9-Rp=)lf+gkpNLq(N1;Mu9=$Y z?&_(kp2=X686ZNGhd~GuLB)%}y$8cZMDca5IrrRy$N`UfI36G9^#LAK1TW%IkH^dX zzJIO#s(xgWOl8E|gr3@aueI0nfB*mbw^i@0D9f_cyJI)qZCQ7#OV-_%y8rIjC0y8- z?#I80OPAy~j$hoS`NRKNcc=6Pu9EtS@2g99$L{C9w$#D3b+^2VM~O@K-*4K$uUy9Y zNO!`Lj5OpGTBaGcc}ce^P0LGCcK`iS#((uVae-2)%m;EI<3u+o^M;Je5#5!pYbGFX zV?><$CH%_)<1Y4VlSSKIJ)c~0S32E`G0U1aWT2r>({$|%i4dT z-fQ2|SZ+@*)qC#owXWM)b60zlr`-N@v)y$Y{Z6;-_AGVCRO~d)_KvS~Ry+O9YP&Jr zSjL0VuG{M@ulL)XRV(JTC>1Z%mzOuz*|srzwR2(1R-{lJl(Dqh%Wm&tukWrL4=xWi zyPY+EnqlFFOKvst~REd^?u#5w`qTb3)5PzpXzN}EzN5Ei)-%o zwR))4Yrn>|;@fnYxX^9)T`RFol?hC*8O(ayPUD>Dwl(%N&|KdQ+MBNTt>iY{r5(CSFnU9GRUY&X44yQ95}D_;L2+tiy_UzKWv6`9baKvBDMTti3i zU~he?*XXvF-06O2y0hM2TgUEb$Qd21e0`*Hdo^5lJ5(9*-?K6kGJv(t^73*1GcKUZ ztNPNiYpH?a3`?dvt8S;&vc`7HyWRR~v$Jws|6~bs`f_^dVjoC5K8W^Xjrvl15xct# zw6!L#mqvW#2gPW2JF6?e8NvV1y`{FUJI;RV-Bas)5tL$^J(v_YJ>RZ->$)A>X9e!3 zudw#6`WgsVGhBT;JWke|=i5Ekn%rizBSg=Bdj%_*-KJWcld^VgR|CYhzb(q8Sc6cx zdz)s){PD2no^5KTNW@ubJA}+|+#cp^hu)K#rn*FqHSmLNw|K8?vBx?L0k-VDQBdpk zn?SHpLXN()_U_qGqrEEB78Tm7*4~XRxZSST0xqq+8Ycp9zNg)fyZFaagV?)EW)#8N z4Rv-)ohTXDP)YB7e6aoTC9=i#>ZxggjSc07q$da8oABS$G(TytEbpDzyKih_zrCOT zzwUs2{ir>ynvUjYL;#Bx$>XC1npv4r5NZ*#)(&* zTdd>w`Ot-ju@F$=A{@4H7hadSxr)(X@?caUz;rG4ar{48TxIKj1KmFZ@ zU;o>0{-clnnN_y-u=sPo{-Jk%>0KZD6Wp`C%$e#<*@rlS>K~}=+hi#5>MuQJo$!id zx)^o;aqkK1I{bd&_y6tNQzdEcD}VW0um9?29(m}mgXSju`lGjaZ7BWBlKUY};lJ#9 zoGD;PT$L|B_O3U*^DTey(a)Pz`IA5Y%!fYk)<68%SAuEmx`xyEOUs|e)4zuQIatG| zzw^%qoo^0<-xwSC*~ddAOoM3rcYpry`#d!MT_EP0fA3cujmDq<)Z6~-b)SDXv6=w; zl`p>bwIBTQyMOsF48Z>BUq14)zw_z$JoM!NU=13h)lIie2$}^7MA{aw=Fe!t=)^Kp zAega}*|!t-bD)mdzt)s7`wl(<70bLU7NM!OM^hb;tuv%@|M1hcA#Mu94W#U>6FZZO zRquv)g%;QWIkThW%#M;Xdw`swI6}_sFgbhB+XLGpXHx8uGux0e zJ0NHFLX@0IeUF^kdRgUJK+gWFtzsc=0-< zd*Q2(J@EGb`sqLT$S5JpUiiXe5B%+af6I@3>B$!i+N0dg0&H*ZHmHiPnfnG8?dW|X_WZFGzs7UPQ-`| z)%2O{FB2U>JYz>=@mzvJHLlR6lc?JLGgC?Xq@$cT9--y2XZ)O!xdvbcdA;zyO`!qv4A_pqTDGKo_gJG0>5vl}5R)S*kz|Jlyjq5xJu^3S3oPQ}L*0BFG~+gaiVYsIM{R>z>; z0pcJLK+CIs1bjf`F>sF<)W7U|gdM>c1ci^~XpR`LHy39$R5}{V=Ij!?9E%wceF0uI z`rrxl8PW%5aU0SHZ^ms{A3V(B5Qt*StA_%8&}Y47c};NuC5H8~nK0`$^*q+=K@*!E z1n^-E-4}wk7FO0!vkE$^u+M9wjNY`%_7fSWwG23qWP@RLCi4CM%>-;v}p0 zoXI7HZenVj)eia8hLRofDJCRvOP>erF#FF>V4-Z1Xz?gN%;5!>2*_;4yqfd;YO8?+S`CiXL~B05avxJ5DvnD zPz-@Xq-7{{S_&D1$iat@LSQ$8%t3N1_K`Ey808Q;N+6Xat80NcBJy!q93eJ)M$R2| z4yL{xbxvdy_@Mqi8M80N?l(@t0fp`=7&8dj`aj2-h{Y6a=rMAtTk&HQwFIah)6hmjv2|F!KSy%p@_BMcMBc%%mmM zu{Xy|=-fVL;wqg>;Z1{?Nhc+k8FP|m&EPx`Jzg6)*-3z!G;t1f@;+*AKKbEx?xUvh z{+YG+P*aA)&5WWZwmxLyH1Bw*c`c^lqvo)u@z$h@dnV2xY^Hj{R6^qnb}RWZKWZj9 zfPpj~X$(Y3fPv=KqnY`)Iw@m`PBF)wz$>!(RF~g&h0u1wss%{Ig=rhr2fm zjp@LdDH|L`Ro|1B_%H;F!SG8Wu3#0yKQ!}a|4Gw!DX6|HuiaJ$X-s-gz8V7rBhmtO zvv3GN#c^QdXCv?RbQn*NdM+ONKphbxMM?|Rl-{^2v$I|5JleoQ*=tF2I5v5wem-Lz^*W zgA%4Vg4qYqL>RN#WEiu}I}yw_&jJF)c{ys@8bLhOO*nusW)FF0KF1YGvtc~LT~?pt z4trS8TVLsFi(?dTtI5ke5O2O+X^cFQ1WvEHxff0n%92qi3cq zE0?ND_;rfv1ztQFqh$|WJSYeh19U;{#!q@2L8*S}4+N!2qA$y>g-Z+fIjO2TcPN*3 z(hI+O>GimaojWv@c9Pk*h~f?NQ&pX>rq8kDJPNzK=vTA2u%@k}UD4K|%2wleP<;-E zcxWm`K{{!6B{dd@7F3L-7t|Ya>4nFv2b?sj%DEVH1*AZWQ$%+sjnFFn16XxZCln6Y zI7xWqS;_Za4oh3|O#sHnZS*CN4oDmX7JGmW#0Ka9H>2v&0eNSm-j(u}#<%4epxQig z5vyzD^Vl$Xh)*rH81+y)_o>CO7ytc9l?)lhVp=?hQOwp@O#W2;AF#RjhB3<5@R`JQ zBzRc)+{_#ewkc|-7PU8`d}js3;R8fbtH11=i~mKsO2shC=3E-7pg zjt{ZZ07udTID(U$fPH{B7$aV&F}^WuYMei>nwoG@Mw(1H%9$wJP}iLCvJIWe zN!?;m;u|a5l=w1maYC`WhYFC_)wv-J8oe8E5paLuI=nHAZv|7{JA+${M52 zs58PEd8v`sH86L$RCOC8&WMv{jiVw^a^a?}iYJWu0_Lj&2KcHd1H2QrAw}~J+=i(H z1nUTusK~}_^f4LYZHhfa6}HGG!-&cz!-#6$@eozsG0#Hu2Ad{JS&hm10t`KuJGOxS zYQR+XM=9YS++GBINSVm?0U2~yOXL&MEhZKtAstrdJ|P|U{yZEt#~2wjc2fWM#7Phc z%>au9)DKV}D4T#rh6jO0fL0jq2kC@1$Kbi=iY3|lK~G~08Dvn?7-VE0zTp)yPys9y z4KfMeAT!jNMZtTcVmQ>!2f^EPA0a;n2FMQ`jA8O)-ieT(jnha32AQzB;aO+2K_<4r zAoGrNB90io7>qK0x{u$43ndeUl~P*o?^%C4qegp2GqBu%YlV%EksK zy=`3LA#kUl^zr9Bt{$CI4B=5aj_xun7ug5F?$RFwuY;vRKfeFI4^CwkVp9_9Gj^^z zhPKcd+%>SW0JUuBVbY|nn~X`kp4a3Un@l@nA0(%A#)2kOXc86_>X9&`_yHATu&DAd z0=;-Np?D5VL=^HLv^Bx1o7hB)9*JNGfkL@b!@ zJxr1zaXw*2&iRBf$-LuX(pJ+ru8@9;P&3pC`Lg%WCloQz5`7W#LgODWm%$P7D#9u> zx*Lfj^Jn8h6cZh)i7+*AVu*9MX|jn^_5~Kuv_GZ5>MkK!1<$nsYH7SNA@G`f1pgXl zD|VU?Awjs^6Y_oN?tva~YOueA@LGeqm}Xqg;vG06-uMveLL)c;+fuA5DTjbTsCxs2 zYo0YE6UXVMF=QrSdq8~PBn(9)3u*M@q#lJ&_ir?#<^;!_#I&_HXVEr{@GZ3Az*dyv zRTd`R)Jw*pRWr{)^$^CGu8ogU`r}zfF4EWtwt@21t@trGTX7O$oXz7lgtJF+8oV_6SkLa8B7$R|Qu z4P%(A=@X&hujVkP@nJ7n#WvH(0ggWZDRsgUX!!iYfBViifAZ&<*U9XB#$*J!7TfUA zD;Ph~=BtlA_@V#y>EHY4S21h?dH8rTrxiY)Y^HVn<4g-q9K&xFb=RTd?r$VaDA_jK zbd_*-n9%m0p0;Tq0VKKGMo%O+Du~!-nmYSj=Ep-CVd(IR_7!Mu6^^2h_$C6MJ;Ua0 z)8*s)DMXS4FELySEN3smh&&w;DG83o-ke8!4@m^1J_N4^1O{fmm{uh%hu#NIWp!+s zdGO@f*ozP4EXkdKifNuOS#aJ^7A6Ce%a##oG-Cw|%|XauA_zlT z^XNwSqz6V5U`NvPXuJTA{aCw*M`M;Qi$K4+8Mk3s?J$c&vKl-D;aEE#J3RNnK&lU$ zRC-vQ``BSz0cLC-cF2%8pRl0F`9!fp=Hp?5mg9#N~w#XLKUaui6l=4>eO?JN?gg5K1iwZ#I_r(PD;htgn!&|?Vf zzzhFu2qbr$4H4aiCA2r#QZxG|28&*RWa6DqiB}zGkZ6Gzf$$cijOGWMr5S9N0{Vr5&4fu! z2`b~#^E`@?FD(HmU{fh4?FXSq$k!A!?Ko6@Czkz3F-O28NxOzJb`2N}wOs=MJ2oXz zU9eVg)kvIx&51{8RwWls(8Pg&C)i?XwxOxR8O^?)zAECgn89wvk8hxe7!~uh8U{>{ zHpVd1qfsu5&oIh`4HUjEXUt%x*u!VB(Xof9E*Brr<&fDmlyB3t;puYHhItmkZ-1f> zaH0$gr8x(S6Q@BZR^{=d>W#=i4FMWUImTRfI9;dhItj7spfV%!ylA0>juyh1851q! zAhn*80Ks(9kKPOKU`8)JOhGZ4g3z$-nSz9J4t1q{%DK%-bMwL+o|_k@oMsh0%DL6b z(i8;1f$w)K${7y{RzB$*>hyimxz(Vx4m=zv_etmQ*M6AO@C`@XOd|*UHijd>PQ-8| zi0>JWuEjR|m!z?%Y%~6=gaX6dhTnO*rtueJ_6R(Ke!kN8B5-Geq^ns<^k2hXX^ufS zjPEOy&}PZhh!S6hRiKKSoNeaGW;(yBa^i|I7}%)=o`v{jGOVN=xRPjQ($!@2pcbm) z(Qo2N7Rj&u^4#d5DI_YDW?-`?lS>7%@fh5Jlw>IcL#51KCQEQ20cOWX{erzYzO7?@ zX!Um(=QBe3egFYC83cc`T&ic^97xVQUE?k1Rpg+QV|ca-?+J83$R?wgVCl2c+?KXSAw%=f-WE z^kRE>zK0|&>rn@~ztJ5W;a+jZ2{#1Nli?cd!QYrSj**%(+GU)){{(ggI)kCA7~8y# zLrGNMI}qfS`Gb)-KA&*E9h?qg7>Wtg!j3B}Sk7Kh_vYeQ$}qRVa;tA2$0Nu7AY(Hj zc*0b{=tgTnmfflzLB=z(494$QZKj)K;HLL1dq#)uSyjYeLR;D^oP=u*0Uc+@4iH)u zDfoe)NmCW+D<1FW<&{hHgX0JI8JRuBVLvo^ZaYT6bdHqa}kuGcYzWGEX z_vXMv%rka~z)OPK#<^fyI5&h{jfvY{ut|L6z`Bp*&*Z?F5KRK@l+3Yu+2LSf;~yCBxBN+j7(ig>y+$JfXyG zVnQN%HIO2OKMs%-jb{;egBFf>XQI$0cqdO_Z`@liNjbJeob|G%Ji;Wq?3Hqtsczkg zSXA978Q;q=MZ@@B;=tA)#LB!7w;{%N0=HqtCpn=*W-53Nsy7FW@7L3Q8VJdXZ;Cy} zCyoO)8D@NJGR*kQJ09cn92D#(#Q0)C_=b0yWLT5(#ed^^*lbcotb>UEGMkY2Zz_A@ z|CX~E;->hvhHb{rZ4cWTxJhBZF{c%_HJE96wua58^~q4;jgYG`c9Q=YSs9KCCMdA= zktez~ybok;p6H+CMS|V^Q%`$C;igD1;Hd2XD@ZFLq)K8=r+_^)VR+7tNN7;l6$o0Qe9)A3UREx{u%~wm5>PhjAaqQ}a#)PoL,zRM+B6=E z9N_)q%}lcfp6O+{f;drP065M-tSG^hY{+P6gxFlfunOgn+F;bM3iT2sKQOE&(e&o_ z)K5T{g!IQqtqfbD8Se&$r6v)iIwE6=P1v@jAZa16|CNq~lMy)W0P#aPqp$425QxX$ zIi6&^lNb_t?$@Y>afl354PhJRt8tvC2)~+?$9NTo?8V|WtRzo^20z%O$=N;F_6#r) z*hYwC1h&mP9&F1y=2-|uaen06AWM1ysKc6&uZC?gjG?ZkuZ9`h(ePFi@Z$v;jZioO zCC33Ch|vI33Q?f#{6PXD7EpT$$GwB8Gj#p8%pDIywciwV5Qk#W@vEvl-Upee4kVedFnxp{~5oS&Uj@ zy7&0B4C$&I68c0Mesw=#_ol)dMW1NYqZWo>>#>skM-gtkSl!Y^kOYLMnD5g(_A>c|?VL=r4kc&gN$q*9x6Rd6WdU z4MDmM=_+Wcqq1V~9oCS6OrqLD2mMYmiK03JG(cm3a^?{3TLr)Eh!Ck0bZS@yfPBMe z9Hm^~V2UG%R`HUX*#!Mz&CJI;3GLh@1L`n4_wmkzcAD-znkGX+s__U-V{X_mO*8L! zG;ND%#EcgNGRl^b^B{MFLgWY1NXs8dauM>CKT(gk;Ke3hafTeik>sNW%q(+oXeG$l z=nM`!ugTiHf?EYUaLASjlKm>N1K0zX&mB4NL*}cHNTrSWDzsaCvwRhBxr%e^GRz$M zAnk(r^o5hq`6}?kd=>bSd=+qnF<%9KPENrGuk%&lhxsZjW9cWMkbD(52FrXEamQjl zg}BaFf#bCFZp4vig83@&uET#e=Br>0=Bq#T8HG7}FY&B-h*N3z8K7ASX(!YC)Gxw<@ zz)GTJ@SmX?j4R2}e)ILOOHL;Ga5XPQNx(}XrViLqdFFl;ul#dEy?=O6;y%Sw^e6EH7h?rK8J@Ujt2}X^@#~KA#C^)i^29x;s6KIzoHmr4gj7oV@?!RH zxjPb-JHk&T;KaY-6Qi_zrU;vJ`0?XtQek=isFMnl1#}uA3+O!}&u67epDg%@k>Y_} zQy4<#p?2;gMoOO{Hr;zPNruGvglQ7z6K1^T9gik$H4R1_jMC;g)Cu{9@u5#BVwoit z^XNU!d;@{$UQY$STLfgtsl>OXqDSvTMB#}M15HFWk_7e&+#>eoMgyeV3qFll8bLZ{ zC)W{hKsv^h1LopmZzRG>8dm5Jt>AF)!fP z#M3apc32!zv;o-R@by7ZGQ|TO!I5PrvNRB_|f|{m@j=M(38o8%t}mQj(gvRgXEynR z({iCCk#N<{eofG8gbFgy5nMNi9}Y(6Ek?lzF^%O36hP}>+G0l4jNpihj+h!@L=)t5 zK7%g6k4FkFju1s?2*mROU(~5laVPF82rqPBjZkM9!w)+BpIY*9FwqLu5QQ+wp#j>` z@Qfb{fz1rPP`MrPQ28ii{E*Ge!EFeY58yV8%2^hNP?;kLN62~E zWEhp%WEhprJ02>_JLXvkl`$b0z$r8gbwYk%#a6=@=4$$Z6~kXmK&q#(i@VgjVfw-h z@W_bD$W<8JjBKElnFlALoHsd$<}oi+2W-sBr2}zX&SpsrAWEW0542BhM0;{LUxP=O zX&h0RNittt!&YaQFY>dJ`Qq6PQ@&OJv)E;ai2zdOoEO+OMP|yw_|_572@&hU;pJ1V zv=lgqO%Tgi_U|-HB^Kg16JBHUz;JKHh+|&6XvJ$cRsDrLrpLBf4jKBgL*#y(#*qtX zpm_-U=rs%2hlqy&Ke@|M<;Nd07?@+(w7ZaekeE>APHH}q^zgpoB*S=*Q{rK~KZ@Hh z-a9M~;r#(wYhSkZS$NV*k;ARE;y{>SP7X?OD1xdc(%1-`JKA((%C$?>)PkVJbgd9Q-zMlo*)RC^6W*X& zLLp6S2EN2WVjlsrh`a?-ACb4RxDU%)lx;(L)}Xv)iakBc;}j8ji%o{*E%Q!9-ZIYu zc}rALOmQS<`|i=9&df(2nZt(h40l<5^f63)Xv+!+^S}KR$&E4~$qu?lABjc{B%*R?#cDI}sDPTWYQi1L?;!^{Z(=_3!1+bwK@Bmb5J?blAXT$JET{pmpGJ)s zl_JzfE*PRlLZgQ7g5vqu2x>&Ue+LG81}OIpGAYtx}9IuM-83&BJ+(PaJ_v;;QGZ6B}>-P9f9l5 zKl7mvy!8)1#%!=d4XF7y&xns9UR4EWg8Ai`xMmzC-q7=vBRmuU`k3`%TqOFrME0!` zF(*$i$N4nY*UxhJ5Fk#wI?0zI1BBF)yqa(_AqzCEO+yV`{C8u~6eK2i(UX3zUSy`X zF#I*lRh$Z;jN2pNmSThgGewzixun^CKr&_is03ng&mx?FR&)3%cse-0oEtlXNC7p4 zlfgJEj)-6TB-b(AJ8GuRNBt5Lo;X|(!^_d+yvjA#^Mo6s9i~4oEEYvxdp0Lv@1|P*xQRbr) zJ`;pfb(8r0FsWva3QX0?O-N?N1V>z@|4Vp=f8HZOE{>S-6Y7>K*bzNUh$O{Y;XH6D zb}MJiCy5hE_m_PWiG7Z~G3-7PQgC4=SPk!ZIT&+eReULpF<;2Ot-tif-LOkX!XAh#U3H2iR2BFS^ zK(;ffy|8HlS2&oBe&GC>DWD-Gpk0s-Cn0u&Ryq?5rA#_mepfo_q;Ihhe@d)_J<8d| z;O$9@8j}vl(ilD!Gh9ORE5X`H8kV6++ryoP@1Wa;J@UX<*gPGxX0g1rhCx-;jv*p>n!ke!2kgZ87D4 zzzt`zlu?oqLUDWc?~OG2psElnKcH{rl|$a0zE`SBnQ@*r-*K@_`L915a9E{y7E zkniZz9)(moh{68bp1ptZk3RFhH~!Qkzw#HjH_boGe62;!w3}yv z{r_!h(dtHi-NK(aA~!I0wEkIZAE zk>hg%pQ41e{xBsIp5wbO_#!&f1HoA9pP=RWI2}L|P8Fn2&~EZ+O52F6_`m{1R(!LB z0X7guag^1jz$z)k)T7Yp;T?KJ0EV9$fedWxa3SSblq_S~{_SVYI_kv2tLNZ0w0bCdbrc@wV9z$!{l!=9Q^nB-!^cv8=xxuPd*D8iW@Sh3g5R5e?W7UIB{qV`-SIK{fU*w^$pi<$ zfFMKiJ?S?`J?V$(Di4_MA>4+^B~p(@$R$1V=+z^a4|zipf3qpva!3iYO5$oe4#S_3 z18$CbFb~s386Hyf{36nX4h$&~9@39{LlQq9-KE>Dl9%37n96ZLx<8}{Q(?lj$dIB; zWegCJv z?2oek6s$zL1VVvT20K+cXCI^671<{2I$*pk!xev!AXJwyovc*(m4C(si$1~&<|O?o zd`w;PhMM;zW2kri1!M}vwZ)eI?l*q&O{fo3J#IeyIqQV_2d`CTqs4p-J8%@(fu%vw z3KrRlVuux7WNQEvQ5;!hE4;{;cN^@mwEV~Ju*{zPXEBKO5VEI+De@lNhbgjo$D_#d zj(HXU^(zCJE*toQuo^tqOhXOiB1kar<^IG@(t<)qzE!lE5l6vpsr4w{_!1r6N7{KMRGQ`vCd4!A5ll!MgpO>I^aP(L`jao*$ic_#2mD^rAP+g3?SYlhjDRMx zWDcH>-NHP^FmdsKQySCI?Ppday?X9w5C1;sH@yx1;iLxl2|s3sfF6RMo8a5;DVv$G z!%QlSa{n9q6Zpo~>Lf-n(mjKKveYmX$3Xw!v$PhF#hsHyrgw36#{ga?^$`(9;266s z#FFR)Fq(=lDAG()y(up45!q0Fx631oga7Gc9muXXIC9A2sE95>KMaRurm8LYD(mKRw?gP1OpuR3S{cT*;% zzBNBqHLwv_^J9t$!T5BMDtY=a*n!6`oz!RnAhSj(of2~x}n6(gXd z6(kPS`z%0|{V@&$F93cRBBvw|T~7E1PU#wk0cZs|i1P>=U=OIGLjut#)5%Mk47{q@ zj#Lz;!cO@@{Di_=0Yd$BEI4^JI8P3q!^hr-XPdLV`GU;o`6j@}%zQVUEu1!-?UXo> zur?qGm><8ACs3|u|Kps!%$-T!2j(V`fV$pK`1SY|C-D0*FnC!Xp})jt1u)f#+))Fo zp`n%phKrzgKuRL(hfTqP(fW>s#E>zdJzmv<3legfQuS7Q@e8tP})G1de0BvTx+O2T||; zvh>_=`IrSgNZf)^}EI zK(1B&oYb`uiy)6t%udGiXmr$3Fq*HSvV6>p^@?+)>)syh4crf+0ejuW$jLOO*D^8a5}lv|O%=!6=@54!sY4wdkxc^~ADW$qNl zmp3Q!uo|>C=773b8tHY6a7uEH2q4T?`*r5!d7w-i&@nvJ3`@kmP z7>@d*ab!+X_ZuxN1k@V)v3kJV2l6CG^Z`S(;2gLwm;=(4`4dox_0jaA`e2?^72jWz zSM-cQfJQM*Ve!zJAOwkXm@@$-gHQ)I6}Jj>v!F0C9@ZH8h^)YN9b&O{#@h&2(fn(@fFD)l8sZtJTB=PAKGmW!wy=OQdGk3O!;Cv46^7 zn!t{khIptAs^{T72D})A0l@keBx=NbGurH-{GL>q1UMEDG4O(!?a@ z$AgfbQnAqz2L~sgdPJ)+e8>f4IwD_*utOnQi%UuvzXR?<(F}}>a~|0Y@L{u zf=jdw$|;{C%{;X>Bt2`U8_~2pK?iFB_WBX>EG`-|AZq2CES9901Y|QihYeQ6Jt9vG z**QqCedTVuE`Me?UEUp|erK2;@DtRpIB#}mm^dSo;+Ha;<#-L-qq-hKP8J8=EMLpR*`jAuGixx*6K z5IdnJfW#9F0|N`6n9NjD_)Ft&6n|O#?ZMw({O!lz_4qr8zeD)D0e?5*@0s{>@R!5i zVf@{Mznk&*T>KrwUmkz6_$%SBjK2#0Zo%IP{N0Mb=i%=K_qf0&zlYat>) zho__f`IkfS2!3WJ;ADX*D*GeaX5uL5n!=7TPoKSpTvASm`H}r$n%K8ntVz>?s!l@Z z$1^D1(vB$H*&k-}0%V@Z`aJ>6hTC*R2!v;BH5b!wVMt_HqswQj`R+CyMOsf=htVUt z90hMaqA&66b-^=ziD$15p6Sa8ydvxH<1%Rf_9x_aRVD97xxK(ZrODS*{q`=C_v6qN z@0|y8>HBe(-R2ddL-7&8#DepNdvi%K6Tu^pz8@7w?s^nY;cj*weBfTV%TjkedM`8v zbw7ln*!}k+iFrEX_x@wj`>(`QS_FNp$RrghW5~9uxIBw2s5u^X!N$a?8KTfpJg|fY z;a-5-2pR-~Q)y&@ssxn}W&>zLuyi}|v$<6D-g7w|eX>b6umtfl$Tx^Kae9FM0d>c? zf^7$NM&a56#7iabQ?1%o%TEvSyOd`gph@I!P<@frME- zO&1+(^I3=AN9A^7+IWB;+CH$h3d_fsVRqxKwWLc9*4ox~3Lc`moZ^kAFOpaFX z#eTAK0B>du*l7~Q05m{VUjrTB`Md!-z6hjB25W$30dEehp)3nt4?r*U4pu_8MbS0@ zLnfgF8-14Qh|S5d0W;|U`uH5f@fTj;6mVtMXb?`L0Agi+PQfiAYvMzmxT^xl8^Cgm z0l-i6j)J_wYi?bR04}gB_$FSn>T6&3Kzdnhv#3e53t=Z_&Ygyc!M6qxZDU_n#`=$M zjO}l9R@OSJ?rML!e{s#d1-C2p)uwHw%#~H|t&CgBO8x2^Vo;`4wWbylsvAr7+(u`$ z*}ITgt*>^>&BeHtZr1y5zrEtxmZeVOFK*eZoePj)tkJI9>nyML+nrTNbZY;Fdar#; zW4Y5f+dF=tzPvmw*9l84q!n9Q>ntzVmzH%)D&9Zc?kQ!(t?_2Jvo`IOs+d|+YVDFb zsbcL_+lt4n49li5t4^z>61JLCOZm;Kg^`#INp_&e3vnyeUhVbkt9{#w zaVikRWGd((Je9aQ8H-;y?XKGC`jSl0y~Jsc^wyVpjc$9%o_?esgV?S`4M zjR6HKrxwOIAaoO1%&tAU-fv7}PCd8(n)qsc#qC|!UY%~%FD|!Fo$gQf>gU_5r>431 zm*Q5Izpud}OgG!TwdMLn&VtM8J;zdUnxcD%FRUt7oAq=-Yt6vo=C;b%#; zcAx6R(wEd3H3HwXnN-SNc2_T0qj4*aW}7Ml$XOz^agp>Bymf(Zjcs^q9B=i`w%61| z_$~d!n|O-5e7(QR)BVnLcwlPMugDeJB~TlwkVV%Qg02(x(t0ax?TTB83*C0#RlDQX zgg;{Q$eUe4&kmKxq-6RvZnxw1)SkGtFZzyOqE6a+!|YzSVO9t8OaeOE4Oi`rTa*5q z-m{=PzQeJlTAl8Ndbg?edD8>N#;t>qb%^Ym+V9uoLhP1>h}O8yR+9oR?apz%)xAU# zND+^0H6KI)LM^Nlno=8J!s6pJ_Ab&7fNCRV#nq~s=v`b{Zm*u5Zh<~@fcm3r_5SJU z)^hz+&$g0kHJ)q$Wcuz%v)y$Y{Z9AdhN z8i`n%yTpr8_a3*gE|=Kol}^(|52K2G$_N^rbyA!$K1sA!QEpokyh*p(%Wkjz8r)~q z%1z07qv7^?nG2ou<>s_(T&ljz?k-L&)tl337sO``Lya%3_b#TJC?WJG&aHR)^@Mv* zyVsv!lYraK^m4s>%H7vqUUpB_m#3F5_TA~8dv4ubZMYfGn6+-_6sUI(*L|Sp`dZ&@ zf;yhBFSnbqc4w^J1C=og6JPFh)+X2}ILXCnPO3KsTGgwcLZcY}I7yf8wX=F^WVM5_ zo(BY`aRo-yy_muUhq?#!cfHkWH`?S+EA9%GeRt$pZ>`=yd!2sJJ=*I}yDMw`i<7*< zpgQN>E>}LYj^@_ZI$aDti7xv6ixc?itv614BVg4Q06>~tbGs|;J}Sr8+H39zmljNA z`66IaCXN+y&rbB+d-~I|j$G!kMz_<$V#tKBr9#W58?uYLNxSy@>!j!EQ?|X__@75dG1@j<)$at&W>Wl-DmpVXbS@^N8duknfD+5gS zu%>PwXdb|ZaDCf4pw3RJuC3wiV4R}B^_s)5wzso-#I|)vttN%0YC5$?W>3gC1sK0L z-MhHj*aI=34ssZNwzo@&>R~~rHOXSd>6)sRSj3RriAMLwN+lwCbkK5?`n1I;rOxLcQ@gVRY9%nSjQz zpozpGc?_&=11#$lWkQA5p_~4C&x|Ql5M6TCvaQ2vB?&0(uGE)DHLCU7_2pz2(pP6? zSw;Nu7%sLZC8MQjof5Vdfcca}KJ>ldQ)Z7)W2~nWscFX=wo$#fCTTyjic$UwDm>`?z3Uzi0IePgxB3{MC{9p?a_)^k#1&JfJyuJx8XH+qClh*` zH`aWz%R0s_l4WHNFZ6qu=z#47TsoEZ?t2r&`hZqAY2N#@PYIVrQ!m1d9nLtp)sREn zd?X5X+Vlme!E;COCR_UruN(GS zgM7_4=B5YRNQ3{xS)xWP{+5L8?rN`Xs5z=ubWN!SPJudRtkbRfN_!dl>6qVI%CrW7 z-x>{SQW9QqJh^DxKxxxmZM#ho*?jqqaz9jMBQ&N+Kk#HPOcssxE|8~j5klE&3vyCl z#Kf?S8DL>lF;(xu5_E;;F7FN#T7_-`nSsNUGFcS=`Cf0pQr=z_#bm;J zh$Vn8!5;4}iRosQs>&p-f;GR!>QX{@rfV zHN~W^+d}irY~&GW`)+dfQ(fr&z8>NW*raj0gwU~5*jCQ7*MqL>jelfP)w?UTqkcsJ+njL(K!V zSZ!he!Ju`=)a2&)DQ3C-W??b#?@FGoupV58fi#T8r?3Or!c3G&?BIO?P^I zwSFF3$8Ei2VSu{^T8A(-q0Xkz?j+mQppDXop`)(q8v;M<8o zJ2?ZJ5=NuJVbZz|qJe4Kt9ZbZ#)7eO2(U47aGFA?>oHODo_VrYb?iy$;9$6eLsU*+ zZ&~Xr$_ANm*^Ou??=B03(4)hvf+GGuC%AZRDhKF@v z3T84+xj3kk8>n-Eb*^I_J+tYhdgJVJ=aklV4r80nx-MAoGB#dKVMweRdX$551ckHd z!g9=V5ySllISlx|@PLm17}sIYuJ`)Wr(vBJ#-(l=7}R|n)IRpKvF@|bGg0M!8frQ1YA3LBxJpj%)ZS^>{^bjyxnY|6sIhUu0s9b{M%p{9x`#=CPA!t@t zjQ{`$LhW8D0SJwE0|8)JlmJ{u?=O(=q|*K;=x144*tFSF90zdH(pw5^_C%;;y);J| zc()K3UHiEHNgUYN=Jk9N5;8m`U3c@wuiLDO=|%eH`CFp9`h8F_;VA^$R_jgS{dciqBit-LX_ucHdD|AjOr4mcm?gi zMYDN3C`e499kr53^x<=H6HRw%{ZyQWmN;CXs|oS$z%aY)o_CkAL0}E~TBRU|(lgXc z8P8Xb>t{m%3;M#%DX7fH;lXGwyWK=iEv#<7#oKx_qr5n-z7Gsb@0syCCE+TG-*MMn zcUo40Kd;0ugnYNFdKgo(2a^KBHAK6k{)Kpuo;yv)DLhRpbWWbV2tP=WZAY-_hVH);bkfZ3;Er^C-$r-wTmp#l~iYs+pQej;uRtt7ZI1Hfv? z?&23l;>PLd>a4i^(;dXa&^r#LwX+f)q>@4UkAp#8CxZ+Xm_c68=LcHreUi0Mv0ig} z)=-{owcX_=76zIHe9KUe-7fB+RirpGeWT9B;f&RO$o1|rwsPFt0D($8n1I)|-)VG~ zbwmZ8WY?iAuZfMwe+KZC7w8=Ww(Gv1L1@j0QA9sbhYj&Nf=VfRX+c45;+RHht}>OL zB?K_$HKKKY>)EKJD@I^@*GOjn3YT6NX5I{QpiP`&*$k?%KpqrZt7aOt}O z)t&VB?HI@GRraCQRHh{wBA)=qK~~%+OYXO6ic}#~Z%uqhZs z3D0UaQnQDiH`JuZM9pFF8%i+V?nU_1VDAZy-zsj_pQbLV1b@JWcIxXG3th(a%>@f# zIlz$(l?~{tG9<$NWK90TS(VM|1J8TlzG_~bOeXcL_i3LMA|NpSo*{h25q}sx55F7> zviM#C_J$>Uhx&4Fnw1->Wig6+YM5A{`KtXocd*oAD^*pq@OF^#|rt81+ zeCq{9Hs1Kk$#CNbg2qEjr#q$xFBrzIpk`>)rshJp<^hTg;hoTxK%*%U&=(i9dVsrj z{f4fmy={9@v@*7Algi$n)qq4{9+nC=2KwW^fsHXkzb)LuF7C>88|G)W<#tq6tsA%y zH)F^z`exOgiRr5j4ucc+v*kdEne)?>3)Ch zI9=7f#9>H;*KJ^Od^pHH`D{yuVnQ2XoY~Np5hp7M6vWhl9#v zrb!F4PHKrpr96L^%*@{mPu_VpxrK)JI7H>%QHCSfh^12B6gS3l2&CuR?uFwf7!}S4 zxEY#=$gx!Q#7-b8_$A1K7gHhejK-8T; zRBD+!fv7uysF34#0#SDYQTw~Bc^G#Y-llc}Q8$U~miXSCKvW(k8HlFc2}I=ypq)U} zoj_DM^|KR*isNUDtlbGj-3dfBCdMla4B81q?PaWJc*#y6D%^cuwB1f1YP&aS?F6Fk z1fs%2v=fNB6NtJKh-!l2cLGu2pxy~Y-3dh92}EUl>c7@NREd{7>UDi6Z$$3 zBN11sieTld9;J=6T!U>6B}!X8l_>4l(-^L64?RyABABgsC{LMW&O&^R|A-;SJDIbP zzicOS)-3~>vl2K&9VAHuASI&b1D;&0c@+3|V$FAA&6%rjC)OM>p*ykWq2OPMXy1u7 zKi%7jHD{y|Lo)sFUoVhdEkJ4Y1KoFG&97CgIkMkc$qn)0d^i{x&S#GoYmRiQ8`=sS zL4z%tSo5)=$C{7JBnK%JA8tJHrWWKhIvi3+<6=&HnG-fz<48n5sT+C*pl4;vEO$c2Y0zq+Zr} z2X;~~@1$PdNxkeM-OogAo(%luXg?Si4S<655oN1Y(nOApGFEhFSPU>Z*f8U9C z--&o<2IH%ddiiNfZ;SNHJLzqA(%bH&w?*>Wo%FU$qwJ-v-AQkYkEZC%&O7OC5iKQo z#}OPD4i5~H*7^ZcUVzn3dRuQLzERTK9)v}0azmIP9}Wfx^4a5s9O6v;hPF(g9zLNk z*rEwJL~ivh+r_DytB~Fn-$NMM7bBjDb=l;L5e`gD!Ivz}8f^R?!!W)Wfe$4-;V(wu zg9q}FhK(acvSl1?G9UNd{)-WZul!37AT7by7s4N&KtbZjmA8X@`J1#vf8`|2OQ31=jUc>YH6Ey3xxo{dWFJ^{IAUSW|5Y= zFpmuX>_{m2Z|x%~GX^E@tQIwb;rweN;GU2nfA7j=zNT`;D``LUE;o z?^bs3k+DU2QpkhsncT;PJk}u8U7{z83u`Eh%inJvte z%B@1aUM{zq_4!)deZoBrPHYyRG9Q>wy)e7fTw0o~V=@)DG*?U9{e-&-O=y!Iif*&e zoG-bJ@?3qkP%hV!_g`@jg?#W8+wk>FnUVjC-Zy71F7iVQ7Xf%ciIssFwq}a;`s`Av zSSilUS6by->g-eQf1aPfUgXEX20AOumtBB-Bac4wu3M_5uR>>peECT9Kxf4UL_2&v zrZ_w6=4TqM+Q^xwJhKWrW2*SUzUF7#O1)K@uUGN_{@L2-Rp<-K%3`nmn!&zG_2TT@ zT&rHF%+9z=`Ft&N>M75wDBqVKnAGfSIo~R^KtkqcmWsu>+Ss|L+)-hU*)9Xn9O$yq zXb`REO7m`Mw%DrF##>Lh%Q-^hKtHXyGRWdmBR}7mpDE4eYZK?6azBN6Z8#1lw^;8F z^jm0FTBZDKsXjM1-*Q{U+GP7F_gm&i!Z&u6Z#3sy&1SQV-?{nnY%O~=rpQm*op-mJ zVm@C4rnh;5{_Oh3NtWhkX39%T;G-36alTpGedYWuOfjR^=DY11 zyQ`G)b1eYQT*WQSHD~IzJy!!G^k?1|Ny|5OS(qv0%gt6}uAHyWEw$X*-nA=+n3;B` ztciYarqo+s>WQmovENywvbPTEvKdDx%*`|l^RC;%%0g_Y)b@3rRFB0-k8&z{^A6{h zD$N3Run8&1ovoB>`>z~gwh~h2{mut4u!!wzfWkBzkQ^$7V(q%^q^_t$G`H4SUY36f zv%+C{&rc{1^ii2BHNbFY>P2_9-kK}c4y#v-ul=Rp7%uk_22B#k_%16WornXdH z0u!Gp&NOGr#eAz!J9zsxQ!Bm_nXX+CP-hzTrS>9-|1zXXNT#iFd1kiJC@sy+&sEBE zt=ggQecXl$MUF1?1;3e@fd|2w6kPCOG+lS|d3SccSi9k6kK4X*cYYB?cf_lp!KJxI zu{7h(L2#*;N;8Gpjoob;i~>%Syo7|dqHx3W?fT}JkYN@Z!j;x>!TnPP3~%E`@EJ#j(mb(f94S{B$AK=l<(rlwusJH5^7Qp@RRp^J`n;Ph6z6o$FmE75Ky@&-Y){a~` zso84rz@zH@jhqh?DKuxHPrAkYEQG<@O;^r`w(6=d<8Rc)4#8rJX8{8OVR7nb~q-raU)0SExOEI}UM$#H2vD*jyL{5d^Vrl=79ZlQVq_ERja&^( z1!jj*t5GS#NHkk6&F5>+eUejwh0LFdTt}wT%+FLRjq*&hSf0VG>b2=tU-4G?Q<-BD zF!^U-68UQuxX$hi9ehCuMOsiQte&swQ z+)+h3+D=BUH|mw8rKQSj89UUhyS4mxUh#s3dJ<)LV6|p3b}))YqgW_ZN^_-Jq48vz zhT)3lJ6Q85bPckL!dwd*0aMKUQVW<;sm*-Xlj&qrv%$=45w^bq1jYIc%z!hs+2)gJ zyD;ZZU^C;y5(KfvtXpnDmM_oei?umsXDjXzF;m+=J!!KvzfJ!}L|yB5A(X;)Q!LFk zDR9{o3$}T6eqnuOtxDCj=t;FppmvqHS?Jw!bLAH1Ub$nN1`352i=nnEGBHi5 zrx)vN4?}_a(1I+KUn#5;8vM}v>Q@bTCLMmv~iRW+Ak)C8A-oh|ETU@F` zj&01e>aeAjYqw5FOSCuj7SZ1GGDgnk>=2+{QP^=9ojd0T6Rr`I(uSrNWFmQ+vTK zuTj6BljCAk#)PEX>V&?fEXAG|Mq159EylfY;qeC%F_M>0&lJ$_5~Tn7(oB86QmMTt z!{)f$&`WA*+)&4IZ@ZHDh3xN(E92a$0Z& z)SEAx&{tkFcX9|Qk$YH&7gy^m?#sEtYl330Na2z%zH-!DpweCMP+0dup}ctHTkblt zxntwlv7r93V=roV@u}lZ_hOA^=NI=~9P;RNkF3w+kJNke)97^FW5?PkId+U6TJHDs z9qS!C=D%_KT}S5d;bbng3yV@QU!E%$Td)zrVE1iYYT(NH%97jtb`BgLlRx_%a)HHv z6)*bk^740bHDq?*wU1xcT^uyhefKVT9A55MUl)DkFYWh?NC9Q6@70$g-i^ysE*wkl z*8L1x%IXiJ5k zP@K!dCcJv(lEPL(xu>R;PZvQXnvMKYqXB0KOc}M#;x;&cWnytiH3P<$>n=3E{A{x^ zPZM5k?aKMyR>Rj!9D}bzZD^JAZlegxSvg-jcNN+us$$vUeJbWFOZjFKO>>os@LwhOxiw2ay$zOsH6qo_Uhu= zG9;kw=zWM8g5diq;1Q5)fNLHGT}Z|)c&gkMw!C(1dHMXxu|lah1F05frF@}KDivn( zrP+($w#}p>PVe$7#aeBQbELMO(F~FXY*tJ2ko`*e!h9aS^w)g*6K+;apV~HN?BeCq z1=##xnue3U(Wtwv`P%or^h(>^=%X*6UYcuFD#d1_(3%B4yOr9#-}*Dl@jq}tRm4&o&dNf~NvheCV3QiquoWPJ%PpceeRTLar=_3|gxbs1ch zJ}>kJ(?Y8_*P5%$RVuS3c${9Vwj=XfuelbOqhMT^fu>w3l|YD><_q(c+UwMJKdAw0 zJN^JL!~6q>TpqHp+iE~lsl8rp2hCCTxg)Vsi6)krC|Go z(#%q69>k|S3w>>-_D1!PNX+?yNX%N+h0wje+&^~g74l2Ude@N`9;uODh6UrT#Ou4d zu%APh|F+c&xYDolRg&8xBxosIT$fS;DLkUEy%m~`*+wy6T&g{I?Z?!Zfxjm|11D{1 z9>D}NwIBEwFs4?iUV&$-R4Rho7Mismy!K;iHe01a13L#pLVmtns=evjkI9{bnYs+7 zjv%r^5!Qk?tIra~w+eKF;3BXOJIr!O;luao&bwV;!EN2n%68I)7l(H27!d;6rJp<^ zdR-$6cp(ms`*_qcil%;VxxEDSd6f#N+dOs*)mJ;LI@iJgfG4waC0HdZ@Cd=r?N(-M zZ&9Dyc3!38(=x9>pt=jOMprhu+ptEAObX8r+ci7WtS`-0=8NEuh1y%yn>fFDy*-*V zb=Lar&g!vaFO%PZwuJQct3;M&%d^c=5piELORdUMeXjOH*K{~=_LKnD`B}H=77&3~ zdq~~74N#X>>WyxvS6u71SH=1>2a3@w&%)bQs8`_Mc$?bJLSpNTMHANnD}AyH$D-X0_#hd-gr@tg&|S$5at(Q7AJ&7tq~ZTv~6V z!fJ08@09R|I+$%^X$kDtEzd(;f`4ni_T#Fw^?PO0GhS?hWf$j5r4nKq=9jR8Kk;}S zVxU~!W@`qKRgJc+BzD`t w*}`+I=T7!v*2PY>+ &'static str { match self { - PollError::NotReady => "not-ready", - PollError::InvalidIoid => "invalid-ioid", + IoError::CoordsNotFound => "coords-not-found", + IoError::InvalidCoords => "invalid-coords", + IoError::InvalidIoid => "invalid-ioid", } } pub fn message(&self) -> &'static str { match self { - PollError::NotReady => "", - PollError::InvalidIoid => "", + IoError::CoordsNotFound => "", + IoError::InvalidCoords => "", + IoError::InvalidIoid => "", } } } - impl ::core::fmt::Debug for PollError { + impl ::core::fmt::Debug for IoError { fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - f.debug_struct("PollError") + f.debug_struct("IoError") .field("code", &(*self as i32)) .field("name", &self.name()) .field("message", &self.message()) .finish() } } - impl ::core::fmt::Display for PollError { + impl ::core::fmt::Display for IoError { fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { write!(f, "{} (error {})", self.name(), *self as i32) } } - impl std::error::Error for PollError {} - pub type Ioid = u32; + impl std::error::Error for IoError {} + + impl IoError { + pub(crate) unsafe fn _lift(val: u8) -> IoError { + if !cfg!(debug_assertions) { + return ::core::mem::transmute(val); + } + + match val { + 0 => IoError::CoordsNotFound, + 1 => IoError::InvalidCoords, + 2 => IoError::InvalidIoid, + + _ => panic!("invalid enum discriminant"), + } + } + } + #[repr(u8)] - #[derive(Clone, Copy, PartialEq, Eq)] - pub enum IoError { - CoordsNotFound, - InvalidCoords, + #[derive(Clone, Copy, Eq, PartialEq)] + pub enum PollError { + NotReady, InvalidIoid, } - impl IoError { + impl PollError { pub fn name(&self) -> &'static str { match self { - IoError::CoordsNotFound => "coords-not-found", - IoError::InvalidCoords => "invalid-coords", - IoError::InvalidIoid => "invalid-ioid", + PollError::NotReady => "not-ready", + PollError::InvalidIoid => "invalid-ioid", } } pub fn message(&self) -> &'static str { match self { - IoError::CoordsNotFound => "", - IoError::InvalidCoords => "", - IoError::InvalidIoid => "", + PollError::NotReady => "", + PollError::InvalidIoid => "", } } } - impl ::core::fmt::Debug for IoError { + impl ::core::fmt::Debug for PollError { fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - f.debug_struct("IoError") + f.debug_struct("PollError") .field("code", &(*self as i32)) .field("name", &self.name()) .field("message", &self.message()) .finish() } } - impl ::core::fmt::Display for IoError { + impl ::core::fmt::Display for PollError { fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { write!(f, "{} (error {})", self.name(), *self as i32) } } - impl std::error::Error for IoError {} - #[allow(clippy::all)] + impl std::error::Error for PollError {} + + impl PollError { + pub(crate) unsafe fn _lift(val: u8) -> PollError { + if !cfg!(debug_assertions) { + return ::core::mem::transmute(val); + } + + match val { + 0 => PollError::NotReady, + 1 => PollError::InvalidIoid, + + _ => panic!("invalid enum discriminant"), + } + } + } + + #[allow(unused_unsafe, clippy::all)] pub fn invoke(path: &str, input: &str) -> Result { #[allow(unused_imports)] use wit_bindgen::rt::{alloc, string::String, vec::Vec}; @@ -100,44 +132,41 @@ pub mod akkoro { let ptr1 = vec1.as_ptr() as i32; let len1 = vec1.len() as i32; let ptr2 = ret_area.as_mut_ptr() as i32; + #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "akkoro:assemblylift/asml-io")] extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "invoke")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "akkoro:assemblylift/asml-io_invoke" - )] + #[link_name = "invoke"] fn wit_import(_: i32, _: i32, _: i32, _: i32, _: i32); } + + #[cfg(not(target_arch = "wasm32"))] + fn wit_import(_: i32, _: i32, _: i32, _: i32, _: i32) { + unreachable!() + } wit_import(ptr0, len0, ptr1, len1, ptr2); - match i32::from(*((ptr2 + 0) as *const u8)) { - 0 => Ok(*((ptr2 + 4) as *const i32) as u32), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr2 + 4) as *const u8)) { - 0 => IoError::CoordsNotFound, - 1 => IoError::InvalidCoords, - 2 => IoError::InvalidIoid, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, IoError>(i32::from( - *((ptr2 + 4) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), + let l3 = i32::from(*((ptr2 + 0) as *const u8)); + match l3 { + 0 => { + let e = { + let l4 = *((ptr2 + 4) as *const i32); + + l4 as u32 + }; + Ok(e) + } + 1 => { + let e = { + let l5 = i32::from(*((ptr2 + 4) as *const u8)); + + IoError::_lift(l5 as u8) + }; + Err(e) + } + _ => wit_bindgen::rt::invalid_enum_discriminant(), } } } - #[allow(clippy::all)] + #[allow(unused_unsafe, clippy::all)] pub fn poll(ioid: Ioid) -> Result, PollError> { #[allow(unused_imports)] use wit_bindgen::rt::{alloc, string::String, vec::Vec}; @@ -146,43 +175,39 @@ pub mod akkoro { struct RetArea([u8; 12]); let mut ret_area = ::core::mem::MaybeUninit::::uninit(); let ptr0 = ret_area.as_mut_ptr() as i32; + #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "akkoro:assemblylift/asml-io")] extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "poll")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "akkoro:assemblylift/asml-io_poll" - )] + #[link_name = "poll"] fn wit_import(_: i32, _: i32); } + + #[cfg(not(target_arch = "wasm32"))] + fn wit_import(_: i32, _: i32) { + unreachable!() + } wit_import(wit_bindgen::rt::as_i32(ioid), ptr0); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok({ - let len1 = *((ptr0 + 8) as *const i32) as usize; + let l1 = i32::from(*((ptr0 + 0) as *const u8)); + match l1 { + 0 => { + let e = { + let l2 = *((ptr0 + 4) as *const i32); + let l3 = *((ptr0 + 8) as *const i32); + let len4 = l3 as usize; - Vec::from_raw_parts(*((ptr0 + 4) as *const i32) as *mut _, len1, len1) - }), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 4) as *const u8)) { - 0 => PollError::NotReady, - 1 => PollError::InvalidIoid, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, PollError>(i32::from( - *((ptr0 + 4) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), + Vec::from_raw_parts(l2 as *mut _, len4, len4) + }; + Ok(e) + } + 1 => { + let e = { + let l5 = i32::from(*((ptr0 + 4) as *const u8)); + + PollError::_lift(l5 as u8) + }; + Err(e) + } + _ => wit_bindgen::rt::invalid_enum_discriminant(), } } } @@ -194,9 +219,9 @@ pub mod akkoro { #[doc(hidden)] #[cfg(target_arch = "wasm32")] static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; - + pub type Bytes = wit_bindgen::rt::vec::Vec; #[repr(u8)] - #[derive(Clone, Copy, PartialEq, Eq)] + #[derive(Clone, Copy, Eq, PartialEq)] pub enum LogLevel { Debug, Trace, @@ -215,9 +240,27 @@ pub mod akkoro { } } } - pub type Bytes<'a> = &'a [u8]; - #[allow(clippy::all)] - pub fn success(response: Bytes<'_>) { + + impl LogLevel { + pub(crate) unsafe fn _lift(val: u8) -> LogLevel { + if !cfg!(debug_assertions) { + return ::core::mem::transmute(val); + } + + match val { + 0 => LogLevel::Debug, + 1 => LogLevel::Trace, + 2 => LogLevel::Info, + 3 => LogLevel::Warn, + 4 => LogLevel::Error, + + _ => panic!("invalid enum discriminant"), + } + } + } + + #[allow(unused_unsafe, clippy::all)] + pub fn success(response: &Bytes) { #[allow(unused_imports)] use wit_bindgen::rt::{alloc, string::String, vec::Vec}; unsafe { @@ -225,20 +268,22 @@ pub mod akkoro { let ptr0 = vec0.as_ptr() as i32; let len0 = vec0.len() as i32; + #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "akkoro:assemblylift/asml-rt")] extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "success")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "akkoro:assemblylift/asml-rt_success" - )] + #[link_name = "success"] fn wit_import(_: i32, _: i32); } + + #[cfg(not(target_arch = "wasm32"))] + fn wit_import(_: i32, _: i32) { + unreachable!() + } wit_import(ptr0, len0); } } - #[allow(clippy::all)] - pub fn failure(response: Bytes<'_>) { + #[allow(unused_unsafe, clippy::all)] + pub fn failure(response: &Bytes) { #[allow(unused_imports)] use wit_bindgen::rt::{alloc, string::String, vec::Vec}; unsafe { @@ -246,19 +291,21 @@ pub mod akkoro { let ptr0 = vec0.as_ptr() as i32; let len0 = vec0.len() as i32; + #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "akkoro:assemblylift/asml-rt")] extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "failure")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "akkoro:assemblylift/asml-rt_failure" - )] + #[link_name = "failure"] fn wit_import(_: i32, _: i32); } + + #[cfg(not(target_arch = "wasm32"))] + fn wit_import(_: i32, _: i32) { + unreachable!() + } wit_import(ptr0, len0); } } - #[allow(clippy::all)] + #[allow(unused_unsafe, clippy::all)] pub fn log(level: LogLevel, context: &str, message: &str) { #[allow(unused_imports)] use wit_bindgen::rt::{alloc, string::String, vec::Vec}; @@ -270,31 +317,21 @@ pub mod akkoro { let ptr1 = vec1.as_ptr() as i32; let len1 = vec1.len() as i32; + #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "akkoro:assemblylift/asml-rt")] extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "log")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "akkoro:assemblylift/asml-rt_log" - )] + #[link_name = "log"] fn wit_import(_: i32, _: i32, _: i32, _: i32, _: i32); } - wit_import( - match level { - LogLevel::Debug => 0, - LogLevel::Trace => 1, - LogLevel::Info => 2, - LogLevel::Warn => 3, - LogLevel::Error => 4, - }, - ptr0, - len0, - ptr1, - len1, - ); + + #[cfg(not(target_arch = "wasm32"))] + fn wit_import(_: i32, _: i32, _: i32, _: i32, _: i32) { + unreachable!() + } + wit_import(level.clone() as i32, ptr0, len0, ptr1, len1); } } - #[allow(clippy::all)] + #[allow(unused_unsafe, clippy::all)] pub fn get_input() -> wit_bindgen::rt::vec::Vec { #[allow(unused_imports)] use wit_bindgen::rt::{alloc, string::String, vec::Vec}; @@ -303,18 +340,22 @@ pub mod akkoro { struct RetArea([u8; 8]); let mut ret_area = ::core::mem::MaybeUninit::::uninit(); let ptr0 = ret_area.as_mut_ptr() as i32; + #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "akkoro:assemblylift/asml-rt")] extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "get-input")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "akkoro:assemblylift/asml-rt_get-input" - )] + #[link_name = "get-input"] fn wit_import(_: i32); } + + #[cfg(not(target_arch = "wasm32"))] + fn wit_import(_: i32) { + unreachable!() + } wit_import(ptr0); - let len1 = *((ptr0 + 4) as *const i32) as usize; - Vec::from_raw_parts(*((ptr0 + 0) as *const i32) as *mut _, len1, len1) + let l1 = *((ptr0 + 0) as *const i32); + let l2 = *((ptr0 + 4) as *const i32); + let len3 = l2 as usize; + Vec::from_raw_parts(l1 as *mut _, len3, len3) } } } @@ -324,52 +365,54 @@ pub mod akkoro { #[cfg(target_arch = "wasm32")] #[link_section = "component-type:assemblylift"] #[doc(hidden)] -pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 989] = [ +pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 1039] = [ 3, 0, 12, 97, 115, 115, 101, 109, 98, 108, 121, 108, 105, 102, 116, 0, 97, 115, 109, 13, 0, 1, - 0, 7, 221, 6, 1, 65, 6, 1, 66, 12, 1, 109, 5, 5, 100, 101, 98, 117, 103, 5, 116, 114, 97, 99, - 101, 4, 105, 110, 102, 111, 4, 119, 97, 114, 110, 5, 101, 114, 114, 111, 114, 4, 0, 9, 108, - 111, 103, 45, 108, 101, 118, 101, 108, 3, 0, 0, 1, 112, 125, 4, 0, 5, 98, 121, 116, 101, 115, - 3, 0, 2, 1, 64, 1, 8, 114, 101, 115, 112, 111, 110, 115, 101, 3, 1, 0, 4, 0, 7, 115, 117, 99, - 99, 101, 115, 115, 1, 4, 4, 0, 7, 102, 97, 105, 108, 117, 114, 101, 1, 4, 1, 64, 3, 5, 108, - 101, 118, 101, 108, 1, 7, 99, 111, 110, 116, 101, 120, 116, 115, 7, 109, 101, 115, 115, 97, - 103, 101, 115, 1, 0, 4, 0, 3, 108, 111, 103, 1, 5, 1, 112, 125, 1, 64, 0, 0, 6, 4, 0, 9, 103, - 101, 116, 45, 105, 110, 112, 117, 116, 1, 7, 4, 1, 27, 97, 107, 107, 111, 114, 111, 58, 97, - 115, 115, 101, 109, 98, 108, 121, 108, 105, 102, 116, 47, 97, 115, 109, 108, 45, 114, 116, 5, - 0, 1, 66, 13, 1, 109, 2, 9, 110, 111, 116, 45, 114, 101, 97, 100, 121, 12, 105, 110, 118, 97, - 108, 105, 100, 45, 105, 111, 105, 100, 4, 0, 10, 112, 111, 108, 108, 45, 101, 114, 114, 111, - 114, 3, 0, 0, 1, 121, 4, 0, 4, 105, 111, 105, 100, 3, 0, 2, 1, 109, 3, 16, 99, 111, 111, 114, - 100, 115, 45, 110, 111, 116, 45, 102, 111, 117, 110, 100, 14, 105, 110, 118, 97, 108, 105, 100, - 45, 99, 111, 111, 114, 100, 115, 12, 105, 110, 118, 97, 108, 105, 100, 45, 105, 111, 105, 100, - 4, 0, 8, 105, 111, 45, 101, 114, 114, 111, 114, 3, 0, 4, 1, 106, 1, 3, 1, 5, 1, 64, 2, 4, 112, - 97, 116, 104, 115, 5, 105, 110, 112, 117, 116, 115, 0, 6, 4, 0, 6, 105, 110, 118, 111, 107, - 101, 1, 7, 1, 112, 125, 1, 106, 1, 8, 1, 1, 1, 64, 1, 4, 105, 111, 105, 100, 3, 0, 9, 4, 0, 4, - 112, 111, 108, 108, 1, 10, 4, 1, 27, 97, 107, 107, 111, 114, 111, 58, 97, 115, 115, 101, 109, - 98, 108, 121, 108, 105, 102, 116, 47, 97, 115, 109, 108, 45, 105, 111, 5, 1, 1, 65, 4, 1, 66, - 13, 1, 109, 2, 9, 110, 111, 116, 45, 114, 101, 97, 100, 121, 12, 105, 110, 118, 97, 108, 105, + 0, 7, 218, 1, 1, 65, 2, 1, 66, 13, 1, 121, 4, 0, 4, 105, 111, 105, 100, 3, 0, 0, 1, 109, 3, 16, + 99, 111, 111, 114, 100, 115, 45, 110, 111, 116, 45, 102, 111, 117, 110, 100, 14, 105, 110, 118, + 97, 108, 105, 100, 45, 99, 111, 111, 114, 100, 115, 12, 105, 110, 118, 97, 108, 105, 100, 45, + 105, 111, 105, 100, 4, 0, 8, 105, 111, 45, 101, 114, 114, 111, 114, 3, 0, 2, 1, 109, 2, 9, 110, + 111, 116, 45, 114, 101, 97, 100, 121, 12, 105, 110, 118, 97, 108, 105, 100, 45, 105, 111, 105, + 100, 4, 0, 10, 112, 111, 108, 108, 45, 101, 114, 114, 111, 114, 3, 0, 4, 1, 106, 1, 1, 1, 3, 1, + 64, 2, 4, 112, 97, 116, 104, 115, 5, 105, 110, 112, 117, 116, 115, 0, 6, 4, 0, 6, 105, 110, + 118, 111, 107, 101, 1, 7, 1, 112, 125, 1, 106, 1, 8, 1, 5, 1, 64, 1, 4, 105, 111, 105, 100, 1, + 0, 9, 4, 0, 4, 112, 111, 108, 108, 1, 10, 4, 1, 27, 97, 107, 107, 111, 114, 111, 58, 97, 115, + 115, 101, 109, 98, 108, 121, 108, 105, 102, 116, 47, 97, 115, 109, 108, 45, 105, 111, 5, 0, 11, + 13, 1, 0, 7, 97, 115, 109, 108, 45, 105, 111, 3, 0, 0, 7, 197, 1, 1, 65, 2, 1, 66, 12, 1, 112, + 125, 4, 0, 5, 98, 121, 116, 101, 115, 3, 0, 0, 1, 109, 5, 5, 100, 101, 98, 117, 103, 5, 116, + 114, 97, 99, 101, 4, 105, 110, 102, 111, 4, 119, 97, 114, 110, 5, 101, 114, 114, 111, 114, 4, + 0, 9, 108, 111, 103, 45, 108, 101, 118, 101, 108, 3, 0, 2, 1, 64, 1, 8, 114, 101, 115, 112, + 111, 110, 115, 101, 1, 1, 0, 4, 0, 7, 115, 117, 99, 99, 101, 115, 115, 1, 4, 4, 0, 7, 102, 97, + 105, 108, 117, 114, 101, 1, 4, 1, 64, 3, 5, 108, 101, 118, 101, 108, 3, 7, 99, 111, 110, 116, + 101, 120, 116, 115, 7, 109, 101, 115, 115, 97, 103, 101, 115, 1, 0, 4, 0, 3, 108, 111, 103, 1, + 5, 1, 112, 125, 1, 64, 0, 0, 6, 4, 0, 9, 103, 101, 116, 45, 105, 110, 112, 117, 116, 1, 7, 4, + 1, 27, 97, 107, 107, 111, 114, 111, 58, 97, 115, 115, 101, 109, 98, 108, 121, 108, 105, 102, + 116, 47, 97, 115, 109, 108, 45, 114, 116, 5, 0, 11, 13, 1, 0, 7, 97, 115, 109, 108, 45, 114, + 116, 3, 2, 0, 7, 196, 3, 1, 65, 2, 1, 65, 4, 1, 66, 13, 1, 121, 4, 0, 4, 105, 111, 105, 100, 3, + 0, 0, 1, 109, 3, 16, 99, 111, 111, 114, 100, 115, 45, 110, 111, 116, 45, 102, 111, 117, 110, + 100, 14, 105, 110, 118, 97, 108, 105, 100, 45, 99, 111, 111, 114, 100, 115, 12, 105, 110, 118, + 97, 108, 105, 100, 45, 105, 111, 105, 100, 4, 0, 8, 105, 111, 45, 101, 114, 114, 111, 114, 3, + 0, 2, 1, 109, 2, 9, 110, 111, 116, 45, 114, 101, 97, 100, 121, 12, 105, 110, 118, 97, 108, 105, 100, 45, 105, 111, 105, 100, 4, 0, 10, 112, 111, 108, 108, 45, 101, 114, 114, 111, 114, 3, 0, - 0, 1, 121, 4, 0, 4, 105, 111, 105, 100, 3, 0, 2, 1, 109, 3, 16, 99, 111, 111, 114, 100, 115, - 45, 110, 111, 116, 45, 102, 111, 117, 110, 100, 14, 105, 110, 118, 97, 108, 105, 100, 45, 99, - 111, 111, 114, 100, 115, 12, 105, 110, 118, 97, 108, 105, 100, 45, 105, 111, 105, 100, 4, 0, 8, - 105, 111, 45, 101, 114, 114, 111, 114, 3, 0, 4, 1, 106, 1, 3, 1, 5, 1, 64, 2, 4, 112, 97, 116, - 104, 115, 5, 105, 110, 112, 117, 116, 115, 0, 6, 4, 0, 6, 105, 110, 118, 111, 107, 101, 1, 7, - 1, 112, 125, 1, 106, 1, 8, 1, 1, 1, 64, 1, 4, 105, 111, 105, 100, 3, 0, 9, 4, 0, 4, 112, 111, - 108, 108, 1, 10, 3, 1, 27, 97, 107, 107, 111, 114, 111, 58, 97, 115, 115, 101, 109, 98, 108, - 121, 108, 105, 102, 116, 47, 97, 115, 109, 108, 45, 105, 111, 5, 0, 1, 66, 12, 1, 109, 5, 5, - 100, 101, 98, 117, 103, 5, 116, 114, 97, 99, 101, 4, 105, 110, 102, 111, 4, 119, 97, 114, 110, - 5, 101, 114, 114, 111, 114, 4, 0, 9, 108, 111, 103, 45, 108, 101, 118, 101, 108, 3, 0, 0, 1, - 112, 125, 4, 0, 5, 98, 121, 116, 101, 115, 3, 0, 2, 1, 64, 1, 8, 114, 101, 115, 112, 111, 110, - 115, 101, 3, 1, 0, 4, 0, 7, 115, 117, 99, 99, 101, 115, 115, 1, 4, 4, 0, 7, 102, 97, 105, 108, - 117, 114, 101, 1, 4, 1, 64, 3, 5, 108, 101, 118, 101, 108, 1, 7, 99, 111, 110, 116, 101, 120, - 116, 115, 7, 109, 101, 115, 115, 97, 103, 101, 115, 1, 0, 4, 0, 3, 108, 111, 103, 1, 5, 1, 112, - 125, 1, 64, 0, 0, 6, 4, 0, 9, 103, 101, 116, 45, 105, 110, 112, 117, 116, 1, 7, 3, 1, 27, 97, - 107, 107, 111, 114, 111, 58, 97, 115, 115, 101, 109, 98, 108, 121, 108, 105, 102, 116, 47, 97, - 115, 109, 108, 45, 114, 116, 5, 1, 4, 1, 32, 97, 107, 107, 111, 114, 111, 58, 97, 115, 115, - 101, 109, 98, 108, 121, 108, 105, 102, 116, 47, 97, 115, 115, 101, 109, 98, 108, 121, 108, 105, - 102, 116, 4, 2, 0, 69, 9, 112, 114, 111, 100, 117, 99, 101, 114, 115, 1, 12, 112, 114, 111, 99, - 101, 115, 115, 101, 100, 45, 98, 121, 2, 13, 119, 105, 116, 45, 99, 111, 109, 112, 111, 110, - 101, 110, 116, 6, 48, 46, 49, 49, 46, 48, 16, 119, 105, 116, 45, 98, 105, 110, 100, 103, 101, - 110, 45, 114, 117, 115, 116, 5, 48, 46, 56, 46, 48, 11, 29, 1, 1, 23, 97, 107, 107, 111, 114, - 111, 58, 97, 115, 115, 101, 109, 98, 108, 121, 108, 105, 102, 116, 47, 119, 105, 116, 3, 0, 0, + 4, 1, 106, 1, 1, 1, 3, 1, 64, 2, 4, 112, 97, 116, 104, 115, 5, 105, 110, 112, 117, 116, 115, 0, + 6, 4, 0, 6, 105, 110, 118, 111, 107, 101, 1, 7, 1, 112, 125, 1, 106, 1, 8, 1, 5, 1, 64, 1, 4, + 105, 111, 105, 100, 1, 0, 9, 4, 0, 4, 112, 111, 108, 108, 1, 10, 3, 1, 27, 97, 107, 107, 111, + 114, 111, 58, 97, 115, 115, 101, 109, 98, 108, 121, 108, 105, 102, 116, 47, 97, 115, 109, 108, + 45, 105, 111, 5, 0, 1, 66, 12, 1, 112, 125, 4, 0, 5, 98, 121, 116, 101, 115, 3, 0, 0, 1, 109, + 5, 5, 100, 101, 98, 117, 103, 5, 116, 114, 97, 99, 101, 4, 105, 110, 102, 111, 4, 119, 97, 114, + 110, 5, 101, 114, 114, 111, 114, 4, 0, 9, 108, 111, 103, 45, 108, 101, 118, 101, 108, 3, 0, 2, + 1, 64, 1, 8, 114, 101, 115, 112, 111, 110, 115, 101, 1, 1, 0, 4, 0, 7, 115, 117, 99, 99, 101, + 115, 115, 1, 4, 4, 0, 7, 102, 97, 105, 108, 117, 114, 101, 1, 4, 1, 64, 3, 5, 108, 101, 118, + 101, 108, 3, 7, 99, 111, 110, 116, 101, 120, 116, 115, 7, 109, 101, 115, 115, 97, 103, 101, + 115, 1, 0, 4, 0, 3, 108, 111, 103, 1, 5, 1, 112, 125, 1, 64, 0, 0, 6, 4, 0, 9, 103, 101, 116, + 45, 105, 110, 112, 117, 116, 1, 7, 3, 1, 27, 97, 107, 107, 111, 114, 111, 58, 97, 115, 115, + 101, 109, 98, 108, 121, 108, 105, 102, 116, 47, 97, 115, 109, 108, 45, 114, 116, 5, 1, 4, 1, + 32, 97, 107, 107, 111, 114, 111, 58, 97, 115, 115, 101, 109, 98, 108, 121, 108, 105, 102, 116, + 47, 97, 115, 115, 101, 109, 98, 108, 121, 108, 105, 102, 116, 4, 0, 11, 18, 1, 0, 12, 97, 115, + 115, 101, 109, 98, 108, 121, 108, 105, 102, 116, 3, 4, 0, 0, 16, 12, 112, 97, 99, 107, 97, 103, + 101, 45, 100, 111, 99, 115, 0, 123, 125, 0, 70, 9, 112, 114, 111, 100, 117, 99, 101, 114, 115, + 1, 12, 112, 114, 111, 99, 101, 115, 115, 101, 100, 45, 98, 121, 2, 13, 119, 105, 116, 45, 99, + 111, 109, 112, 111, 110, 101, 110, 116, 6, 48, 46, 49, 56, 46, 50, 16, 119, 105, 116, 45, 98, + 105, 110, 100, 103, 101, 110, 45, 114, 117, 115, 116, 6, 48, 46, 49, 53, 46, 48, ]; #[inline(never)] diff --git a/core/guest/src/command.rs b/core/guest/src/command.rs index 3bff5d14..4a364bd4 100644 --- a/core/guest/src/command.rs +++ b/core/guest/src/command.rs @@ -1,11457 +1,11457 @@ -// Generated by `wit-bindgen` 0.8.0. DO NOT EDIT! -pub mod wasi { - pub mod cli_base { +// // Generated by `wit-bindgen` 0.8.0. DO NOT EDIT! +// pub mod wasi { +// pub mod cli_base { - #[allow(clippy::all)] - pub mod environment { - #[used] - #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; +// #[allow(clippy::all)] +// pub mod environment { +// #[used] +// #[doc(hidden)] +// #[cfg(target_arch = "wasm32")] +// static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; - #[allow(clippy::all)] - /// Get the POSIX-style environment variables. - /// - /// Each environment variable is provided as a pair of string variable names - /// and string value. - /// - /// Morally, these are a value import, but until value imports are available - /// in the component model, this import function should return the same - /// values each time it is called. - pub fn get_environment() -> wit_bindgen::rt::vec::Vec<( - wit_bindgen::rt::string::String, - wit_bindgen::rt::string::String, - )> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(4))] - struct RetArea([u8; 8]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:cli-base/environment")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "get-environment")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:cli-base/environment_get-environment" - )] - fn wit_import(_: i32); - } - wit_import(ptr0); - let base3 = *((ptr0 + 0) as *const i32); - let len3 = *((ptr0 + 4) as *const i32); - let mut result3 = Vec::with_capacity(len3 as usize); - for i in 0..len3 { - let base = base3 + i * 16; - result3.push({ - let len1 = *((base + 4) as *const i32) as usize; - let len2 = *((base + 12) as *const i32) as usize; +// #[allow(clippy::all)] +// /// Get the POSIX-style environment variables. +// /// +// /// Each environment variable is provided as a pair of string variable names +// /// and string value. +// /// +// /// Morally, these are a value import, but until value imports are available +// /// in the component model, this import function should return the same +// /// values each time it is called. +// pub fn get_environment() -> wit_bindgen::rt::vec::Vec<( +// wit_bindgen::rt::string::String, +// wit_bindgen::rt::string::String, +// )> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(4))] +// struct RetArea([u8; 8]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:cli-base/environment")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "get-environment")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:cli-base/environment_get-environment" +// )] +// fn wit_import(_: i32); +// } +// wit_import(ptr0); +// let base3 = *((ptr0 + 0) as *const i32); +// let len3 = *((ptr0 + 4) as *const i32); +// let mut result3 = Vec::with_capacity(len3 as usize); +// for i in 0..len3 { +// let base = base3 + i * 16; +// result3.push({ +// let len1 = *((base + 4) as *const i32) as usize; +// let len2 = *((base + 12) as *const i32) as usize; - ( - { - #[cfg(not(debug_assertions))] - { - String::from_utf8_unchecked(Vec::from_raw_parts( - *((base + 0) as *const i32) as *mut _, - len1, - len1, - )) - } - #[cfg(debug_assertions)] - { - String::from_utf8(Vec::from_raw_parts( - *((base + 0) as *const i32) as *mut _, - len1, - len1, - )) - .unwrap() - } - }, - { - #[cfg(not(debug_assertions))] - { - String::from_utf8_unchecked(Vec::from_raw_parts( - *((base + 8) as *const i32) as *mut _, - len2, - len2, - )) - } - #[cfg(debug_assertions)] - { - String::from_utf8(Vec::from_raw_parts( - *((base + 8) as *const i32) as *mut _, - len2, - len2, - )) - .unwrap() - } - }, - ) - }); - } - wit_bindgen::rt::dealloc(base3, (len3 as usize) * 16, 4); - result3 - } - } - #[allow(clippy::all)] - /// Get the POSIX-style arguments to the program. - pub fn get_arguments() -> wit_bindgen::rt::vec::Vec { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(4))] - struct RetArea([u8; 8]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:cli-base/environment")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "get-arguments")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:cli-base/environment_get-arguments" - )] - fn wit_import(_: i32); - } - wit_import(ptr0); - let base2 = *((ptr0 + 0) as *const i32); - let len2 = *((ptr0 + 4) as *const i32); - let mut result2 = Vec::with_capacity(len2 as usize); - for i in 0..len2 { - let base = base2 + i * 8; - result2.push({ - let len1 = *((base + 4) as *const i32) as usize; +// ( +// { +// #[cfg(not(debug_assertions))] +// { +// String::from_utf8_unchecked(Vec::from_raw_parts( +// *((base + 0) as *const i32) as *mut _, +// len1, +// len1, +// )) +// } +// #[cfg(debug_assertions)] +// { +// String::from_utf8(Vec::from_raw_parts( +// *((base + 0) as *const i32) as *mut _, +// len1, +// len1, +// )) +// .unwrap() +// } +// }, +// { +// #[cfg(not(debug_assertions))] +// { +// String::from_utf8_unchecked(Vec::from_raw_parts( +// *((base + 8) as *const i32) as *mut _, +// len2, +// len2, +// )) +// } +// #[cfg(debug_assertions)] +// { +// String::from_utf8(Vec::from_raw_parts( +// *((base + 8) as *const i32) as *mut _, +// len2, +// len2, +// )) +// .unwrap() +// } +// }, +// ) +// }); +// } +// wit_bindgen::rt::dealloc(base3, (len3 as usize) * 16, 4); +// result3 +// } +// } +// #[allow(clippy::all)] +// /// Get the POSIX-style arguments to the program. +// pub fn get_arguments() -> wit_bindgen::rt::vec::Vec { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(4))] +// struct RetArea([u8; 8]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:cli-base/environment")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "get-arguments")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:cli-base/environment_get-arguments" +// )] +// fn wit_import(_: i32); +// } +// wit_import(ptr0); +// let base2 = *((ptr0 + 0) as *const i32); +// let len2 = *((ptr0 + 4) as *const i32); +// let mut result2 = Vec::with_capacity(len2 as usize); +// for i in 0..len2 { +// let base = base2 + i * 8; +// result2.push({ +// let len1 = *((base + 4) as *const i32) as usize; - { - #[cfg(not(debug_assertions))] - { - String::from_utf8_unchecked(Vec::from_raw_parts( - *((base + 0) as *const i32) as *mut _, - len1, - len1, - )) - } - #[cfg(debug_assertions)] - { - String::from_utf8(Vec::from_raw_parts( - *((base + 0) as *const i32) as *mut _, - len1, - len1, - )) - .unwrap() - } - } - }); - } - wit_bindgen::rt::dealloc(base2, (len2 as usize) * 8, 4); - result2 - } - } - } +// { +// #[cfg(not(debug_assertions))] +// { +// String::from_utf8_unchecked(Vec::from_raw_parts( +// *((base + 0) as *const i32) as *mut _, +// len1, +// len1, +// )) +// } +// #[cfg(debug_assertions)] +// { +// String::from_utf8(Vec::from_raw_parts( +// *((base + 0) as *const i32) as *mut _, +// len1, +// len1, +// )) +// .unwrap() +// } +// } +// }); +// } +// wit_bindgen::rt::dealloc(base2, (len2 as usize) * 8, 4); +// result2 +// } +// } +// } - #[allow(clippy::all)] - pub mod preopens { - #[used] - #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; +// #[allow(clippy::all)] +// pub mod preopens { +// #[used] +// #[doc(hidden)] +// #[cfg(target_arch = "wasm32")] +// static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; - pub type Descriptor = super::super::super::wasi::filesystem::filesystem::Descriptor; - #[allow(clippy::all)] - /// Return the set of of preopened directories, and their path. - pub fn get_directories( - ) -> wit_bindgen::rt::vec::Vec<(Descriptor, wit_bindgen::rt::string::String)> - { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(4))] - struct RetArea([u8; 8]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:cli-base/preopens")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "get-directories")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:cli-base/preopens_get-directories" - )] - fn wit_import(_: i32); - } - wit_import(ptr0); - let base2 = *((ptr0 + 0) as *const i32); - let len2 = *((ptr0 + 4) as *const i32); - let mut result2 = Vec::with_capacity(len2 as usize); - for i in 0..len2 { - let base = base2 + i * 12; - result2.push({ - let len1 = *((base + 8) as *const i32) as usize; +// pub type Descriptor = super::super::super::wasi::filesystem::filesystem::Descriptor; +// #[allow(clippy::all)] +// /// Return the set of of preopened directories, and their path. +// pub fn get_directories( +// ) -> wit_bindgen::rt::vec::Vec<(Descriptor, wit_bindgen::rt::string::String)> +// { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(4))] +// struct RetArea([u8; 8]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:cli-base/preopens")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "get-directories")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:cli-base/preopens_get-directories" +// )] +// fn wit_import(_: i32); +// } +// wit_import(ptr0); +// let base2 = *((ptr0 + 0) as *const i32); +// let len2 = *((ptr0 + 4) as *const i32); +// let mut result2 = Vec::with_capacity(len2 as usize); +// for i in 0..len2 { +// let base = base2 + i * 12; +// result2.push({ +// let len1 = *((base + 8) as *const i32) as usize; - (*((base + 0) as *const i32) as u32, { - #[cfg(not(debug_assertions))] - { - String::from_utf8_unchecked(Vec::from_raw_parts( - *((base + 4) as *const i32) as *mut _, - len1, - len1, - )) - } - #[cfg(debug_assertions)] - { - String::from_utf8(Vec::from_raw_parts( - *((base + 4) as *const i32) as *mut _, - len1, - len1, - )) - .unwrap() - } - }) - }); - } - wit_bindgen::rt::dealloc(base2, (len2 as usize) * 12, 4); - result2 - } - } - } +// (*((base + 0) as *const i32) as u32, { +// #[cfg(not(debug_assertions))] +// { +// String::from_utf8_unchecked(Vec::from_raw_parts( +// *((base + 4) as *const i32) as *mut _, +// len1, +// len1, +// )) +// } +// #[cfg(debug_assertions)] +// { +// String::from_utf8(Vec::from_raw_parts( +// *((base + 4) as *const i32) as *mut _, +// len1, +// len1, +// )) +// .unwrap() +// } +// }) +// }); +// } +// wit_bindgen::rt::dealloc(base2, (len2 as usize) * 12, 4); +// result2 +// } +// } +// } - #[allow(clippy::all)] - pub mod exit { - #[used] - #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; +// #[allow(clippy::all)] +// pub mod exit { +// #[used] +// #[doc(hidden)] +// #[cfg(target_arch = "wasm32")] +// static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; - #[allow(clippy::all)] - /// Exit the curerent instance and any linked instances. - pub fn exit(status: Result<(), ()>) { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - let result0 = match status { - Ok(_) => 0i32, - Err(_) => 1i32, - }; - #[link(wasm_import_module = "wasi:cli-base/exit")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "exit")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:cli-base/exit_exit" - )] - fn wit_import(_: i32); - } - wit_import(result0); - } - } - } +// #[allow(clippy::all)] +// /// Exit the curerent instance and any linked instances. +// pub fn exit(status: Result<(), ()>) { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// let result0 = match status { +// Ok(_) => 0i32, +// Err(_) => 1i32, +// }; +// #[link(wasm_import_module = "wasi:cli-base/exit")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "exit")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:cli-base/exit_exit" +// )] +// fn wit_import(_: i32); +// } +// wit_import(result0); +// } +// } +// } - #[allow(clippy::all)] - pub mod stdin { - #[used] - #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; +// #[allow(clippy::all)] +// pub mod stdin { +// #[used] +// #[doc(hidden)] +// #[cfg(target_arch = "wasm32")] +// static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; - pub type InputStream = super::super::super::wasi::io::streams::InputStream; - #[allow(clippy::all)] - pub fn get_stdin() -> InputStream { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[link(wasm_import_module = "wasi:cli-base/stdin")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "get-stdin")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:cli-base/stdin_get-stdin" - )] - fn wit_import() -> i32; - } - let ret = wit_import(); - ret as u32 - } - } - } +// pub type InputStream = super::super::super::wasi::io::streams::InputStream; +// #[allow(clippy::all)] +// pub fn get_stdin() -> InputStream { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[link(wasm_import_module = "wasi:cli-base/stdin")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "get-stdin")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:cli-base/stdin_get-stdin" +// )] +// fn wit_import() -> i32; +// } +// let ret = wit_import(); +// ret as u32 +// } +// } +// } - #[allow(clippy::all)] - pub mod stdout { - #[used] - #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; +// #[allow(clippy::all)] +// pub mod stdout { +// #[used] +// #[doc(hidden)] +// #[cfg(target_arch = "wasm32")] +// static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; - pub type OutputStream = super::super::super::wasi::io::streams::OutputStream; - #[allow(clippy::all)] - pub fn get_stdout() -> OutputStream { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[link(wasm_import_module = "wasi:cli-base/stdout")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "get-stdout")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:cli-base/stdout_get-stdout" - )] - fn wit_import() -> i32; - } - let ret = wit_import(); - ret as u32 - } - } - } +// pub type OutputStream = super::super::super::wasi::io::streams::OutputStream; +// #[allow(clippy::all)] +// pub fn get_stdout() -> OutputStream { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[link(wasm_import_module = "wasi:cli-base/stdout")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "get-stdout")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:cli-base/stdout_get-stdout" +// )] +// fn wit_import() -> i32; +// } +// let ret = wit_import(); +// ret as u32 +// } +// } +// } - #[allow(clippy::all)] - pub mod stderr { - #[used] - #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; +// #[allow(clippy::all)] +// pub mod stderr { +// #[used] +// #[doc(hidden)] +// #[cfg(target_arch = "wasm32")] +// static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; - pub type OutputStream = super::super::super::wasi::io::streams::OutputStream; - #[allow(clippy::all)] - pub fn get_stderr() -> OutputStream { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[link(wasm_import_module = "wasi:cli-base/stderr")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "get-stderr")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:cli-base/stderr_get-stderr" - )] - fn wit_import() -> i32; - } - let ret = wit_import(); - ret as u32 - } - } - } - } - pub mod clocks { +// pub type OutputStream = super::super::super::wasi::io::streams::OutputStream; +// #[allow(clippy::all)] +// pub fn get_stderr() -> OutputStream { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[link(wasm_import_module = "wasi:cli-base/stderr")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "get-stderr")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:cli-base/stderr_get-stderr" +// )] +// fn wit_import() -> i32; +// } +// let ret = wit_import(); +// ret as u32 +// } +// } +// } +// } +// pub mod clocks { - #[allow(clippy::all)] - pub mod wall_clock { - #[used] - #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; +// #[allow(clippy::all)] +// pub mod wall_clock { +// #[used] +// #[doc(hidden)] +// #[cfg(target_arch = "wasm32")] +// static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; - /// A time and date in seconds plus nanoseconds. - #[repr(C)] - #[derive(Copy, Clone)] - pub struct Datetime { - pub seconds: u64, - pub nanoseconds: u32, - } - impl ::core::fmt::Debug for Datetime { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - f.debug_struct("Datetime") - .field("seconds", &self.seconds) - .field("nanoseconds", &self.nanoseconds) - .finish() - } - } - #[allow(clippy::all)] - /// Read the current value of the clock. - /// - /// This clock is not monotonic, therefore calling this function repeatedly - /// will not necessarily produce a sequence of non-decreasing values. - /// - /// The returned timestamps represent the number of seconds since - /// 1970-01-01T00:00:00Z, also known as [POSIX's Seconds Since the Epoch], - /// also known as [Unix Time]. - /// - /// The nanoseconds field of the output is always less than 1000000000. - /// - /// [POSIX's Seconds Since the Epoch]: https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xbd_chap04.html#tag_21_04_16 - /// [Unix Time]: https://en.wikipedia.org/wiki/Unix_time - pub fn now() -> Datetime { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(8))] - struct RetArea([u8; 16]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:clocks/wall-clock")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "now")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:clocks/wall-clock_now" - )] - fn wit_import(_: i32); - } - wit_import(ptr0); - Datetime { - seconds: *((ptr0 + 0) as *const i64) as u64, - nanoseconds: *((ptr0 + 8) as *const i32) as u32, - } - } - } - #[allow(clippy::all)] - /// Query the resolution of the clock. - /// - /// The nanoseconds field of the output is always less than 1000000000. - pub fn resolution() -> Datetime { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(8))] - struct RetArea([u8; 16]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:clocks/wall-clock")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "resolution")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:clocks/wall-clock_resolution" - )] - fn wit_import(_: i32); - } - wit_import(ptr0); - Datetime { - seconds: *((ptr0 + 0) as *const i64) as u64, - nanoseconds: *((ptr0 + 8) as *const i32) as u32, - } - } - } - } +// /// A time and date in seconds plus nanoseconds. +// #[repr(C)] +// #[derive(Copy, Clone)] +// pub struct Datetime { +// pub seconds: u64, +// pub nanoseconds: u32, +// } +// impl ::core::fmt::Debug for Datetime { +// fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { +// f.debug_struct("Datetime") +// .field("seconds", &self.seconds) +// .field("nanoseconds", &self.nanoseconds) +// .finish() +// } +// } +// #[allow(clippy::all)] +// /// Read the current value of the clock. +// /// +// /// This clock is not monotonic, therefore calling this function repeatedly +// /// will not necessarily produce a sequence of non-decreasing values. +// /// +// /// The returned timestamps represent the number of seconds since +// /// 1970-01-01T00:00:00Z, also known as [POSIX's Seconds Since the Epoch], +// /// also known as [Unix Time]. +// /// +// /// The nanoseconds field of the output is always less than 1000000000. +// /// +// /// [POSIX's Seconds Since the Epoch]: https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xbd_chap04.html#tag_21_04_16 +// /// [Unix Time]: https://en.wikipedia.org/wiki/Unix_time +// pub fn now() -> Datetime { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(8))] +// struct RetArea([u8; 16]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:clocks/wall-clock")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "now")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:clocks/wall-clock_now" +// )] +// fn wit_import(_: i32); +// } +// wit_import(ptr0); +// Datetime { +// seconds: *((ptr0 + 0) as *const i64) as u64, +// nanoseconds: *((ptr0 + 8) as *const i32) as u32, +// } +// } +// } +// #[allow(clippy::all)] +// /// Query the resolution of the clock. +// /// +// /// The nanoseconds field of the output is always less than 1000000000. +// pub fn resolution() -> Datetime { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(8))] +// struct RetArea([u8; 16]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:clocks/wall-clock")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "resolution")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:clocks/wall-clock_resolution" +// )] +// fn wit_import(_: i32); +// } +// wit_import(ptr0); +// Datetime { +// seconds: *((ptr0 + 0) as *const i64) as u64, +// nanoseconds: *((ptr0 + 8) as *const i32) as u32, +// } +// } +// } +// } - #[allow(clippy::all)] - pub mod monotonic_clock { - #[used] - #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; +// #[allow(clippy::all)] +// pub mod monotonic_clock { +// #[used] +// #[doc(hidden)] +// #[cfg(target_arch = "wasm32")] +// static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; - pub type Pollable = super::super::super::wasi::poll::poll::Pollable; - /// A timestamp in nanoseconds. - pub type Instant = u64; - #[allow(clippy::all)] - /// Read the current value of the clock. - /// - /// The clock is monotonic, therefore calling this function repeatedly will - /// produce a sequence of non-decreasing values. - pub fn now() -> Instant { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[link(wasm_import_module = "wasi:clocks/monotonic-clock")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "now")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:clocks/monotonic-clock_now" - )] - fn wit_import() -> i64; - } - let ret = wit_import(); - ret as u64 - } - } - #[allow(clippy::all)] - /// Query the resolution of the clock. - pub fn resolution() -> Instant { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[link(wasm_import_module = "wasi:clocks/monotonic-clock")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "resolution")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:clocks/monotonic-clock_resolution" - )] - fn wit_import() -> i64; - } - let ret = wit_import(); - ret as u64 - } - } - #[allow(clippy::all)] - /// Create a `pollable` which will resolve once the specified time has been - /// reached. - pub fn subscribe(when: Instant, absolute: bool) -> Pollable { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[link(wasm_import_module = "wasi:clocks/monotonic-clock")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "subscribe")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:clocks/monotonic-clock_subscribe" - )] - fn wit_import(_: i64, _: i32) -> i32; - } - let ret = wit_import( - wit_bindgen::rt::as_i64(when), - match absolute { - true => 1, - false => 0, - }, - ); - ret as u32 - } - } - } +// pub type Pollable = super::super::super::wasi::poll::poll::Pollable; +// /// A timestamp in nanoseconds. +// pub type Instant = u64; +// #[allow(clippy::all)] +// /// Read the current value of the clock. +// /// +// /// The clock is monotonic, therefore calling this function repeatedly will +// /// produce a sequence of non-decreasing values. +// pub fn now() -> Instant { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[link(wasm_import_module = "wasi:clocks/monotonic-clock")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "now")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:clocks/monotonic-clock_now" +// )] +// fn wit_import() -> i64; +// } +// let ret = wit_import(); +// ret as u64 +// } +// } +// #[allow(clippy::all)] +// /// Query the resolution of the clock. +// pub fn resolution() -> Instant { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[link(wasm_import_module = "wasi:clocks/monotonic-clock")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "resolution")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:clocks/monotonic-clock_resolution" +// )] +// fn wit_import() -> i64; +// } +// let ret = wit_import(); +// ret as u64 +// } +// } +// #[allow(clippy::all)] +// /// Create a `pollable` which will resolve once the specified time has been +// /// reached. +// pub fn subscribe(when: Instant, absolute: bool) -> Pollable { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[link(wasm_import_module = "wasi:clocks/monotonic-clock")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "subscribe")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:clocks/monotonic-clock_subscribe" +// )] +// fn wit_import(_: i64, _: i32) -> i32; +// } +// let ret = wit_import( +// wit_bindgen::rt::as_i64(when), +// match absolute { +// true => 1, +// false => 0, +// }, +// ); +// ret as u32 +// } +// } +// } - #[allow(clippy::all)] - pub mod timezone { - #[used] - #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; +// #[allow(clippy::all)] +// pub mod timezone { +// #[used] +// #[doc(hidden)] +// #[cfg(target_arch = "wasm32")] +// static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; - pub type Datetime = super::super::super::wasi::clocks::wall_clock::Datetime; - /// Information useful for displaying the timezone of a specific `datetime`. - /// - /// This information may vary within a single `timezone` to reflect daylight - /// saving time adjustments. - #[derive(Clone)] - pub struct TimezoneDisplay { - /// The number of seconds difference between UTC time and the local - /// time of the timezone. - /// - /// The returned value will always be less than 86400 which is the - /// number of seconds in a day (24*60*60). - /// - /// In implementations that do not expose an actual time zone, this - /// should return 0. - pub utc_offset: i32, - /// The abbreviated name of the timezone to display to a user. The name - /// `UTC` indicates Coordinated Universal Time. Otherwise, this should - /// reference local standards for the name of the time zone. - /// - /// In implementations that do not expose an actual time zone, this - /// should be the string `UTC`. - /// - /// In time zones that do not have an applicable name, a formatted - /// representation of the UTC offset may be returned, such as `-04:00`. - pub name: wit_bindgen::rt::string::String, - /// Whether daylight saving time is active. - /// - /// In implementations that do not expose an actual time zone, this - /// should return false. - pub in_daylight_saving_time: bool, - } - impl ::core::fmt::Debug for TimezoneDisplay { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - f.debug_struct("TimezoneDisplay") - .field("utc-offset", &self.utc_offset) - .field("name", &self.name) - .field("in-daylight-saving-time", &self.in_daylight_saving_time) - .finish() - } - } - /// A timezone. - /// - /// In timezones that recognize daylight saving time, also known as daylight - /// time and summer time, the information returned from the functions varies - /// over time to reflect these adjustments. - /// - /// This [represents a resource](https://github.com/WebAssembly/WASI/blob/main/docs/WitInWasi.md#Resources). - pub type Timezone = u32; - #[allow(clippy::all)] - /// Return information needed to display the given `datetime`. This includes - /// the UTC offset, the time zone name, and a flag indicating whether - /// daylight saving time is active. - /// - /// If the timezone cannot be determined for the given `datetime`, return a - /// `timezone-display` for `UTC` with a `utc-offset` of 0 and no daylight - /// saving time. - pub fn display(this: Timezone, when: Datetime) -> TimezoneDisplay { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(4))] - struct RetArea([u8; 16]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let super::super::super::wasi::clocks::wall_clock::Datetime { - seconds: seconds0, - nanoseconds: nanoseconds0, - } = when; - let ptr1 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:clocks/timezone")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "display")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:clocks/timezone_display" - )] - fn wit_import(_: i32, _: i64, _: i32, _: i32); - } - wit_import( - wit_bindgen::rt::as_i32(this), - wit_bindgen::rt::as_i64(seconds0), - wit_bindgen::rt::as_i32(nanoseconds0), - ptr1, - ); - let len2 = *((ptr1 + 8) as *const i32) as usize; - TimezoneDisplay { - utc_offset: *((ptr1 + 0) as *const i32), - name: { - #[cfg(not(debug_assertions))] - { - String::from_utf8_unchecked(Vec::from_raw_parts( - *((ptr1 + 4) as *const i32) as *mut _, - len2, - len2, - )) - } - #[cfg(debug_assertions)] - { - String::from_utf8(Vec::from_raw_parts( - *((ptr1 + 4) as *const i32) as *mut _, - len2, - len2, - )) - .unwrap() - } - }, - in_daylight_saving_time: { - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::(i32::from( - *((ptr1 + 12) as *const u8), - ) - as u8) - } - #[cfg(debug_assertions)] - { - match i32::from(*((ptr1 + 12) as *const u8)) { - 0 => false, - 1 => true, - _ => panic!("invalid bool discriminant"), - } - } - }, - } - } - } - #[allow(clippy::all)] - /// The same as `display`, but only return the UTC offset. - pub fn utc_offset(this: Timezone, when: Datetime) -> i32 { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - let super::super::super::wasi::clocks::wall_clock::Datetime { - seconds: seconds0, - nanoseconds: nanoseconds0, - } = when; +// pub type Datetime = super::super::super::wasi::clocks::wall_clock::Datetime; +// /// Information useful for displaying the timezone of a specific `datetime`. +// /// +// /// This information may vary within a single `timezone` to reflect daylight +// /// saving time adjustments. +// #[derive(Clone)] +// pub struct TimezoneDisplay { +// /// The number of seconds difference between UTC time and the local +// /// time of the timezone. +// /// +// /// The returned value will always be less than 86400 which is the +// /// number of seconds in a day (24*60*60). +// /// +// /// In implementations that do not expose an actual time zone, this +// /// should return 0. +// pub utc_offset: i32, +// /// The abbreviated name of the timezone to display to a user. The name +// /// `UTC` indicates Coordinated Universal Time. Otherwise, this should +// /// reference local standards for the name of the time zone. +// /// +// /// In implementations that do not expose an actual time zone, this +// /// should be the string `UTC`. +// /// +// /// In time zones that do not have an applicable name, a formatted +// /// representation of the UTC offset may be returned, such as `-04:00`. +// pub name: wit_bindgen::rt::string::String, +// /// Whether daylight saving time is active. +// /// +// /// In implementations that do not expose an actual time zone, this +// /// should return false. +// pub in_daylight_saving_time: bool, +// } +// impl ::core::fmt::Debug for TimezoneDisplay { +// fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { +// f.debug_struct("TimezoneDisplay") +// .field("utc-offset", &self.utc_offset) +// .field("name", &self.name) +// .field("in-daylight-saving-time", &self.in_daylight_saving_time) +// .finish() +// } +// } +// /// A timezone. +// /// +// /// In timezones that recognize daylight saving time, also known as daylight +// /// time and summer time, the information returned from the functions varies +// /// over time to reflect these adjustments. +// /// +// /// This [represents a resource](https://github.com/WebAssembly/WASI/blob/main/docs/WitInWasi.md#Resources). +// pub type Timezone = u32; +// #[allow(clippy::all)] +// /// Return information needed to display the given `datetime`. This includes +// /// the UTC offset, the time zone name, and a flag indicating whether +// /// daylight saving time is active. +// /// +// /// If the timezone cannot be determined for the given `datetime`, return a +// /// `timezone-display` for `UTC` with a `utc-offset` of 0 and no daylight +// /// saving time. +// pub fn display(this: Timezone, when: Datetime) -> TimezoneDisplay { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(4))] +// struct RetArea([u8; 16]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let super::super::super::wasi::clocks::wall_clock::Datetime { +// seconds: seconds0, +// nanoseconds: nanoseconds0, +// } = when; +// let ptr1 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:clocks/timezone")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "display")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:clocks/timezone_display" +// )] +// fn wit_import(_: i32, _: i64, _: i32, _: i32); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// wit_bindgen::rt::as_i64(seconds0), +// wit_bindgen::rt::as_i32(nanoseconds0), +// ptr1, +// ); +// let len2 = *((ptr1 + 8) as *const i32) as usize; +// TimezoneDisplay { +// utc_offset: *((ptr1 + 0) as *const i32), +// name: { +// #[cfg(not(debug_assertions))] +// { +// String::from_utf8_unchecked(Vec::from_raw_parts( +// *((ptr1 + 4) as *const i32) as *mut _, +// len2, +// len2, +// )) +// } +// #[cfg(debug_assertions)] +// { +// String::from_utf8(Vec::from_raw_parts( +// *((ptr1 + 4) as *const i32) as *mut _, +// len2, +// len2, +// )) +// .unwrap() +// } +// }, +// in_daylight_saving_time: { +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::(i32::from( +// *((ptr1 + 12) as *const u8), +// ) +// as u8) +// } +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr1 + 12) as *const u8)) { +// 0 => false, +// 1 => true, +// _ => panic!("invalid bool discriminant"), +// } +// } +// }, +// } +// } +// } +// #[allow(clippy::all)] +// /// The same as `display`, but only return the UTC offset. +// pub fn utc_offset(this: Timezone, when: Datetime) -> i32 { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// let super::super::super::wasi::clocks::wall_clock::Datetime { +// seconds: seconds0, +// nanoseconds: nanoseconds0, +// } = when; - #[link(wasm_import_module = "wasi:clocks/timezone")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "utc-offset")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:clocks/timezone_utc-offset" - )] - fn wit_import(_: i32, _: i64, _: i32) -> i32; - } - let ret = wit_import( - wit_bindgen::rt::as_i32(this), - wit_bindgen::rt::as_i64(seconds0), - wit_bindgen::rt::as_i32(nanoseconds0), - ); - ret - } - } - #[allow(clippy::all)] - /// Dispose of the specified input-stream, after which it may no longer - /// be used. - pub fn drop_timezone(this: Timezone) { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[link(wasm_import_module = "wasi:clocks/timezone")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "drop-timezone")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:clocks/timezone_drop-timezone" - )] - fn wit_import(_: i32); - } - wit_import(wit_bindgen::rt::as_i32(this)); - } - } - } - } - pub mod filesystem { +// #[link(wasm_import_module = "wasi:clocks/timezone")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "utc-offset")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:clocks/timezone_utc-offset" +// )] +// fn wit_import(_: i32, _: i64, _: i32) -> i32; +// } +// let ret = wit_import( +// wit_bindgen::rt::as_i32(this), +// wit_bindgen::rt::as_i64(seconds0), +// wit_bindgen::rt::as_i32(nanoseconds0), +// ); +// ret +// } +// } +// #[allow(clippy::all)] +// /// Dispose of the specified input-stream, after which it may no longer +// /// be used. +// pub fn drop_timezone(this: Timezone) { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[link(wasm_import_module = "wasi:clocks/timezone")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "drop-timezone")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:clocks/timezone_drop-timezone" +// )] +// fn wit_import(_: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this)); +// } +// } +// } +// } +// pub mod filesystem { - #[allow(clippy::all)] - pub mod filesystem { - #[used] - #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; +// #[allow(clippy::all)] +// pub mod filesystem { +// #[used] +// #[doc(hidden)] +// #[cfg(target_arch = "wasm32")] +// static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; - pub type InputStream = super::super::super::wasi::io::streams::InputStream; - pub type OutputStream = super::super::super::wasi::io::streams::OutputStream; - pub type Datetime = super::super::super::wasi::clocks::wall_clock::Datetime; - wit_bindgen::bitflags::bitflags! { - /// Flags determining the method of how paths are resolved. - #[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)] - pub struct PathFlags: u8 { - /// As long as the resolved path corresponds to a symbolic link, it is - /// expanded. - const SYMLINK_FOLLOW = 1 << 0; - } - } - wit_bindgen::bitflags::bitflags! { - /// Open flags used by `open-at`. - #[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)] - pub struct OpenFlags: u8 { - /// Create file if it does not exist, similar to `O_CREAT` in POSIX. - const CREATE = 1 << 0; - /// Fail if not a directory, similar to `O_DIRECTORY` in POSIX. - const DIRECTORY = 1 << 1; - /// Fail if file already exists, similar to `O_EXCL` in POSIX. - const EXCLUSIVE = 1 << 2; - /// Truncate file to size 0, similar to `O_TRUNC` in POSIX. - const TRUNCATE = 1 << 3; - } - } - wit_bindgen::bitflags::bitflags! { - /// Permissions mode used by `open-at`, `change-file-permissions-at`, and - /// similar. - #[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)] - pub struct Modes: u8 { - /// True if the resource is considered readable by the containing - /// filesystem. - const READABLE = 1 << 0; - /// True if the resource is considered writable by the containing - /// filesystem. - const WRITABLE = 1 << 1; - /// True if the resource is considered executable by the containing - /// filesystem. This does not apply to directories. - const EXECUTABLE = 1 << 2; - } - } - /// Number of hard links to an inode. - pub type LinkCount = u64; - /// Filesystem object serial number that is unique within its file system. - pub type Inode = u64; - /// File size or length of a region within a file. - pub type Filesize = u64; - /// Error codes returned by functions, similar to `errno` in POSIX. - /// Not all of these error codes are returned by the functions provided by this - /// API; some are used in higher-level library layers, and others are provided - /// merely for alignment with POSIX. - #[repr(u8)] - #[derive(Clone, Copy, PartialEq, Eq)] - pub enum ErrorCode { - /// Permission denied, similar to `EACCES` in POSIX. - Access, - /// Resource unavailable, or operation would block, similar to `EAGAIN` and `EWOULDBLOCK` in POSIX. - WouldBlock, - /// Connection already in progress, similar to `EALREADY` in POSIX. - Already, - /// Bad descriptor, similar to `EBADF` in POSIX. - BadDescriptor, - /// Device or resource busy, similar to `EBUSY` in POSIX. - Busy, - /// Resource deadlock would occur, similar to `EDEADLK` in POSIX. - Deadlock, - /// Storage quota exceeded, similar to `EDQUOT` in POSIX. - Quota, - /// File exists, similar to `EEXIST` in POSIX. - Exist, - /// File too large, similar to `EFBIG` in POSIX. - FileTooLarge, - /// Illegal byte sequence, similar to `EILSEQ` in POSIX. - IllegalByteSequence, - /// Operation in progress, similar to `EINPROGRESS` in POSIX. - InProgress, - /// Interrupted function, similar to `EINTR` in POSIX. - Interrupted, - /// Invalid argument, similar to `EINVAL` in POSIX. - Invalid, - /// I/O error, similar to `EIO` in POSIX. - Io, - /// Is a directory, similar to `EISDIR` in POSIX. - IsDirectory, - /// Too many levels of symbolic links, similar to `ELOOP` in POSIX. - Loop, - /// Too many links, similar to `EMLINK` in POSIX. - TooManyLinks, - /// Message too large, similar to `EMSGSIZE` in POSIX. - MessageSize, - /// Filename too long, similar to `ENAMETOOLONG` in POSIX. - NameTooLong, - /// No such device, similar to `ENODEV` in POSIX. - NoDevice, - /// No such file or directory, similar to `ENOENT` in POSIX. - NoEntry, - /// No locks available, similar to `ENOLCK` in POSIX. - NoLock, - /// Not enough space, similar to `ENOMEM` in POSIX. - InsufficientMemory, - /// No space left on device, similar to `ENOSPC` in POSIX. - InsufficientSpace, - /// Not a directory or a symbolic link to a directory, similar to `ENOTDIR` in POSIX. - NotDirectory, - /// Directory not empty, similar to `ENOTEMPTY` in POSIX. - NotEmpty, - /// State not recoverable, similar to `ENOTRECOVERABLE` in POSIX. - NotRecoverable, - /// Not supported, similar to `ENOTSUP` and `ENOSYS` in POSIX. - Unsupported, - /// Inappropriate I/O control operation, similar to `ENOTTY` in POSIX. - NoTty, - /// No such device or address, similar to `ENXIO` in POSIX. - NoSuchDevice, - /// Value too large to be stored in data type, similar to `EOVERFLOW` in POSIX. - Overflow, - /// Operation not permitted, similar to `EPERM` in POSIX. - NotPermitted, - /// Broken pipe, similar to `EPIPE` in POSIX. - Pipe, - /// Read-only file system, similar to `EROFS` in POSIX. - ReadOnly, - /// Invalid seek, similar to `ESPIPE` in POSIX. - InvalidSeek, - /// Text file busy, similar to `ETXTBSY` in POSIX. - TextFileBusy, - /// Cross-device link, similar to `EXDEV` in POSIX. - CrossDevice, - } - impl ErrorCode { - pub fn name(&self) -> &'static str { - match self { - ErrorCode::Access => "access", - ErrorCode::WouldBlock => "would-block", - ErrorCode::Already => "already", - ErrorCode::BadDescriptor => "bad-descriptor", - ErrorCode::Busy => "busy", - ErrorCode::Deadlock => "deadlock", - ErrorCode::Quota => "quota", - ErrorCode::Exist => "exist", - ErrorCode::FileTooLarge => "file-too-large", - ErrorCode::IllegalByteSequence => "illegal-byte-sequence", - ErrorCode::InProgress => "in-progress", - ErrorCode::Interrupted => "interrupted", - ErrorCode::Invalid => "invalid", - ErrorCode::Io => "io", - ErrorCode::IsDirectory => "is-directory", - ErrorCode::Loop => "loop", - ErrorCode::TooManyLinks => "too-many-links", - ErrorCode::MessageSize => "message-size", - ErrorCode::NameTooLong => "name-too-long", - ErrorCode::NoDevice => "no-device", - ErrorCode::NoEntry => "no-entry", - ErrorCode::NoLock => "no-lock", - ErrorCode::InsufficientMemory => "insufficient-memory", - ErrorCode::InsufficientSpace => "insufficient-space", - ErrorCode::NotDirectory => "not-directory", - ErrorCode::NotEmpty => "not-empty", - ErrorCode::NotRecoverable => "not-recoverable", - ErrorCode::Unsupported => "unsupported", - ErrorCode::NoTty => "no-tty", - ErrorCode::NoSuchDevice => "no-such-device", - ErrorCode::Overflow => "overflow", - ErrorCode::NotPermitted => "not-permitted", - ErrorCode::Pipe => "pipe", - ErrorCode::ReadOnly => "read-only", - ErrorCode::InvalidSeek => "invalid-seek", - ErrorCode::TextFileBusy => "text-file-busy", - ErrorCode::CrossDevice => "cross-device", - } - } - pub fn message(&self) -> &'static str { - match self { - ErrorCode::Access => "Permission denied, similar to `EACCES` in POSIX.", - ErrorCode::WouldBlock => "Resource unavailable, or operation would block, similar to `EAGAIN` and `EWOULDBLOCK` in POSIX.", - ErrorCode::Already => "Connection already in progress, similar to `EALREADY` in POSIX.", - ErrorCode::BadDescriptor => "Bad descriptor, similar to `EBADF` in POSIX.", - ErrorCode::Busy => "Device or resource busy, similar to `EBUSY` in POSIX.", - ErrorCode::Deadlock => "Resource deadlock would occur, similar to `EDEADLK` in POSIX.", - ErrorCode::Quota => "Storage quota exceeded, similar to `EDQUOT` in POSIX.", - ErrorCode::Exist => "File exists, similar to `EEXIST` in POSIX.", - ErrorCode::FileTooLarge => "File too large, similar to `EFBIG` in POSIX.", - ErrorCode::IllegalByteSequence => "Illegal byte sequence, similar to `EILSEQ` in POSIX.", - ErrorCode::InProgress => "Operation in progress, similar to `EINPROGRESS` in POSIX.", - ErrorCode::Interrupted => "Interrupted function, similar to `EINTR` in POSIX.", - ErrorCode::Invalid => "Invalid argument, similar to `EINVAL` in POSIX.", - ErrorCode::Io => "I/O error, similar to `EIO` in POSIX.", - ErrorCode::IsDirectory => "Is a directory, similar to `EISDIR` in POSIX.", - ErrorCode::Loop => "Too many levels of symbolic links, similar to `ELOOP` in POSIX.", - ErrorCode::TooManyLinks => "Too many links, similar to `EMLINK` in POSIX.", - ErrorCode::MessageSize => "Message too large, similar to `EMSGSIZE` in POSIX.", - ErrorCode::NameTooLong => "Filename too long, similar to `ENAMETOOLONG` in POSIX.", - ErrorCode::NoDevice => "No such device, similar to `ENODEV` in POSIX.", - ErrorCode::NoEntry => "No such file or directory, similar to `ENOENT` in POSIX.", - ErrorCode::NoLock => "No locks available, similar to `ENOLCK` in POSIX.", - ErrorCode::InsufficientMemory => "Not enough space, similar to `ENOMEM` in POSIX.", - ErrorCode::InsufficientSpace => "No space left on device, similar to `ENOSPC` in POSIX.", - ErrorCode::NotDirectory => "Not a directory or a symbolic link to a directory, similar to `ENOTDIR` in POSIX.", - ErrorCode::NotEmpty => "Directory not empty, similar to `ENOTEMPTY` in POSIX.", - ErrorCode::NotRecoverable => "State not recoverable, similar to `ENOTRECOVERABLE` in POSIX.", - ErrorCode::Unsupported => "Not supported, similar to `ENOTSUP` and `ENOSYS` in POSIX.", - ErrorCode::NoTty => "Inappropriate I/O control operation, similar to `ENOTTY` in POSIX.", - ErrorCode::NoSuchDevice => "No such device or address, similar to `ENXIO` in POSIX.", - ErrorCode::Overflow => "Value too large to be stored in data type, similar to `EOVERFLOW` in POSIX.", - ErrorCode::NotPermitted => "Operation not permitted, similar to `EPERM` in POSIX.", - ErrorCode::Pipe => "Broken pipe, similar to `EPIPE` in POSIX.", - ErrorCode::ReadOnly => "Read-only file system, similar to `EROFS` in POSIX.", - ErrorCode::InvalidSeek => "Invalid seek, similar to `ESPIPE` in POSIX.", - ErrorCode::TextFileBusy => "Text file busy, similar to `ETXTBSY` in POSIX.", - ErrorCode::CrossDevice => "Cross-device link, similar to `EXDEV` in POSIX.", - } - } - } - impl ::core::fmt::Debug for ErrorCode { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - f.debug_struct("ErrorCode") - .field("code", &(*self as i32)) - .field("name", &self.name()) - .field("message", &self.message()) - .finish() - } - } - impl ::core::fmt::Display for ErrorCode { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - write!(f, "{} (error {})", self.name(), *self as i32) - } - } +// pub type InputStream = super::super::super::wasi::io::streams::InputStream; +// pub type OutputStream = super::super::super::wasi::io::streams::OutputStream; +// pub type Datetime = super::super::super::wasi::clocks::wall_clock::Datetime; +// wit_bindgen::bitflags::bitflags! { +// /// Flags determining the method of how paths are resolved. +// #[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)] +// pub struct PathFlags: u8 { +// /// As long as the resolved path corresponds to a symbolic link, it is +// /// expanded. +// const SYMLINK_FOLLOW = 1 << 0; +// } +// } +// wit_bindgen::bitflags::bitflags! { +// /// Open flags used by `open-at`. +// #[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)] +// pub struct OpenFlags: u8 { +// /// Create file if it does not exist, similar to `O_CREAT` in POSIX. +// const CREATE = 1 << 0; +// /// Fail if not a directory, similar to `O_DIRECTORY` in POSIX. +// const DIRECTORY = 1 << 1; +// /// Fail if file already exists, similar to `O_EXCL` in POSIX. +// const EXCLUSIVE = 1 << 2; +// /// Truncate file to size 0, similar to `O_TRUNC` in POSIX. +// const TRUNCATE = 1 << 3; +// } +// } +// wit_bindgen::bitflags::bitflags! { +// /// Permissions mode used by `open-at`, `change-file-permissions-at`, and +// /// similar. +// #[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)] +// pub struct Modes: u8 { +// /// True if the resource is considered readable by the containing +// /// filesystem. +// const READABLE = 1 << 0; +// /// True if the resource is considered writable by the containing +// /// filesystem. +// const WRITABLE = 1 << 1; +// /// True if the resource is considered executable by the containing +// /// filesystem. This does not apply to directories. +// const EXECUTABLE = 1 << 2; +// } +// } +// /// Number of hard links to an inode. +// pub type LinkCount = u64; +// /// Filesystem object serial number that is unique within its file system. +// pub type Inode = u64; +// /// File size or length of a region within a file. +// pub type Filesize = u64; +// /// Error codes returned by functions, similar to `errno` in POSIX. +// /// Not all of these error codes are returned by the functions provided by this +// /// API; some are used in higher-level library layers, and others are provided +// /// merely for alignment with POSIX. +// #[repr(u8)] +// #[derive(Clone, Copy, PartialEq, Eq)] +// pub enum ErrorCode { +// /// Permission denied, similar to `EACCES` in POSIX. +// Access, +// /// Resource unavailable, or operation would block, similar to `EAGAIN` and `EWOULDBLOCK` in POSIX. +// WouldBlock, +// /// Connection already in progress, similar to `EALREADY` in POSIX. +// Already, +// /// Bad descriptor, similar to `EBADF` in POSIX. +// BadDescriptor, +// /// Device or resource busy, similar to `EBUSY` in POSIX. +// Busy, +// /// Resource deadlock would occur, similar to `EDEADLK` in POSIX. +// Deadlock, +// /// Storage quota exceeded, similar to `EDQUOT` in POSIX. +// Quota, +// /// File exists, similar to `EEXIST` in POSIX. +// Exist, +// /// File too large, similar to `EFBIG` in POSIX. +// FileTooLarge, +// /// Illegal byte sequence, similar to `EILSEQ` in POSIX. +// IllegalByteSequence, +// /// Operation in progress, similar to `EINPROGRESS` in POSIX. +// InProgress, +// /// Interrupted function, similar to `EINTR` in POSIX. +// Interrupted, +// /// Invalid argument, similar to `EINVAL` in POSIX. +// Invalid, +// /// I/O error, similar to `EIO` in POSIX. +// Io, +// /// Is a directory, similar to `EISDIR` in POSIX. +// IsDirectory, +// /// Too many levels of symbolic links, similar to `ELOOP` in POSIX. +// Loop, +// /// Too many links, similar to `EMLINK` in POSIX. +// TooManyLinks, +// /// Message too large, similar to `EMSGSIZE` in POSIX. +// MessageSize, +// /// Filename too long, similar to `ENAMETOOLONG` in POSIX. +// NameTooLong, +// /// No such device, similar to `ENODEV` in POSIX. +// NoDevice, +// /// No such file or directory, similar to `ENOENT` in POSIX. +// NoEntry, +// /// No locks available, similar to `ENOLCK` in POSIX. +// NoLock, +// /// Not enough space, similar to `ENOMEM` in POSIX. +// InsufficientMemory, +// /// No space left on device, similar to `ENOSPC` in POSIX. +// InsufficientSpace, +// /// Not a directory or a symbolic link to a directory, similar to `ENOTDIR` in POSIX. +// NotDirectory, +// /// Directory not empty, similar to `ENOTEMPTY` in POSIX. +// NotEmpty, +// /// State not recoverable, similar to `ENOTRECOVERABLE` in POSIX. +// NotRecoverable, +// /// Not supported, similar to `ENOTSUP` and `ENOSYS` in POSIX. +// Unsupported, +// /// Inappropriate I/O control operation, similar to `ENOTTY` in POSIX. +// NoTty, +// /// No such device or address, similar to `ENXIO` in POSIX. +// NoSuchDevice, +// /// Value too large to be stored in data type, similar to `EOVERFLOW` in POSIX. +// Overflow, +// /// Operation not permitted, similar to `EPERM` in POSIX. +// NotPermitted, +// /// Broken pipe, similar to `EPIPE` in POSIX. +// Pipe, +// /// Read-only file system, similar to `EROFS` in POSIX. +// ReadOnly, +// /// Invalid seek, similar to `ESPIPE` in POSIX. +// InvalidSeek, +// /// Text file busy, similar to `ETXTBSY` in POSIX. +// TextFileBusy, +// /// Cross-device link, similar to `EXDEV` in POSIX. +// CrossDevice, +// } +// impl ErrorCode { +// pub fn name(&self) -> &'static str { +// match self { +// ErrorCode::Access => "access", +// ErrorCode::WouldBlock => "would-block", +// ErrorCode::Already => "already", +// ErrorCode::BadDescriptor => "bad-descriptor", +// ErrorCode::Busy => "busy", +// ErrorCode::Deadlock => "deadlock", +// ErrorCode::Quota => "quota", +// ErrorCode::Exist => "exist", +// ErrorCode::FileTooLarge => "file-too-large", +// ErrorCode::IllegalByteSequence => "illegal-byte-sequence", +// ErrorCode::InProgress => "in-progress", +// ErrorCode::Interrupted => "interrupted", +// ErrorCode::Invalid => "invalid", +// ErrorCode::Io => "io", +// ErrorCode::IsDirectory => "is-directory", +// ErrorCode::Loop => "loop", +// ErrorCode::TooManyLinks => "too-many-links", +// ErrorCode::MessageSize => "message-size", +// ErrorCode::NameTooLong => "name-too-long", +// ErrorCode::NoDevice => "no-device", +// ErrorCode::NoEntry => "no-entry", +// ErrorCode::NoLock => "no-lock", +// ErrorCode::InsufficientMemory => "insufficient-memory", +// ErrorCode::InsufficientSpace => "insufficient-space", +// ErrorCode::NotDirectory => "not-directory", +// ErrorCode::NotEmpty => "not-empty", +// ErrorCode::NotRecoverable => "not-recoverable", +// ErrorCode::Unsupported => "unsupported", +// ErrorCode::NoTty => "no-tty", +// ErrorCode::NoSuchDevice => "no-such-device", +// ErrorCode::Overflow => "overflow", +// ErrorCode::NotPermitted => "not-permitted", +// ErrorCode::Pipe => "pipe", +// ErrorCode::ReadOnly => "read-only", +// ErrorCode::InvalidSeek => "invalid-seek", +// ErrorCode::TextFileBusy => "text-file-busy", +// ErrorCode::CrossDevice => "cross-device", +// } +// } +// pub fn message(&self) -> &'static str { +// match self { +// ErrorCode::Access => "Permission denied, similar to `EACCES` in POSIX.", +// ErrorCode::WouldBlock => "Resource unavailable, or operation would block, similar to `EAGAIN` and `EWOULDBLOCK` in POSIX.", +// ErrorCode::Already => "Connection already in progress, similar to `EALREADY` in POSIX.", +// ErrorCode::BadDescriptor => "Bad descriptor, similar to `EBADF` in POSIX.", +// ErrorCode::Busy => "Device or resource busy, similar to `EBUSY` in POSIX.", +// ErrorCode::Deadlock => "Resource deadlock would occur, similar to `EDEADLK` in POSIX.", +// ErrorCode::Quota => "Storage quota exceeded, similar to `EDQUOT` in POSIX.", +// ErrorCode::Exist => "File exists, similar to `EEXIST` in POSIX.", +// ErrorCode::FileTooLarge => "File too large, similar to `EFBIG` in POSIX.", +// ErrorCode::IllegalByteSequence => "Illegal byte sequence, similar to `EILSEQ` in POSIX.", +// ErrorCode::InProgress => "Operation in progress, similar to `EINPROGRESS` in POSIX.", +// ErrorCode::Interrupted => "Interrupted function, similar to `EINTR` in POSIX.", +// ErrorCode::Invalid => "Invalid argument, similar to `EINVAL` in POSIX.", +// ErrorCode::Io => "I/O error, similar to `EIO` in POSIX.", +// ErrorCode::IsDirectory => "Is a directory, similar to `EISDIR` in POSIX.", +// ErrorCode::Loop => "Too many levels of symbolic links, similar to `ELOOP` in POSIX.", +// ErrorCode::TooManyLinks => "Too many links, similar to `EMLINK` in POSIX.", +// ErrorCode::MessageSize => "Message too large, similar to `EMSGSIZE` in POSIX.", +// ErrorCode::NameTooLong => "Filename too long, similar to `ENAMETOOLONG` in POSIX.", +// ErrorCode::NoDevice => "No such device, similar to `ENODEV` in POSIX.", +// ErrorCode::NoEntry => "No such file or directory, similar to `ENOENT` in POSIX.", +// ErrorCode::NoLock => "No locks available, similar to `ENOLCK` in POSIX.", +// ErrorCode::InsufficientMemory => "Not enough space, similar to `ENOMEM` in POSIX.", +// ErrorCode::InsufficientSpace => "No space left on device, similar to `ENOSPC` in POSIX.", +// ErrorCode::NotDirectory => "Not a directory or a symbolic link to a directory, similar to `ENOTDIR` in POSIX.", +// ErrorCode::NotEmpty => "Directory not empty, similar to `ENOTEMPTY` in POSIX.", +// ErrorCode::NotRecoverable => "State not recoverable, similar to `ENOTRECOVERABLE` in POSIX.", +// ErrorCode::Unsupported => "Not supported, similar to `ENOTSUP` and `ENOSYS` in POSIX.", +// ErrorCode::NoTty => "Inappropriate I/O control operation, similar to `ENOTTY` in POSIX.", +// ErrorCode::NoSuchDevice => "No such device or address, similar to `ENXIO` in POSIX.", +// ErrorCode::Overflow => "Value too large to be stored in data type, similar to `EOVERFLOW` in POSIX.", +// ErrorCode::NotPermitted => "Operation not permitted, similar to `EPERM` in POSIX.", +// ErrorCode::Pipe => "Broken pipe, similar to `EPIPE` in POSIX.", +// ErrorCode::ReadOnly => "Read-only file system, similar to `EROFS` in POSIX.", +// ErrorCode::InvalidSeek => "Invalid seek, similar to `ESPIPE` in POSIX.", +// ErrorCode::TextFileBusy => "Text file busy, similar to `ETXTBSY` in POSIX.", +// ErrorCode::CrossDevice => "Cross-device link, similar to `EXDEV` in POSIX.", +// } +// } +// } +// impl ::core::fmt::Debug for ErrorCode { +// fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { +// f.debug_struct("ErrorCode") +// .field("code", &(*self as i32)) +// .field("name", &self.name()) +// .field("message", &self.message()) +// .finish() +// } +// } +// impl ::core::fmt::Display for ErrorCode { +// fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { +// write!(f, "{} (error {})", self.name(), *self as i32) +// } +// } - impl std::error::Error for ErrorCode {} - /// A stream of directory entries. - /// - /// This [represents a stream of `dir-entry`](https://github.com/WebAssembly/WASI/blob/main/docs/WitInWasi.md#Streams). - pub type DirectoryEntryStream = u32; - /// Identifier for a device containing a file system. Can be used in - /// combination with `inode` to uniquely identify a file or directory in - /// the filesystem. - pub type Device = u64; - /// The type of a filesystem object referenced by a descriptor. - /// - /// Note: This was called `filetype` in earlier versions of WASI. - #[repr(u8)] - #[derive(Clone, Copy, PartialEq, Eq)] - pub enum DescriptorType { - /// The type of the descriptor or file is unknown or is different from - /// any of the other types specified. - Unknown, - /// The descriptor refers to a block device inode. - BlockDevice, - /// The descriptor refers to a character device inode. - CharacterDevice, - /// The descriptor refers to a directory inode. - Directory, - /// The descriptor refers to a named pipe. - Fifo, - /// The file refers to a symbolic link inode. - SymbolicLink, - /// The descriptor refers to a regular file inode. - RegularFile, - /// The descriptor refers to a socket. - Socket, - } - impl ::core::fmt::Debug for DescriptorType { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - match self { - DescriptorType::Unknown => { - f.debug_tuple("DescriptorType::Unknown").finish() - } - DescriptorType::BlockDevice => { - f.debug_tuple("DescriptorType::BlockDevice").finish() - } - DescriptorType::CharacterDevice => { - f.debug_tuple("DescriptorType::CharacterDevice").finish() - } - DescriptorType::Directory => { - f.debug_tuple("DescriptorType::Directory").finish() - } - DescriptorType::Fifo => f.debug_tuple("DescriptorType::Fifo").finish(), - DescriptorType::SymbolicLink => { - f.debug_tuple("DescriptorType::SymbolicLink").finish() - } - DescriptorType::RegularFile => { - f.debug_tuple("DescriptorType::RegularFile").finish() - } - DescriptorType::Socket => f.debug_tuple("DescriptorType::Socket").finish(), - } - } - } - /// A directory entry. - #[derive(Clone)] - pub struct DirectoryEntry { - /// The serial number of the object referred to by this directory entry. - /// May be none if the inode value is not known. - /// - /// When this is none, libc implementations might do an extra `stat-at` - /// call to retrieve the inode number to fill their `d_ino` fields, so - /// implementations which can set this to a non-none value should do so. - pub inode: Option, - /// The type of the file referred to by this directory entry. - pub type_: DescriptorType, - /// The name of the object. - pub name: wit_bindgen::rt::string::String, - } - impl ::core::fmt::Debug for DirectoryEntry { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - f.debug_struct("DirectoryEntry") - .field("inode", &self.inode) - .field("type", &self.type_) - .field("name", &self.name) - .finish() - } - } - wit_bindgen::bitflags::bitflags! { - /// Descriptor flags. - /// - /// Note: This was called `fdflags` in earlier versions of WASI. - #[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)] - pub struct DescriptorFlags: u8 { - /// Read mode: Data can be read. - const READ = 1 << 0; - /// Write mode: Data can be written to. - const WRITE = 1 << 1; - /// Request that writes be performed according to synchronized I/O file - /// integrity completion. The data stored in the file and the file's - /// metadata are synchronized. This is similar to `O_SYNC` in POSIX. - /// - /// The precise semantics of this operation have not yet been defined for - /// WASI. At this time, it should be interpreted as a request, and not a - /// requirement. - const FILE_INTEGRITY_SYNC = 1 << 2; - /// Request that writes be performed according to synchronized I/O data - /// integrity completion. Only the data stored in the file is - /// synchronized. This is similar to `O_DSYNC` in POSIX. - /// - /// The precise semantics of this operation have not yet been defined for - /// WASI. At this time, it should be interpreted as a request, and not a - /// requirement. - const DATA_INTEGRITY_SYNC = 1 << 3; - /// Requests that reads be performed at the same level of integrety - /// requested for writes. This is similar to `O_RSYNC` in POSIX. - /// - /// The precise semantics of this operation have not yet been defined for - /// WASI. At this time, it should be interpreted as a request, and not a - /// requirement. - const REQUESTED_WRITE_SYNC = 1 << 4; - /// Mutating directories mode: Directory contents may be mutated. - /// - /// When this flag is unset on a descriptor, operations using the - /// descriptor which would create, rename, delete, modify the data or - /// metadata of filesystem objects, or obtain another handle which - /// would permit any of those, shall fail with `error-code::read-only` if - /// they would otherwise succeed. - /// - /// This may only be set on directories. - const MUTATE_DIRECTORY = 1 << 5; - } - } - /// A descriptor is a reference to a filesystem object, which may be a file, - /// directory, named pipe, special file, or other object on which filesystem - /// calls may be made. - /// - /// This [represents a resource](https://github.com/WebAssembly/WASI/blob/main/docs/WitInWasi.md#Resources). - pub type Descriptor = u32; - /// When setting a timestamp, this gives the value to set it to. - #[derive(Clone, Copy)] - pub enum NewTimestamp { - /// Leave the timestamp set to its previous value. - NoChange, - /// Set the timestamp to the current time of the system clock associated - /// with the filesystem. - Now, - /// Set the timestamp to the given value. - Timestamp(Datetime), - } - impl ::core::fmt::Debug for NewTimestamp { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - match self { - NewTimestamp::NoChange => f.debug_tuple("NewTimestamp::NoChange").finish(), - NewTimestamp::Now => f.debug_tuple("NewTimestamp::Now").finish(), - NewTimestamp::Timestamp(e) => { - f.debug_tuple("NewTimestamp::Timestamp").field(e).finish() - } - } - } - } - /// File attributes. - /// - /// Note: This was called `filestat` in earlier versions of WASI. - #[repr(C)] - #[derive(Copy, Clone)] - pub struct DescriptorStat { - /// Device ID of device containing the file. - pub device: Device, - /// File serial number. - pub inode: Inode, - /// File type. - pub type_: DescriptorType, - /// Number of hard links to the file. - pub link_count: LinkCount, - /// For regular files, the file size in bytes. For symbolic links, the - /// length in bytes of the pathname contained in the symbolic link. - pub size: Filesize, - /// Last data access timestamp. - pub data_access_timestamp: Datetime, - /// Last data modification timestamp. - pub data_modification_timestamp: Datetime, - /// Last file status change timestamp. - pub status_change_timestamp: Datetime, - } - impl ::core::fmt::Debug for DescriptorStat { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - f.debug_struct("DescriptorStat") - .field("device", &self.device) - .field("inode", &self.inode) - .field("type", &self.type_) - .field("link-count", &self.link_count) - .field("size", &self.size) - .field("data-access-timestamp", &self.data_access_timestamp) - .field( - "data-modification-timestamp", - &self.data_modification_timestamp, - ) - .field("status-change-timestamp", &self.status_change_timestamp) - .finish() - } - } - /// File or memory access pattern advisory information. - #[repr(u8)] - #[derive(Clone, Copy, PartialEq, Eq)] - pub enum Advice { - /// The application has no advice to give on its behavior with respect - /// to the specified data. - Normal, - /// The application expects to access the specified data sequentially - /// from lower offsets to higher offsets. - Sequential, - /// The application expects to access the specified data in a random - /// order. - Random, - /// The application expects to access the specified data in the near - /// future. - WillNeed, - /// The application expects that it will not access the specified data - /// in the near future. - DontNeed, - /// The application expects to access the specified data once and then - /// not reuse it thereafter. - NoReuse, - } - impl ::core::fmt::Debug for Advice { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - match self { - Advice::Normal => f.debug_tuple("Advice::Normal").finish(), - Advice::Sequential => f.debug_tuple("Advice::Sequential").finish(), - Advice::Random => f.debug_tuple("Advice::Random").finish(), - Advice::WillNeed => f.debug_tuple("Advice::WillNeed").finish(), - Advice::DontNeed => f.debug_tuple("Advice::DontNeed").finish(), - Advice::NoReuse => f.debug_tuple("Advice::NoReuse").finish(), - } - } - } - /// Access type used by `access-at`. - #[derive(Clone, Copy)] - pub enum AccessType { - /// Test for readability, writeability, or executability. - Access(Modes), - /// Test whether the path exists. - Exists, - } - impl ::core::fmt::Debug for AccessType { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - match self { - AccessType::Access(e) => { - f.debug_tuple("AccessType::Access").field(e).finish() - } - AccessType::Exists => f.debug_tuple("AccessType::Exists").finish(), - } - } - } - #[allow(clippy::all)] - /// Return a stream for reading from a file. - /// - /// Multiple read, write, and append streams may be active on the same open - /// file and they do not interfere with each other. - /// - /// Note: This allows using `wasi:io/streams.read`, which is similar to `read` in POSIX. - pub fn read_via_stream( - this: Descriptor, - offset: Filesize, - ) -> Result { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(4))] - struct RetArea([u8; 8]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:filesystem/filesystem")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "read-via-stream")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:filesystem/filesystem_read-via-stream" - )] - fn wit_import(_: i32, _: i64, _: i32); - } - wit_import( - wit_bindgen::rt::as_i32(this), - wit_bindgen::rt::as_i64(offset), - ptr0, - ); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(*((ptr0 + 4) as *const i32) as u32), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 4) as *const u8)) { - 0 => ErrorCode::Access, - 1 => ErrorCode::WouldBlock, - 2 => ErrorCode::Already, - 3 => ErrorCode::BadDescriptor, - 4 => ErrorCode::Busy, - 5 => ErrorCode::Deadlock, - 6 => ErrorCode::Quota, - 7 => ErrorCode::Exist, - 8 => ErrorCode::FileTooLarge, - 9 => ErrorCode::IllegalByteSequence, - 10 => ErrorCode::InProgress, - 11 => ErrorCode::Interrupted, - 12 => ErrorCode::Invalid, - 13 => ErrorCode::Io, - 14 => ErrorCode::IsDirectory, - 15 => ErrorCode::Loop, - 16 => ErrorCode::TooManyLinks, - 17 => ErrorCode::MessageSize, - 18 => ErrorCode::NameTooLong, - 19 => ErrorCode::NoDevice, - 20 => ErrorCode::NoEntry, - 21 => ErrorCode::NoLock, - 22 => ErrorCode::InsufficientMemory, - 23 => ErrorCode::InsufficientSpace, - 24 => ErrorCode::NotDirectory, - 25 => ErrorCode::NotEmpty, - 26 => ErrorCode::NotRecoverable, - 27 => ErrorCode::Unsupported, - 28 => ErrorCode::NoTty, - 29 => ErrorCode::NoSuchDevice, - 30 => ErrorCode::Overflow, - 31 => ErrorCode::NotPermitted, - 32 => ErrorCode::Pipe, - 33 => ErrorCode::ReadOnly, - 34 => ErrorCode::InvalidSeek, - 35 => ErrorCode::TextFileBusy, - 36 => ErrorCode::CrossDevice, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, ErrorCode>(i32::from( - *((ptr0 + 4) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Return a stream for writing to a file. - /// - /// Note: This allows using `wasi:io/streams.write`, which is similar to `write` in - /// POSIX. - pub fn write_via_stream( - this: Descriptor, - offset: Filesize, - ) -> Result { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(4))] - struct RetArea([u8; 8]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:filesystem/filesystem")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "write-via-stream")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:filesystem/filesystem_write-via-stream" - )] - fn wit_import(_: i32, _: i64, _: i32); - } - wit_import( - wit_bindgen::rt::as_i32(this), - wit_bindgen::rt::as_i64(offset), - ptr0, - ); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(*((ptr0 + 4) as *const i32) as u32), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 4) as *const u8)) { - 0 => ErrorCode::Access, - 1 => ErrorCode::WouldBlock, - 2 => ErrorCode::Already, - 3 => ErrorCode::BadDescriptor, - 4 => ErrorCode::Busy, - 5 => ErrorCode::Deadlock, - 6 => ErrorCode::Quota, - 7 => ErrorCode::Exist, - 8 => ErrorCode::FileTooLarge, - 9 => ErrorCode::IllegalByteSequence, - 10 => ErrorCode::InProgress, - 11 => ErrorCode::Interrupted, - 12 => ErrorCode::Invalid, - 13 => ErrorCode::Io, - 14 => ErrorCode::IsDirectory, - 15 => ErrorCode::Loop, - 16 => ErrorCode::TooManyLinks, - 17 => ErrorCode::MessageSize, - 18 => ErrorCode::NameTooLong, - 19 => ErrorCode::NoDevice, - 20 => ErrorCode::NoEntry, - 21 => ErrorCode::NoLock, - 22 => ErrorCode::InsufficientMemory, - 23 => ErrorCode::InsufficientSpace, - 24 => ErrorCode::NotDirectory, - 25 => ErrorCode::NotEmpty, - 26 => ErrorCode::NotRecoverable, - 27 => ErrorCode::Unsupported, - 28 => ErrorCode::NoTty, - 29 => ErrorCode::NoSuchDevice, - 30 => ErrorCode::Overflow, - 31 => ErrorCode::NotPermitted, - 32 => ErrorCode::Pipe, - 33 => ErrorCode::ReadOnly, - 34 => ErrorCode::InvalidSeek, - 35 => ErrorCode::TextFileBusy, - 36 => ErrorCode::CrossDevice, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, ErrorCode>(i32::from( - *((ptr0 + 4) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Return a stream for appending to a file. - /// - /// Note: This allows using `wasi:io/streams.write`, which is similar to `write` with - /// `O_APPEND` in in POSIX. - pub fn append_via_stream(this: Descriptor) -> Result { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(4))] - struct RetArea([u8; 8]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:filesystem/filesystem")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "append-via-stream")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:filesystem/filesystem_append-via-stream" - )] - fn wit_import(_: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(*((ptr0 + 4) as *const i32) as u32), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 4) as *const u8)) { - 0 => ErrorCode::Access, - 1 => ErrorCode::WouldBlock, - 2 => ErrorCode::Already, - 3 => ErrorCode::BadDescriptor, - 4 => ErrorCode::Busy, - 5 => ErrorCode::Deadlock, - 6 => ErrorCode::Quota, - 7 => ErrorCode::Exist, - 8 => ErrorCode::FileTooLarge, - 9 => ErrorCode::IllegalByteSequence, - 10 => ErrorCode::InProgress, - 11 => ErrorCode::Interrupted, - 12 => ErrorCode::Invalid, - 13 => ErrorCode::Io, - 14 => ErrorCode::IsDirectory, - 15 => ErrorCode::Loop, - 16 => ErrorCode::TooManyLinks, - 17 => ErrorCode::MessageSize, - 18 => ErrorCode::NameTooLong, - 19 => ErrorCode::NoDevice, - 20 => ErrorCode::NoEntry, - 21 => ErrorCode::NoLock, - 22 => ErrorCode::InsufficientMemory, - 23 => ErrorCode::InsufficientSpace, - 24 => ErrorCode::NotDirectory, - 25 => ErrorCode::NotEmpty, - 26 => ErrorCode::NotRecoverable, - 27 => ErrorCode::Unsupported, - 28 => ErrorCode::NoTty, - 29 => ErrorCode::NoSuchDevice, - 30 => ErrorCode::Overflow, - 31 => ErrorCode::NotPermitted, - 32 => ErrorCode::Pipe, - 33 => ErrorCode::ReadOnly, - 34 => ErrorCode::InvalidSeek, - 35 => ErrorCode::TextFileBusy, - 36 => ErrorCode::CrossDevice, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, ErrorCode>(i32::from( - *((ptr0 + 4) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Provide file advisory information on a descriptor. - /// - /// This is similar to `posix_fadvise` in POSIX. - pub fn advise( - this: Descriptor, - offset: Filesize, - length: Filesize, - advice: Advice, - ) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:filesystem/filesystem")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "advise")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:filesystem/filesystem_advise" - )] - fn wit_import(_: i32, _: i64, _: i64, _: i32, _: i32); - } - wit_import( - wit_bindgen::rt::as_i32(this), - wit_bindgen::rt::as_i64(offset), - wit_bindgen::rt::as_i64(length), - match advice { - Advice::Normal => 0, - Advice::Sequential => 1, - Advice::Random => 2, - Advice::WillNeed => 3, - Advice::DontNeed => 4, - Advice::NoReuse => 5, - }, - ptr0, - ); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 1) as *const u8)) { - 0 => ErrorCode::Access, - 1 => ErrorCode::WouldBlock, - 2 => ErrorCode::Already, - 3 => ErrorCode::BadDescriptor, - 4 => ErrorCode::Busy, - 5 => ErrorCode::Deadlock, - 6 => ErrorCode::Quota, - 7 => ErrorCode::Exist, - 8 => ErrorCode::FileTooLarge, - 9 => ErrorCode::IllegalByteSequence, - 10 => ErrorCode::InProgress, - 11 => ErrorCode::Interrupted, - 12 => ErrorCode::Invalid, - 13 => ErrorCode::Io, - 14 => ErrorCode::IsDirectory, - 15 => ErrorCode::Loop, - 16 => ErrorCode::TooManyLinks, - 17 => ErrorCode::MessageSize, - 18 => ErrorCode::NameTooLong, - 19 => ErrorCode::NoDevice, - 20 => ErrorCode::NoEntry, - 21 => ErrorCode::NoLock, - 22 => ErrorCode::InsufficientMemory, - 23 => ErrorCode::InsufficientSpace, - 24 => ErrorCode::NotDirectory, - 25 => ErrorCode::NotEmpty, - 26 => ErrorCode::NotRecoverable, - 27 => ErrorCode::Unsupported, - 28 => ErrorCode::NoTty, - 29 => ErrorCode::NoSuchDevice, - 30 => ErrorCode::Overflow, - 31 => ErrorCode::NotPermitted, - 32 => ErrorCode::Pipe, - 33 => ErrorCode::ReadOnly, - 34 => ErrorCode::InvalidSeek, - 35 => ErrorCode::TextFileBusy, - 36 => ErrorCode::CrossDevice, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, ErrorCode>(i32::from( - *((ptr0 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Synchronize the data of a file to disk. - /// - /// This function succeeds with no effect if the file descriptor is not - /// opened for writing. - /// - /// Note: This is similar to `fdatasync` in POSIX. - pub fn sync_data(this: Descriptor) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:filesystem/filesystem")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "sync-data")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:filesystem/filesystem_sync-data" - )] - fn wit_import(_: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 1) as *const u8)) { - 0 => ErrorCode::Access, - 1 => ErrorCode::WouldBlock, - 2 => ErrorCode::Already, - 3 => ErrorCode::BadDescriptor, - 4 => ErrorCode::Busy, - 5 => ErrorCode::Deadlock, - 6 => ErrorCode::Quota, - 7 => ErrorCode::Exist, - 8 => ErrorCode::FileTooLarge, - 9 => ErrorCode::IllegalByteSequence, - 10 => ErrorCode::InProgress, - 11 => ErrorCode::Interrupted, - 12 => ErrorCode::Invalid, - 13 => ErrorCode::Io, - 14 => ErrorCode::IsDirectory, - 15 => ErrorCode::Loop, - 16 => ErrorCode::TooManyLinks, - 17 => ErrorCode::MessageSize, - 18 => ErrorCode::NameTooLong, - 19 => ErrorCode::NoDevice, - 20 => ErrorCode::NoEntry, - 21 => ErrorCode::NoLock, - 22 => ErrorCode::InsufficientMemory, - 23 => ErrorCode::InsufficientSpace, - 24 => ErrorCode::NotDirectory, - 25 => ErrorCode::NotEmpty, - 26 => ErrorCode::NotRecoverable, - 27 => ErrorCode::Unsupported, - 28 => ErrorCode::NoTty, - 29 => ErrorCode::NoSuchDevice, - 30 => ErrorCode::Overflow, - 31 => ErrorCode::NotPermitted, - 32 => ErrorCode::Pipe, - 33 => ErrorCode::ReadOnly, - 34 => ErrorCode::InvalidSeek, - 35 => ErrorCode::TextFileBusy, - 36 => ErrorCode::CrossDevice, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, ErrorCode>(i32::from( - *((ptr0 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Get flags associated with a descriptor. - /// - /// Note: This returns similar flags to `fcntl(fd, F_GETFL)` in POSIX. - /// - /// Note: This returns the value that was the `fs_flags` value returned - /// from `fdstat_get` in earlier versions of WASI. - pub fn get_flags(this: Descriptor) -> Result { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:filesystem/filesystem")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "get-flags")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:filesystem/filesystem_get-flags" - )] - fn wit_import(_: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(DescriptorFlags::empty() - | DescriptorFlags::from_bits_retain( - ((i32::from(*((ptr0 + 1) as *const u8)) as u8) << 0) as _, - )), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 1) as *const u8)) { - 0 => ErrorCode::Access, - 1 => ErrorCode::WouldBlock, - 2 => ErrorCode::Already, - 3 => ErrorCode::BadDescriptor, - 4 => ErrorCode::Busy, - 5 => ErrorCode::Deadlock, - 6 => ErrorCode::Quota, - 7 => ErrorCode::Exist, - 8 => ErrorCode::FileTooLarge, - 9 => ErrorCode::IllegalByteSequence, - 10 => ErrorCode::InProgress, - 11 => ErrorCode::Interrupted, - 12 => ErrorCode::Invalid, - 13 => ErrorCode::Io, - 14 => ErrorCode::IsDirectory, - 15 => ErrorCode::Loop, - 16 => ErrorCode::TooManyLinks, - 17 => ErrorCode::MessageSize, - 18 => ErrorCode::NameTooLong, - 19 => ErrorCode::NoDevice, - 20 => ErrorCode::NoEntry, - 21 => ErrorCode::NoLock, - 22 => ErrorCode::InsufficientMemory, - 23 => ErrorCode::InsufficientSpace, - 24 => ErrorCode::NotDirectory, - 25 => ErrorCode::NotEmpty, - 26 => ErrorCode::NotRecoverable, - 27 => ErrorCode::Unsupported, - 28 => ErrorCode::NoTty, - 29 => ErrorCode::NoSuchDevice, - 30 => ErrorCode::Overflow, - 31 => ErrorCode::NotPermitted, - 32 => ErrorCode::Pipe, - 33 => ErrorCode::ReadOnly, - 34 => ErrorCode::InvalidSeek, - 35 => ErrorCode::TextFileBusy, - 36 => ErrorCode::CrossDevice, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, ErrorCode>(i32::from( - *((ptr0 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Get the dynamic type of a descriptor. - /// - /// Note: This returns the same value as the `type` field of the `fd-stat` - /// returned by `stat`, `stat-at` and similar. - /// - /// Note: This returns similar flags to the `st_mode & S_IFMT` value provided - /// by `fstat` in POSIX. - /// - /// Note: This returns the value that was the `fs_filetype` value returned - /// from `fdstat_get` in earlier versions of WASI. - pub fn get_type(this: Descriptor) -> Result { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:filesystem/filesystem")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "get-type")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:filesystem/filesystem_get-type" - )] - fn wit_import(_: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 1) as *const u8)) { - 0 => DescriptorType::Unknown, - 1 => DescriptorType::BlockDevice, - 2 => DescriptorType::CharacterDevice, - 3 => DescriptorType::Directory, - 4 => DescriptorType::Fifo, - 5 => DescriptorType::SymbolicLink, - 6 => DescriptorType::RegularFile, - 7 => DescriptorType::Socket, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, DescriptorType>(i32::from( - *((ptr0 + 1) as *const u8), - ) - as u8) - } - }), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 1) as *const u8)) { - 0 => ErrorCode::Access, - 1 => ErrorCode::WouldBlock, - 2 => ErrorCode::Already, - 3 => ErrorCode::BadDescriptor, - 4 => ErrorCode::Busy, - 5 => ErrorCode::Deadlock, - 6 => ErrorCode::Quota, - 7 => ErrorCode::Exist, - 8 => ErrorCode::FileTooLarge, - 9 => ErrorCode::IllegalByteSequence, - 10 => ErrorCode::InProgress, - 11 => ErrorCode::Interrupted, - 12 => ErrorCode::Invalid, - 13 => ErrorCode::Io, - 14 => ErrorCode::IsDirectory, - 15 => ErrorCode::Loop, - 16 => ErrorCode::TooManyLinks, - 17 => ErrorCode::MessageSize, - 18 => ErrorCode::NameTooLong, - 19 => ErrorCode::NoDevice, - 20 => ErrorCode::NoEntry, - 21 => ErrorCode::NoLock, - 22 => ErrorCode::InsufficientMemory, - 23 => ErrorCode::InsufficientSpace, - 24 => ErrorCode::NotDirectory, - 25 => ErrorCode::NotEmpty, - 26 => ErrorCode::NotRecoverable, - 27 => ErrorCode::Unsupported, - 28 => ErrorCode::NoTty, - 29 => ErrorCode::NoSuchDevice, - 30 => ErrorCode::Overflow, - 31 => ErrorCode::NotPermitted, - 32 => ErrorCode::Pipe, - 33 => ErrorCode::ReadOnly, - 34 => ErrorCode::InvalidSeek, - 35 => ErrorCode::TextFileBusy, - 36 => ErrorCode::CrossDevice, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, ErrorCode>(i32::from( - *((ptr0 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Adjust the size of an open file. If this increases the file's size, the - /// extra bytes are filled with zeros. - /// - /// Note: This was called `fd_filestat_set_size` in earlier versions of WASI. - pub fn set_size(this: Descriptor, size: Filesize) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:filesystem/filesystem")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "set-size")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:filesystem/filesystem_set-size" - )] - fn wit_import(_: i32, _: i64, _: i32); - } - wit_import( - wit_bindgen::rt::as_i32(this), - wit_bindgen::rt::as_i64(size), - ptr0, - ); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 1) as *const u8)) { - 0 => ErrorCode::Access, - 1 => ErrorCode::WouldBlock, - 2 => ErrorCode::Already, - 3 => ErrorCode::BadDescriptor, - 4 => ErrorCode::Busy, - 5 => ErrorCode::Deadlock, - 6 => ErrorCode::Quota, - 7 => ErrorCode::Exist, - 8 => ErrorCode::FileTooLarge, - 9 => ErrorCode::IllegalByteSequence, - 10 => ErrorCode::InProgress, - 11 => ErrorCode::Interrupted, - 12 => ErrorCode::Invalid, - 13 => ErrorCode::Io, - 14 => ErrorCode::IsDirectory, - 15 => ErrorCode::Loop, - 16 => ErrorCode::TooManyLinks, - 17 => ErrorCode::MessageSize, - 18 => ErrorCode::NameTooLong, - 19 => ErrorCode::NoDevice, - 20 => ErrorCode::NoEntry, - 21 => ErrorCode::NoLock, - 22 => ErrorCode::InsufficientMemory, - 23 => ErrorCode::InsufficientSpace, - 24 => ErrorCode::NotDirectory, - 25 => ErrorCode::NotEmpty, - 26 => ErrorCode::NotRecoverable, - 27 => ErrorCode::Unsupported, - 28 => ErrorCode::NoTty, - 29 => ErrorCode::NoSuchDevice, - 30 => ErrorCode::Overflow, - 31 => ErrorCode::NotPermitted, - 32 => ErrorCode::Pipe, - 33 => ErrorCode::ReadOnly, - 34 => ErrorCode::InvalidSeek, - 35 => ErrorCode::TextFileBusy, - 36 => ErrorCode::CrossDevice, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, ErrorCode>(i32::from( - *((ptr0 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Adjust the timestamps of an open file or directory. - /// - /// Note: This is similar to `futimens` in POSIX. - /// - /// Note: This was called `fd_filestat_set_times` in earlier versions of WASI. - pub fn set_times( - this: Descriptor, - data_access_timestamp: NewTimestamp, - data_modification_timestamp: NewTimestamp, - ) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let (result1_0, result1_1, result1_2) = match data_access_timestamp { - NewTimestamp::NoChange => (0i32, 0i64, 0i32), - NewTimestamp::Now => (1i32, 0i64, 0i32), - NewTimestamp::Timestamp(e) => { - let super::super::super::wasi::clocks::wall_clock::Datetime { - seconds: seconds0, - nanoseconds: nanoseconds0, - } = e; +// impl std::error::Error for ErrorCode {} +// /// A stream of directory entries. +// /// +// /// This [represents a stream of `dir-entry`](https://github.com/WebAssembly/WASI/blob/main/docs/WitInWasi.md#Streams). +// pub type DirectoryEntryStream = u32; +// /// Identifier for a device containing a file system. Can be used in +// /// combination with `inode` to uniquely identify a file or directory in +// /// the filesystem. +// pub type Device = u64; +// /// The type of a filesystem object referenced by a descriptor. +// /// +// /// Note: This was called `filetype` in earlier versions of WASI. +// #[repr(u8)] +// #[derive(Clone, Copy, PartialEq, Eq)] +// pub enum DescriptorType { +// /// The type of the descriptor or file is unknown or is different from +// /// any of the other types specified. +// Unknown, +// /// The descriptor refers to a block device inode. +// BlockDevice, +// /// The descriptor refers to a character device inode. +// CharacterDevice, +// /// The descriptor refers to a directory inode. +// Directory, +// /// The descriptor refers to a named pipe. +// Fifo, +// /// The file refers to a symbolic link inode. +// SymbolicLink, +// /// The descriptor refers to a regular file inode. +// RegularFile, +// /// The descriptor refers to a socket. +// Socket, +// } +// impl ::core::fmt::Debug for DescriptorType { +// fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { +// match self { +// DescriptorType::Unknown => { +// f.debug_tuple("DescriptorType::Unknown").finish() +// } +// DescriptorType::BlockDevice => { +// f.debug_tuple("DescriptorType::BlockDevice").finish() +// } +// DescriptorType::CharacterDevice => { +// f.debug_tuple("DescriptorType::CharacterDevice").finish() +// } +// DescriptorType::Directory => { +// f.debug_tuple("DescriptorType::Directory").finish() +// } +// DescriptorType::Fifo => f.debug_tuple("DescriptorType::Fifo").finish(), +// DescriptorType::SymbolicLink => { +// f.debug_tuple("DescriptorType::SymbolicLink").finish() +// } +// DescriptorType::RegularFile => { +// f.debug_tuple("DescriptorType::RegularFile").finish() +// } +// DescriptorType::Socket => f.debug_tuple("DescriptorType::Socket").finish(), +// } +// } +// } +// /// A directory entry. +// #[derive(Clone)] +// pub struct DirectoryEntry { +// /// The serial number of the object referred to by this directory entry. +// /// May be none if the inode value is not known. +// /// +// /// When this is none, libc implementations might do an extra `stat-at` +// /// call to retrieve the inode number to fill their `d_ino` fields, so +// /// implementations which can set this to a non-none value should do so. +// pub inode: Option, +// /// The type of the file referred to by this directory entry. +// pub type_: DescriptorType, +// /// The name of the object. +// pub name: wit_bindgen::rt::string::String, +// } +// impl ::core::fmt::Debug for DirectoryEntry { +// fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { +// f.debug_struct("DirectoryEntry") +// .field("inode", &self.inode) +// .field("type", &self.type_) +// .field("name", &self.name) +// .finish() +// } +// } +// wit_bindgen::bitflags::bitflags! { +// /// Descriptor flags. +// /// +// /// Note: This was called `fdflags` in earlier versions of WASI. +// #[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)] +// pub struct DescriptorFlags: u8 { +// /// Read mode: Data can be read. +// const READ = 1 << 0; +// /// Write mode: Data can be written to. +// const WRITE = 1 << 1; +// /// Request that writes be performed according to synchronized I/O file +// /// integrity completion. The data stored in the file and the file's +// /// metadata are synchronized. This is similar to `O_SYNC` in POSIX. +// /// +// /// The precise semantics of this operation have not yet been defined for +// /// WASI. At this time, it should be interpreted as a request, and not a +// /// requirement. +// const FILE_INTEGRITY_SYNC = 1 << 2; +// /// Request that writes be performed according to synchronized I/O data +// /// integrity completion. Only the data stored in the file is +// /// synchronized. This is similar to `O_DSYNC` in POSIX. +// /// +// /// The precise semantics of this operation have not yet been defined for +// /// WASI. At this time, it should be interpreted as a request, and not a +// /// requirement. +// const DATA_INTEGRITY_SYNC = 1 << 3; +// /// Requests that reads be performed at the same level of integrety +// /// requested for writes. This is similar to `O_RSYNC` in POSIX. +// /// +// /// The precise semantics of this operation have not yet been defined for +// /// WASI. At this time, it should be interpreted as a request, and not a +// /// requirement. +// const REQUESTED_WRITE_SYNC = 1 << 4; +// /// Mutating directories mode: Directory contents may be mutated. +// /// +// /// When this flag is unset on a descriptor, operations using the +// /// descriptor which would create, rename, delete, modify the data or +// /// metadata of filesystem objects, or obtain another handle which +// /// would permit any of those, shall fail with `error-code::read-only` if +// /// they would otherwise succeed. +// /// +// /// This may only be set on directories. +// const MUTATE_DIRECTORY = 1 << 5; +// } +// } +// /// A descriptor is a reference to a filesystem object, which may be a file, +// /// directory, named pipe, special file, or other object on which filesystem +// /// calls may be made. +// /// +// /// This [represents a resource](https://github.com/WebAssembly/WASI/blob/main/docs/WitInWasi.md#Resources). +// pub type Descriptor = u32; +// /// When setting a timestamp, this gives the value to set it to. +// #[derive(Clone, Copy)] +// pub enum NewTimestamp { +// /// Leave the timestamp set to its previous value. +// NoChange, +// /// Set the timestamp to the current time of the system clock associated +// /// with the filesystem. +// Now, +// /// Set the timestamp to the given value. +// Timestamp(Datetime), +// } +// impl ::core::fmt::Debug for NewTimestamp { +// fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { +// match self { +// NewTimestamp::NoChange => f.debug_tuple("NewTimestamp::NoChange").finish(), +// NewTimestamp::Now => f.debug_tuple("NewTimestamp::Now").finish(), +// NewTimestamp::Timestamp(e) => { +// f.debug_tuple("NewTimestamp::Timestamp").field(e).finish() +// } +// } +// } +// } +// /// File attributes. +// /// +// /// Note: This was called `filestat` in earlier versions of WASI. +// #[repr(C)] +// #[derive(Copy, Clone)] +// pub struct DescriptorStat { +// /// Device ID of device containing the file. +// pub device: Device, +// /// File serial number. +// pub inode: Inode, +// /// File type. +// pub type_: DescriptorType, +// /// Number of hard links to the file. +// pub link_count: LinkCount, +// /// For regular files, the file size in bytes. For symbolic links, the +// /// length in bytes of the pathname contained in the symbolic link. +// pub size: Filesize, +// /// Last data access timestamp. +// pub data_access_timestamp: Datetime, +// /// Last data modification timestamp. +// pub data_modification_timestamp: Datetime, +// /// Last file status change timestamp. +// pub status_change_timestamp: Datetime, +// } +// impl ::core::fmt::Debug for DescriptorStat { +// fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { +// f.debug_struct("DescriptorStat") +// .field("device", &self.device) +// .field("inode", &self.inode) +// .field("type", &self.type_) +// .field("link-count", &self.link_count) +// .field("size", &self.size) +// .field("data-access-timestamp", &self.data_access_timestamp) +// .field( +// "data-modification-timestamp", +// &self.data_modification_timestamp, +// ) +// .field("status-change-timestamp", &self.status_change_timestamp) +// .finish() +// } +// } +// /// File or memory access pattern advisory information. +// #[repr(u8)] +// #[derive(Clone, Copy, PartialEq, Eq)] +// pub enum Advice { +// /// The application has no advice to give on its behavior with respect +// /// to the specified data. +// Normal, +// /// The application expects to access the specified data sequentially +// /// from lower offsets to higher offsets. +// Sequential, +// /// The application expects to access the specified data in a random +// /// order. +// Random, +// /// The application expects to access the specified data in the near +// /// future. +// WillNeed, +// /// The application expects that it will not access the specified data +// /// in the near future. +// DontNeed, +// /// The application expects to access the specified data once and then +// /// not reuse it thereafter. +// NoReuse, +// } +// impl ::core::fmt::Debug for Advice { +// fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { +// match self { +// Advice::Normal => f.debug_tuple("Advice::Normal").finish(), +// Advice::Sequential => f.debug_tuple("Advice::Sequential").finish(), +// Advice::Random => f.debug_tuple("Advice::Random").finish(), +// Advice::WillNeed => f.debug_tuple("Advice::WillNeed").finish(), +// Advice::DontNeed => f.debug_tuple("Advice::DontNeed").finish(), +// Advice::NoReuse => f.debug_tuple("Advice::NoReuse").finish(), +// } +// } +// } +// /// Access type used by `access-at`. +// #[derive(Clone, Copy)] +// pub enum AccessType { +// /// Test for readability, writeability, or executability. +// Access(Modes), +// /// Test whether the path exists. +// Exists, +// } +// impl ::core::fmt::Debug for AccessType { +// fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { +// match self { +// AccessType::Access(e) => { +// f.debug_tuple("AccessType::Access").field(e).finish() +// } +// AccessType::Exists => f.debug_tuple("AccessType::Exists").finish(), +// } +// } +// } +// #[allow(clippy::all)] +// /// Return a stream for reading from a file. +// /// +// /// Multiple read, write, and append streams may be active on the same open +// /// file and they do not interfere with each other. +// /// +// /// Note: This allows using `wasi:io/streams.read`, which is similar to `read` in POSIX. +// pub fn read_via_stream( +// this: Descriptor, +// offset: Filesize, +// ) -> Result { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(4))] +// struct RetArea([u8; 8]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:filesystem/filesystem")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "read-via-stream")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:filesystem/filesystem_read-via-stream" +// )] +// fn wit_import(_: i32, _: i64, _: i32); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// wit_bindgen::rt::as_i64(offset), +// ptr0, +// ); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(*((ptr0 + 4) as *const i32) as u32), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 4) as *const u8)) { +// 0 => ErrorCode::Access, +// 1 => ErrorCode::WouldBlock, +// 2 => ErrorCode::Already, +// 3 => ErrorCode::BadDescriptor, +// 4 => ErrorCode::Busy, +// 5 => ErrorCode::Deadlock, +// 6 => ErrorCode::Quota, +// 7 => ErrorCode::Exist, +// 8 => ErrorCode::FileTooLarge, +// 9 => ErrorCode::IllegalByteSequence, +// 10 => ErrorCode::InProgress, +// 11 => ErrorCode::Interrupted, +// 12 => ErrorCode::Invalid, +// 13 => ErrorCode::Io, +// 14 => ErrorCode::IsDirectory, +// 15 => ErrorCode::Loop, +// 16 => ErrorCode::TooManyLinks, +// 17 => ErrorCode::MessageSize, +// 18 => ErrorCode::NameTooLong, +// 19 => ErrorCode::NoDevice, +// 20 => ErrorCode::NoEntry, +// 21 => ErrorCode::NoLock, +// 22 => ErrorCode::InsufficientMemory, +// 23 => ErrorCode::InsufficientSpace, +// 24 => ErrorCode::NotDirectory, +// 25 => ErrorCode::NotEmpty, +// 26 => ErrorCode::NotRecoverable, +// 27 => ErrorCode::Unsupported, +// 28 => ErrorCode::NoTty, +// 29 => ErrorCode::NoSuchDevice, +// 30 => ErrorCode::Overflow, +// 31 => ErrorCode::NotPermitted, +// 32 => ErrorCode::Pipe, +// 33 => ErrorCode::ReadOnly, +// 34 => ErrorCode::InvalidSeek, +// 35 => ErrorCode::TextFileBusy, +// 36 => ErrorCode::CrossDevice, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::<_, ErrorCode>(i32::from( +// *((ptr0 + 4) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Return a stream for writing to a file. +// /// +// /// Note: This allows using `wasi:io/streams.write`, which is similar to `write` in +// /// POSIX. +// pub fn write_via_stream( +// this: Descriptor, +// offset: Filesize, +// ) -> Result { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(4))] +// struct RetArea([u8; 8]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:filesystem/filesystem")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "write-via-stream")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:filesystem/filesystem_write-via-stream" +// )] +// fn wit_import(_: i32, _: i64, _: i32); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// wit_bindgen::rt::as_i64(offset), +// ptr0, +// ); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(*((ptr0 + 4) as *const i32) as u32), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 4) as *const u8)) { +// 0 => ErrorCode::Access, +// 1 => ErrorCode::WouldBlock, +// 2 => ErrorCode::Already, +// 3 => ErrorCode::BadDescriptor, +// 4 => ErrorCode::Busy, +// 5 => ErrorCode::Deadlock, +// 6 => ErrorCode::Quota, +// 7 => ErrorCode::Exist, +// 8 => ErrorCode::FileTooLarge, +// 9 => ErrorCode::IllegalByteSequence, +// 10 => ErrorCode::InProgress, +// 11 => ErrorCode::Interrupted, +// 12 => ErrorCode::Invalid, +// 13 => ErrorCode::Io, +// 14 => ErrorCode::IsDirectory, +// 15 => ErrorCode::Loop, +// 16 => ErrorCode::TooManyLinks, +// 17 => ErrorCode::MessageSize, +// 18 => ErrorCode::NameTooLong, +// 19 => ErrorCode::NoDevice, +// 20 => ErrorCode::NoEntry, +// 21 => ErrorCode::NoLock, +// 22 => ErrorCode::InsufficientMemory, +// 23 => ErrorCode::InsufficientSpace, +// 24 => ErrorCode::NotDirectory, +// 25 => ErrorCode::NotEmpty, +// 26 => ErrorCode::NotRecoverable, +// 27 => ErrorCode::Unsupported, +// 28 => ErrorCode::NoTty, +// 29 => ErrorCode::NoSuchDevice, +// 30 => ErrorCode::Overflow, +// 31 => ErrorCode::NotPermitted, +// 32 => ErrorCode::Pipe, +// 33 => ErrorCode::ReadOnly, +// 34 => ErrorCode::InvalidSeek, +// 35 => ErrorCode::TextFileBusy, +// 36 => ErrorCode::CrossDevice, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::<_, ErrorCode>(i32::from( +// *((ptr0 + 4) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Return a stream for appending to a file. +// /// +// /// Note: This allows using `wasi:io/streams.write`, which is similar to `write` with +// /// `O_APPEND` in in POSIX. +// pub fn append_via_stream(this: Descriptor) -> Result { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(4))] +// struct RetArea([u8; 8]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:filesystem/filesystem")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "append-via-stream")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:filesystem/filesystem_append-via-stream" +// )] +// fn wit_import(_: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(*((ptr0 + 4) as *const i32) as u32), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 4) as *const u8)) { +// 0 => ErrorCode::Access, +// 1 => ErrorCode::WouldBlock, +// 2 => ErrorCode::Already, +// 3 => ErrorCode::BadDescriptor, +// 4 => ErrorCode::Busy, +// 5 => ErrorCode::Deadlock, +// 6 => ErrorCode::Quota, +// 7 => ErrorCode::Exist, +// 8 => ErrorCode::FileTooLarge, +// 9 => ErrorCode::IllegalByteSequence, +// 10 => ErrorCode::InProgress, +// 11 => ErrorCode::Interrupted, +// 12 => ErrorCode::Invalid, +// 13 => ErrorCode::Io, +// 14 => ErrorCode::IsDirectory, +// 15 => ErrorCode::Loop, +// 16 => ErrorCode::TooManyLinks, +// 17 => ErrorCode::MessageSize, +// 18 => ErrorCode::NameTooLong, +// 19 => ErrorCode::NoDevice, +// 20 => ErrorCode::NoEntry, +// 21 => ErrorCode::NoLock, +// 22 => ErrorCode::InsufficientMemory, +// 23 => ErrorCode::InsufficientSpace, +// 24 => ErrorCode::NotDirectory, +// 25 => ErrorCode::NotEmpty, +// 26 => ErrorCode::NotRecoverable, +// 27 => ErrorCode::Unsupported, +// 28 => ErrorCode::NoTty, +// 29 => ErrorCode::NoSuchDevice, +// 30 => ErrorCode::Overflow, +// 31 => ErrorCode::NotPermitted, +// 32 => ErrorCode::Pipe, +// 33 => ErrorCode::ReadOnly, +// 34 => ErrorCode::InvalidSeek, +// 35 => ErrorCode::TextFileBusy, +// 36 => ErrorCode::CrossDevice, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::<_, ErrorCode>(i32::from( +// *((ptr0 + 4) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Provide file advisory information on a descriptor. +// /// +// /// This is similar to `posix_fadvise` in POSIX. +// pub fn advise( +// this: Descriptor, +// offset: Filesize, +// length: Filesize, +// advice: Advice, +// ) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:filesystem/filesystem")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "advise")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:filesystem/filesystem_advise" +// )] +// fn wit_import(_: i32, _: i64, _: i64, _: i32, _: i32); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// wit_bindgen::rt::as_i64(offset), +// wit_bindgen::rt::as_i64(length), +// match advice { +// Advice::Normal => 0, +// Advice::Sequential => 1, +// Advice::Random => 2, +// Advice::WillNeed => 3, +// Advice::DontNeed => 4, +// Advice::NoReuse => 5, +// }, +// ptr0, +// ); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 1) as *const u8)) { +// 0 => ErrorCode::Access, +// 1 => ErrorCode::WouldBlock, +// 2 => ErrorCode::Already, +// 3 => ErrorCode::BadDescriptor, +// 4 => ErrorCode::Busy, +// 5 => ErrorCode::Deadlock, +// 6 => ErrorCode::Quota, +// 7 => ErrorCode::Exist, +// 8 => ErrorCode::FileTooLarge, +// 9 => ErrorCode::IllegalByteSequence, +// 10 => ErrorCode::InProgress, +// 11 => ErrorCode::Interrupted, +// 12 => ErrorCode::Invalid, +// 13 => ErrorCode::Io, +// 14 => ErrorCode::IsDirectory, +// 15 => ErrorCode::Loop, +// 16 => ErrorCode::TooManyLinks, +// 17 => ErrorCode::MessageSize, +// 18 => ErrorCode::NameTooLong, +// 19 => ErrorCode::NoDevice, +// 20 => ErrorCode::NoEntry, +// 21 => ErrorCode::NoLock, +// 22 => ErrorCode::InsufficientMemory, +// 23 => ErrorCode::InsufficientSpace, +// 24 => ErrorCode::NotDirectory, +// 25 => ErrorCode::NotEmpty, +// 26 => ErrorCode::NotRecoverable, +// 27 => ErrorCode::Unsupported, +// 28 => ErrorCode::NoTty, +// 29 => ErrorCode::NoSuchDevice, +// 30 => ErrorCode::Overflow, +// 31 => ErrorCode::NotPermitted, +// 32 => ErrorCode::Pipe, +// 33 => ErrorCode::ReadOnly, +// 34 => ErrorCode::InvalidSeek, +// 35 => ErrorCode::TextFileBusy, +// 36 => ErrorCode::CrossDevice, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::<_, ErrorCode>(i32::from( +// *((ptr0 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Synchronize the data of a file to disk. +// /// +// /// This function succeeds with no effect if the file descriptor is not +// /// opened for writing. +// /// +// /// Note: This is similar to `fdatasync` in POSIX. +// pub fn sync_data(this: Descriptor) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:filesystem/filesystem")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "sync-data")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:filesystem/filesystem_sync-data" +// )] +// fn wit_import(_: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 1) as *const u8)) { +// 0 => ErrorCode::Access, +// 1 => ErrorCode::WouldBlock, +// 2 => ErrorCode::Already, +// 3 => ErrorCode::BadDescriptor, +// 4 => ErrorCode::Busy, +// 5 => ErrorCode::Deadlock, +// 6 => ErrorCode::Quota, +// 7 => ErrorCode::Exist, +// 8 => ErrorCode::FileTooLarge, +// 9 => ErrorCode::IllegalByteSequence, +// 10 => ErrorCode::InProgress, +// 11 => ErrorCode::Interrupted, +// 12 => ErrorCode::Invalid, +// 13 => ErrorCode::Io, +// 14 => ErrorCode::IsDirectory, +// 15 => ErrorCode::Loop, +// 16 => ErrorCode::TooManyLinks, +// 17 => ErrorCode::MessageSize, +// 18 => ErrorCode::NameTooLong, +// 19 => ErrorCode::NoDevice, +// 20 => ErrorCode::NoEntry, +// 21 => ErrorCode::NoLock, +// 22 => ErrorCode::InsufficientMemory, +// 23 => ErrorCode::InsufficientSpace, +// 24 => ErrorCode::NotDirectory, +// 25 => ErrorCode::NotEmpty, +// 26 => ErrorCode::NotRecoverable, +// 27 => ErrorCode::Unsupported, +// 28 => ErrorCode::NoTty, +// 29 => ErrorCode::NoSuchDevice, +// 30 => ErrorCode::Overflow, +// 31 => ErrorCode::NotPermitted, +// 32 => ErrorCode::Pipe, +// 33 => ErrorCode::ReadOnly, +// 34 => ErrorCode::InvalidSeek, +// 35 => ErrorCode::TextFileBusy, +// 36 => ErrorCode::CrossDevice, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::<_, ErrorCode>(i32::from( +// *((ptr0 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Get flags associated with a descriptor. +// /// +// /// Note: This returns similar flags to `fcntl(fd, F_GETFL)` in POSIX. +// /// +// /// Note: This returns the value that was the `fs_flags` value returned +// /// from `fdstat_get` in earlier versions of WASI. +// pub fn get_flags(this: Descriptor) -> Result { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:filesystem/filesystem")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "get-flags")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:filesystem/filesystem_get-flags" +// )] +// fn wit_import(_: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(DescriptorFlags::empty() +// | DescriptorFlags::from_bits_retain( +// ((i32::from(*((ptr0 + 1) as *const u8)) as u8) << 0) as _, +// )), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 1) as *const u8)) { +// 0 => ErrorCode::Access, +// 1 => ErrorCode::WouldBlock, +// 2 => ErrorCode::Already, +// 3 => ErrorCode::BadDescriptor, +// 4 => ErrorCode::Busy, +// 5 => ErrorCode::Deadlock, +// 6 => ErrorCode::Quota, +// 7 => ErrorCode::Exist, +// 8 => ErrorCode::FileTooLarge, +// 9 => ErrorCode::IllegalByteSequence, +// 10 => ErrorCode::InProgress, +// 11 => ErrorCode::Interrupted, +// 12 => ErrorCode::Invalid, +// 13 => ErrorCode::Io, +// 14 => ErrorCode::IsDirectory, +// 15 => ErrorCode::Loop, +// 16 => ErrorCode::TooManyLinks, +// 17 => ErrorCode::MessageSize, +// 18 => ErrorCode::NameTooLong, +// 19 => ErrorCode::NoDevice, +// 20 => ErrorCode::NoEntry, +// 21 => ErrorCode::NoLock, +// 22 => ErrorCode::InsufficientMemory, +// 23 => ErrorCode::InsufficientSpace, +// 24 => ErrorCode::NotDirectory, +// 25 => ErrorCode::NotEmpty, +// 26 => ErrorCode::NotRecoverable, +// 27 => ErrorCode::Unsupported, +// 28 => ErrorCode::NoTty, +// 29 => ErrorCode::NoSuchDevice, +// 30 => ErrorCode::Overflow, +// 31 => ErrorCode::NotPermitted, +// 32 => ErrorCode::Pipe, +// 33 => ErrorCode::ReadOnly, +// 34 => ErrorCode::InvalidSeek, +// 35 => ErrorCode::TextFileBusy, +// 36 => ErrorCode::CrossDevice, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::<_, ErrorCode>(i32::from( +// *((ptr0 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Get the dynamic type of a descriptor. +// /// +// /// Note: This returns the same value as the `type` field of the `fd-stat` +// /// returned by `stat`, `stat-at` and similar. +// /// +// /// Note: This returns similar flags to the `st_mode & S_IFMT` value provided +// /// by `fstat` in POSIX. +// /// +// /// Note: This returns the value that was the `fs_filetype` value returned +// /// from `fdstat_get` in earlier versions of WASI. +// pub fn get_type(this: Descriptor) -> Result { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:filesystem/filesystem")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "get-type")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:filesystem/filesystem_get-type" +// )] +// fn wit_import(_: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 1) as *const u8)) { +// 0 => DescriptorType::Unknown, +// 1 => DescriptorType::BlockDevice, +// 2 => DescriptorType::CharacterDevice, +// 3 => DescriptorType::Directory, +// 4 => DescriptorType::Fifo, +// 5 => DescriptorType::SymbolicLink, +// 6 => DescriptorType::RegularFile, +// 7 => DescriptorType::Socket, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::<_, DescriptorType>(i32::from( +// *((ptr0 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 1) as *const u8)) { +// 0 => ErrorCode::Access, +// 1 => ErrorCode::WouldBlock, +// 2 => ErrorCode::Already, +// 3 => ErrorCode::BadDescriptor, +// 4 => ErrorCode::Busy, +// 5 => ErrorCode::Deadlock, +// 6 => ErrorCode::Quota, +// 7 => ErrorCode::Exist, +// 8 => ErrorCode::FileTooLarge, +// 9 => ErrorCode::IllegalByteSequence, +// 10 => ErrorCode::InProgress, +// 11 => ErrorCode::Interrupted, +// 12 => ErrorCode::Invalid, +// 13 => ErrorCode::Io, +// 14 => ErrorCode::IsDirectory, +// 15 => ErrorCode::Loop, +// 16 => ErrorCode::TooManyLinks, +// 17 => ErrorCode::MessageSize, +// 18 => ErrorCode::NameTooLong, +// 19 => ErrorCode::NoDevice, +// 20 => ErrorCode::NoEntry, +// 21 => ErrorCode::NoLock, +// 22 => ErrorCode::InsufficientMemory, +// 23 => ErrorCode::InsufficientSpace, +// 24 => ErrorCode::NotDirectory, +// 25 => ErrorCode::NotEmpty, +// 26 => ErrorCode::NotRecoverable, +// 27 => ErrorCode::Unsupported, +// 28 => ErrorCode::NoTty, +// 29 => ErrorCode::NoSuchDevice, +// 30 => ErrorCode::Overflow, +// 31 => ErrorCode::NotPermitted, +// 32 => ErrorCode::Pipe, +// 33 => ErrorCode::ReadOnly, +// 34 => ErrorCode::InvalidSeek, +// 35 => ErrorCode::TextFileBusy, +// 36 => ErrorCode::CrossDevice, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::<_, ErrorCode>(i32::from( +// *((ptr0 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Adjust the size of an open file. If this increases the file's size, the +// /// extra bytes are filled with zeros. +// /// +// /// Note: This was called `fd_filestat_set_size` in earlier versions of WASI. +// pub fn set_size(this: Descriptor, size: Filesize) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:filesystem/filesystem")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "set-size")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:filesystem/filesystem_set-size" +// )] +// fn wit_import(_: i32, _: i64, _: i32); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// wit_bindgen::rt::as_i64(size), +// ptr0, +// ); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 1) as *const u8)) { +// 0 => ErrorCode::Access, +// 1 => ErrorCode::WouldBlock, +// 2 => ErrorCode::Already, +// 3 => ErrorCode::BadDescriptor, +// 4 => ErrorCode::Busy, +// 5 => ErrorCode::Deadlock, +// 6 => ErrorCode::Quota, +// 7 => ErrorCode::Exist, +// 8 => ErrorCode::FileTooLarge, +// 9 => ErrorCode::IllegalByteSequence, +// 10 => ErrorCode::InProgress, +// 11 => ErrorCode::Interrupted, +// 12 => ErrorCode::Invalid, +// 13 => ErrorCode::Io, +// 14 => ErrorCode::IsDirectory, +// 15 => ErrorCode::Loop, +// 16 => ErrorCode::TooManyLinks, +// 17 => ErrorCode::MessageSize, +// 18 => ErrorCode::NameTooLong, +// 19 => ErrorCode::NoDevice, +// 20 => ErrorCode::NoEntry, +// 21 => ErrorCode::NoLock, +// 22 => ErrorCode::InsufficientMemory, +// 23 => ErrorCode::InsufficientSpace, +// 24 => ErrorCode::NotDirectory, +// 25 => ErrorCode::NotEmpty, +// 26 => ErrorCode::NotRecoverable, +// 27 => ErrorCode::Unsupported, +// 28 => ErrorCode::NoTty, +// 29 => ErrorCode::NoSuchDevice, +// 30 => ErrorCode::Overflow, +// 31 => ErrorCode::NotPermitted, +// 32 => ErrorCode::Pipe, +// 33 => ErrorCode::ReadOnly, +// 34 => ErrorCode::InvalidSeek, +// 35 => ErrorCode::TextFileBusy, +// 36 => ErrorCode::CrossDevice, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::<_, ErrorCode>(i32::from( +// *((ptr0 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Adjust the timestamps of an open file or directory. +// /// +// /// Note: This is similar to `futimens` in POSIX. +// /// +// /// Note: This was called `fd_filestat_set_times` in earlier versions of WASI. +// pub fn set_times( +// this: Descriptor, +// data_access_timestamp: NewTimestamp, +// data_modification_timestamp: NewTimestamp, +// ) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let (result1_0, result1_1, result1_2) = match data_access_timestamp { +// NewTimestamp::NoChange => (0i32, 0i64, 0i32), +// NewTimestamp::Now => (1i32, 0i64, 0i32), +// NewTimestamp::Timestamp(e) => { +// let super::super::super::wasi::clocks::wall_clock::Datetime { +// seconds: seconds0, +// nanoseconds: nanoseconds0, +// } = e; - ( - 2i32, - wit_bindgen::rt::as_i64(seconds0), - wit_bindgen::rt::as_i32(nanoseconds0), - ) - } - }; - let (result3_0, result3_1, result3_2) = match data_modification_timestamp { - NewTimestamp::NoChange => (0i32, 0i64, 0i32), - NewTimestamp::Now => (1i32, 0i64, 0i32), - NewTimestamp::Timestamp(e) => { - let super::super::super::wasi::clocks::wall_clock::Datetime { - seconds: seconds2, - nanoseconds: nanoseconds2, - } = e; +// ( +// 2i32, +// wit_bindgen::rt::as_i64(seconds0), +// wit_bindgen::rt::as_i32(nanoseconds0), +// ) +// } +// }; +// let (result3_0, result3_1, result3_2) = match data_modification_timestamp { +// NewTimestamp::NoChange => (0i32, 0i64, 0i32), +// NewTimestamp::Now => (1i32, 0i64, 0i32), +// NewTimestamp::Timestamp(e) => { +// let super::super::super::wasi::clocks::wall_clock::Datetime { +// seconds: seconds2, +// nanoseconds: nanoseconds2, +// } = e; - ( - 2i32, - wit_bindgen::rt::as_i64(seconds2), - wit_bindgen::rt::as_i32(nanoseconds2), - ) - } - }; - let ptr4 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:filesystem/filesystem")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "set-times")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:filesystem/filesystem_set-times" - )] - fn wit_import( - _: i32, - _: i32, - _: i64, - _: i32, - _: i32, - _: i64, - _: i32, - _: i32, - ); - } - wit_import( - wit_bindgen::rt::as_i32(this), - result1_0, - result1_1, - result1_2, - result3_0, - result3_1, - result3_2, - ptr4, - ); - match i32::from(*((ptr4 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr4 + 1) as *const u8)) { - 0 => ErrorCode::Access, - 1 => ErrorCode::WouldBlock, - 2 => ErrorCode::Already, - 3 => ErrorCode::BadDescriptor, - 4 => ErrorCode::Busy, - 5 => ErrorCode::Deadlock, - 6 => ErrorCode::Quota, - 7 => ErrorCode::Exist, - 8 => ErrorCode::FileTooLarge, - 9 => ErrorCode::IllegalByteSequence, - 10 => ErrorCode::InProgress, - 11 => ErrorCode::Interrupted, - 12 => ErrorCode::Invalid, - 13 => ErrorCode::Io, - 14 => ErrorCode::IsDirectory, - 15 => ErrorCode::Loop, - 16 => ErrorCode::TooManyLinks, - 17 => ErrorCode::MessageSize, - 18 => ErrorCode::NameTooLong, - 19 => ErrorCode::NoDevice, - 20 => ErrorCode::NoEntry, - 21 => ErrorCode::NoLock, - 22 => ErrorCode::InsufficientMemory, - 23 => ErrorCode::InsufficientSpace, - 24 => ErrorCode::NotDirectory, - 25 => ErrorCode::NotEmpty, - 26 => ErrorCode::NotRecoverable, - 27 => ErrorCode::Unsupported, - 28 => ErrorCode::NoTty, - 29 => ErrorCode::NoSuchDevice, - 30 => ErrorCode::Overflow, - 31 => ErrorCode::NotPermitted, - 32 => ErrorCode::Pipe, - 33 => ErrorCode::ReadOnly, - 34 => ErrorCode::InvalidSeek, - 35 => ErrorCode::TextFileBusy, - 36 => ErrorCode::CrossDevice, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, ErrorCode>(i32::from( - *((ptr4 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Read from a descriptor, without using and updating the descriptor's offset. - /// - /// This function returns a list of bytes containing the data that was - /// read, along with a bool which, when true, indicates that the end of the - /// file was reached. The returned list will contain up to `length` bytes; it - /// may return fewer than requested, if the end of the file is reached or - /// if the I/O operation is interrupted. - /// - /// In the future, this may change to return a `stream`. - /// - /// Note: This is similar to `pread` in POSIX. - pub fn read( - this: Descriptor, - length: Filesize, - offset: Filesize, - ) -> Result<(wit_bindgen::rt::vec::Vec, bool), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(4))] - struct RetArea([u8; 16]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:filesystem/filesystem")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "read")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:filesystem/filesystem_read" - )] - fn wit_import(_: i32, _: i64, _: i64, _: i32); - } - wit_import( - wit_bindgen::rt::as_i32(this), - wit_bindgen::rt::as_i64(length), - wit_bindgen::rt::as_i64(offset), - ptr0, - ); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok({ - let len1 = *((ptr0 + 8) as *const i32) as usize; +// ( +// 2i32, +// wit_bindgen::rt::as_i64(seconds2), +// wit_bindgen::rt::as_i32(nanoseconds2), +// ) +// } +// }; +// let ptr4 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:filesystem/filesystem")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "set-times")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:filesystem/filesystem_set-times" +// )] +// fn wit_import( +// _: i32, +// _: i32, +// _: i64, +// _: i32, +// _: i32, +// _: i64, +// _: i32, +// _: i32, +// ); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// result1_0, +// result1_1, +// result1_2, +// result3_0, +// result3_1, +// result3_2, +// ptr4, +// ); +// match i32::from(*((ptr4 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr4 + 1) as *const u8)) { +// 0 => ErrorCode::Access, +// 1 => ErrorCode::WouldBlock, +// 2 => ErrorCode::Already, +// 3 => ErrorCode::BadDescriptor, +// 4 => ErrorCode::Busy, +// 5 => ErrorCode::Deadlock, +// 6 => ErrorCode::Quota, +// 7 => ErrorCode::Exist, +// 8 => ErrorCode::FileTooLarge, +// 9 => ErrorCode::IllegalByteSequence, +// 10 => ErrorCode::InProgress, +// 11 => ErrorCode::Interrupted, +// 12 => ErrorCode::Invalid, +// 13 => ErrorCode::Io, +// 14 => ErrorCode::IsDirectory, +// 15 => ErrorCode::Loop, +// 16 => ErrorCode::TooManyLinks, +// 17 => ErrorCode::MessageSize, +// 18 => ErrorCode::NameTooLong, +// 19 => ErrorCode::NoDevice, +// 20 => ErrorCode::NoEntry, +// 21 => ErrorCode::NoLock, +// 22 => ErrorCode::InsufficientMemory, +// 23 => ErrorCode::InsufficientSpace, +// 24 => ErrorCode::NotDirectory, +// 25 => ErrorCode::NotEmpty, +// 26 => ErrorCode::NotRecoverable, +// 27 => ErrorCode::Unsupported, +// 28 => ErrorCode::NoTty, +// 29 => ErrorCode::NoSuchDevice, +// 30 => ErrorCode::Overflow, +// 31 => ErrorCode::NotPermitted, +// 32 => ErrorCode::Pipe, +// 33 => ErrorCode::ReadOnly, +// 34 => ErrorCode::InvalidSeek, +// 35 => ErrorCode::TextFileBusy, +// 36 => ErrorCode::CrossDevice, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::<_, ErrorCode>(i32::from( +// *((ptr4 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Read from a descriptor, without using and updating the descriptor's offset. +// /// +// /// This function returns a list of bytes containing the data that was +// /// read, along with a bool which, when true, indicates that the end of the +// /// file was reached. The returned list will contain up to `length` bytes; it +// /// may return fewer than requested, if the end of the file is reached or +// /// if the I/O operation is interrupted. +// /// +// /// In the future, this may change to return a `stream`. +// /// +// /// Note: This is similar to `pread` in POSIX. +// pub fn read( +// this: Descriptor, +// length: Filesize, +// offset: Filesize, +// ) -> Result<(wit_bindgen::rt::vec::Vec, bool), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(4))] +// struct RetArea([u8; 16]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:filesystem/filesystem")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "read")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:filesystem/filesystem_read" +// )] +// fn wit_import(_: i32, _: i64, _: i64, _: i32); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// wit_bindgen::rt::as_i64(length), +// wit_bindgen::rt::as_i64(offset), +// ptr0, +// ); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok({ +// let len1 = *((ptr0 + 8) as *const i32) as usize; - ( - Vec::from_raw_parts( - *((ptr0 + 4) as *const i32) as *mut _, - len1, - len1, - ), - { - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::(i32::from( - *((ptr0 + 12) as *const u8), - ) - as u8) - } - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 12) as *const u8)) { - 0 => false, - 1 => true, - _ => panic!("invalid bool discriminant"), - } - } - }, - ) - }), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 4) as *const u8)) { - 0 => ErrorCode::Access, - 1 => ErrorCode::WouldBlock, - 2 => ErrorCode::Already, - 3 => ErrorCode::BadDescriptor, - 4 => ErrorCode::Busy, - 5 => ErrorCode::Deadlock, - 6 => ErrorCode::Quota, - 7 => ErrorCode::Exist, - 8 => ErrorCode::FileTooLarge, - 9 => ErrorCode::IllegalByteSequence, - 10 => ErrorCode::InProgress, - 11 => ErrorCode::Interrupted, - 12 => ErrorCode::Invalid, - 13 => ErrorCode::Io, - 14 => ErrorCode::IsDirectory, - 15 => ErrorCode::Loop, - 16 => ErrorCode::TooManyLinks, - 17 => ErrorCode::MessageSize, - 18 => ErrorCode::NameTooLong, - 19 => ErrorCode::NoDevice, - 20 => ErrorCode::NoEntry, - 21 => ErrorCode::NoLock, - 22 => ErrorCode::InsufficientMemory, - 23 => ErrorCode::InsufficientSpace, - 24 => ErrorCode::NotDirectory, - 25 => ErrorCode::NotEmpty, - 26 => ErrorCode::NotRecoverable, - 27 => ErrorCode::Unsupported, - 28 => ErrorCode::NoTty, - 29 => ErrorCode::NoSuchDevice, - 30 => ErrorCode::Overflow, - 31 => ErrorCode::NotPermitted, - 32 => ErrorCode::Pipe, - 33 => ErrorCode::ReadOnly, - 34 => ErrorCode::InvalidSeek, - 35 => ErrorCode::TextFileBusy, - 36 => ErrorCode::CrossDevice, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, ErrorCode>(i32::from( - *((ptr0 + 4) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Write to a descriptor, without using and updating the descriptor's offset. - /// - /// It is valid to write past the end of a file; the file is extended to the - /// extent of the write, with bytes between the previous end and the start of - /// the write set to zero. - /// - /// In the future, this may change to take a `stream`. - /// - /// Note: This is similar to `pwrite` in POSIX. - pub fn write( - this: Descriptor, - buffer: &[u8], - offset: Filesize, - ) -> Result { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(8))] - struct RetArea([u8; 16]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let vec0 = buffer; - let ptr0 = vec0.as_ptr() as i32; - let len0 = vec0.len() as i32; - let ptr1 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:filesystem/filesystem")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "write")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:filesystem/filesystem_write" - )] - fn wit_import(_: i32, _: i32, _: i32, _: i64, _: i32); - } - wit_import( - wit_bindgen::rt::as_i32(this), - ptr0, - len0, - wit_bindgen::rt::as_i64(offset), - ptr1, - ); - match i32::from(*((ptr1 + 0) as *const u8)) { - 0 => Ok(*((ptr1 + 8) as *const i64) as u64), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr1 + 8) as *const u8)) { - 0 => ErrorCode::Access, - 1 => ErrorCode::WouldBlock, - 2 => ErrorCode::Already, - 3 => ErrorCode::BadDescriptor, - 4 => ErrorCode::Busy, - 5 => ErrorCode::Deadlock, - 6 => ErrorCode::Quota, - 7 => ErrorCode::Exist, - 8 => ErrorCode::FileTooLarge, - 9 => ErrorCode::IllegalByteSequence, - 10 => ErrorCode::InProgress, - 11 => ErrorCode::Interrupted, - 12 => ErrorCode::Invalid, - 13 => ErrorCode::Io, - 14 => ErrorCode::IsDirectory, - 15 => ErrorCode::Loop, - 16 => ErrorCode::TooManyLinks, - 17 => ErrorCode::MessageSize, - 18 => ErrorCode::NameTooLong, - 19 => ErrorCode::NoDevice, - 20 => ErrorCode::NoEntry, - 21 => ErrorCode::NoLock, - 22 => ErrorCode::InsufficientMemory, - 23 => ErrorCode::InsufficientSpace, - 24 => ErrorCode::NotDirectory, - 25 => ErrorCode::NotEmpty, - 26 => ErrorCode::NotRecoverable, - 27 => ErrorCode::Unsupported, - 28 => ErrorCode::NoTty, - 29 => ErrorCode::NoSuchDevice, - 30 => ErrorCode::Overflow, - 31 => ErrorCode::NotPermitted, - 32 => ErrorCode::Pipe, - 33 => ErrorCode::ReadOnly, - 34 => ErrorCode::InvalidSeek, - 35 => ErrorCode::TextFileBusy, - 36 => ErrorCode::CrossDevice, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, ErrorCode>(i32::from( - *((ptr1 + 8) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Read directory entries from a directory. - /// - /// On filesystems where directories contain entries referring to themselves - /// and their parents, often named `.` and `..` respectively, these entries - /// are omitted. - /// - /// This always returns a new stream which starts at the beginning of the - /// directory. Multiple streams may be active on the same directory, and they - /// do not interfere with each other. - pub fn read_directory(this: Descriptor) -> Result { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(4))] - struct RetArea([u8; 8]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:filesystem/filesystem")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "read-directory")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:filesystem/filesystem_read-directory" - )] - fn wit_import(_: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(*((ptr0 + 4) as *const i32) as u32), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 4) as *const u8)) { - 0 => ErrorCode::Access, - 1 => ErrorCode::WouldBlock, - 2 => ErrorCode::Already, - 3 => ErrorCode::BadDescriptor, - 4 => ErrorCode::Busy, - 5 => ErrorCode::Deadlock, - 6 => ErrorCode::Quota, - 7 => ErrorCode::Exist, - 8 => ErrorCode::FileTooLarge, - 9 => ErrorCode::IllegalByteSequence, - 10 => ErrorCode::InProgress, - 11 => ErrorCode::Interrupted, - 12 => ErrorCode::Invalid, - 13 => ErrorCode::Io, - 14 => ErrorCode::IsDirectory, - 15 => ErrorCode::Loop, - 16 => ErrorCode::TooManyLinks, - 17 => ErrorCode::MessageSize, - 18 => ErrorCode::NameTooLong, - 19 => ErrorCode::NoDevice, - 20 => ErrorCode::NoEntry, - 21 => ErrorCode::NoLock, - 22 => ErrorCode::InsufficientMemory, - 23 => ErrorCode::InsufficientSpace, - 24 => ErrorCode::NotDirectory, - 25 => ErrorCode::NotEmpty, - 26 => ErrorCode::NotRecoverable, - 27 => ErrorCode::Unsupported, - 28 => ErrorCode::NoTty, - 29 => ErrorCode::NoSuchDevice, - 30 => ErrorCode::Overflow, - 31 => ErrorCode::NotPermitted, - 32 => ErrorCode::Pipe, - 33 => ErrorCode::ReadOnly, - 34 => ErrorCode::InvalidSeek, - 35 => ErrorCode::TextFileBusy, - 36 => ErrorCode::CrossDevice, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, ErrorCode>(i32::from( - *((ptr0 + 4) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Synchronize the data and metadata of a file to disk. - /// - /// This function succeeds with no effect if the file descriptor is not - /// opened for writing. - /// - /// Note: This is similar to `fsync` in POSIX. - pub fn sync(this: Descriptor) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:filesystem/filesystem")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "sync")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:filesystem/filesystem_sync" - )] - fn wit_import(_: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 1) as *const u8)) { - 0 => ErrorCode::Access, - 1 => ErrorCode::WouldBlock, - 2 => ErrorCode::Already, - 3 => ErrorCode::BadDescriptor, - 4 => ErrorCode::Busy, - 5 => ErrorCode::Deadlock, - 6 => ErrorCode::Quota, - 7 => ErrorCode::Exist, - 8 => ErrorCode::FileTooLarge, - 9 => ErrorCode::IllegalByteSequence, - 10 => ErrorCode::InProgress, - 11 => ErrorCode::Interrupted, - 12 => ErrorCode::Invalid, - 13 => ErrorCode::Io, - 14 => ErrorCode::IsDirectory, - 15 => ErrorCode::Loop, - 16 => ErrorCode::TooManyLinks, - 17 => ErrorCode::MessageSize, - 18 => ErrorCode::NameTooLong, - 19 => ErrorCode::NoDevice, - 20 => ErrorCode::NoEntry, - 21 => ErrorCode::NoLock, - 22 => ErrorCode::InsufficientMemory, - 23 => ErrorCode::InsufficientSpace, - 24 => ErrorCode::NotDirectory, - 25 => ErrorCode::NotEmpty, - 26 => ErrorCode::NotRecoverable, - 27 => ErrorCode::Unsupported, - 28 => ErrorCode::NoTty, - 29 => ErrorCode::NoSuchDevice, - 30 => ErrorCode::Overflow, - 31 => ErrorCode::NotPermitted, - 32 => ErrorCode::Pipe, - 33 => ErrorCode::ReadOnly, - 34 => ErrorCode::InvalidSeek, - 35 => ErrorCode::TextFileBusy, - 36 => ErrorCode::CrossDevice, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, ErrorCode>(i32::from( - *((ptr0 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Create a directory. - /// - /// Note: This is similar to `mkdirat` in POSIX. - pub fn create_directory_at(this: Descriptor, path: &str) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let vec0 = path; - let ptr0 = vec0.as_ptr() as i32; - let len0 = vec0.len() as i32; - let ptr1 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:filesystem/filesystem")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "create-directory-at")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:filesystem/filesystem_create-directory-at" - )] - fn wit_import(_: i32, _: i32, _: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0, len0, ptr1); - match i32::from(*((ptr1 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr1 + 1) as *const u8)) { - 0 => ErrorCode::Access, - 1 => ErrorCode::WouldBlock, - 2 => ErrorCode::Already, - 3 => ErrorCode::BadDescriptor, - 4 => ErrorCode::Busy, - 5 => ErrorCode::Deadlock, - 6 => ErrorCode::Quota, - 7 => ErrorCode::Exist, - 8 => ErrorCode::FileTooLarge, - 9 => ErrorCode::IllegalByteSequence, - 10 => ErrorCode::InProgress, - 11 => ErrorCode::Interrupted, - 12 => ErrorCode::Invalid, - 13 => ErrorCode::Io, - 14 => ErrorCode::IsDirectory, - 15 => ErrorCode::Loop, - 16 => ErrorCode::TooManyLinks, - 17 => ErrorCode::MessageSize, - 18 => ErrorCode::NameTooLong, - 19 => ErrorCode::NoDevice, - 20 => ErrorCode::NoEntry, - 21 => ErrorCode::NoLock, - 22 => ErrorCode::InsufficientMemory, - 23 => ErrorCode::InsufficientSpace, - 24 => ErrorCode::NotDirectory, - 25 => ErrorCode::NotEmpty, - 26 => ErrorCode::NotRecoverable, - 27 => ErrorCode::Unsupported, - 28 => ErrorCode::NoTty, - 29 => ErrorCode::NoSuchDevice, - 30 => ErrorCode::Overflow, - 31 => ErrorCode::NotPermitted, - 32 => ErrorCode::Pipe, - 33 => ErrorCode::ReadOnly, - 34 => ErrorCode::InvalidSeek, - 35 => ErrorCode::TextFileBusy, - 36 => ErrorCode::CrossDevice, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, ErrorCode>(i32::from( - *((ptr1 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Return the attributes of an open file or directory. - /// - /// Note: This is similar to `fstat` in POSIX. - /// - /// Note: This was called `fd_filestat_get` in earlier versions of WASI. - pub fn stat(this: Descriptor) -> Result { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(8))] - struct RetArea([u8; 96]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:filesystem/filesystem")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "stat")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:filesystem/filesystem_stat" - )] - fn wit_import(_: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(DescriptorStat { - device: *((ptr0 + 8) as *const i64) as u64, - inode: *((ptr0 + 16) as *const i64) as u64, - type_: { - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 24) as *const u8)) { - 0 => DescriptorType::Unknown, - 1 => DescriptorType::BlockDevice, - 2 => DescriptorType::CharacterDevice, - 3 => DescriptorType::Directory, - 4 => DescriptorType::Fifo, - 5 => DescriptorType::SymbolicLink, - 6 => DescriptorType::RegularFile, - 7 => DescriptorType::Socket, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, DescriptorType>(i32::from( - *((ptr0 + 24) as *const u8), - ) - as u8) - } - }, - link_count: *((ptr0 + 32) as *const i64) as u64, - size: *((ptr0 + 40) as *const i64) as u64, - data_access_timestamp: - super::super::super::wasi::clocks::wall_clock::Datetime { - seconds: *((ptr0 + 48) as *const i64) as u64, - nanoseconds: *((ptr0 + 56) as *const i32) as u32, - }, - data_modification_timestamp: - super::super::super::wasi::clocks::wall_clock::Datetime { - seconds: *((ptr0 + 64) as *const i64) as u64, - nanoseconds: *((ptr0 + 72) as *const i32) as u32, - }, - status_change_timestamp: - super::super::super::wasi::clocks::wall_clock::Datetime { - seconds: *((ptr0 + 80) as *const i64) as u64, - nanoseconds: *((ptr0 + 88) as *const i32) as u32, - }, - }), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 8) as *const u8)) { - 0 => ErrorCode::Access, - 1 => ErrorCode::WouldBlock, - 2 => ErrorCode::Already, - 3 => ErrorCode::BadDescriptor, - 4 => ErrorCode::Busy, - 5 => ErrorCode::Deadlock, - 6 => ErrorCode::Quota, - 7 => ErrorCode::Exist, - 8 => ErrorCode::FileTooLarge, - 9 => ErrorCode::IllegalByteSequence, - 10 => ErrorCode::InProgress, - 11 => ErrorCode::Interrupted, - 12 => ErrorCode::Invalid, - 13 => ErrorCode::Io, - 14 => ErrorCode::IsDirectory, - 15 => ErrorCode::Loop, - 16 => ErrorCode::TooManyLinks, - 17 => ErrorCode::MessageSize, - 18 => ErrorCode::NameTooLong, - 19 => ErrorCode::NoDevice, - 20 => ErrorCode::NoEntry, - 21 => ErrorCode::NoLock, - 22 => ErrorCode::InsufficientMemory, - 23 => ErrorCode::InsufficientSpace, - 24 => ErrorCode::NotDirectory, - 25 => ErrorCode::NotEmpty, - 26 => ErrorCode::NotRecoverable, - 27 => ErrorCode::Unsupported, - 28 => ErrorCode::NoTty, - 29 => ErrorCode::NoSuchDevice, - 30 => ErrorCode::Overflow, - 31 => ErrorCode::NotPermitted, - 32 => ErrorCode::Pipe, - 33 => ErrorCode::ReadOnly, - 34 => ErrorCode::InvalidSeek, - 35 => ErrorCode::TextFileBusy, - 36 => ErrorCode::CrossDevice, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, ErrorCode>(i32::from( - *((ptr0 + 8) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Return the attributes of a file or directory. - /// - /// Note: This is similar to `fstatat` in POSIX. - /// - /// Note: This was called `path_filestat_get` in earlier versions of WASI. - pub fn stat_at( - this: Descriptor, - path_flags: PathFlags, - path: &str, - ) -> Result { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(8))] - struct RetArea([u8; 96]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let flags0 = path_flags; - let vec1 = path; - let ptr1 = vec1.as_ptr() as i32; - let len1 = vec1.len() as i32; - let ptr2 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:filesystem/filesystem")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "stat-at")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:filesystem/filesystem_stat-at" - )] - fn wit_import(_: i32, _: i32, _: i32, _: i32, _: i32); - } - wit_import( - wit_bindgen::rt::as_i32(this), - (flags0.bits() >> 0) as i32, - ptr1, - len1, - ptr2, - ); - match i32::from(*((ptr2 + 0) as *const u8)) { - 0 => Ok(DescriptorStat { - device: *((ptr2 + 8) as *const i64) as u64, - inode: *((ptr2 + 16) as *const i64) as u64, - type_: { - #[cfg(debug_assertions)] - { - match i32::from(*((ptr2 + 24) as *const u8)) { - 0 => DescriptorType::Unknown, - 1 => DescriptorType::BlockDevice, - 2 => DescriptorType::CharacterDevice, - 3 => DescriptorType::Directory, - 4 => DescriptorType::Fifo, - 5 => DescriptorType::SymbolicLink, - 6 => DescriptorType::RegularFile, - 7 => DescriptorType::Socket, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, DescriptorType>(i32::from( - *((ptr2 + 24) as *const u8), - ) - as u8) - } - }, - link_count: *((ptr2 + 32) as *const i64) as u64, - size: *((ptr2 + 40) as *const i64) as u64, - data_access_timestamp: - super::super::super::wasi::clocks::wall_clock::Datetime { - seconds: *((ptr2 + 48) as *const i64) as u64, - nanoseconds: *((ptr2 + 56) as *const i32) as u32, - }, - data_modification_timestamp: - super::super::super::wasi::clocks::wall_clock::Datetime { - seconds: *((ptr2 + 64) as *const i64) as u64, - nanoseconds: *((ptr2 + 72) as *const i32) as u32, - }, - status_change_timestamp: - super::super::super::wasi::clocks::wall_clock::Datetime { - seconds: *((ptr2 + 80) as *const i64) as u64, - nanoseconds: *((ptr2 + 88) as *const i32) as u32, - }, - }), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr2 + 8) as *const u8)) { - 0 => ErrorCode::Access, - 1 => ErrorCode::WouldBlock, - 2 => ErrorCode::Already, - 3 => ErrorCode::BadDescriptor, - 4 => ErrorCode::Busy, - 5 => ErrorCode::Deadlock, - 6 => ErrorCode::Quota, - 7 => ErrorCode::Exist, - 8 => ErrorCode::FileTooLarge, - 9 => ErrorCode::IllegalByteSequence, - 10 => ErrorCode::InProgress, - 11 => ErrorCode::Interrupted, - 12 => ErrorCode::Invalid, - 13 => ErrorCode::Io, - 14 => ErrorCode::IsDirectory, - 15 => ErrorCode::Loop, - 16 => ErrorCode::TooManyLinks, - 17 => ErrorCode::MessageSize, - 18 => ErrorCode::NameTooLong, - 19 => ErrorCode::NoDevice, - 20 => ErrorCode::NoEntry, - 21 => ErrorCode::NoLock, - 22 => ErrorCode::InsufficientMemory, - 23 => ErrorCode::InsufficientSpace, - 24 => ErrorCode::NotDirectory, - 25 => ErrorCode::NotEmpty, - 26 => ErrorCode::NotRecoverable, - 27 => ErrorCode::Unsupported, - 28 => ErrorCode::NoTty, - 29 => ErrorCode::NoSuchDevice, - 30 => ErrorCode::Overflow, - 31 => ErrorCode::NotPermitted, - 32 => ErrorCode::Pipe, - 33 => ErrorCode::ReadOnly, - 34 => ErrorCode::InvalidSeek, - 35 => ErrorCode::TextFileBusy, - 36 => ErrorCode::CrossDevice, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, ErrorCode>(i32::from( - *((ptr2 + 8) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Adjust the timestamps of a file or directory. - /// - /// Note: This is similar to `utimensat` in POSIX. - /// - /// Note: This was called `path_filestat_set_times` in earlier versions of - /// WASI. - pub fn set_times_at( - this: Descriptor, - path_flags: PathFlags, - path: &str, - data_access_timestamp: NewTimestamp, - data_modification_timestamp: NewTimestamp, - ) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let flags0 = path_flags; - let vec1 = path; - let ptr1 = vec1.as_ptr() as i32; - let len1 = vec1.len() as i32; - let (result3_0, result3_1, result3_2) = match data_access_timestamp { - NewTimestamp::NoChange => (0i32, 0i64, 0i32), - NewTimestamp::Now => (1i32, 0i64, 0i32), - NewTimestamp::Timestamp(e) => { - let super::super::super::wasi::clocks::wall_clock::Datetime { - seconds: seconds2, - nanoseconds: nanoseconds2, - } = e; +// ( +// Vec::from_raw_parts( +// *((ptr0 + 4) as *const i32) as *mut _, +// len1, +// len1, +// ), +// { +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::(i32::from( +// *((ptr0 + 12) as *const u8), +// ) +// as u8) +// } +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 12) as *const u8)) { +// 0 => false, +// 1 => true, +// _ => panic!("invalid bool discriminant"), +// } +// } +// }, +// ) +// }), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 4) as *const u8)) { +// 0 => ErrorCode::Access, +// 1 => ErrorCode::WouldBlock, +// 2 => ErrorCode::Already, +// 3 => ErrorCode::BadDescriptor, +// 4 => ErrorCode::Busy, +// 5 => ErrorCode::Deadlock, +// 6 => ErrorCode::Quota, +// 7 => ErrorCode::Exist, +// 8 => ErrorCode::FileTooLarge, +// 9 => ErrorCode::IllegalByteSequence, +// 10 => ErrorCode::InProgress, +// 11 => ErrorCode::Interrupted, +// 12 => ErrorCode::Invalid, +// 13 => ErrorCode::Io, +// 14 => ErrorCode::IsDirectory, +// 15 => ErrorCode::Loop, +// 16 => ErrorCode::TooManyLinks, +// 17 => ErrorCode::MessageSize, +// 18 => ErrorCode::NameTooLong, +// 19 => ErrorCode::NoDevice, +// 20 => ErrorCode::NoEntry, +// 21 => ErrorCode::NoLock, +// 22 => ErrorCode::InsufficientMemory, +// 23 => ErrorCode::InsufficientSpace, +// 24 => ErrorCode::NotDirectory, +// 25 => ErrorCode::NotEmpty, +// 26 => ErrorCode::NotRecoverable, +// 27 => ErrorCode::Unsupported, +// 28 => ErrorCode::NoTty, +// 29 => ErrorCode::NoSuchDevice, +// 30 => ErrorCode::Overflow, +// 31 => ErrorCode::NotPermitted, +// 32 => ErrorCode::Pipe, +// 33 => ErrorCode::ReadOnly, +// 34 => ErrorCode::InvalidSeek, +// 35 => ErrorCode::TextFileBusy, +// 36 => ErrorCode::CrossDevice, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::<_, ErrorCode>(i32::from( +// *((ptr0 + 4) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Write to a descriptor, without using and updating the descriptor's offset. +// /// +// /// It is valid to write past the end of a file; the file is extended to the +// /// extent of the write, with bytes between the previous end and the start of +// /// the write set to zero. +// /// +// /// In the future, this may change to take a `stream`. +// /// +// /// Note: This is similar to `pwrite` in POSIX. +// pub fn write( +// this: Descriptor, +// buffer: &[u8], +// offset: Filesize, +// ) -> Result { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(8))] +// struct RetArea([u8; 16]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let vec0 = buffer; +// let ptr0 = vec0.as_ptr() as i32; +// let len0 = vec0.len() as i32; +// let ptr1 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:filesystem/filesystem")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "write")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:filesystem/filesystem_write" +// )] +// fn wit_import(_: i32, _: i32, _: i32, _: i64, _: i32); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// ptr0, +// len0, +// wit_bindgen::rt::as_i64(offset), +// ptr1, +// ); +// match i32::from(*((ptr1 + 0) as *const u8)) { +// 0 => Ok(*((ptr1 + 8) as *const i64) as u64), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr1 + 8) as *const u8)) { +// 0 => ErrorCode::Access, +// 1 => ErrorCode::WouldBlock, +// 2 => ErrorCode::Already, +// 3 => ErrorCode::BadDescriptor, +// 4 => ErrorCode::Busy, +// 5 => ErrorCode::Deadlock, +// 6 => ErrorCode::Quota, +// 7 => ErrorCode::Exist, +// 8 => ErrorCode::FileTooLarge, +// 9 => ErrorCode::IllegalByteSequence, +// 10 => ErrorCode::InProgress, +// 11 => ErrorCode::Interrupted, +// 12 => ErrorCode::Invalid, +// 13 => ErrorCode::Io, +// 14 => ErrorCode::IsDirectory, +// 15 => ErrorCode::Loop, +// 16 => ErrorCode::TooManyLinks, +// 17 => ErrorCode::MessageSize, +// 18 => ErrorCode::NameTooLong, +// 19 => ErrorCode::NoDevice, +// 20 => ErrorCode::NoEntry, +// 21 => ErrorCode::NoLock, +// 22 => ErrorCode::InsufficientMemory, +// 23 => ErrorCode::InsufficientSpace, +// 24 => ErrorCode::NotDirectory, +// 25 => ErrorCode::NotEmpty, +// 26 => ErrorCode::NotRecoverable, +// 27 => ErrorCode::Unsupported, +// 28 => ErrorCode::NoTty, +// 29 => ErrorCode::NoSuchDevice, +// 30 => ErrorCode::Overflow, +// 31 => ErrorCode::NotPermitted, +// 32 => ErrorCode::Pipe, +// 33 => ErrorCode::ReadOnly, +// 34 => ErrorCode::InvalidSeek, +// 35 => ErrorCode::TextFileBusy, +// 36 => ErrorCode::CrossDevice, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::<_, ErrorCode>(i32::from( +// *((ptr1 + 8) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Read directory entries from a directory. +// /// +// /// On filesystems where directories contain entries referring to themselves +// /// and their parents, often named `.` and `..` respectively, these entries +// /// are omitted. +// /// +// /// This always returns a new stream which starts at the beginning of the +// /// directory. Multiple streams may be active on the same directory, and they +// /// do not interfere with each other. +// pub fn read_directory(this: Descriptor) -> Result { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(4))] +// struct RetArea([u8; 8]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:filesystem/filesystem")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "read-directory")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:filesystem/filesystem_read-directory" +// )] +// fn wit_import(_: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(*((ptr0 + 4) as *const i32) as u32), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 4) as *const u8)) { +// 0 => ErrorCode::Access, +// 1 => ErrorCode::WouldBlock, +// 2 => ErrorCode::Already, +// 3 => ErrorCode::BadDescriptor, +// 4 => ErrorCode::Busy, +// 5 => ErrorCode::Deadlock, +// 6 => ErrorCode::Quota, +// 7 => ErrorCode::Exist, +// 8 => ErrorCode::FileTooLarge, +// 9 => ErrorCode::IllegalByteSequence, +// 10 => ErrorCode::InProgress, +// 11 => ErrorCode::Interrupted, +// 12 => ErrorCode::Invalid, +// 13 => ErrorCode::Io, +// 14 => ErrorCode::IsDirectory, +// 15 => ErrorCode::Loop, +// 16 => ErrorCode::TooManyLinks, +// 17 => ErrorCode::MessageSize, +// 18 => ErrorCode::NameTooLong, +// 19 => ErrorCode::NoDevice, +// 20 => ErrorCode::NoEntry, +// 21 => ErrorCode::NoLock, +// 22 => ErrorCode::InsufficientMemory, +// 23 => ErrorCode::InsufficientSpace, +// 24 => ErrorCode::NotDirectory, +// 25 => ErrorCode::NotEmpty, +// 26 => ErrorCode::NotRecoverable, +// 27 => ErrorCode::Unsupported, +// 28 => ErrorCode::NoTty, +// 29 => ErrorCode::NoSuchDevice, +// 30 => ErrorCode::Overflow, +// 31 => ErrorCode::NotPermitted, +// 32 => ErrorCode::Pipe, +// 33 => ErrorCode::ReadOnly, +// 34 => ErrorCode::InvalidSeek, +// 35 => ErrorCode::TextFileBusy, +// 36 => ErrorCode::CrossDevice, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::<_, ErrorCode>(i32::from( +// *((ptr0 + 4) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Synchronize the data and metadata of a file to disk. +// /// +// /// This function succeeds with no effect if the file descriptor is not +// /// opened for writing. +// /// +// /// Note: This is similar to `fsync` in POSIX. +// pub fn sync(this: Descriptor) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:filesystem/filesystem")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "sync")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:filesystem/filesystem_sync" +// )] +// fn wit_import(_: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 1) as *const u8)) { +// 0 => ErrorCode::Access, +// 1 => ErrorCode::WouldBlock, +// 2 => ErrorCode::Already, +// 3 => ErrorCode::BadDescriptor, +// 4 => ErrorCode::Busy, +// 5 => ErrorCode::Deadlock, +// 6 => ErrorCode::Quota, +// 7 => ErrorCode::Exist, +// 8 => ErrorCode::FileTooLarge, +// 9 => ErrorCode::IllegalByteSequence, +// 10 => ErrorCode::InProgress, +// 11 => ErrorCode::Interrupted, +// 12 => ErrorCode::Invalid, +// 13 => ErrorCode::Io, +// 14 => ErrorCode::IsDirectory, +// 15 => ErrorCode::Loop, +// 16 => ErrorCode::TooManyLinks, +// 17 => ErrorCode::MessageSize, +// 18 => ErrorCode::NameTooLong, +// 19 => ErrorCode::NoDevice, +// 20 => ErrorCode::NoEntry, +// 21 => ErrorCode::NoLock, +// 22 => ErrorCode::InsufficientMemory, +// 23 => ErrorCode::InsufficientSpace, +// 24 => ErrorCode::NotDirectory, +// 25 => ErrorCode::NotEmpty, +// 26 => ErrorCode::NotRecoverable, +// 27 => ErrorCode::Unsupported, +// 28 => ErrorCode::NoTty, +// 29 => ErrorCode::NoSuchDevice, +// 30 => ErrorCode::Overflow, +// 31 => ErrorCode::NotPermitted, +// 32 => ErrorCode::Pipe, +// 33 => ErrorCode::ReadOnly, +// 34 => ErrorCode::InvalidSeek, +// 35 => ErrorCode::TextFileBusy, +// 36 => ErrorCode::CrossDevice, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::<_, ErrorCode>(i32::from( +// *((ptr0 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Create a directory. +// /// +// /// Note: This is similar to `mkdirat` in POSIX. +// pub fn create_directory_at(this: Descriptor, path: &str) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let vec0 = path; +// let ptr0 = vec0.as_ptr() as i32; +// let len0 = vec0.len() as i32; +// let ptr1 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:filesystem/filesystem")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "create-directory-at")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:filesystem/filesystem_create-directory-at" +// )] +// fn wit_import(_: i32, _: i32, _: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0, len0, ptr1); +// match i32::from(*((ptr1 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr1 + 1) as *const u8)) { +// 0 => ErrorCode::Access, +// 1 => ErrorCode::WouldBlock, +// 2 => ErrorCode::Already, +// 3 => ErrorCode::BadDescriptor, +// 4 => ErrorCode::Busy, +// 5 => ErrorCode::Deadlock, +// 6 => ErrorCode::Quota, +// 7 => ErrorCode::Exist, +// 8 => ErrorCode::FileTooLarge, +// 9 => ErrorCode::IllegalByteSequence, +// 10 => ErrorCode::InProgress, +// 11 => ErrorCode::Interrupted, +// 12 => ErrorCode::Invalid, +// 13 => ErrorCode::Io, +// 14 => ErrorCode::IsDirectory, +// 15 => ErrorCode::Loop, +// 16 => ErrorCode::TooManyLinks, +// 17 => ErrorCode::MessageSize, +// 18 => ErrorCode::NameTooLong, +// 19 => ErrorCode::NoDevice, +// 20 => ErrorCode::NoEntry, +// 21 => ErrorCode::NoLock, +// 22 => ErrorCode::InsufficientMemory, +// 23 => ErrorCode::InsufficientSpace, +// 24 => ErrorCode::NotDirectory, +// 25 => ErrorCode::NotEmpty, +// 26 => ErrorCode::NotRecoverable, +// 27 => ErrorCode::Unsupported, +// 28 => ErrorCode::NoTty, +// 29 => ErrorCode::NoSuchDevice, +// 30 => ErrorCode::Overflow, +// 31 => ErrorCode::NotPermitted, +// 32 => ErrorCode::Pipe, +// 33 => ErrorCode::ReadOnly, +// 34 => ErrorCode::InvalidSeek, +// 35 => ErrorCode::TextFileBusy, +// 36 => ErrorCode::CrossDevice, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::<_, ErrorCode>(i32::from( +// *((ptr1 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Return the attributes of an open file or directory. +// /// +// /// Note: This is similar to `fstat` in POSIX. +// /// +// /// Note: This was called `fd_filestat_get` in earlier versions of WASI. +// pub fn stat(this: Descriptor) -> Result { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(8))] +// struct RetArea([u8; 96]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:filesystem/filesystem")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "stat")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:filesystem/filesystem_stat" +// )] +// fn wit_import(_: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(DescriptorStat { +// device: *((ptr0 + 8) as *const i64) as u64, +// inode: *((ptr0 + 16) as *const i64) as u64, +// type_: { +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 24) as *const u8)) { +// 0 => DescriptorType::Unknown, +// 1 => DescriptorType::BlockDevice, +// 2 => DescriptorType::CharacterDevice, +// 3 => DescriptorType::Directory, +// 4 => DescriptorType::Fifo, +// 5 => DescriptorType::SymbolicLink, +// 6 => DescriptorType::RegularFile, +// 7 => DescriptorType::Socket, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::<_, DescriptorType>(i32::from( +// *((ptr0 + 24) as *const u8), +// ) +// as u8) +// } +// }, +// link_count: *((ptr0 + 32) as *const i64) as u64, +// size: *((ptr0 + 40) as *const i64) as u64, +// data_access_timestamp: +// super::super::super::wasi::clocks::wall_clock::Datetime { +// seconds: *((ptr0 + 48) as *const i64) as u64, +// nanoseconds: *((ptr0 + 56) as *const i32) as u32, +// }, +// data_modification_timestamp: +// super::super::super::wasi::clocks::wall_clock::Datetime { +// seconds: *((ptr0 + 64) as *const i64) as u64, +// nanoseconds: *((ptr0 + 72) as *const i32) as u32, +// }, +// status_change_timestamp: +// super::super::super::wasi::clocks::wall_clock::Datetime { +// seconds: *((ptr0 + 80) as *const i64) as u64, +// nanoseconds: *((ptr0 + 88) as *const i32) as u32, +// }, +// }), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 8) as *const u8)) { +// 0 => ErrorCode::Access, +// 1 => ErrorCode::WouldBlock, +// 2 => ErrorCode::Already, +// 3 => ErrorCode::BadDescriptor, +// 4 => ErrorCode::Busy, +// 5 => ErrorCode::Deadlock, +// 6 => ErrorCode::Quota, +// 7 => ErrorCode::Exist, +// 8 => ErrorCode::FileTooLarge, +// 9 => ErrorCode::IllegalByteSequence, +// 10 => ErrorCode::InProgress, +// 11 => ErrorCode::Interrupted, +// 12 => ErrorCode::Invalid, +// 13 => ErrorCode::Io, +// 14 => ErrorCode::IsDirectory, +// 15 => ErrorCode::Loop, +// 16 => ErrorCode::TooManyLinks, +// 17 => ErrorCode::MessageSize, +// 18 => ErrorCode::NameTooLong, +// 19 => ErrorCode::NoDevice, +// 20 => ErrorCode::NoEntry, +// 21 => ErrorCode::NoLock, +// 22 => ErrorCode::InsufficientMemory, +// 23 => ErrorCode::InsufficientSpace, +// 24 => ErrorCode::NotDirectory, +// 25 => ErrorCode::NotEmpty, +// 26 => ErrorCode::NotRecoverable, +// 27 => ErrorCode::Unsupported, +// 28 => ErrorCode::NoTty, +// 29 => ErrorCode::NoSuchDevice, +// 30 => ErrorCode::Overflow, +// 31 => ErrorCode::NotPermitted, +// 32 => ErrorCode::Pipe, +// 33 => ErrorCode::ReadOnly, +// 34 => ErrorCode::InvalidSeek, +// 35 => ErrorCode::TextFileBusy, +// 36 => ErrorCode::CrossDevice, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::<_, ErrorCode>(i32::from( +// *((ptr0 + 8) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Return the attributes of a file or directory. +// /// +// /// Note: This is similar to `fstatat` in POSIX. +// /// +// /// Note: This was called `path_filestat_get` in earlier versions of WASI. +// pub fn stat_at( +// this: Descriptor, +// path_flags: PathFlags, +// path: &str, +// ) -> Result { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(8))] +// struct RetArea([u8; 96]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let flags0 = path_flags; +// let vec1 = path; +// let ptr1 = vec1.as_ptr() as i32; +// let len1 = vec1.len() as i32; +// let ptr2 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:filesystem/filesystem")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "stat-at")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:filesystem/filesystem_stat-at" +// )] +// fn wit_import(_: i32, _: i32, _: i32, _: i32, _: i32); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// (flags0.bits() >> 0) as i32, +// ptr1, +// len1, +// ptr2, +// ); +// match i32::from(*((ptr2 + 0) as *const u8)) { +// 0 => Ok(DescriptorStat { +// device: *((ptr2 + 8) as *const i64) as u64, +// inode: *((ptr2 + 16) as *const i64) as u64, +// type_: { +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr2 + 24) as *const u8)) { +// 0 => DescriptorType::Unknown, +// 1 => DescriptorType::BlockDevice, +// 2 => DescriptorType::CharacterDevice, +// 3 => DescriptorType::Directory, +// 4 => DescriptorType::Fifo, +// 5 => DescriptorType::SymbolicLink, +// 6 => DescriptorType::RegularFile, +// 7 => DescriptorType::Socket, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::<_, DescriptorType>(i32::from( +// *((ptr2 + 24) as *const u8), +// ) +// as u8) +// } +// }, +// link_count: *((ptr2 + 32) as *const i64) as u64, +// size: *((ptr2 + 40) as *const i64) as u64, +// data_access_timestamp: +// super::super::super::wasi::clocks::wall_clock::Datetime { +// seconds: *((ptr2 + 48) as *const i64) as u64, +// nanoseconds: *((ptr2 + 56) as *const i32) as u32, +// }, +// data_modification_timestamp: +// super::super::super::wasi::clocks::wall_clock::Datetime { +// seconds: *((ptr2 + 64) as *const i64) as u64, +// nanoseconds: *((ptr2 + 72) as *const i32) as u32, +// }, +// status_change_timestamp: +// super::super::super::wasi::clocks::wall_clock::Datetime { +// seconds: *((ptr2 + 80) as *const i64) as u64, +// nanoseconds: *((ptr2 + 88) as *const i32) as u32, +// }, +// }), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr2 + 8) as *const u8)) { +// 0 => ErrorCode::Access, +// 1 => ErrorCode::WouldBlock, +// 2 => ErrorCode::Already, +// 3 => ErrorCode::BadDescriptor, +// 4 => ErrorCode::Busy, +// 5 => ErrorCode::Deadlock, +// 6 => ErrorCode::Quota, +// 7 => ErrorCode::Exist, +// 8 => ErrorCode::FileTooLarge, +// 9 => ErrorCode::IllegalByteSequence, +// 10 => ErrorCode::InProgress, +// 11 => ErrorCode::Interrupted, +// 12 => ErrorCode::Invalid, +// 13 => ErrorCode::Io, +// 14 => ErrorCode::IsDirectory, +// 15 => ErrorCode::Loop, +// 16 => ErrorCode::TooManyLinks, +// 17 => ErrorCode::MessageSize, +// 18 => ErrorCode::NameTooLong, +// 19 => ErrorCode::NoDevice, +// 20 => ErrorCode::NoEntry, +// 21 => ErrorCode::NoLock, +// 22 => ErrorCode::InsufficientMemory, +// 23 => ErrorCode::InsufficientSpace, +// 24 => ErrorCode::NotDirectory, +// 25 => ErrorCode::NotEmpty, +// 26 => ErrorCode::NotRecoverable, +// 27 => ErrorCode::Unsupported, +// 28 => ErrorCode::NoTty, +// 29 => ErrorCode::NoSuchDevice, +// 30 => ErrorCode::Overflow, +// 31 => ErrorCode::NotPermitted, +// 32 => ErrorCode::Pipe, +// 33 => ErrorCode::ReadOnly, +// 34 => ErrorCode::InvalidSeek, +// 35 => ErrorCode::TextFileBusy, +// 36 => ErrorCode::CrossDevice, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::<_, ErrorCode>(i32::from( +// *((ptr2 + 8) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Adjust the timestamps of a file or directory. +// /// +// /// Note: This is similar to `utimensat` in POSIX. +// /// +// /// Note: This was called `path_filestat_set_times` in earlier versions of +// /// WASI. +// pub fn set_times_at( +// this: Descriptor, +// path_flags: PathFlags, +// path: &str, +// data_access_timestamp: NewTimestamp, +// data_modification_timestamp: NewTimestamp, +// ) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let flags0 = path_flags; +// let vec1 = path; +// let ptr1 = vec1.as_ptr() as i32; +// let len1 = vec1.len() as i32; +// let (result3_0, result3_1, result3_2) = match data_access_timestamp { +// NewTimestamp::NoChange => (0i32, 0i64, 0i32), +// NewTimestamp::Now => (1i32, 0i64, 0i32), +// NewTimestamp::Timestamp(e) => { +// let super::super::super::wasi::clocks::wall_clock::Datetime { +// seconds: seconds2, +// nanoseconds: nanoseconds2, +// } = e; - ( - 2i32, - wit_bindgen::rt::as_i64(seconds2), - wit_bindgen::rt::as_i32(nanoseconds2), - ) - } - }; - let (result5_0, result5_1, result5_2) = match data_modification_timestamp { - NewTimestamp::NoChange => (0i32, 0i64, 0i32), - NewTimestamp::Now => (1i32, 0i64, 0i32), - NewTimestamp::Timestamp(e) => { - let super::super::super::wasi::clocks::wall_clock::Datetime { - seconds: seconds4, - nanoseconds: nanoseconds4, - } = e; +// ( +// 2i32, +// wit_bindgen::rt::as_i64(seconds2), +// wit_bindgen::rt::as_i32(nanoseconds2), +// ) +// } +// }; +// let (result5_0, result5_1, result5_2) = match data_modification_timestamp { +// NewTimestamp::NoChange => (0i32, 0i64, 0i32), +// NewTimestamp::Now => (1i32, 0i64, 0i32), +// NewTimestamp::Timestamp(e) => { +// let super::super::super::wasi::clocks::wall_clock::Datetime { +// seconds: seconds4, +// nanoseconds: nanoseconds4, +// } = e; - ( - 2i32, - wit_bindgen::rt::as_i64(seconds4), - wit_bindgen::rt::as_i32(nanoseconds4), - ) - } - }; - let ptr6 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:filesystem/filesystem")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "set-times-at")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:filesystem/filesystem_set-times-at" - )] - fn wit_import( - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i64, - _: i32, - _: i32, - _: i64, - _: i32, - _: i32, - ); - } - wit_import( - wit_bindgen::rt::as_i32(this), - (flags0.bits() >> 0) as i32, - ptr1, - len1, - result3_0, - result3_1, - result3_2, - result5_0, - result5_1, - result5_2, - ptr6, - ); - match i32::from(*((ptr6 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr6 + 1) as *const u8)) { - 0 => ErrorCode::Access, - 1 => ErrorCode::WouldBlock, - 2 => ErrorCode::Already, - 3 => ErrorCode::BadDescriptor, - 4 => ErrorCode::Busy, - 5 => ErrorCode::Deadlock, - 6 => ErrorCode::Quota, - 7 => ErrorCode::Exist, - 8 => ErrorCode::FileTooLarge, - 9 => ErrorCode::IllegalByteSequence, - 10 => ErrorCode::InProgress, - 11 => ErrorCode::Interrupted, - 12 => ErrorCode::Invalid, - 13 => ErrorCode::Io, - 14 => ErrorCode::IsDirectory, - 15 => ErrorCode::Loop, - 16 => ErrorCode::TooManyLinks, - 17 => ErrorCode::MessageSize, - 18 => ErrorCode::NameTooLong, - 19 => ErrorCode::NoDevice, - 20 => ErrorCode::NoEntry, - 21 => ErrorCode::NoLock, - 22 => ErrorCode::InsufficientMemory, - 23 => ErrorCode::InsufficientSpace, - 24 => ErrorCode::NotDirectory, - 25 => ErrorCode::NotEmpty, - 26 => ErrorCode::NotRecoverable, - 27 => ErrorCode::Unsupported, - 28 => ErrorCode::NoTty, - 29 => ErrorCode::NoSuchDevice, - 30 => ErrorCode::Overflow, - 31 => ErrorCode::NotPermitted, - 32 => ErrorCode::Pipe, - 33 => ErrorCode::ReadOnly, - 34 => ErrorCode::InvalidSeek, - 35 => ErrorCode::TextFileBusy, - 36 => ErrorCode::CrossDevice, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, ErrorCode>(i32::from( - *((ptr6 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Create a hard link. - /// - /// Note: This is similar to `linkat` in POSIX. - pub fn link_at( - this: Descriptor, - old_path_flags: PathFlags, - old_path: &str, - new_descriptor: Descriptor, - new_path: &str, - ) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let flags0 = old_path_flags; - let vec1 = old_path; - let ptr1 = vec1.as_ptr() as i32; - let len1 = vec1.len() as i32; - let vec2 = new_path; - let ptr2 = vec2.as_ptr() as i32; - let len2 = vec2.len() as i32; - let ptr3 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:filesystem/filesystem")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "link-at")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:filesystem/filesystem_link-at" - )] - fn wit_import( - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - ); - } - wit_import( - wit_bindgen::rt::as_i32(this), - (flags0.bits() >> 0) as i32, - ptr1, - len1, - wit_bindgen::rt::as_i32(new_descriptor), - ptr2, - len2, - ptr3, - ); - match i32::from(*((ptr3 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr3 + 1) as *const u8)) { - 0 => ErrorCode::Access, - 1 => ErrorCode::WouldBlock, - 2 => ErrorCode::Already, - 3 => ErrorCode::BadDescriptor, - 4 => ErrorCode::Busy, - 5 => ErrorCode::Deadlock, - 6 => ErrorCode::Quota, - 7 => ErrorCode::Exist, - 8 => ErrorCode::FileTooLarge, - 9 => ErrorCode::IllegalByteSequence, - 10 => ErrorCode::InProgress, - 11 => ErrorCode::Interrupted, - 12 => ErrorCode::Invalid, - 13 => ErrorCode::Io, - 14 => ErrorCode::IsDirectory, - 15 => ErrorCode::Loop, - 16 => ErrorCode::TooManyLinks, - 17 => ErrorCode::MessageSize, - 18 => ErrorCode::NameTooLong, - 19 => ErrorCode::NoDevice, - 20 => ErrorCode::NoEntry, - 21 => ErrorCode::NoLock, - 22 => ErrorCode::InsufficientMemory, - 23 => ErrorCode::InsufficientSpace, - 24 => ErrorCode::NotDirectory, - 25 => ErrorCode::NotEmpty, - 26 => ErrorCode::NotRecoverable, - 27 => ErrorCode::Unsupported, - 28 => ErrorCode::NoTty, - 29 => ErrorCode::NoSuchDevice, - 30 => ErrorCode::Overflow, - 31 => ErrorCode::NotPermitted, - 32 => ErrorCode::Pipe, - 33 => ErrorCode::ReadOnly, - 34 => ErrorCode::InvalidSeek, - 35 => ErrorCode::TextFileBusy, - 36 => ErrorCode::CrossDevice, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, ErrorCode>(i32::from( - *((ptr3 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Open a file or directory. - /// - /// The returned descriptor is not guaranteed to be the lowest-numbered - /// descriptor not currently open/ it is randomized to prevent applications - /// from depending on making assumptions about indexes, since this is - /// error-prone in multi-threaded contexts. The returned descriptor is - /// guaranteed to be less than 2**31. - /// - /// If `flags` contains `descriptor-flags::mutate-directory`, and the base - /// descriptor doesn't have `descriptor-flags::mutate-directory` set, - /// `open-at` fails with `error-code::read-only`. - /// - /// If `flags` contains `write` or `mutate-directory`, or `open-flags` - /// contains `truncate` or `create`, and the base descriptor doesn't have - /// `descriptor-flags::mutate-directory` set, `open-at` fails with - /// `error-code::read-only`. - /// - /// Note: This is similar to `openat` in POSIX. - pub fn open_at( - this: Descriptor, - path_flags: PathFlags, - path: &str, - open_flags: OpenFlags, - flags: DescriptorFlags, - modes: Modes, - ) -> Result { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(4))] - struct RetArea([u8; 8]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let flags0 = path_flags; - let vec1 = path; - let ptr1 = vec1.as_ptr() as i32; - let len1 = vec1.len() as i32; - let flags2 = open_flags; - let flags3 = flags; - let flags4 = modes; - let ptr5 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:filesystem/filesystem")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "open-at")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:filesystem/filesystem_open-at" - )] - fn wit_import( - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - ); - } - wit_import( - wit_bindgen::rt::as_i32(this), - (flags0.bits() >> 0) as i32, - ptr1, - len1, - (flags2.bits() >> 0) as i32, - (flags3.bits() >> 0) as i32, - (flags4.bits() >> 0) as i32, - ptr5, - ); - match i32::from(*((ptr5 + 0) as *const u8)) { - 0 => Ok(*((ptr5 + 4) as *const i32) as u32), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr5 + 4) as *const u8)) { - 0 => ErrorCode::Access, - 1 => ErrorCode::WouldBlock, - 2 => ErrorCode::Already, - 3 => ErrorCode::BadDescriptor, - 4 => ErrorCode::Busy, - 5 => ErrorCode::Deadlock, - 6 => ErrorCode::Quota, - 7 => ErrorCode::Exist, - 8 => ErrorCode::FileTooLarge, - 9 => ErrorCode::IllegalByteSequence, - 10 => ErrorCode::InProgress, - 11 => ErrorCode::Interrupted, - 12 => ErrorCode::Invalid, - 13 => ErrorCode::Io, - 14 => ErrorCode::IsDirectory, - 15 => ErrorCode::Loop, - 16 => ErrorCode::TooManyLinks, - 17 => ErrorCode::MessageSize, - 18 => ErrorCode::NameTooLong, - 19 => ErrorCode::NoDevice, - 20 => ErrorCode::NoEntry, - 21 => ErrorCode::NoLock, - 22 => ErrorCode::InsufficientMemory, - 23 => ErrorCode::InsufficientSpace, - 24 => ErrorCode::NotDirectory, - 25 => ErrorCode::NotEmpty, - 26 => ErrorCode::NotRecoverable, - 27 => ErrorCode::Unsupported, - 28 => ErrorCode::NoTty, - 29 => ErrorCode::NoSuchDevice, - 30 => ErrorCode::Overflow, - 31 => ErrorCode::NotPermitted, - 32 => ErrorCode::Pipe, - 33 => ErrorCode::ReadOnly, - 34 => ErrorCode::InvalidSeek, - 35 => ErrorCode::TextFileBusy, - 36 => ErrorCode::CrossDevice, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, ErrorCode>(i32::from( - *((ptr5 + 4) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Read the contents of a symbolic link. - /// - /// If the contents contain an absolute or rooted path in the underlying - /// filesystem, this function fails with `error-code::not-permitted`. - /// - /// Note: This is similar to `readlinkat` in POSIX. - pub fn readlink_at( - this: Descriptor, - path: &str, - ) -> Result { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(4))] - struct RetArea([u8; 12]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let vec0 = path; - let ptr0 = vec0.as_ptr() as i32; - let len0 = vec0.len() as i32; - let ptr1 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:filesystem/filesystem")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "readlink-at")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:filesystem/filesystem_readlink-at" - )] - fn wit_import(_: i32, _: i32, _: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0, len0, ptr1); - match i32::from(*((ptr1 + 0) as *const u8)) { - 0 => Ok({ - let len2 = *((ptr1 + 8) as *const i32) as usize; +// ( +// 2i32, +// wit_bindgen::rt::as_i64(seconds4), +// wit_bindgen::rt::as_i32(nanoseconds4), +// ) +// } +// }; +// let ptr6 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:filesystem/filesystem")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "set-times-at")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:filesystem/filesystem_set-times-at" +// )] +// fn wit_import( +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i64, +// _: i32, +// _: i32, +// _: i64, +// _: i32, +// _: i32, +// ); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// (flags0.bits() >> 0) as i32, +// ptr1, +// len1, +// result3_0, +// result3_1, +// result3_2, +// result5_0, +// result5_1, +// result5_2, +// ptr6, +// ); +// match i32::from(*((ptr6 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr6 + 1) as *const u8)) { +// 0 => ErrorCode::Access, +// 1 => ErrorCode::WouldBlock, +// 2 => ErrorCode::Already, +// 3 => ErrorCode::BadDescriptor, +// 4 => ErrorCode::Busy, +// 5 => ErrorCode::Deadlock, +// 6 => ErrorCode::Quota, +// 7 => ErrorCode::Exist, +// 8 => ErrorCode::FileTooLarge, +// 9 => ErrorCode::IllegalByteSequence, +// 10 => ErrorCode::InProgress, +// 11 => ErrorCode::Interrupted, +// 12 => ErrorCode::Invalid, +// 13 => ErrorCode::Io, +// 14 => ErrorCode::IsDirectory, +// 15 => ErrorCode::Loop, +// 16 => ErrorCode::TooManyLinks, +// 17 => ErrorCode::MessageSize, +// 18 => ErrorCode::NameTooLong, +// 19 => ErrorCode::NoDevice, +// 20 => ErrorCode::NoEntry, +// 21 => ErrorCode::NoLock, +// 22 => ErrorCode::InsufficientMemory, +// 23 => ErrorCode::InsufficientSpace, +// 24 => ErrorCode::NotDirectory, +// 25 => ErrorCode::NotEmpty, +// 26 => ErrorCode::NotRecoverable, +// 27 => ErrorCode::Unsupported, +// 28 => ErrorCode::NoTty, +// 29 => ErrorCode::NoSuchDevice, +// 30 => ErrorCode::Overflow, +// 31 => ErrorCode::NotPermitted, +// 32 => ErrorCode::Pipe, +// 33 => ErrorCode::ReadOnly, +// 34 => ErrorCode::InvalidSeek, +// 35 => ErrorCode::TextFileBusy, +// 36 => ErrorCode::CrossDevice, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::<_, ErrorCode>(i32::from( +// *((ptr6 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Create a hard link. +// /// +// /// Note: This is similar to `linkat` in POSIX. +// pub fn link_at( +// this: Descriptor, +// old_path_flags: PathFlags, +// old_path: &str, +// new_descriptor: Descriptor, +// new_path: &str, +// ) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let flags0 = old_path_flags; +// let vec1 = old_path; +// let ptr1 = vec1.as_ptr() as i32; +// let len1 = vec1.len() as i32; +// let vec2 = new_path; +// let ptr2 = vec2.as_ptr() as i32; +// let len2 = vec2.len() as i32; +// let ptr3 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:filesystem/filesystem")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "link-at")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:filesystem/filesystem_link-at" +// )] +// fn wit_import( +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// ); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// (flags0.bits() >> 0) as i32, +// ptr1, +// len1, +// wit_bindgen::rt::as_i32(new_descriptor), +// ptr2, +// len2, +// ptr3, +// ); +// match i32::from(*((ptr3 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr3 + 1) as *const u8)) { +// 0 => ErrorCode::Access, +// 1 => ErrorCode::WouldBlock, +// 2 => ErrorCode::Already, +// 3 => ErrorCode::BadDescriptor, +// 4 => ErrorCode::Busy, +// 5 => ErrorCode::Deadlock, +// 6 => ErrorCode::Quota, +// 7 => ErrorCode::Exist, +// 8 => ErrorCode::FileTooLarge, +// 9 => ErrorCode::IllegalByteSequence, +// 10 => ErrorCode::InProgress, +// 11 => ErrorCode::Interrupted, +// 12 => ErrorCode::Invalid, +// 13 => ErrorCode::Io, +// 14 => ErrorCode::IsDirectory, +// 15 => ErrorCode::Loop, +// 16 => ErrorCode::TooManyLinks, +// 17 => ErrorCode::MessageSize, +// 18 => ErrorCode::NameTooLong, +// 19 => ErrorCode::NoDevice, +// 20 => ErrorCode::NoEntry, +// 21 => ErrorCode::NoLock, +// 22 => ErrorCode::InsufficientMemory, +// 23 => ErrorCode::InsufficientSpace, +// 24 => ErrorCode::NotDirectory, +// 25 => ErrorCode::NotEmpty, +// 26 => ErrorCode::NotRecoverable, +// 27 => ErrorCode::Unsupported, +// 28 => ErrorCode::NoTty, +// 29 => ErrorCode::NoSuchDevice, +// 30 => ErrorCode::Overflow, +// 31 => ErrorCode::NotPermitted, +// 32 => ErrorCode::Pipe, +// 33 => ErrorCode::ReadOnly, +// 34 => ErrorCode::InvalidSeek, +// 35 => ErrorCode::TextFileBusy, +// 36 => ErrorCode::CrossDevice, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::<_, ErrorCode>(i32::from( +// *((ptr3 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Open a file or directory. +// /// +// /// The returned descriptor is not guaranteed to be the lowest-numbered +// /// descriptor not currently open/ it is randomized to prevent applications +// /// from depending on making assumptions about indexes, since this is +// /// error-prone in multi-threaded contexts. The returned descriptor is +// /// guaranteed to be less than 2**31. +// /// +// /// If `flags` contains `descriptor-flags::mutate-directory`, and the base +// /// descriptor doesn't have `descriptor-flags::mutate-directory` set, +// /// `open-at` fails with `error-code::read-only`. +// /// +// /// If `flags` contains `write` or `mutate-directory`, or `open-flags` +// /// contains `truncate` or `create`, and the base descriptor doesn't have +// /// `descriptor-flags::mutate-directory` set, `open-at` fails with +// /// `error-code::read-only`. +// /// +// /// Note: This is similar to `openat` in POSIX. +// pub fn open_at( +// this: Descriptor, +// path_flags: PathFlags, +// path: &str, +// open_flags: OpenFlags, +// flags: DescriptorFlags, +// modes: Modes, +// ) -> Result { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(4))] +// struct RetArea([u8; 8]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let flags0 = path_flags; +// let vec1 = path; +// let ptr1 = vec1.as_ptr() as i32; +// let len1 = vec1.len() as i32; +// let flags2 = open_flags; +// let flags3 = flags; +// let flags4 = modes; +// let ptr5 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:filesystem/filesystem")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "open-at")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:filesystem/filesystem_open-at" +// )] +// fn wit_import( +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// ); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// (flags0.bits() >> 0) as i32, +// ptr1, +// len1, +// (flags2.bits() >> 0) as i32, +// (flags3.bits() >> 0) as i32, +// (flags4.bits() >> 0) as i32, +// ptr5, +// ); +// match i32::from(*((ptr5 + 0) as *const u8)) { +// 0 => Ok(*((ptr5 + 4) as *const i32) as u32), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr5 + 4) as *const u8)) { +// 0 => ErrorCode::Access, +// 1 => ErrorCode::WouldBlock, +// 2 => ErrorCode::Already, +// 3 => ErrorCode::BadDescriptor, +// 4 => ErrorCode::Busy, +// 5 => ErrorCode::Deadlock, +// 6 => ErrorCode::Quota, +// 7 => ErrorCode::Exist, +// 8 => ErrorCode::FileTooLarge, +// 9 => ErrorCode::IllegalByteSequence, +// 10 => ErrorCode::InProgress, +// 11 => ErrorCode::Interrupted, +// 12 => ErrorCode::Invalid, +// 13 => ErrorCode::Io, +// 14 => ErrorCode::IsDirectory, +// 15 => ErrorCode::Loop, +// 16 => ErrorCode::TooManyLinks, +// 17 => ErrorCode::MessageSize, +// 18 => ErrorCode::NameTooLong, +// 19 => ErrorCode::NoDevice, +// 20 => ErrorCode::NoEntry, +// 21 => ErrorCode::NoLock, +// 22 => ErrorCode::InsufficientMemory, +// 23 => ErrorCode::InsufficientSpace, +// 24 => ErrorCode::NotDirectory, +// 25 => ErrorCode::NotEmpty, +// 26 => ErrorCode::NotRecoverable, +// 27 => ErrorCode::Unsupported, +// 28 => ErrorCode::NoTty, +// 29 => ErrorCode::NoSuchDevice, +// 30 => ErrorCode::Overflow, +// 31 => ErrorCode::NotPermitted, +// 32 => ErrorCode::Pipe, +// 33 => ErrorCode::ReadOnly, +// 34 => ErrorCode::InvalidSeek, +// 35 => ErrorCode::TextFileBusy, +// 36 => ErrorCode::CrossDevice, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::<_, ErrorCode>(i32::from( +// *((ptr5 + 4) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Read the contents of a symbolic link. +// /// +// /// If the contents contain an absolute or rooted path in the underlying +// /// filesystem, this function fails with `error-code::not-permitted`. +// /// +// /// Note: This is similar to `readlinkat` in POSIX. +// pub fn readlink_at( +// this: Descriptor, +// path: &str, +// ) -> Result { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(4))] +// struct RetArea([u8; 12]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let vec0 = path; +// let ptr0 = vec0.as_ptr() as i32; +// let len0 = vec0.len() as i32; +// let ptr1 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:filesystem/filesystem")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "readlink-at")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:filesystem/filesystem_readlink-at" +// )] +// fn wit_import(_: i32, _: i32, _: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0, len0, ptr1); +// match i32::from(*((ptr1 + 0) as *const u8)) { +// 0 => Ok({ +// let len2 = *((ptr1 + 8) as *const i32) as usize; - { - #[cfg(not(debug_assertions))] - { - String::from_utf8_unchecked(Vec::from_raw_parts( - *((ptr1 + 4) as *const i32) as *mut _, - len2, - len2, - )) - } - #[cfg(debug_assertions)] - { - String::from_utf8(Vec::from_raw_parts( - *((ptr1 + 4) as *const i32) as *mut _, - len2, - len2, - )) - .unwrap() - } - } - }), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr1 + 4) as *const u8)) { - 0 => ErrorCode::Access, - 1 => ErrorCode::WouldBlock, - 2 => ErrorCode::Already, - 3 => ErrorCode::BadDescriptor, - 4 => ErrorCode::Busy, - 5 => ErrorCode::Deadlock, - 6 => ErrorCode::Quota, - 7 => ErrorCode::Exist, - 8 => ErrorCode::FileTooLarge, - 9 => ErrorCode::IllegalByteSequence, - 10 => ErrorCode::InProgress, - 11 => ErrorCode::Interrupted, - 12 => ErrorCode::Invalid, - 13 => ErrorCode::Io, - 14 => ErrorCode::IsDirectory, - 15 => ErrorCode::Loop, - 16 => ErrorCode::TooManyLinks, - 17 => ErrorCode::MessageSize, - 18 => ErrorCode::NameTooLong, - 19 => ErrorCode::NoDevice, - 20 => ErrorCode::NoEntry, - 21 => ErrorCode::NoLock, - 22 => ErrorCode::InsufficientMemory, - 23 => ErrorCode::InsufficientSpace, - 24 => ErrorCode::NotDirectory, - 25 => ErrorCode::NotEmpty, - 26 => ErrorCode::NotRecoverable, - 27 => ErrorCode::Unsupported, - 28 => ErrorCode::NoTty, - 29 => ErrorCode::NoSuchDevice, - 30 => ErrorCode::Overflow, - 31 => ErrorCode::NotPermitted, - 32 => ErrorCode::Pipe, - 33 => ErrorCode::ReadOnly, - 34 => ErrorCode::InvalidSeek, - 35 => ErrorCode::TextFileBusy, - 36 => ErrorCode::CrossDevice, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, ErrorCode>(i32::from( - *((ptr1 + 4) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Remove a directory. - /// - /// Return `error-code::not-empty` if the directory is not empty. - /// - /// Note: This is similar to `unlinkat(fd, path, AT_REMOVEDIR)` in POSIX. - pub fn remove_directory_at(this: Descriptor, path: &str) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let vec0 = path; - let ptr0 = vec0.as_ptr() as i32; - let len0 = vec0.len() as i32; - let ptr1 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:filesystem/filesystem")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "remove-directory-at")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:filesystem/filesystem_remove-directory-at" - )] - fn wit_import(_: i32, _: i32, _: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0, len0, ptr1); - match i32::from(*((ptr1 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr1 + 1) as *const u8)) { - 0 => ErrorCode::Access, - 1 => ErrorCode::WouldBlock, - 2 => ErrorCode::Already, - 3 => ErrorCode::BadDescriptor, - 4 => ErrorCode::Busy, - 5 => ErrorCode::Deadlock, - 6 => ErrorCode::Quota, - 7 => ErrorCode::Exist, - 8 => ErrorCode::FileTooLarge, - 9 => ErrorCode::IllegalByteSequence, - 10 => ErrorCode::InProgress, - 11 => ErrorCode::Interrupted, - 12 => ErrorCode::Invalid, - 13 => ErrorCode::Io, - 14 => ErrorCode::IsDirectory, - 15 => ErrorCode::Loop, - 16 => ErrorCode::TooManyLinks, - 17 => ErrorCode::MessageSize, - 18 => ErrorCode::NameTooLong, - 19 => ErrorCode::NoDevice, - 20 => ErrorCode::NoEntry, - 21 => ErrorCode::NoLock, - 22 => ErrorCode::InsufficientMemory, - 23 => ErrorCode::InsufficientSpace, - 24 => ErrorCode::NotDirectory, - 25 => ErrorCode::NotEmpty, - 26 => ErrorCode::NotRecoverable, - 27 => ErrorCode::Unsupported, - 28 => ErrorCode::NoTty, - 29 => ErrorCode::NoSuchDevice, - 30 => ErrorCode::Overflow, - 31 => ErrorCode::NotPermitted, - 32 => ErrorCode::Pipe, - 33 => ErrorCode::ReadOnly, - 34 => ErrorCode::InvalidSeek, - 35 => ErrorCode::TextFileBusy, - 36 => ErrorCode::CrossDevice, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, ErrorCode>(i32::from( - *((ptr1 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Rename a filesystem object. - /// - /// Note: This is similar to `renameat` in POSIX. - pub fn rename_at( - this: Descriptor, - old_path: &str, - new_descriptor: Descriptor, - new_path: &str, - ) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let vec0 = old_path; - let ptr0 = vec0.as_ptr() as i32; - let len0 = vec0.len() as i32; - let vec1 = new_path; - let ptr1 = vec1.as_ptr() as i32; - let len1 = vec1.len() as i32; - let ptr2 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:filesystem/filesystem")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "rename-at")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:filesystem/filesystem_rename-at" - )] - fn wit_import(_: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32); - } - wit_import( - wit_bindgen::rt::as_i32(this), - ptr0, - len0, - wit_bindgen::rt::as_i32(new_descriptor), - ptr1, - len1, - ptr2, - ); - match i32::from(*((ptr2 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr2 + 1) as *const u8)) { - 0 => ErrorCode::Access, - 1 => ErrorCode::WouldBlock, - 2 => ErrorCode::Already, - 3 => ErrorCode::BadDescriptor, - 4 => ErrorCode::Busy, - 5 => ErrorCode::Deadlock, - 6 => ErrorCode::Quota, - 7 => ErrorCode::Exist, - 8 => ErrorCode::FileTooLarge, - 9 => ErrorCode::IllegalByteSequence, - 10 => ErrorCode::InProgress, - 11 => ErrorCode::Interrupted, - 12 => ErrorCode::Invalid, - 13 => ErrorCode::Io, - 14 => ErrorCode::IsDirectory, - 15 => ErrorCode::Loop, - 16 => ErrorCode::TooManyLinks, - 17 => ErrorCode::MessageSize, - 18 => ErrorCode::NameTooLong, - 19 => ErrorCode::NoDevice, - 20 => ErrorCode::NoEntry, - 21 => ErrorCode::NoLock, - 22 => ErrorCode::InsufficientMemory, - 23 => ErrorCode::InsufficientSpace, - 24 => ErrorCode::NotDirectory, - 25 => ErrorCode::NotEmpty, - 26 => ErrorCode::NotRecoverable, - 27 => ErrorCode::Unsupported, - 28 => ErrorCode::NoTty, - 29 => ErrorCode::NoSuchDevice, - 30 => ErrorCode::Overflow, - 31 => ErrorCode::NotPermitted, - 32 => ErrorCode::Pipe, - 33 => ErrorCode::ReadOnly, - 34 => ErrorCode::InvalidSeek, - 35 => ErrorCode::TextFileBusy, - 36 => ErrorCode::CrossDevice, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, ErrorCode>(i32::from( - *((ptr2 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Create a symbolic link (also known as a "symlink"). - /// - /// If `old-path` starts with `/`, the function fails with - /// `error-code::not-permitted`. - /// - /// Note: This is similar to `symlinkat` in POSIX. - pub fn symlink_at( - this: Descriptor, - old_path: &str, - new_path: &str, - ) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let vec0 = old_path; - let ptr0 = vec0.as_ptr() as i32; - let len0 = vec0.len() as i32; - let vec1 = new_path; - let ptr1 = vec1.as_ptr() as i32; - let len1 = vec1.len() as i32; - let ptr2 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:filesystem/filesystem")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "symlink-at")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:filesystem/filesystem_symlink-at" - )] - fn wit_import(_: i32, _: i32, _: i32, _: i32, _: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0, len0, ptr1, len1, ptr2); - match i32::from(*((ptr2 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr2 + 1) as *const u8)) { - 0 => ErrorCode::Access, - 1 => ErrorCode::WouldBlock, - 2 => ErrorCode::Already, - 3 => ErrorCode::BadDescriptor, - 4 => ErrorCode::Busy, - 5 => ErrorCode::Deadlock, - 6 => ErrorCode::Quota, - 7 => ErrorCode::Exist, - 8 => ErrorCode::FileTooLarge, - 9 => ErrorCode::IllegalByteSequence, - 10 => ErrorCode::InProgress, - 11 => ErrorCode::Interrupted, - 12 => ErrorCode::Invalid, - 13 => ErrorCode::Io, - 14 => ErrorCode::IsDirectory, - 15 => ErrorCode::Loop, - 16 => ErrorCode::TooManyLinks, - 17 => ErrorCode::MessageSize, - 18 => ErrorCode::NameTooLong, - 19 => ErrorCode::NoDevice, - 20 => ErrorCode::NoEntry, - 21 => ErrorCode::NoLock, - 22 => ErrorCode::InsufficientMemory, - 23 => ErrorCode::InsufficientSpace, - 24 => ErrorCode::NotDirectory, - 25 => ErrorCode::NotEmpty, - 26 => ErrorCode::NotRecoverable, - 27 => ErrorCode::Unsupported, - 28 => ErrorCode::NoTty, - 29 => ErrorCode::NoSuchDevice, - 30 => ErrorCode::Overflow, - 31 => ErrorCode::NotPermitted, - 32 => ErrorCode::Pipe, - 33 => ErrorCode::ReadOnly, - 34 => ErrorCode::InvalidSeek, - 35 => ErrorCode::TextFileBusy, - 36 => ErrorCode::CrossDevice, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, ErrorCode>(i32::from( - *((ptr2 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Check accessibility of a filesystem path. - /// - /// Check whether the given filesystem path names an object which is - /// readable, writable, or executable, or whether it exists. - /// - /// This does not a guarantee that subsequent accesses will succeed, as - /// filesystem permissions may be modified asynchronously by external - /// entities. - /// - /// Note: This is similar to `faccessat` with the `AT_EACCESS` flag in POSIX. - pub fn access_at( - this: Descriptor, - path_flags: PathFlags, - path: &str, - type_: AccessType, - ) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let flags0 = path_flags; - let vec1 = path; - let ptr1 = vec1.as_ptr() as i32; - let len1 = vec1.len() as i32; - let (result3_0, result3_1) = match type_ { - AccessType::Access(e) => { - let flags2 = e; +// { +// #[cfg(not(debug_assertions))] +// { +// String::from_utf8_unchecked(Vec::from_raw_parts( +// *((ptr1 + 4) as *const i32) as *mut _, +// len2, +// len2, +// )) +// } +// #[cfg(debug_assertions)] +// { +// String::from_utf8(Vec::from_raw_parts( +// *((ptr1 + 4) as *const i32) as *mut _, +// len2, +// len2, +// )) +// .unwrap() +// } +// } +// }), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr1 + 4) as *const u8)) { +// 0 => ErrorCode::Access, +// 1 => ErrorCode::WouldBlock, +// 2 => ErrorCode::Already, +// 3 => ErrorCode::BadDescriptor, +// 4 => ErrorCode::Busy, +// 5 => ErrorCode::Deadlock, +// 6 => ErrorCode::Quota, +// 7 => ErrorCode::Exist, +// 8 => ErrorCode::FileTooLarge, +// 9 => ErrorCode::IllegalByteSequence, +// 10 => ErrorCode::InProgress, +// 11 => ErrorCode::Interrupted, +// 12 => ErrorCode::Invalid, +// 13 => ErrorCode::Io, +// 14 => ErrorCode::IsDirectory, +// 15 => ErrorCode::Loop, +// 16 => ErrorCode::TooManyLinks, +// 17 => ErrorCode::MessageSize, +// 18 => ErrorCode::NameTooLong, +// 19 => ErrorCode::NoDevice, +// 20 => ErrorCode::NoEntry, +// 21 => ErrorCode::NoLock, +// 22 => ErrorCode::InsufficientMemory, +// 23 => ErrorCode::InsufficientSpace, +// 24 => ErrorCode::NotDirectory, +// 25 => ErrorCode::NotEmpty, +// 26 => ErrorCode::NotRecoverable, +// 27 => ErrorCode::Unsupported, +// 28 => ErrorCode::NoTty, +// 29 => ErrorCode::NoSuchDevice, +// 30 => ErrorCode::Overflow, +// 31 => ErrorCode::NotPermitted, +// 32 => ErrorCode::Pipe, +// 33 => ErrorCode::ReadOnly, +// 34 => ErrorCode::InvalidSeek, +// 35 => ErrorCode::TextFileBusy, +// 36 => ErrorCode::CrossDevice, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::<_, ErrorCode>(i32::from( +// *((ptr1 + 4) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Remove a directory. +// /// +// /// Return `error-code::not-empty` if the directory is not empty. +// /// +// /// Note: This is similar to `unlinkat(fd, path, AT_REMOVEDIR)` in POSIX. +// pub fn remove_directory_at(this: Descriptor, path: &str) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let vec0 = path; +// let ptr0 = vec0.as_ptr() as i32; +// let len0 = vec0.len() as i32; +// let ptr1 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:filesystem/filesystem")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "remove-directory-at")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:filesystem/filesystem_remove-directory-at" +// )] +// fn wit_import(_: i32, _: i32, _: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0, len0, ptr1); +// match i32::from(*((ptr1 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr1 + 1) as *const u8)) { +// 0 => ErrorCode::Access, +// 1 => ErrorCode::WouldBlock, +// 2 => ErrorCode::Already, +// 3 => ErrorCode::BadDescriptor, +// 4 => ErrorCode::Busy, +// 5 => ErrorCode::Deadlock, +// 6 => ErrorCode::Quota, +// 7 => ErrorCode::Exist, +// 8 => ErrorCode::FileTooLarge, +// 9 => ErrorCode::IllegalByteSequence, +// 10 => ErrorCode::InProgress, +// 11 => ErrorCode::Interrupted, +// 12 => ErrorCode::Invalid, +// 13 => ErrorCode::Io, +// 14 => ErrorCode::IsDirectory, +// 15 => ErrorCode::Loop, +// 16 => ErrorCode::TooManyLinks, +// 17 => ErrorCode::MessageSize, +// 18 => ErrorCode::NameTooLong, +// 19 => ErrorCode::NoDevice, +// 20 => ErrorCode::NoEntry, +// 21 => ErrorCode::NoLock, +// 22 => ErrorCode::InsufficientMemory, +// 23 => ErrorCode::InsufficientSpace, +// 24 => ErrorCode::NotDirectory, +// 25 => ErrorCode::NotEmpty, +// 26 => ErrorCode::NotRecoverable, +// 27 => ErrorCode::Unsupported, +// 28 => ErrorCode::NoTty, +// 29 => ErrorCode::NoSuchDevice, +// 30 => ErrorCode::Overflow, +// 31 => ErrorCode::NotPermitted, +// 32 => ErrorCode::Pipe, +// 33 => ErrorCode::ReadOnly, +// 34 => ErrorCode::InvalidSeek, +// 35 => ErrorCode::TextFileBusy, +// 36 => ErrorCode::CrossDevice, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::<_, ErrorCode>(i32::from( +// *((ptr1 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Rename a filesystem object. +// /// +// /// Note: This is similar to `renameat` in POSIX. +// pub fn rename_at( +// this: Descriptor, +// old_path: &str, +// new_descriptor: Descriptor, +// new_path: &str, +// ) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let vec0 = old_path; +// let ptr0 = vec0.as_ptr() as i32; +// let len0 = vec0.len() as i32; +// let vec1 = new_path; +// let ptr1 = vec1.as_ptr() as i32; +// let len1 = vec1.len() as i32; +// let ptr2 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:filesystem/filesystem")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "rename-at")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:filesystem/filesystem_rename-at" +// )] +// fn wit_import(_: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// ptr0, +// len0, +// wit_bindgen::rt::as_i32(new_descriptor), +// ptr1, +// len1, +// ptr2, +// ); +// match i32::from(*((ptr2 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr2 + 1) as *const u8)) { +// 0 => ErrorCode::Access, +// 1 => ErrorCode::WouldBlock, +// 2 => ErrorCode::Already, +// 3 => ErrorCode::BadDescriptor, +// 4 => ErrorCode::Busy, +// 5 => ErrorCode::Deadlock, +// 6 => ErrorCode::Quota, +// 7 => ErrorCode::Exist, +// 8 => ErrorCode::FileTooLarge, +// 9 => ErrorCode::IllegalByteSequence, +// 10 => ErrorCode::InProgress, +// 11 => ErrorCode::Interrupted, +// 12 => ErrorCode::Invalid, +// 13 => ErrorCode::Io, +// 14 => ErrorCode::IsDirectory, +// 15 => ErrorCode::Loop, +// 16 => ErrorCode::TooManyLinks, +// 17 => ErrorCode::MessageSize, +// 18 => ErrorCode::NameTooLong, +// 19 => ErrorCode::NoDevice, +// 20 => ErrorCode::NoEntry, +// 21 => ErrorCode::NoLock, +// 22 => ErrorCode::InsufficientMemory, +// 23 => ErrorCode::InsufficientSpace, +// 24 => ErrorCode::NotDirectory, +// 25 => ErrorCode::NotEmpty, +// 26 => ErrorCode::NotRecoverable, +// 27 => ErrorCode::Unsupported, +// 28 => ErrorCode::NoTty, +// 29 => ErrorCode::NoSuchDevice, +// 30 => ErrorCode::Overflow, +// 31 => ErrorCode::NotPermitted, +// 32 => ErrorCode::Pipe, +// 33 => ErrorCode::ReadOnly, +// 34 => ErrorCode::InvalidSeek, +// 35 => ErrorCode::TextFileBusy, +// 36 => ErrorCode::CrossDevice, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::<_, ErrorCode>(i32::from( +// *((ptr2 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Create a symbolic link (also known as a "symlink"). +// /// +// /// If `old-path` starts with `/`, the function fails with +// /// `error-code::not-permitted`. +// /// +// /// Note: This is similar to `symlinkat` in POSIX. +// pub fn symlink_at( +// this: Descriptor, +// old_path: &str, +// new_path: &str, +// ) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let vec0 = old_path; +// let ptr0 = vec0.as_ptr() as i32; +// let len0 = vec0.len() as i32; +// let vec1 = new_path; +// let ptr1 = vec1.as_ptr() as i32; +// let len1 = vec1.len() as i32; +// let ptr2 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:filesystem/filesystem")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "symlink-at")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:filesystem/filesystem_symlink-at" +// )] +// fn wit_import(_: i32, _: i32, _: i32, _: i32, _: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0, len0, ptr1, len1, ptr2); +// match i32::from(*((ptr2 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr2 + 1) as *const u8)) { +// 0 => ErrorCode::Access, +// 1 => ErrorCode::WouldBlock, +// 2 => ErrorCode::Already, +// 3 => ErrorCode::BadDescriptor, +// 4 => ErrorCode::Busy, +// 5 => ErrorCode::Deadlock, +// 6 => ErrorCode::Quota, +// 7 => ErrorCode::Exist, +// 8 => ErrorCode::FileTooLarge, +// 9 => ErrorCode::IllegalByteSequence, +// 10 => ErrorCode::InProgress, +// 11 => ErrorCode::Interrupted, +// 12 => ErrorCode::Invalid, +// 13 => ErrorCode::Io, +// 14 => ErrorCode::IsDirectory, +// 15 => ErrorCode::Loop, +// 16 => ErrorCode::TooManyLinks, +// 17 => ErrorCode::MessageSize, +// 18 => ErrorCode::NameTooLong, +// 19 => ErrorCode::NoDevice, +// 20 => ErrorCode::NoEntry, +// 21 => ErrorCode::NoLock, +// 22 => ErrorCode::InsufficientMemory, +// 23 => ErrorCode::InsufficientSpace, +// 24 => ErrorCode::NotDirectory, +// 25 => ErrorCode::NotEmpty, +// 26 => ErrorCode::NotRecoverable, +// 27 => ErrorCode::Unsupported, +// 28 => ErrorCode::NoTty, +// 29 => ErrorCode::NoSuchDevice, +// 30 => ErrorCode::Overflow, +// 31 => ErrorCode::NotPermitted, +// 32 => ErrorCode::Pipe, +// 33 => ErrorCode::ReadOnly, +// 34 => ErrorCode::InvalidSeek, +// 35 => ErrorCode::TextFileBusy, +// 36 => ErrorCode::CrossDevice, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::<_, ErrorCode>(i32::from( +// *((ptr2 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Check accessibility of a filesystem path. +// /// +// /// Check whether the given filesystem path names an object which is +// /// readable, writable, or executable, or whether it exists. +// /// +// /// This does not a guarantee that subsequent accesses will succeed, as +// /// filesystem permissions may be modified asynchronously by external +// /// entities. +// /// +// /// Note: This is similar to `faccessat` with the `AT_EACCESS` flag in POSIX. +// pub fn access_at( +// this: Descriptor, +// path_flags: PathFlags, +// path: &str, +// type_: AccessType, +// ) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let flags0 = path_flags; +// let vec1 = path; +// let ptr1 = vec1.as_ptr() as i32; +// let len1 = vec1.len() as i32; +// let (result3_0, result3_1) = match type_ { +// AccessType::Access(e) => { +// let flags2 = e; - (0i32, (flags2.bits() >> 0) as i32) - } - AccessType::Exists => (1i32, 0i32), - }; - let ptr4 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:filesystem/filesystem")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "access-at")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:filesystem/filesystem_access-at" - )] - fn wit_import(_: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32); - } - wit_import( - wit_bindgen::rt::as_i32(this), - (flags0.bits() >> 0) as i32, - ptr1, - len1, - result3_0, - result3_1, - ptr4, - ); - match i32::from(*((ptr4 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr4 + 1) as *const u8)) { - 0 => ErrorCode::Access, - 1 => ErrorCode::WouldBlock, - 2 => ErrorCode::Already, - 3 => ErrorCode::BadDescriptor, - 4 => ErrorCode::Busy, - 5 => ErrorCode::Deadlock, - 6 => ErrorCode::Quota, - 7 => ErrorCode::Exist, - 8 => ErrorCode::FileTooLarge, - 9 => ErrorCode::IllegalByteSequence, - 10 => ErrorCode::InProgress, - 11 => ErrorCode::Interrupted, - 12 => ErrorCode::Invalid, - 13 => ErrorCode::Io, - 14 => ErrorCode::IsDirectory, - 15 => ErrorCode::Loop, - 16 => ErrorCode::TooManyLinks, - 17 => ErrorCode::MessageSize, - 18 => ErrorCode::NameTooLong, - 19 => ErrorCode::NoDevice, - 20 => ErrorCode::NoEntry, - 21 => ErrorCode::NoLock, - 22 => ErrorCode::InsufficientMemory, - 23 => ErrorCode::InsufficientSpace, - 24 => ErrorCode::NotDirectory, - 25 => ErrorCode::NotEmpty, - 26 => ErrorCode::NotRecoverable, - 27 => ErrorCode::Unsupported, - 28 => ErrorCode::NoTty, - 29 => ErrorCode::NoSuchDevice, - 30 => ErrorCode::Overflow, - 31 => ErrorCode::NotPermitted, - 32 => ErrorCode::Pipe, - 33 => ErrorCode::ReadOnly, - 34 => ErrorCode::InvalidSeek, - 35 => ErrorCode::TextFileBusy, - 36 => ErrorCode::CrossDevice, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, ErrorCode>(i32::from( - *((ptr4 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Unlink a filesystem object that is not a directory. - /// - /// Return `error-code::is-directory` if the path refers to a directory. - /// Note: This is similar to `unlinkat(fd, path, 0)` in POSIX. - pub fn unlink_file_at(this: Descriptor, path: &str) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let vec0 = path; - let ptr0 = vec0.as_ptr() as i32; - let len0 = vec0.len() as i32; - let ptr1 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:filesystem/filesystem")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "unlink-file-at")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:filesystem/filesystem_unlink-file-at" - )] - fn wit_import(_: i32, _: i32, _: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0, len0, ptr1); - match i32::from(*((ptr1 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr1 + 1) as *const u8)) { - 0 => ErrorCode::Access, - 1 => ErrorCode::WouldBlock, - 2 => ErrorCode::Already, - 3 => ErrorCode::BadDescriptor, - 4 => ErrorCode::Busy, - 5 => ErrorCode::Deadlock, - 6 => ErrorCode::Quota, - 7 => ErrorCode::Exist, - 8 => ErrorCode::FileTooLarge, - 9 => ErrorCode::IllegalByteSequence, - 10 => ErrorCode::InProgress, - 11 => ErrorCode::Interrupted, - 12 => ErrorCode::Invalid, - 13 => ErrorCode::Io, - 14 => ErrorCode::IsDirectory, - 15 => ErrorCode::Loop, - 16 => ErrorCode::TooManyLinks, - 17 => ErrorCode::MessageSize, - 18 => ErrorCode::NameTooLong, - 19 => ErrorCode::NoDevice, - 20 => ErrorCode::NoEntry, - 21 => ErrorCode::NoLock, - 22 => ErrorCode::InsufficientMemory, - 23 => ErrorCode::InsufficientSpace, - 24 => ErrorCode::NotDirectory, - 25 => ErrorCode::NotEmpty, - 26 => ErrorCode::NotRecoverable, - 27 => ErrorCode::Unsupported, - 28 => ErrorCode::NoTty, - 29 => ErrorCode::NoSuchDevice, - 30 => ErrorCode::Overflow, - 31 => ErrorCode::NotPermitted, - 32 => ErrorCode::Pipe, - 33 => ErrorCode::ReadOnly, - 34 => ErrorCode::InvalidSeek, - 35 => ErrorCode::TextFileBusy, - 36 => ErrorCode::CrossDevice, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, ErrorCode>(i32::from( - *((ptr1 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Change the permissions of a filesystem object that is not a directory. - /// - /// Note that the ultimate meanings of these permissions is - /// filesystem-specific. - /// - /// Note: This is similar to `fchmodat` in POSIX. - pub fn change_file_permissions_at( - this: Descriptor, - path_flags: PathFlags, - path: &str, - modes: Modes, - ) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let flags0 = path_flags; - let vec1 = path; - let ptr1 = vec1.as_ptr() as i32; - let len1 = vec1.len() as i32; - let flags2 = modes; - let ptr3 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:filesystem/filesystem")] - extern "C" { - #[cfg_attr( - target_arch = "wasm32", - link_name = "change-file-permissions-at" - )] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:filesystem/filesystem_change-file-permissions-at" - )] - fn wit_import(_: i32, _: i32, _: i32, _: i32, _: i32, _: i32); - } - wit_import( - wit_bindgen::rt::as_i32(this), - (flags0.bits() >> 0) as i32, - ptr1, - len1, - (flags2.bits() >> 0) as i32, - ptr3, - ); - match i32::from(*((ptr3 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr3 + 1) as *const u8)) { - 0 => ErrorCode::Access, - 1 => ErrorCode::WouldBlock, - 2 => ErrorCode::Already, - 3 => ErrorCode::BadDescriptor, - 4 => ErrorCode::Busy, - 5 => ErrorCode::Deadlock, - 6 => ErrorCode::Quota, - 7 => ErrorCode::Exist, - 8 => ErrorCode::FileTooLarge, - 9 => ErrorCode::IllegalByteSequence, - 10 => ErrorCode::InProgress, - 11 => ErrorCode::Interrupted, - 12 => ErrorCode::Invalid, - 13 => ErrorCode::Io, - 14 => ErrorCode::IsDirectory, - 15 => ErrorCode::Loop, - 16 => ErrorCode::TooManyLinks, - 17 => ErrorCode::MessageSize, - 18 => ErrorCode::NameTooLong, - 19 => ErrorCode::NoDevice, - 20 => ErrorCode::NoEntry, - 21 => ErrorCode::NoLock, - 22 => ErrorCode::InsufficientMemory, - 23 => ErrorCode::InsufficientSpace, - 24 => ErrorCode::NotDirectory, - 25 => ErrorCode::NotEmpty, - 26 => ErrorCode::NotRecoverable, - 27 => ErrorCode::Unsupported, - 28 => ErrorCode::NoTty, - 29 => ErrorCode::NoSuchDevice, - 30 => ErrorCode::Overflow, - 31 => ErrorCode::NotPermitted, - 32 => ErrorCode::Pipe, - 33 => ErrorCode::ReadOnly, - 34 => ErrorCode::InvalidSeek, - 35 => ErrorCode::TextFileBusy, - 36 => ErrorCode::CrossDevice, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, ErrorCode>(i32::from( - *((ptr3 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Change the permissions of a directory. - /// - /// Note that the ultimate meanings of these permissions is - /// filesystem-specific. - /// - /// Unlike in POSIX, the `executable` flag is not reinterpreted as a "search" - /// flag. `read` on a directory implies readability and searchability, and - /// `execute` is not valid for directories. - /// - /// Note: This is similar to `fchmodat` in POSIX. - pub fn change_directory_permissions_at( - this: Descriptor, - path_flags: PathFlags, - path: &str, - modes: Modes, - ) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let flags0 = path_flags; - let vec1 = path; - let ptr1 = vec1.as_ptr() as i32; - let len1 = vec1.len() as i32; - let flags2 = modes; - let ptr3 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:filesystem/filesystem")] - extern "C" { - #[cfg_attr( - target_arch = "wasm32", - link_name = "change-directory-permissions-at" - )] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:filesystem/filesystem_change-directory-permissions-at" - )] - fn wit_import(_: i32, _: i32, _: i32, _: i32, _: i32, _: i32); - } - wit_import( - wit_bindgen::rt::as_i32(this), - (flags0.bits() >> 0) as i32, - ptr1, - len1, - (flags2.bits() >> 0) as i32, - ptr3, - ); - match i32::from(*((ptr3 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr3 + 1) as *const u8)) { - 0 => ErrorCode::Access, - 1 => ErrorCode::WouldBlock, - 2 => ErrorCode::Already, - 3 => ErrorCode::BadDescriptor, - 4 => ErrorCode::Busy, - 5 => ErrorCode::Deadlock, - 6 => ErrorCode::Quota, - 7 => ErrorCode::Exist, - 8 => ErrorCode::FileTooLarge, - 9 => ErrorCode::IllegalByteSequence, - 10 => ErrorCode::InProgress, - 11 => ErrorCode::Interrupted, - 12 => ErrorCode::Invalid, - 13 => ErrorCode::Io, - 14 => ErrorCode::IsDirectory, - 15 => ErrorCode::Loop, - 16 => ErrorCode::TooManyLinks, - 17 => ErrorCode::MessageSize, - 18 => ErrorCode::NameTooLong, - 19 => ErrorCode::NoDevice, - 20 => ErrorCode::NoEntry, - 21 => ErrorCode::NoLock, - 22 => ErrorCode::InsufficientMemory, - 23 => ErrorCode::InsufficientSpace, - 24 => ErrorCode::NotDirectory, - 25 => ErrorCode::NotEmpty, - 26 => ErrorCode::NotRecoverable, - 27 => ErrorCode::Unsupported, - 28 => ErrorCode::NoTty, - 29 => ErrorCode::NoSuchDevice, - 30 => ErrorCode::Overflow, - 31 => ErrorCode::NotPermitted, - 32 => ErrorCode::Pipe, - 33 => ErrorCode::ReadOnly, - 34 => ErrorCode::InvalidSeek, - 35 => ErrorCode::TextFileBusy, - 36 => ErrorCode::CrossDevice, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, ErrorCode>(i32::from( - *((ptr3 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Request a shared advisory lock for an open file. - /// - /// This requests a *shared* lock; more than one shared lock can be held for - /// a file at the same time. - /// - /// If the open file has an exclusive lock, this function downgrades the lock - /// to a shared lock. If it has a shared lock, this function has no effect. - /// - /// This requests an *advisory* lock, meaning that the file could be accessed - /// by other programs that don't hold the lock. - /// - /// It is unspecified how shared locks interact with locks acquired by - /// non-WASI programs. - /// - /// This function blocks until the lock can be acquired. - /// - /// Not all filesystems support locking; on filesystems which don't support - /// locking, this function returns `error-code::unsupported`. - /// - /// Note: This is similar to `flock(fd, LOCK_SH)` in Unix. - pub fn lock_shared(this: Descriptor) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:filesystem/filesystem")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "lock-shared")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:filesystem/filesystem_lock-shared" - )] - fn wit_import(_: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 1) as *const u8)) { - 0 => ErrorCode::Access, - 1 => ErrorCode::WouldBlock, - 2 => ErrorCode::Already, - 3 => ErrorCode::BadDescriptor, - 4 => ErrorCode::Busy, - 5 => ErrorCode::Deadlock, - 6 => ErrorCode::Quota, - 7 => ErrorCode::Exist, - 8 => ErrorCode::FileTooLarge, - 9 => ErrorCode::IllegalByteSequence, - 10 => ErrorCode::InProgress, - 11 => ErrorCode::Interrupted, - 12 => ErrorCode::Invalid, - 13 => ErrorCode::Io, - 14 => ErrorCode::IsDirectory, - 15 => ErrorCode::Loop, - 16 => ErrorCode::TooManyLinks, - 17 => ErrorCode::MessageSize, - 18 => ErrorCode::NameTooLong, - 19 => ErrorCode::NoDevice, - 20 => ErrorCode::NoEntry, - 21 => ErrorCode::NoLock, - 22 => ErrorCode::InsufficientMemory, - 23 => ErrorCode::InsufficientSpace, - 24 => ErrorCode::NotDirectory, - 25 => ErrorCode::NotEmpty, - 26 => ErrorCode::NotRecoverable, - 27 => ErrorCode::Unsupported, - 28 => ErrorCode::NoTty, - 29 => ErrorCode::NoSuchDevice, - 30 => ErrorCode::Overflow, - 31 => ErrorCode::NotPermitted, - 32 => ErrorCode::Pipe, - 33 => ErrorCode::ReadOnly, - 34 => ErrorCode::InvalidSeek, - 35 => ErrorCode::TextFileBusy, - 36 => ErrorCode::CrossDevice, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, ErrorCode>(i32::from( - *((ptr0 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Request an exclusive advisory lock for an open file. - /// - /// This requests an *exclusive* lock; no other locks may be held for the - /// file while an exclusive lock is held. - /// - /// If the open file has a shared lock and there are no exclusive locks held - /// for the file, this function upgrades the lock to an exclusive lock. If the - /// open file already has an exclusive lock, this function has no effect. - /// - /// This requests an *advisory* lock, meaning that the file could be accessed - /// by other programs that don't hold the lock. - /// - /// It is unspecified whether this function succeeds if the file descriptor - /// is not opened for writing. It is unspecified how exclusive locks interact - /// with locks acquired by non-WASI programs. - /// - /// This function blocks until the lock can be acquired. - /// - /// Not all filesystems support locking; on filesystems which don't support - /// locking, this function returns `error-code::unsupported`. - /// - /// Note: This is similar to `flock(fd, LOCK_EX)` in Unix. - pub fn lock_exclusive(this: Descriptor) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:filesystem/filesystem")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "lock-exclusive")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:filesystem/filesystem_lock-exclusive" - )] - fn wit_import(_: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 1) as *const u8)) { - 0 => ErrorCode::Access, - 1 => ErrorCode::WouldBlock, - 2 => ErrorCode::Already, - 3 => ErrorCode::BadDescriptor, - 4 => ErrorCode::Busy, - 5 => ErrorCode::Deadlock, - 6 => ErrorCode::Quota, - 7 => ErrorCode::Exist, - 8 => ErrorCode::FileTooLarge, - 9 => ErrorCode::IllegalByteSequence, - 10 => ErrorCode::InProgress, - 11 => ErrorCode::Interrupted, - 12 => ErrorCode::Invalid, - 13 => ErrorCode::Io, - 14 => ErrorCode::IsDirectory, - 15 => ErrorCode::Loop, - 16 => ErrorCode::TooManyLinks, - 17 => ErrorCode::MessageSize, - 18 => ErrorCode::NameTooLong, - 19 => ErrorCode::NoDevice, - 20 => ErrorCode::NoEntry, - 21 => ErrorCode::NoLock, - 22 => ErrorCode::InsufficientMemory, - 23 => ErrorCode::InsufficientSpace, - 24 => ErrorCode::NotDirectory, - 25 => ErrorCode::NotEmpty, - 26 => ErrorCode::NotRecoverable, - 27 => ErrorCode::Unsupported, - 28 => ErrorCode::NoTty, - 29 => ErrorCode::NoSuchDevice, - 30 => ErrorCode::Overflow, - 31 => ErrorCode::NotPermitted, - 32 => ErrorCode::Pipe, - 33 => ErrorCode::ReadOnly, - 34 => ErrorCode::InvalidSeek, - 35 => ErrorCode::TextFileBusy, - 36 => ErrorCode::CrossDevice, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, ErrorCode>(i32::from( - *((ptr0 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Request a shared advisory lock for an open file. - /// - /// This requests a *shared* lock; more than one shared lock can be held for - /// a file at the same time. - /// - /// If the open file has an exclusive lock, this function downgrades the lock - /// to a shared lock. If it has a shared lock, this function has no effect. - /// - /// This requests an *advisory* lock, meaning that the file could be accessed - /// by other programs that don't hold the lock. - /// - /// It is unspecified how shared locks interact with locks acquired by - /// non-WASI programs. - /// - /// This function returns `error-code::would-block` if the lock cannot be - /// acquired. - /// - /// Not all filesystems support locking; on filesystems which don't support - /// locking, this function returns `error-code::unsupported`. - /// - /// Note: This is similar to `flock(fd, LOCK_SH | LOCK_NB)` in Unix. - pub fn try_lock_shared(this: Descriptor) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:filesystem/filesystem")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "try-lock-shared")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:filesystem/filesystem_try-lock-shared" - )] - fn wit_import(_: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 1) as *const u8)) { - 0 => ErrorCode::Access, - 1 => ErrorCode::WouldBlock, - 2 => ErrorCode::Already, - 3 => ErrorCode::BadDescriptor, - 4 => ErrorCode::Busy, - 5 => ErrorCode::Deadlock, - 6 => ErrorCode::Quota, - 7 => ErrorCode::Exist, - 8 => ErrorCode::FileTooLarge, - 9 => ErrorCode::IllegalByteSequence, - 10 => ErrorCode::InProgress, - 11 => ErrorCode::Interrupted, - 12 => ErrorCode::Invalid, - 13 => ErrorCode::Io, - 14 => ErrorCode::IsDirectory, - 15 => ErrorCode::Loop, - 16 => ErrorCode::TooManyLinks, - 17 => ErrorCode::MessageSize, - 18 => ErrorCode::NameTooLong, - 19 => ErrorCode::NoDevice, - 20 => ErrorCode::NoEntry, - 21 => ErrorCode::NoLock, - 22 => ErrorCode::InsufficientMemory, - 23 => ErrorCode::InsufficientSpace, - 24 => ErrorCode::NotDirectory, - 25 => ErrorCode::NotEmpty, - 26 => ErrorCode::NotRecoverable, - 27 => ErrorCode::Unsupported, - 28 => ErrorCode::NoTty, - 29 => ErrorCode::NoSuchDevice, - 30 => ErrorCode::Overflow, - 31 => ErrorCode::NotPermitted, - 32 => ErrorCode::Pipe, - 33 => ErrorCode::ReadOnly, - 34 => ErrorCode::InvalidSeek, - 35 => ErrorCode::TextFileBusy, - 36 => ErrorCode::CrossDevice, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, ErrorCode>(i32::from( - *((ptr0 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Request an exclusive advisory lock for an open file. - /// - /// This requests an *exclusive* lock; no other locks may be held for the - /// file while an exclusive lock is held. - /// - /// If the open file has a shared lock and there are no exclusive locks held - /// for the file, this function upgrades the lock to an exclusive lock. If the - /// open file already has an exclusive lock, this function has no effect. - /// - /// This requests an *advisory* lock, meaning that the file could be accessed - /// by other programs that don't hold the lock. - /// - /// It is unspecified whether this function succeeds if the file descriptor - /// is not opened for writing. It is unspecified how exclusive locks interact - /// with locks acquired by non-WASI programs. - /// - /// This function returns `error-code::would-block` if the lock cannot be - /// acquired. - /// - /// Not all filesystems support locking; on filesystems which don't support - /// locking, this function returns `error-code::unsupported`. - /// - /// Note: This is similar to `flock(fd, LOCK_EX | LOCK_NB)` in Unix. - pub fn try_lock_exclusive(this: Descriptor) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:filesystem/filesystem")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "try-lock-exclusive")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:filesystem/filesystem_try-lock-exclusive" - )] - fn wit_import(_: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 1) as *const u8)) { - 0 => ErrorCode::Access, - 1 => ErrorCode::WouldBlock, - 2 => ErrorCode::Already, - 3 => ErrorCode::BadDescriptor, - 4 => ErrorCode::Busy, - 5 => ErrorCode::Deadlock, - 6 => ErrorCode::Quota, - 7 => ErrorCode::Exist, - 8 => ErrorCode::FileTooLarge, - 9 => ErrorCode::IllegalByteSequence, - 10 => ErrorCode::InProgress, - 11 => ErrorCode::Interrupted, - 12 => ErrorCode::Invalid, - 13 => ErrorCode::Io, - 14 => ErrorCode::IsDirectory, - 15 => ErrorCode::Loop, - 16 => ErrorCode::TooManyLinks, - 17 => ErrorCode::MessageSize, - 18 => ErrorCode::NameTooLong, - 19 => ErrorCode::NoDevice, - 20 => ErrorCode::NoEntry, - 21 => ErrorCode::NoLock, - 22 => ErrorCode::InsufficientMemory, - 23 => ErrorCode::InsufficientSpace, - 24 => ErrorCode::NotDirectory, - 25 => ErrorCode::NotEmpty, - 26 => ErrorCode::NotRecoverable, - 27 => ErrorCode::Unsupported, - 28 => ErrorCode::NoTty, - 29 => ErrorCode::NoSuchDevice, - 30 => ErrorCode::Overflow, - 31 => ErrorCode::NotPermitted, - 32 => ErrorCode::Pipe, - 33 => ErrorCode::ReadOnly, - 34 => ErrorCode::InvalidSeek, - 35 => ErrorCode::TextFileBusy, - 36 => ErrorCode::CrossDevice, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, ErrorCode>(i32::from( - *((ptr0 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Release a shared or exclusive lock on an open file. - /// - /// Note: This is similar to `flock(fd, LOCK_UN)` in Unix. - pub fn unlock(this: Descriptor) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:filesystem/filesystem")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "unlock")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:filesystem/filesystem_unlock" - )] - fn wit_import(_: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 1) as *const u8)) { - 0 => ErrorCode::Access, - 1 => ErrorCode::WouldBlock, - 2 => ErrorCode::Already, - 3 => ErrorCode::BadDescriptor, - 4 => ErrorCode::Busy, - 5 => ErrorCode::Deadlock, - 6 => ErrorCode::Quota, - 7 => ErrorCode::Exist, - 8 => ErrorCode::FileTooLarge, - 9 => ErrorCode::IllegalByteSequence, - 10 => ErrorCode::InProgress, - 11 => ErrorCode::Interrupted, - 12 => ErrorCode::Invalid, - 13 => ErrorCode::Io, - 14 => ErrorCode::IsDirectory, - 15 => ErrorCode::Loop, - 16 => ErrorCode::TooManyLinks, - 17 => ErrorCode::MessageSize, - 18 => ErrorCode::NameTooLong, - 19 => ErrorCode::NoDevice, - 20 => ErrorCode::NoEntry, - 21 => ErrorCode::NoLock, - 22 => ErrorCode::InsufficientMemory, - 23 => ErrorCode::InsufficientSpace, - 24 => ErrorCode::NotDirectory, - 25 => ErrorCode::NotEmpty, - 26 => ErrorCode::NotRecoverable, - 27 => ErrorCode::Unsupported, - 28 => ErrorCode::NoTty, - 29 => ErrorCode::NoSuchDevice, - 30 => ErrorCode::Overflow, - 31 => ErrorCode::NotPermitted, - 32 => ErrorCode::Pipe, - 33 => ErrorCode::ReadOnly, - 34 => ErrorCode::InvalidSeek, - 35 => ErrorCode::TextFileBusy, - 36 => ErrorCode::CrossDevice, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, ErrorCode>(i32::from( - *((ptr0 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Dispose of the specified `descriptor`, after which it may no longer - /// be used. - pub fn drop_descriptor(this: Descriptor) { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[link(wasm_import_module = "wasi:filesystem/filesystem")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "drop-descriptor")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:filesystem/filesystem_drop-descriptor" - )] - fn wit_import(_: i32); - } - wit_import(wit_bindgen::rt::as_i32(this)); - } - } - #[allow(clippy::all)] - /// Read a single directory entry from a `directory-entry-stream`. - pub fn read_directory_entry( - this: DirectoryEntryStream, - ) -> Result, ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(8))] - struct RetArea([u8; 48]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:filesystem/filesystem")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "read-directory-entry")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:filesystem/filesystem_read-directory-entry" - )] - fn wit_import(_: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(match i32::from(*((ptr0 + 8) as *const u8)) { - 0 => None, - 1 => Some({ - let len1 = *((ptr0 + 40) as *const i32) as usize; +// (0i32, (flags2.bits() >> 0) as i32) +// } +// AccessType::Exists => (1i32, 0i32), +// }; +// let ptr4 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:filesystem/filesystem")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "access-at")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:filesystem/filesystem_access-at" +// )] +// fn wit_import(_: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// (flags0.bits() >> 0) as i32, +// ptr1, +// len1, +// result3_0, +// result3_1, +// ptr4, +// ); +// match i32::from(*((ptr4 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr4 + 1) as *const u8)) { +// 0 => ErrorCode::Access, +// 1 => ErrorCode::WouldBlock, +// 2 => ErrorCode::Already, +// 3 => ErrorCode::BadDescriptor, +// 4 => ErrorCode::Busy, +// 5 => ErrorCode::Deadlock, +// 6 => ErrorCode::Quota, +// 7 => ErrorCode::Exist, +// 8 => ErrorCode::FileTooLarge, +// 9 => ErrorCode::IllegalByteSequence, +// 10 => ErrorCode::InProgress, +// 11 => ErrorCode::Interrupted, +// 12 => ErrorCode::Invalid, +// 13 => ErrorCode::Io, +// 14 => ErrorCode::IsDirectory, +// 15 => ErrorCode::Loop, +// 16 => ErrorCode::TooManyLinks, +// 17 => ErrorCode::MessageSize, +// 18 => ErrorCode::NameTooLong, +// 19 => ErrorCode::NoDevice, +// 20 => ErrorCode::NoEntry, +// 21 => ErrorCode::NoLock, +// 22 => ErrorCode::InsufficientMemory, +// 23 => ErrorCode::InsufficientSpace, +// 24 => ErrorCode::NotDirectory, +// 25 => ErrorCode::NotEmpty, +// 26 => ErrorCode::NotRecoverable, +// 27 => ErrorCode::Unsupported, +// 28 => ErrorCode::NoTty, +// 29 => ErrorCode::NoSuchDevice, +// 30 => ErrorCode::Overflow, +// 31 => ErrorCode::NotPermitted, +// 32 => ErrorCode::Pipe, +// 33 => ErrorCode::ReadOnly, +// 34 => ErrorCode::InvalidSeek, +// 35 => ErrorCode::TextFileBusy, +// 36 => ErrorCode::CrossDevice, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::<_, ErrorCode>(i32::from( +// *((ptr4 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Unlink a filesystem object that is not a directory. +// /// +// /// Return `error-code::is-directory` if the path refers to a directory. +// /// Note: This is similar to `unlinkat(fd, path, 0)` in POSIX. +// pub fn unlink_file_at(this: Descriptor, path: &str) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let vec0 = path; +// let ptr0 = vec0.as_ptr() as i32; +// let len0 = vec0.len() as i32; +// let ptr1 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:filesystem/filesystem")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "unlink-file-at")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:filesystem/filesystem_unlink-file-at" +// )] +// fn wit_import(_: i32, _: i32, _: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0, len0, ptr1); +// match i32::from(*((ptr1 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr1 + 1) as *const u8)) { +// 0 => ErrorCode::Access, +// 1 => ErrorCode::WouldBlock, +// 2 => ErrorCode::Already, +// 3 => ErrorCode::BadDescriptor, +// 4 => ErrorCode::Busy, +// 5 => ErrorCode::Deadlock, +// 6 => ErrorCode::Quota, +// 7 => ErrorCode::Exist, +// 8 => ErrorCode::FileTooLarge, +// 9 => ErrorCode::IllegalByteSequence, +// 10 => ErrorCode::InProgress, +// 11 => ErrorCode::Interrupted, +// 12 => ErrorCode::Invalid, +// 13 => ErrorCode::Io, +// 14 => ErrorCode::IsDirectory, +// 15 => ErrorCode::Loop, +// 16 => ErrorCode::TooManyLinks, +// 17 => ErrorCode::MessageSize, +// 18 => ErrorCode::NameTooLong, +// 19 => ErrorCode::NoDevice, +// 20 => ErrorCode::NoEntry, +// 21 => ErrorCode::NoLock, +// 22 => ErrorCode::InsufficientMemory, +// 23 => ErrorCode::InsufficientSpace, +// 24 => ErrorCode::NotDirectory, +// 25 => ErrorCode::NotEmpty, +// 26 => ErrorCode::NotRecoverable, +// 27 => ErrorCode::Unsupported, +// 28 => ErrorCode::NoTty, +// 29 => ErrorCode::NoSuchDevice, +// 30 => ErrorCode::Overflow, +// 31 => ErrorCode::NotPermitted, +// 32 => ErrorCode::Pipe, +// 33 => ErrorCode::ReadOnly, +// 34 => ErrorCode::InvalidSeek, +// 35 => ErrorCode::TextFileBusy, +// 36 => ErrorCode::CrossDevice, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::<_, ErrorCode>(i32::from( +// *((ptr1 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Change the permissions of a filesystem object that is not a directory. +// /// +// /// Note that the ultimate meanings of these permissions is +// /// filesystem-specific. +// /// +// /// Note: This is similar to `fchmodat` in POSIX. +// pub fn change_file_permissions_at( +// this: Descriptor, +// path_flags: PathFlags, +// path: &str, +// modes: Modes, +// ) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let flags0 = path_flags; +// let vec1 = path; +// let ptr1 = vec1.as_ptr() as i32; +// let len1 = vec1.len() as i32; +// let flags2 = modes; +// let ptr3 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:filesystem/filesystem")] +// extern "C" { +// #[cfg_attr( +// target_arch = "wasm32", +// link_name = "change-file-permissions-at" +// )] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:filesystem/filesystem_change-file-permissions-at" +// )] +// fn wit_import(_: i32, _: i32, _: i32, _: i32, _: i32, _: i32); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// (flags0.bits() >> 0) as i32, +// ptr1, +// len1, +// (flags2.bits() >> 0) as i32, +// ptr3, +// ); +// match i32::from(*((ptr3 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr3 + 1) as *const u8)) { +// 0 => ErrorCode::Access, +// 1 => ErrorCode::WouldBlock, +// 2 => ErrorCode::Already, +// 3 => ErrorCode::BadDescriptor, +// 4 => ErrorCode::Busy, +// 5 => ErrorCode::Deadlock, +// 6 => ErrorCode::Quota, +// 7 => ErrorCode::Exist, +// 8 => ErrorCode::FileTooLarge, +// 9 => ErrorCode::IllegalByteSequence, +// 10 => ErrorCode::InProgress, +// 11 => ErrorCode::Interrupted, +// 12 => ErrorCode::Invalid, +// 13 => ErrorCode::Io, +// 14 => ErrorCode::IsDirectory, +// 15 => ErrorCode::Loop, +// 16 => ErrorCode::TooManyLinks, +// 17 => ErrorCode::MessageSize, +// 18 => ErrorCode::NameTooLong, +// 19 => ErrorCode::NoDevice, +// 20 => ErrorCode::NoEntry, +// 21 => ErrorCode::NoLock, +// 22 => ErrorCode::InsufficientMemory, +// 23 => ErrorCode::InsufficientSpace, +// 24 => ErrorCode::NotDirectory, +// 25 => ErrorCode::NotEmpty, +// 26 => ErrorCode::NotRecoverable, +// 27 => ErrorCode::Unsupported, +// 28 => ErrorCode::NoTty, +// 29 => ErrorCode::NoSuchDevice, +// 30 => ErrorCode::Overflow, +// 31 => ErrorCode::NotPermitted, +// 32 => ErrorCode::Pipe, +// 33 => ErrorCode::ReadOnly, +// 34 => ErrorCode::InvalidSeek, +// 35 => ErrorCode::TextFileBusy, +// 36 => ErrorCode::CrossDevice, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::<_, ErrorCode>(i32::from( +// *((ptr3 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Change the permissions of a directory. +// /// +// /// Note that the ultimate meanings of these permissions is +// /// filesystem-specific. +// /// +// /// Unlike in POSIX, the `executable` flag is not reinterpreted as a "search" +// /// flag. `read` on a directory implies readability and searchability, and +// /// `execute` is not valid for directories. +// /// +// /// Note: This is similar to `fchmodat` in POSIX. +// pub fn change_directory_permissions_at( +// this: Descriptor, +// path_flags: PathFlags, +// path: &str, +// modes: Modes, +// ) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let flags0 = path_flags; +// let vec1 = path; +// let ptr1 = vec1.as_ptr() as i32; +// let len1 = vec1.len() as i32; +// let flags2 = modes; +// let ptr3 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:filesystem/filesystem")] +// extern "C" { +// #[cfg_attr( +// target_arch = "wasm32", +// link_name = "change-directory-permissions-at" +// )] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:filesystem/filesystem_change-directory-permissions-at" +// )] +// fn wit_import(_: i32, _: i32, _: i32, _: i32, _: i32, _: i32); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// (flags0.bits() >> 0) as i32, +// ptr1, +// len1, +// (flags2.bits() >> 0) as i32, +// ptr3, +// ); +// match i32::from(*((ptr3 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr3 + 1) as *const u8)) { +// 0 => ErrorCode::Access, +// 1 => ErrorCode::WouldBlock, +// 2 => ErrorCode::Already, +// 3 => ErrorCode::BadDescriptor, +// 4 => ErrorCode::Busy, +// 5 => ErrorCode::Deadlock, +// 6 => ErrorCode::Quota, +// 7 => ErrorCode::Exist, +// 8 => ErrorCode::FileTooLarge, +// 9 => ErrorCode::IllegalByteSequence, +// 10 => ErrorCode::InProgress, +// 11 => ErrorCode::Interrupted, +// 12 => ErrorCode::Invalid, +// 13 => ErrorCode::Io, +// 14 => ErrorCode::IsDirectory, +// 15 => ErrorCode::Loop, +// 16 => ErrorCode::TooManyLinks, +// 17 => ErrorCode::MessageSize, +// 18 => ErrorCode::NameTooLong, +// 19 => ErrorCode::NoDevice, +// 20 => ErrorCode::NoEntry, +// 21 => ErrorCode::NoLock, +// 22 => ErrorCode::InsufficientMemory, +// 23 => ErrorCode::InsufficientSpace, +// 24 => ErrorCode::NotDirectory, +// 25 => ErrorCode::NotEmpty, +// 26 => ErrorCode::NotRecoverable, +// 27 => ErrorCode::Unsupported, +// 28 => ErrorCode::NoTty, +// 29 => ErrorCode::NoSuchDevice, +// 30 => ErrorCode::Overflow, +// 31 => ErrorCode::NotPermitted, +// 32 => ErrorCode::Pipe, +// 33 => ErrorCode::ReadOnly, +// 34 => ErrorCode::InvalidSeek, +// 35 => ErrorCode::TextFileBusy, +// 36 => ErrorCode::CrossDevice, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::<_, ErrorCode>(i32::from( +// *((ptr3 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Request a shared advisory lock for an open file. +// /// +// /// This requests a *shared* lock; more than one shared lock can be held for +// /// a file at the same time. +// /// +// /// If the open file has an exclusive lock, this function downgrades the lock +// /// to a shared lock. If it has a shared lock, this function has no effect. +// /// +// /// This requests an *advisory* lock, meaning that the file could be accessed +// /// by other programs that don't hold the lock. +// /// +// /// It is unspecified how shared locks interact with locks acquired by +// /// non-WASI programs. +// /// +// /// This function blocks until the lock can be acquired. +// /// +// /// Not all filesystems support locking; on filesystems which don't support +// /// locking, this function returns `error-code::unsupported`. +// /// +// /// Note: This is similar to `flock(fd, LOCK_SH)` in Unix. +// pub fn lock_shared(this: Descriptor) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:filesystem/filesystem")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "lock-shared")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:filesystem/filesystem_lock-shared" +// )] +// fn wit_import(_: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 1) as *const u8)) { +// 0 => ErrorCode::Access, +// 1 => ErrorCode::WouldBlock, +// 2 => ErrorCode::Already, +// 3 => ErrorCode::BadDescriptor, +// 4 => ErrorCode::Busy, +// 5 => ErrorCode::Deadlock, +// 6 => ErrorCode::Quota, +// 7 => ErrorCode::Exist, +// 8 => ErrorCode::FileTooLarge, +// 9 => ErrorCode::IllegalByteSequence, +// 10 => ErrorCode::InProgress, +// 11 => ErrorCode::Interrupted, +// 12 => ErrorCode::Invalid, +// 13 => ErrorCode::Io, +// 14 => ErrorCode::IsDirectory, +// 15 => ErrorCode::Loop, +// 16 => ErrorCode::TooManyLinks, +// 17 => ErrorCode::MessageSize, +// 18 => ErrorCode::NameTooLong, +// 19 => ErrorCode::NoDevice, +// 20 => ErrorCode::NoEntry, +// 21 => ErrorCode::NoLock, +// 22 => ErrorCode::InsufficientMemory, +// 23 => ErrorCode::InsufficientSpace, +// 24 => ErrorCode::NotDirectory, +// 25 => ErrorCode::NotEmpty, +// 26 => ErrorCode::NotRecoverable, +// 27 => ErrorCode::Unsupported, +// 28 => ErrorCode::NoTty, +// 29 => ErrorCode::NoSuchDevice, +// 30 => ErrorCode::Overflow, +// 31 => ErrorCode::NotPermitted, +// 32 => ErrorCode::Pipe, +// 33 => ErrorCode::ReadOnly, +// 34 => ErrorCode::InvalidSeek, +// 35 => ErrorCode::TextFileBusy, +// 36 => ErrorCode::CrossDevice, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::<_, ErrorCode>(i32::from( +// *((ptr0 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Request an exclusive advisory lock for an open file. +// /// +// /// This requests an *exclusive* lock; no other locks may be held for the +// /// file while an exclusive lock is held. +// /// +// /// If the open file has a shared lock and there are no exclusive locks held +// /// for the file, this function upgrades the lock to an exclusive lock. If the +// /// open file already has an exclusive lock, this function has no effect. +// /// +// /// This requests an *advisory* lock, meaning that the file could be accessed +// /// by other programs that don't hold the lock. +// /// +// /// It is unspecified whether this function succeeds if the file descriptor +// /// is not opened for writing. It is unspecified how exclusive locks interact +// /// with locks acquired by non-WASI programs. +// /// +// /// This function blocks until the lock can be acquired. +// /// +// /// Not all filesystems support locking; on filesystems which don't support +// /// locking, this function returns `error-code::unsupported`. +// /// +// /// Note: This is similar to `flock(fd, LOCK_EX)` in Unix. +// pub fn lock_exclusive(this: Descriptor) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:filesystem/filesystem")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "lock-exclusive")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:filesystem/filesystem_lock-exclusive" +// )] +// fn wit_import(_: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 1) as *const u8)) { +// 0 => ErrorCode::Access, +// 1 => ErrorCode::WouldBlock, +// 2 => ErrorCode::Already, +// 3 => ErrorCode::BadDescriptor, +// 4 => ErrorCode::Busy, +// 5 => ErrorCode::Deadlock, +// 6 => ErrorCode::Quota, +// 7 => ErrorCode::Exist, +// 8 => ErrorCode::FileTooLarge, +// 9 => ErrorCode::IllegalByteSequence, +// 10 => ErrorCode::InProgress, +// 11 => ErrorCode::Interrupted, +// 12 => ErrorCode::Invalid, +// 13 => ErrorCode::Io, +// 14 => ErrorCode::IsDirectory, +// 15 => ErrorCode::Loop, +// 16 => ErrorCode::TooManyLinks, +// 17 => ErrorCode::MessageSize, +// 18 => ErrorCode::NameTooLong, +// 19 => ErrorCode::NoDevice, +// 20 => ErrorCode::NoEntry, +// 21 => ErrorCode::NoLock, +// 22 => ErrorCode::InsufficientMemory, +// 23 => ErrorCode::InsufficientSpace, +// 24 => ErrorCode::NotDirectory, +// 25 => ErrorCode::NotEmpty, +// 26 => ErrorCode::NotRecoverable, +// 27 => ErrorCode::Unsupported, +// 28 => ErrorCode::NoTty, +// 29 => ErrorCode::NoSuchDevice, +// 30 => ErrorCode::Overflow, +// 31 => ErrorCode::NotPermitted, +// 32 => ErrorCode::Pipe, +// 33 => ErrorCode::ReadOnly, +// 34 => ErrorCode::InvalidSeek, +// 35 => ErrorCode::TextFileBusy, +// 36 => ErrorCode::CrossDevice, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::<_, ErrorCode>(i32::from( +// *((ptr0 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Request a shared advisory lock for an open file. +// /// +// /// This requests a *shared* lock; more than one shared lock can be held for +// /// a file at the same time. +// /// +// /// If the open file has an exclusive lock, this function downgrades the lock +// /// to a shared lock. If it has a shared lock, this function has no effect. +// /// +// /// This requests an *advisory* lock, meaning that the file could be accessed +// /// by other programs that don't hold the lock. +// /// +// /// It is unspecified how shared locks interact with locks acquired by +// /// non-WASI programs. +// /// +// /// This function returns `error-code::would-block` if the lock cannot be +// /// acquired. +// /// +// /// Not all filesystems support locking; on filesystems which don't support +// /// locking, this function returns `error-code::unsupported`. +// /// +// /// Note: This is similar to `flock(fd, LOCK_SH | LOCK_NB)` in Unix. +// pub fn try_lock_shared(this: Descriptor) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:filesystem/filesystem")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "try-lock-shared")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:filesystem/filesystem_try-lock-shared" +// )] +// fn wit_import(_: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 1) as *const u8)) { +// 0 => ErrorCode::Access, +// 1 => ErrorCode::WouldBlock, +// 2 => ErrorCode::Already, +// 3 => ErrorCode::BadDescriptor, +// 4 => ErrorCode::Busy, +// 5 => ErrorCode::Deadlock, +// 6 => ErrorCode::Quota, +// 7 => ErrorCode::Exist, +// 8 => ErrorCode::FileTooLarge, +// 9 => ErrorCode::IllegalByteSequence, +// 10 => ErrorCode::InProgress, +// 11 => ErrorCode::Interrupted, +// 12 => ErrorCode::Invalid, +// 13 => ErrorCode::Io, +// 14 => ErrorCode::IsDirectory, +// 15 => ErrorCode::Loop, +// 16 => ErrorCode::TooManyLinks, +// 17 => ErrorCode::MessageSize, +// 18 => ErrorCode::NameTooLong, +// 19 => ErrorCode::NoDevice, +// 20 => ErrorCode::NoEntry, +// 21 => ErrorCode::NoLock, +// 22 => ErrorCode::InsufficientMemory, +// 23 => ErrorCode::InsufficientSpace, +// 24 => ErrorCode::NotDirectory, +// 25 => ErrorCode::NotEmpty, +// 26 => ErrorCode::NotRecoverable, +// 27 => ErrorCode::Unsupported, +// 28 => ErrorCode::NoTty, +// 29 => ErrorCode::NoSuchDevice, +// 30 => ErrorCode::Overflow, +// 31 => ErrorCode::NotPermitted, +// 32 => ErrorCode::Pipe, +// 33 => ErrorCode::ReadOnly, +// 34 => ErrorCode::InvalidSeek, +// 35 => ErrorCode::TextFileBusy, +// 36 => ErrorCode::CrossDevice, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::<_, ErrorCode>(i32::from( +// *((ptr0 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Request an exclusive advisory lock for an open file. +// /// +// /// This requests an *exclusive* lock; no other locks may be held for the +// /// file while an exclusive lock is held. +// /// +// /// If the open file has a shared lock and there are no exclusive locks held +// /// for the file, this function upgrades the lock to an exclusive lock. If the +// /// open file already has an exclusive lock, this function has no effect. +// /// +// /// This requests an *advisory* lock, meaning that the file could be accessed +// /// by other programs that don't hold the lock. +// /// +// /// It is unspecified whether this function succeeds if the file descriptor +// /// is not opened for writing. It is unspecified how exclusive locks interact +// /// with locks acquired by non-WASI programs. +// /// +// /// This function returns `error-code::would-block` if the lock cannot be +// /// acquired. +// /// +// /// Not all filesystems support locking; on filesystems which don't support +// /// locking, this function returns `error-code::unsupported`. +// /// +// /// Note: This is similar to `flock(fd, LOCK_EX | LOCK_NB)` in Unix. +// pub fn try_lock_exclusive(this: Descriptor) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:filesystem/filesystem")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "try-lock-exclusive")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:filesystem/filesystem_try-lock-exclusive" +// )] +// fn wit_import(_: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 1) as *const u8)) { +// 0 => ErrorCode::Access, +// 1 => ErrorCode::WouldBlock, +// 2 => ErrorCode::Already, +// 3 => ErrorCode::BadDescriptor, +// 4 => ErrorCode::Busy, +// 5 => ErrorCode::Deadlock, +// 6 => ErrorCode::Quota, +// 7 => ErrorCode::Exist, +// 8 => ErrorCode::FileTooLarge, +// 9 => ErrorCode::IllegalByteSequence, +// 10 => ErrorCode::InProgress, +// 11 => ErrorCode::Interrupted, +// 12 => ErrorCode::Invalid, +// 13 => ErrorCode::Io, +// 14 => ErrorCode::IsDirectory, +// 15 => ErrorCode::Loop, +// 16 => ErrorCode::TooManyLinks, +// 17 => ErrorCode::MessageSize, +// 18 => ErrorCode::NameTooLong, +// 19 => ErrorCode::NoDevice, +// 20 => ErrorCode::NoEntry, +// 21 => ErrorCode::NoLock, +// 22 => ErrorCode::InsufficientMemory, +// 23 => ErrorCode::InsufficientSpace, +// 24 => ErrorCode::NotDirectory, +// 25 => ErrorCode::NotEmpty, +// 26 => ErrorCode::NotRecoverable, +// 27 => ErrorCode::Unsupported, +// 28 => ErrorCode::NoTty, +// 29 => ErrorCode::NoSuchDevice, +// 30 => ErrorCode::Overflow, +// 31 => ErrorCode::NotPermitted, +// 32 => ErrorCode::Pipe, +// 33 => ErrorCode::ReadOnly, +// 34 => ErrorCode::InvalidSeek, +// 35 => ErrorCode::TextFileBusy, +// 36 => ErrorCode::CrossDevice, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::<_, ErrorCode>(i32::from( +// *((ptr0 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Release a shared or exclusive lock on an open file. +// /// +// /// Note: This is similar to `flock(fd, LOCK_UN)` in Unix. +// pub fn unlock(this: Descriptor) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:filesystem/filesystem")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "unlock")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:filesystem/filesystem_unlock" +// )] +// fn wit_import(_: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 1) as *const u8)) { +// 0 => ErrorCode::Access, +// 1 => ErrorCode::WouldBlock, +// 2 => ErrorCode::Already, +// 3 => ErrorCode::BadDescriptor, +// 4 => ErrorCode::Busy, +// 5 => ErrorCode::Deadlock, +// 6 => ErrorCode::Quota, +// 7 => ErrorCode::Exist, +// 8 => ErrorCode::FileTooLarge, +// 9 => ErrorCode::IllegalByteSequence, +// 10 => ErrorCode::InProgress, +// 11 => ErrorCode::Interrupted, +// 12 => ErrorCode::Invalid, +// 13 => ErrorCode::Io, +// 14 => ErrorCode::IsDirectory, +// 15 => ErrorCode::Loop, +// 16 => ErrorCode::TooManyLinks, +// 17 => ErrorCode::MessageSize, +// 18 => ErrorCode::NameTooLong, +// 19 => ErrorCode::NoDevice, +// 20 => ErrorCode::NoEntry, +// 21 => ErrorCode::NoLock, +// 22 => ErrorCode::InsufficientMemory, +// 23 => ErrorCode::InsufficientSpace, +// 24 => ErrorCode::NotDirectory, +// 25 => ErrorCode::NotEmpty, +// 26 => ErrorCode::NotRecoverable, +// 27 => ErrorCode::Unsupported, +// 28 => ErrorCode::NoTty, +// 29 => ErrorCode::NoSuchDevice, +// 30 => ErrorCode::Overflow, +// 31 => ErrorCode::NotPermitted, +// 32 => ErrorCode::Pipe, +// 33 => ErrorCode::ReadOnly, +// 34 => ErrorCode::InvalidSeek, +// 35 => ErrorCode::TextFileBusy, +// 36 => ErrorCode::CrossDevice, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::<_, ErrorCode>(i32::from( +// *((ptr0 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Dispose of the specified `descriptor`, after which it may no longer +// /// be used. +// pub fn drop_descriptor(this: Descriptor) { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[link(wasm_import_module = "wasi:filesystem/filesystem")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "drop-descriptor")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:filesystem/filesystem_drop-descriptor" +// )] +// fn wit_import(_: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this)); +// } +// } +// #[allow(clippy::all)] +// /// Read a single directory entry from a `directory-entry-stream`. +// pub fn read_directory_entry( +// this: DirectoryEntryStream, +// ) -> Result, ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(8))] +// struct RetArea([u8; 48]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:filesystem/filesystem")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "read-directory-entry")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:filesystem/filesystem_read-directory-entry" +// )] +// fn wit_import(_: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(match i32::from(*((ptr0 + 8) as *const u8)) { +// 0 => None, +// 1 => Some({ +// let len1 = *((ptr0 + 40) as *const i32) as usize; - DirectoryEntry { - inode: match i32::from(*((ptr0 + 16) as *const u8)) { - 0 => None, - 1 => Some(*((ptr0 + 24) as *const i64) as u64), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - }, - type_: { - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 32) as *const u8)) { - 0 => DescriptorType::Unknown, - 1 => DescriptorType::BlockDevice, - 2 => DescriptorType::CharacterDevice, - 3 => DescriptorType::Directory, - 4 => DescriptorType::Fifo, - 5 => DescriptorType::SymbolicLink, - 6 => DescriptorType::RegularFile, - 7 => DescriptorType::Socket, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, DescriptorType>(i32::from( - *((ptr0 + 32) as *const u8), - ) - as u8) - } - }, - name: { - #[cfg(not(debug_assertions))] - { - String::from_utf8_unchecked(Vec::from_raw_parts( - *((ptr0 + 36) as *const i32) as *mut _, - len1, - len1, - )) - } - #[cfg(debug_assertions)] - { - String::from_utf8(Vec::from_raw_parts( - *((ptr0 + 36) as *const i32) as *mut _, - len1, - len1, - )) - .unwrap() - } - }, - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - }), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 8) as *const u8)) { - 0 => ErrorCode::Access, - 1 => ErrorCode::WouldBlock, - 2 => ErrorCode::Already, - 3 => ErrorCode::BadDescriptor, - 4 => ErrorCode::Busy, - 5 => ErrorCode::Deadlock, - 6 => ErrorCode::Quota, - 7 => ErrorCode::Exist, - 8 => ErrorCode::FileTooLarge, - 9 => ErrorCode::IllegalByteSequence, - 10 => ErrorCode::InProgress, - 11 => ErrorCode::Interrupted, - 12 => ErrorCode::Invalid, - 13 => ErrorCode::Io, - 14 => ErrorCode::IsDirectory, - 15 => ErrorCode::Loop, - 16 => ErrorCode::TooManyLinks, - 17 => ErrorCode::MessageSize, - 18 => ErrorCode::NameTooLong, - 19 => ErrorCode::NoDevice, - 20 => ErrorCode::NoEntry, - 21 => ErrorCode::NoLock, - 22 => ErrorCode::InsufficientMemory, - 23 => ErrorCode::InsufficientSpace, - 24 => ErrorCode::NotDirectory, - 25 => ErrorCode::NotEmpty, - 26 => ErrorCode::NotRecoverable, - 27 => ErrorCode::Unsupported, - 28 => ErrorCode::NoTty, - 29 => ErrorCode::NoSuchDevice, - 30 => ErrorCode::Overflow, - 31 => ErrorCode::NotPermitted, - 32 => ErrorCode::Pipe, - 33 => ErrorCode::ReadOnly, - 34 => ErrorCode::InvalidSeek, - 35 => ErrorCode::TextFileBusy, - 36 => ErrorCode::CrossDevice, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, ErrorCode>(i32::from( - *((ptr0 + 8) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Dispose of the specified `directory-entry-stream`, after which it may no longer - /// be used. - pub fn drop_directory_entry_stream(this: DirectoryEntryStream) { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[link(wasm_import_module = "wasi:filesystem/filesystem")] - extern "C" { - #[cfg_attr( - target_arch = "wasm32", - link_name = "drop-directory-entry-stream" - )] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:filesystem/filesystem_drop-directory-entry-stream" - )] - fn wit_import(_: i32); - } - wit_import(wit_bindgen::rt::as_i32(this)); - } - } - } - } - pub mod io { +// DirectoryEntry { +// inode: match i32::from(*((ptr0 + 16) as *const u8)) { +// 0 => None, +// 1 => Some(*((ptr0 + 24) as *const i64) as u64), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// }, +// type_: { +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 32) as *const u8)) { +// 0 => DescriptorType::Unknown, +// 1 => DescriptorType::BlockDevice, +// 2 => DescriptorType::CharacterDevice, +// 3 => DescriptorType::Directory, +// 4 => DescriptorType::Fifo, +// 5 => DescriptorType::SymbolicLink, +// 6 => DescriptorType::RegularFile, +// 7 => DescriptorType::Socket, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::<_, DescriptorType>(i32::from( +// *((ptr0 + 32) as *const u8), +// ) +// as u8) +// } +// }, +// name: { +// #[cfg(not(debug_assertions))] +// { +// String::from_utf8_unchecked(Vec::from_raw_parts( +// *((ptr0 + 36) as *const i32) as *mut _, +// len1, +// len1, +// )) +// } +// #[cfg(debug_assertions)] +// { +// String::from_utf8(Vec::from_raw_parts( +// *((ptr0 + 36) as *const i32) as *mut _, +// len1, +// len1, +// )) +// .unwrap() +// } +// }, +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// }), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 8) as *const u8)) { +// 0 => ErrorCode::Access, +// 1 => ErrorCode::WouldBlock, +// 2 => ErrorCode::Already, +// 3 => ErrorCode::BadDescriptor, +// 4 => ErrorCode::Busy, +// 5 => ErrorCode::Deadlock, +// 6 => ErrorCode::Quota, +// 7 => ErrorCode::Exist, +// 8 => ErrorCode::FileTooLarge, +// 9 => ErrorCode::IllegalByteSequence, +// 10 => ErrorCode::InProgress, +// 11 => ErrorCode::Interrupted, +// 12 => ErrorCode::Invalid, +// 13 => ErrorCode::Io, +// 14 => ErrorCode::IsDirectory, +// 15 => ErrorCode::Loop, +// 16 => ErrorCode::TooManyLinks, +// 17 => ErrorCode::MessageSize, +// 18 => ErrorCode::NameTooLong, +// 19 => ErrorCode::NoDevice, +// 20 => ErrorCode::NoEntry, +// 21 => ErrorCode::NoLock, +// 22 => ErrorCode::InsufficientMemory, +// 23 => ErrorCode::InsufficientSpace, +// 24 => ErrorCode::NotDirectory, +// 25 => ErrorCode::NotEmpty, +// 26 => ErrorCode::NotRecoverable, +// 27 => ErrorCode::Unsupported, +// 28 => ErrorCode::NoTty, +// 29 => ErrorCode::NoSuchDevice, +// 30 => ErrorCode::Overflow, +// 31 => ErrorCode::NotPermitted, +// 32 => ErrorCode::Pipe, +// 33 => ErrorCode::ReadOnly, +// 34 => ErrorCode::InvalidSeek, +// 35 => ErrorCode::TextFileBusy, +// 36 => ErrorCode::CrossDevice, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::<_, ErrorCode>(i32::from( +// *((ptr0 + 8) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Dispose of the specified `directory-entry-stream`, after which it may no longer +// /// be used. +// pub fn drop_directory_entry_stream(this: DirectoryEntryStream) { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[link(wasm_import_module = "wasi:filesystem/filesystem")] +// extern "C" { +// #[cfg_attr( +// target_arch = "wasm32", +// link_name = "drop-directory-entry-stream" +// )] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:filesystem/filesystem_drop-directory-entry-stream" +// )] +// fn wit_import(_: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this)); +// } +// } +// } +// } +// pub mod io { - #[allow(clippy::all)] - pub mod streams { - #[used] - #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; +// #[allow(clippy::all)] +// pub mod streams { +// #[used] +// #[doc(hidden)] +// #[cfg(target_arch = "wasm32")] +// static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; - pub type Pollable = super::super::super::wasi::poll::poll::Pollable; - /// An error type returned from a stream operation. Currently this - /// doesn't provide any additional information. - #[repr(C)] - #[derive(Copy, Clone)] - pub struct StreamError {} - impl ::core::fmt::Debug for StreamError { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - f.debug_struct("StreamError").finish() - } - } - impl ::core::fmt::Display for StreamError { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - write!(f, "{:?}", self) - } - } - impl std::error::Error for StreamError {} - /// An output bytestream. In the future, this will be replaced by handle - /// types. - /// - /// This conceptually represents a `stream`. It's temporary - /// scaffolding until component-model's async features are ready. - /// - /// `output-stream`s are *non-blocking* to the extent practical on - /// underlying platforms. Except where specified otherwise, I/O operations also - /// always return promptly, after the number of bytes that can be written - /// promptly, which could even be zero. To wait for the stream to be ready to - /// accept data, the `subscribe-to-output-stream` function to obtain a - /// `pollable` which can be polled for using `wasi_poll`. - /// - /// And at present, it is a `u32` instead of being an actual handle, until - /// the wit-bindgen implementation of handles and resources is ready. - /// - /// This [represents a resource](https://github.com/WebAssembly/WASI/blob/main/docs/WitInWasi.md#Resources). - pub type OutputStream = u32; - /// An input bytestream. In the future, this will be replaced by handle - /// types. - /// - /// This conceptually represents a `stream`. It's temporary - /// scaffolding until component-model's async features are ready. - /// - /// `input-stream`s are *non-blocking* to the extent practical on underlying - /// platforms. I/O operations always return promptly; if fewer bytes are - /// promptly available than requested, they return the number of bytes promptly - /// available, which could even be zero. To wait for data to be available, - /// use the `subscribe-to-input-stream` function to obtain a `pollable` which - /// can be polled for using `wasi_poll`. - /// - /// And at present, it is a `u32` instead of being an actual handle, until - /// the wit-bindgen implementation of handles and resources is ready. - /// - /// This [represents a resource](https://github.com/WebAssembly/WASI/blob/main/docs/WitInWasi.md#Resources). - pub type InputStream = u32; - #[allow(clippy::all)] - /// Read bytes from a stream. - /// - /// This function returns a list of bytes containing the data that was - /// read, along with a bool which, when true, indicates that the end of the - /// stream was reached. The returned list will contain up to `len` bytes; it - /// may return fewer than requested, but not more. - /// - /// Once a stream has reached the end, subsequent calls to read or - /// `skip` will always report end-of-stream rather than producing more - /// data. - /// - /// If `len` is 0, it represents a request to read 0 bytes, which should - /// always succeed, assuming the stream hasn't reached its end yet, and - /// return an empty list. - /// - /// The len here is a `u64`, but some callees may not be able to allocate - /// a buffer as large as that would imply. - /// FIXME: describe what happens if allocation fails. - pub fn read( - this: InputStream, - len: u64, - ) -> Result<(wit_bindgen::rt::vec::Vec, bool), StreamError> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(4))] - struct RetArea([u8; 16]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:io/streams")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "read")] - #[cfg_attr(not(target_arch = "wasm32"), link_name = "wasi:io/streams_read")] - fn wit_import(_: i32, _: i64, _: i32); - } - wit_import( - wit_bindgen::rt::as_i32(this), - wit_bindgen::rt::as_i64(len), - ptr0, - ); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok({ - let len1 = *((ptr0 + 8) as *const i32) as usize; +// pub type Pollable = super::super::super::wasi::poll::poll::Pollable; +// /// An error type returned from a stream operation. Currently this +// /// doesn't provide any additional information. +// #[repr(C)] +// #[derive(Copy, Clone)] +// pub struct StreamError {} +// impl ::core::fmt::Debug for StreamError { +// fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { +// f.debug_struct("StreamError").finish() +// } +// } +// impl ::core::fmt::Display for StreamError { +// fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { +// write!(f, "{:?}", self) +// } +// } +// impl std::error::Error for StreamError {} +// /// An output bytestream. In the future, this will be replaced by handle +// /// types. +// /// +// /// This conceptually represents a `stream`. It's temporary +// /// scaffolding until component-model's async features are ready. +// /// +// /// `output-stream`s are *non-blocking* to the extent practical on +// /// underlying platforms. Except where specified otherwise, I/O operations also +// /// always return promptly, after the number of bytes that can be written +// /// promptly, which could even be zero. To wait for the stream to be ready to +// /// accept data, the `subscribe-to-output-stream` function to obtain a +// /// `pollable` which can be polled for using `wasi_poll`. +// /// +// /// And at present, it is a `u32` instead of being an actual handle, until +// /// the wit-bindgen implementation of handles and resources is ready. +// /// +// /// This [represents a resource](https://github.com/WebAssembly/WASI/blob/main/docs/WitInWasi.md#Resources). +// pub type OutputStream = u32; +// /// An input bytestream. In the future, this will be replaced by handle +// /// types. +// /// +// /// This conceptually represents a `stream`. It's temporary +// /// scaffolding until component-model's async features are ready. +// /// +// /// `input-stream`s are *non-blocking* to the extent practical on underlying +// /// platforms. I/O operations always return promptly; if fewer bytes are +// /// promptly available than requested, they return the number of bytes promptly +// /// available, which could even be zero. To wait for data to be available, +// /// use the `subscribe-to-input-stream` function to obtain a `pollable` which +// /// can be polled for using `wasi_poll`. +// /// +// /// And at present, it is a `u32` instead of being an actual handle, until +// /// the wit-bindgen implementation of handles and resources is ready. +// /// +// /// This [represents a resource](https://github.com/WebAssembly/WASI/blob/main/docs/WitInWasi.md#Resources). +// pub type InputStream = u32; +// #[allow(clippy::all)] +// /// Read bytes from a stream. +// /// +// /// This function returns a list of bytes containing the data that was +// /// read, along with a bool which, when true, indicates that the end of the +// /// stream was reached. The returned list will contain up to `len` bytes; it +// /// may return fewer than requested, but not more. +// /// +// /// Once a stream has reached the end, subsequent calls to read or +// /// `skip` will always report end-of-stream rather than producing more +// /// data. +// /// +// /// If `len` is 0, it represents a request to read 0 bytes, which should +// /// always succeed, assuming the stream hasn't reached its end yet, and +// /// return an empty list. +// /// +// /// The len here is a `u64`, but some callees may not be able to allocate +// /// a buffer as large as that would imply. +// /// FIXME: describe what happens if allocation fails. +// pub fn read( +// this: InputStream, +// len: u64, +// ) -> Result<(wit_bindgen::rt::vec::Vec, bool), StreamError> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(4))] +// struct RetArea([u8; 16]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:io/streams")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "read")] +// #[cfg_attr(not(target_arch = "wasm32"), link_name = "wasi:io/streams_read")] +// fn wit_import(_: i32, _: i64, _: i32); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// wit_bindgen::rt::as_i64(len), +// ptr0, +// ); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok({ +// let len1 = *((ptr0 + 8) as *const i32) as usize; - ( - Vec::from_raw_parts( - *((ptr0 + 4) as *const i32) as *mut _, - len1, - len1, - ), - { - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::(i32::from( - *((ptr0 + 12) as *const u8), - ) - as u8) - } - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 12) as *const u8)) { - 0 => false, - 1 => true, - _ => panic!("invalid bool discriminant"), - } - } - }, - ) - }), - 1 => Err(StreamError {}), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Read bytes from a stream, with blocking. - /// - /// This is similar to `read`, except that it blocks until at least one - /// byte can be read. - pub fn blocking_read( - this: InputStream, - len: u64, - ) -> Result<(wit_bindgen::rt::vec::Vec, bool), StreamError> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(4))] - struct RetArea([u8; 16]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:io/streams")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "blocking-read")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:io/streams_blocking-read" - )] - fn wit_import(_: i32, _: i64, _: i32); - } - wit_import( - wit_bindgen::rt::as_i32(this), - wit_bindgen::rt::as_i64(len), - ptr0, - ); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok({ - let len1 = *((ptr0 + 8) as *const i32) as usize; +// ( +// Vec::from_raw_parts( +// *((ptr0 + 4) as *const i32) as *mut _, +// len1, +// len1, +// ), +// { +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::(i32::from( +// *((ptr0 + 12) as *const u8), +// ) +// as u8) +// } +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 12) as *const u8)) { +// 0 => false, +// 1 => true, +// _ => panic!("invalid bool discriminant"), +// } +// } +// }, +// ) +// }), +// 1 => Err(StreamError {}), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Read bytes from a stream, with blocking. +// /// +// /// This is similar to `read`, except that it blocks until at least one +// /// byte can be read. +// pub fn blocking_read( +// this: InputStream, +// len: u64, +// ) -> Result<(wit_bindgen::rt::vec::Vec, bool), StreamError> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(4))] +// struct RetArea([u8; 16]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:io/streams")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "blocking-read")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:io/streams_blocking-read" +// )] +// fn wit_import(_: i32, _: i64, _: i32); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// wit_bindgen::rt::as_i64(len), +// ptr0, +// ); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok({ +// let len1 = *((ptr0 + 8) as *const i32) as usize; - ( - Vec::from_raw_parts( - *((ptr0 + 4) as *const i32) as *mut _, - len1, - len1, - ), - { - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::(i32::from( - *((ptr0 + 12) as *const u8), - ) - as u8) - } - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 12) as *const u8)) { - 0 => false, - 1 => true, - _ => panic!("invalid bool discriminant"), - } - } - }, - ) - }), - 1 => Err(StreamError {}), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Skip bytes from a stream. - /// - /// This is similar to the `read` function, but avoids copying the - /// bytes into the instance. - /// - /// Once a stream has reached the end, subsequent calls to read or - /// `skip` will always report end-of-stream rather than producing more - /// data. - /// - /// This function returns the number of bytes skipped, along with a bool - /// indicating whether the end of the stream was reached. The returned - /// value will be at most `len`; it may be less. - pub fn skip(this: InputStream, len: u64) -> Result<(u64, bool), StreamError> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(8))] - struct RetArea([u8; 24]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:io/streams")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "skip")] - #[cfg_attr(not(target_arch = "wasm32"), link_name = "wasi:io/streams_skip")] - fn wit_import(_: i32, _: i64, _: i32); - } - wit_import( - wit_bindgen::rt::as_i32(this), - wit_bindgen::rt::as_i64(len), - ptr0, - ); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok((*((ptr0 + 8) as *const i64) as u64, { - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::(i32::from( - *((ptr0 + 16) as *const u8), - ) - as u8) - } - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 16) as *const u8)) { - 0 => false, - 1 => true, - _ => panic!("invalid bool discriminant"), - } - } - })), - 1 => Err(StreamError {}), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Skip bytes from a stream, with blocking. - /// - /// This is similar to `skip`, except that it blocks until at least one - /// byte can be consumed. - pub fn blocking_skip(this: InputStream, len: u64) -> Result<(u64, bool), StreamError> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(8))] - struct RetArea([u8; 24]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:io/streams")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "blocking-skip")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:io/streams_blocking-skip" - )] - fn wit_import(_: i32, _: i64, _: i32); - } - wit_import( - wit_bindgen::rt::as_i32(this), - wit_bindgen::rt::as_i64(len), - ptr0, - ); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok((*((ptr0 + 8) as *const i64) as u64, { - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::(i32::from( - *((ptr0 + 16) as *const u8), - ) - as u8) - } - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 16) as *const u8)) { - 0 => false, - 1 => true, - _ => panic!("invalid bool discriminant"), - } - } - })), - 1 => Err(StreamError {}), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Create a `pollable` which will resolve once either the specified stream - /// has bytes available to read or the other end of the stream has been - /// closed. - pub fn subscribe_to_input_stream(this: InputStream) -> Pollable { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[link(wasm_import_module = "wasi:io/streams")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "subscribe-to-input-stream")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:io/streams_subscribe-to-input-stream" - )] - fn wit_import(_: i32) -> i32; - } - let ret = wit_import(wit_bindgen::rt::as_i32(this)); - ret as u32 - } - } - #[allow(clippy::all)] - /// Dispose of the specified `input-stream`, after which it may no longer - /// be used. - pub fn drop_input_stream(this: InputStream) { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[link(wasm_import_module = "wasi:io/streams")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "drop-input-stream")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:io/streams_drop-input-stream" - )] - fn wit_import(_: i32); - } - wit_import(wit_bindgen::rt::as_i32(this)); - } - } - #[allow(clippy::all)] - /// Write bytes to a stream. - /// - /// This function returns a `u64` indicating the number of bytes from - /// `buf` that were written; it may be less than the full list. - pub fn write(this: OutputStream, buf: &[u8]) -> Result { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(8))] - struct RetArea([u8; 16]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let vec0 = buf; - let ptr0 = vec0.as_ptr() as i32; - let len0 = vec0.len() as i32; - let ptr1 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:io/streams")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "write")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:io/streams_write" - )] - fn wit_import(_: i32, _: i32, _: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0, len0, ptr1); - match i32::from(*((ptr1 + 0) as *const u8)) { - 0 => Ok(*((ptr1 + 8) as *const i64) as u64), - 1 => Err(StreamError {}), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Write bytes to a stream, with blocking. - /// - /// This is similar to `write`, except that it blocks until at least one - /// byte can be written. - pub fn blocking_write(this: OutputStream, buf: &[u8]) -> Result { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(8))] - struct RetArea([u8; 16]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let vec0 = buf; - let ptr0 = vec0.as_ptr() as i32; - let len0 = vec0.len() as i32; - let ptr1 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:io/streams")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "blocking-write")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:io/streams_blocking-write" - )] - fn wit_import(_: i32, _: i32, _: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0, len0, ptr1); - match i32::from(*((ptr1 + 0) as *const u8)) { - 0 => Ok(*((ptr1 + 8) as *const i64) as u64), - 1 => Err(StreamError {}), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Write multiple zero bytes to a stream. - /// - /// This function returns a `u64` indicating the number of zero bytes - /// that were written; it may be less than `len`. - pub fn write_zeroes(this: OutputStream, len: u64) -> Result { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(8))] - struct RetArea([u8; 16]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:io/streams")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "write-zeroes")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:io/streams_write-zeroes" - )] - fn wit_import(_: i32, _: i64, _: i32); - } - wit_import( - wit_bindgen::rt::as_i32(this), - wit_bindgen::rt::as_i64(len), - ptr0, - ); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(*((ptr0 + 8) as *const i64) as u64), - 1 => Err(StreamError {}), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Write multiple zero bytes to a stream, with blocking. - /// - /// This is similar to `write-zeroes`, except that it blocks until at least - /// one byte can be written. - pub fn blocking_write_zeroes(this: OutputStream, len: u64) -> Result { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(8))] - struct RetArea([u8; 16]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:io/streams")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "blocking-write-zeroes")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:io/streams_blocking-write-zeroes" - )] - fn wit_import(_: i32, _: i64, _: i32); - } - wit_import( - wit_bindgen::rt::as_i32(this), - wit_bindgen::rt::as_i64(len), - ptr0, - ); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(*((ptr0 + 8) as *const i64) as u64), - 1 => Err(StreamError {}), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Read from one stream and write to another. - /// - /// This function returns the number of bytes transferred; it may be less - /// than `len`. - /// - /// Unlike other I/O functions, this function blocks until all the data - /// read from the input stream has been written to the output stream. - pub fn splice( - this: OutputStream, - src: InputStream, - len: u64, - ) -> Result<(u64, bool), StreamError> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(8))] - struct RetArea([u8; 24]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:io/streams")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "splice")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:io/streams_splice" - )] - fn wit_import(_: i32, _: i32, _: i64, _: i32); - } - wit_import( - wit_bindgen::rt::as_i32(this), - wit_bindgen::rt::as_i32(src), - wit_bindgen::rt::as_i64(len), - ptr0, - ); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok((*((ptr0 + 8) as *const i64) as u64, { - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::(i32::from( - *((ptr0 + 16) as *const u8), - ) - as u8) - } - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 16) as *const u8)) { - 0 => false, - 1 => true, - _ => panic!("invalid bool discriminant"), - } - } - })), - 1 => Err(StreamError {}), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Read from one stream and write to another, with blocking. - /// - /// This is similar to `splice`, except that it blocks until at least - /// one byte can be read. - pub fn blocking_splice( - this: OutputStream, - src: InputStream, - len: u64, - ) -> Result<(u64, bool), StreamError> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(8))] - struct RetArea([u8; 24]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:io/streams")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "blocking-splice")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:io/streams_blocking-splice" - )] - fn wit_import(_: i32, _: i32, _: i64, _: i32); - } - wit_import( - wit_bindgen::rt::as_i32(this), - wit_bindgen::rt::as_i32(src), - wit_bindgen::rt::as_i64(len), - ptr0, - ); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok((*((ptr0 + 8) as *const i64) as u64, { - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::(i32::from( - *((ptr0 + 16) as *const u8), - ) - as u8) - } - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 16) as *const u8)) { - 0 => false, - 1 => true, - _ => panic!("invalid bool discriminant"), - } - } - })), - 1 => Err(StreamError {}), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Forward the entire contents of an input stream to an output stream. - /// - /// This function repeatedly reads from the input stream and writes - /// the data to the output stream, until the end of the input stream - /// is reached, or an error is encountered. - /// - /// Unlike other I/O functions, this function blocks until the end - /// of the input stream is seen and all the data has been written to - /// the output stream. - /// - /// This function returns the number of bytes transferred. - pub fn forward(this: OutputStream, src: InputStream) -> Result { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(8))] - struct RetArea([u8; 16]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:io/streams")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "forward")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:io/streams_forward" - )] - fn wit_import(_: i32, _: i32, _: i32); - } - wit_import( - wit_bindgen::rt::as_i32(this), - wit_bindgen::rt::as_i32(src), - ptr0, - ); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(*((ptr0 + 8) as *const i64) as u64), - 1 => Err(StreamError {}), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Create a `pollable` which will resolve once either the specified stream - /// is ready to accept bytes or the other end of the stream has been closed. - pub fn subscribe_to_output_stream(this: OutputStream) -> Pollable { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[link(wasm_import_module = "wasi:io/streams")] - extern "C" { - #[cfg_attr( - target_arch = "wasm32", - link_name = "subscribe-to-output-stream" - )] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:io/streams_subscribe-to-output-stream" - )] - fn wit_import(_: i32) -> i32; - } - let ret = wit_import(wit_bindgen::rt::as_i32(this)); - ret as u32 - } - } - #[allow(clippy::all)] - /// Dispose of the specified `output-stream`, after which it may no longer - /// be used. - pub fn drop_output_stream(this: OutputStream) { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[link(wasm_import_module = "wasi:io/streams")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "drop-output-stream")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:io/streams_drop-output-stream" - )] - fn wit_import(_: i32); - } - wit_import(wit_bindgen::rt::as_i32(this)); - } - } - } - } - pub mod poll { +// ( +// Vec::from_raw_parts( +// *((ptr0 + 4) as *const i32) as *mut _, +// len1, +// len1, +// ), +// { +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::(i32::from( +// *((ptr0 + 12) as *const u8), +// ) +// as u8) +// } +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 12) as *const u8)) { +// 0 => false, +// 1 => true, +// _ => panic!("invalid bool discriminant"), +// } +// } +// }, +// ) +// }), +// 1 => Err(StreamError {}), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Skip bytes from a stream. +// /// +// /// This is similar to the `read` function, but avoids copying the +// /// bytes into the instance. +// /// +// /// Once a stream has reached the end, subsequent calls to read or +// /// `skip` will always report end-of-stream rather than producing more +// /// data. +// /// +// /// This function returns the number of bytes skipped, along with a bool +// /// indicating whether the end of the stream was reached. The returned +// /// value will be at most `len`; it may be less. +// pub fn skip(this: InputStream, len: u64) -> Result<(u64, bool), StreamError> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(8))] +// struct RetArea([u8; 24]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:io/streams")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "skip")] +// #[cfg_attr(not(target_arch = "wasm32"), link_name = "wasi:io/streams_skip")] +// fn wit_import(_: i32, _: i64, _: i32); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// wit_bindgen::rt::as_i64(len), +// ptr0, +// ); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok((*((ptr0 + 8) as *const i64) as u64, { +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::(i32::from( +// *((ptr0 + 16) as *const u8), +// ) +// as u8) +// } +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 16) as *const u8)) { +// 0 => false, +// 1 => true, +// _ => panic!("invalid bool discriminant"), +// } +// } +// })), +// 1 => Err(StreamError {}), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Skip bytes from a stream, with blocking. +// /// +// /// This is similar to `skip`, except that it blocks until at least one +// /// byte can be consumed. +// pub fn blocking_skip(this: InputStream, len: u64) -> Result<(u64, bool), StreamError> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(8))] +// struct RetArea([u8; 24]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:io/streams")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "blocking-skip")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:io/streams_blocking-skip" +// )] +// fn wit_import(_: i32, _: i64, _: i32); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// wit_bindgen::rt::as_i64(len), +// ptr0, +// ); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok((*((ptr0 + 8) as *const i64) as u64, { +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::(i32::from( +// *((ptr0 + 16) as *const u8), +// ) +// as u8) +// } +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 16) as *const u8)) { +// 0 => false, +// 1 => true, +// _ => panic!("invalid bool discriminant"), +// } +// } +// })), +// 1 => Err(StreamError {}), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Create a `pollable` which will resolve once either the specified stream +// /// has bytes available to read or the other end of the stream has been +// /// closed. +// pub fn subscribe_to_input_stream(this: InputStream) -> Pollable { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[link(wasm_import_module = "wasi:io/streams")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "subscribe-to-input-stream")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:io/streams_subscribe-to-input-stream" +// )] +// fn wit_import(_: i32) -> i32; +// } +// let ret = wit_import(wit_bindgen::rt::as_i32(this)); +// ret as u32 +// } +// } +// #[allow(clippy::all)] +// /// Dispose of the specified `input-stream`, after which it may no longer +// /// be used. +// pub fn drop_input_stream(this: InputStream) { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[link(wasm_import_module = "wasi:io/streams")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "drop-input-stream")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:io/streams_drop-input-stream" +// )] +// fn wit_import(_: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this)); +// } +// } +// #[allow(clippy::all)] +// /// Write bytes to a stream. +// /// +// /// This function returns a `u64` indicating the number of bytes from +// /// `buf` that were written; it may be less than the full list. +// pub fn write(this: OutputStream, buf: &[u8]) -> Result { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(8))] +// struct RetArea([u8; 16]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let vec0 = buf; +// let ptr0 = vec0.as_ptr() as i32; +// let len0 = vec0.len() as i32; +// let ptr1 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:io/streams")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "write")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:io/streams_write" +// )] +// fn wit_import(_: i32, _: i32, _: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0, len0, ptr1); +// match i32::from(*((ptr1 + 0) as *const u8)) { +// 0 => Ok(*((ptr1 + 8) as *const i64) as u64), +// 1 => Err(StreamError {}), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Write bytes to a stream, with blocking. +// /// +// /// This is similar to `write`, except that it blocks until at least one +// /// byte can be written. +// pub fn blocking_write(this: OutputStream, buf: &[u8]) -> Result { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(8))] +// struct RetArea([u8; 16]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let vec0 = buf; +// let ptr0 = vec0.as_ptr() as i32; +// let len0 = vec0.len() as i32; +// let ptr1 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:io/streams")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "blocking-write")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:io/streams_blocking-write" +// )] +// fn wit_import(_: i32, _: i32, _: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0, len0, ptr1); +// match i32::from(*((ptr1 + 0) as *const u8)) { +// 0 => Ok(*((ptr1 + 8) as *const i64) as u64), +// 1 => Err(StreamError {}), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Write multiple zero bytes to a stream. +// /// +// /// This function returns a `u64` indicating the number of zero bytes +// /// that were written; it may be less than `len`. +// pub fn write_zeroes(this: OutputStream, len: u64) -> Result { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(8))] +// struct RetArea([u8; 16]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:io/streams")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "write-zeroes")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:io/streams_write-zeroes" +// )] +// fn wit_import(_: i32, _: i64, _: i32); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// wit_bindgen::rt::as_i64(len), +// ptr0, +// ); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(*((ptr0 + 8) as *const i64) as u64), +// 1 => Err(StreamError {}), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Write multiple zero bytes to a stream, with blocking. +// /// +// /// This is similar to `write-zeroes`, except that it blocks until at least +// /// one byte can be written. +// pub fn blocking_write_zeroes(this: OutputStream, len: u64) -> Result { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(8))] +// struct RetArea([u8; 16]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:io/streams")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "blocking-write-zeroes")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:io/streams_blocking-write-zeroes" +// )] +// fn wit_import(_: i32, _: i64, _: i32); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// wit_bindgen::rt::as_i64(len), +// ptr0, +// ); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(*((ptr0 + 8) as *const i64) as u64), +// 1 => Err(StreamError {}), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Read from one stream and write to another. +// /// +// /// This function returns the number of bytes transferred; it may be less +// /// than `len`. +// /// +// /// Unlike other I/O functions, this function blocks until all the data +// /// read from the input stream has been written to the output stream. +// pub fn splice( +// this: OutputStream, +// src: InputStream, +// len: u64, +// ) -> Result<(u64, bool), StreamError> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(8))] +// struct RetArea([u8; 24]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:io/streams")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "splice")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:io/streams_splice" +// )] +// fn wit_import(_: i32, _: i32, _: i64, _: i32); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// wit_bindgen::rt::as_i32(src), +// wit_bindgen::rt::as_i64(len), +// ptr0, +// ); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok((*((ptr0 + 8) as *const i64) as u64, { +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::(i32::from( +// *((ptr0 + 16) as *const u8), +// ) +// as u8) +// } +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 16) as *const u8)) { +// 0 => false, +// 1 => true, +// _ => panic!("invalid bool discriminant"), +// } +// } +// })), +// 1 => Err(StreamError {}), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Read from one stream and write to another, with blocking. +// /// +// /// This is similar to `splice`, except that it blocks until at least +// /// one byte can be read. +// pub fn blocking_splice( +// this: OutputStream, +// src: InputStream, +// len: u64, +// ) -> Result<(u64, bool), StreamError> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(8))] +// struct RetArea([u8; 24]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:io/streams")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "blocking-splice")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:io/streams_blocking-splice" +// )] +// fn wit_import(_: i32, _: i32, _: i64, _: i32); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// wit_bindgen::rt::as_i32(src), +// wit_bindgen::rt::as_i64(len), +// ptr0, +// ); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok((*((ptr0 + 8) as *const i64) as u64, { +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::(i32::from( +// *((ptr0 + 16) as *const u8), +// ) +// as u8) +// } +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 16) as *const u8)) { +// 0 => false, +// 1 => true, +// _ => panic!("invalid bool discriminant"), +// } +// } +// })), +// 1 => Err(StreamError {}), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Forward the entire contents of an input stream to an output stream. +// /// +// /// This function repeatedly reads from the input stream and writes +// /// the data to the output stream, until the end of the input stream +// /// is reached, or an error is encountered. +// /// +// /// Unlike other I/O functions, this function blocks until the end +// /// of the input stream is seen and all the data has been written to +// /// the output stream. +// /// +// /// This function returns the number of bytes transferred. +// pub fn forward(this: OutputStream, src: InputStream) -> Result { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(8))] +// struct RetArea([u8; 16]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:io/streams")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "forward")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:io/streams_forward" +// )] +// fn wit_import(_: i32, _: i32, _: i32); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// wit_bindgen::rt::as_i32(src), +// ptr0, +// ); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(*((ptr0 + 8) as *const i64) as u64), +// 1 => Err(StreamError {}), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Create a `pollable` which will resolve once either the specified stream +// /// is ready to accept bytes or the other end of the stream has been closed. +// pub fn subscribe_to_output_stream(this: OutputStream) -> Pollable { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[link(wasm_import_module = "wasi:io/streams")] +// extern "C" { +// #[cfg_attr( +// target_arch = "wasm32", +// link_name = "subscribe-to-output-stream" +// )] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:io/streams_subscribe-to-output-stream" +// )] +// fn wit_import(_: i32) -> i32; +// } +// let ret = wit_import(wit_bindgen::rt::as_i32(this)); +// ret as u32 +// } +// } +// #[allow(clippy::all)] +// /// Dispose of the specified `output-stream`, after which it may no longer +// /// be used. +// pub fn drop_output_stream(this: OutputStream) { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[link(wasm_import_module = "wasi:io/streams")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "drop-output-stream")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:io/streams_drop-output-stream" +// )] +// fn wit_import(_: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this)); +// } +// } +// } +// } +// pub mod poll { - #[allow(clippy::all)] - pub mod poll { - #[used] - #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; +// #[allow(clippy::all)] +// pub mod poll { +// #[used] +// #[doc(hidden)] +// #[cfg(target_arch = "wasm32")] +// static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; - /// A "pollable" handle. - /// - /// This is conceptually represents a `stream<_, _>`, or in other words, - /// a stream that one can wait on, repeatedly, but which does not itself - /// produce any data. It's temporary scaffolding until component-model's - /// async features are ready. - /// - /// And at present, it is a `u32` instead of being an actual handle, until - /// the wit-bindgen implementation of handles and resources is ready. - /// - /// `pollable` lifetimes are not automatically managed. Users must ensure - /// that they do not outlive the resource they reference. - /// - /// This [represents a resource](https://github.com/WebAssembly/WASI/blob/main/docs/WitInWasi.md#Resources). - pub type Pollable = u32; - #[allow(clippy::all)] - /// Dispose of the specified `pollable`, after which it may no longer - /// be used. - pub fn drop_pollable(this: Pollable) { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[link(wasm_import_module = "wasi:poll/poll")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "drop-pollable")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:poll/poll_drop-pollable" - )] - fn wit_import(_: i32); - } - wit_import(wit_bindgen::rt::as_i32(this)); - } - } - #[allow(clippy::all)] - /// Poll for completion on a set of pollables. - /// - /// The "oneoff" in the name refers to the fact that this function must do a - /// linear scan through the entire list of subscriptions, which may be - /// inefficient if the number is large and the same subscriptions are used - /// many times. In the future, this is expected to be obsoleted by the - /// component model async proposal, which will include a scalable waiting - /// facility. - /// - /// The result list is the same length as the argument - /// list, and indicates the readiness of each corresponding - /// element in that / list, with true indicating ready. - pub fn poll_oneoff(in_: &[Pollable]) -> wit_bindgen::rt::vec::Vec { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(4))] - struct RetArea([u8; 8]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let vec0 = in_; - let ptr0 = vec0.as_ptr() as i32; - let len0 = vec0.len() as i32; - let ptr1 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:poll/poll")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "poll-oneoff")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:poll/poll_poll-oneoff" - )] - fn wit_import(_: i32, _: i32, _: i32); - } - wit_import(ptr0, len0, ptr1); - let base2 = *((ptr1 + 0) as *const i32); - let len2 = *((ptr1 + 4) as *const i32); - let mut result2 = Vec::with_capacity(len2 as usize); - for i in 0..len2 { - let base = base2 + i * 1; - result2.push({ - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::(i32::from( - *((base + 0) as *const u8), - ) - as u8) - } - #[cfg(debug_assertions)] - { - match i32::from(*((base + 0) as *const u8)) { - 0 => false, - 1 => true, - _ => panic!("invalid bool discriminant"), - } - } - }); - } - wit_bindgen::rt::dealloc(base2, (len2 as usize) * 1, 1); - result2 - } - } - } - } - pub mod random { +// /// A "pollable" handle. +// /// +// /// This is conceptually represents a `stream<_, _>`, or in other words, +// /// a stream that one can wait on, repeatedly, but which does not itself +// /// produce any data. It's temporary scaffolding until component-model's +// /// async features are ready. +// /// +// /// And at present, it is a `u32` instead of being an actual handle, until +// /// the wit-bindgen implementation of handles and resources is ready. +// /// +// /// `pollable` lifetimes are not automatically managed. Users must ensure +// /// that they do not outlive the resource they reference. +// /// +// /// This [represents a resource](https://github.com/WebAssembly/WASI/blob/main/docs/WitInWasi.md#Resources). +// pub type Pollable = u32; +// #[allow(clippy::all)] +// /// Dispose of the specified `pollable`, after which it may no longer +// /// be used. +// pub fn drop_pollable(this: Pollable) { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[link(wasm_import_module = "wasi:poll/poll")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "drop-pollable")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:poll/poll_drop-pollable" +// )] +// fn wit_import(_: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this)); +// } +// } +// #[allow(clippy::all)] +// /// Poll for completion on a set of pollables. +// /// +// /// The "oneoff" in the name refers to the fact that this function must do a +// /// linear scan through the entire list of subscriptions, which may be +// /// inefficient if the number is large and the same subscriptions are used +// /// many times. In the future, this is expected to be obsoleted by the +// /// component model async proposal, which will include a scalable waiting +// /// facility. +// /// +// /// The result list is the same length as the argument +// /// list, and indicates the readiness of each corresponding +// /// element in that / list, with true indicating ready. +// pub fn poll_oneoff(in_: &[Pollable]) -> wit_bindgen::rt::vec::Vec { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(4))] +// struct RetArea([u8; 8]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let vec0 = in_; +// let ptr0 = vec0.as_ptr() as i32; +// let len0 = vec0.len() as i32; +// let ptr1 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:poll/poll")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "poll-oneoff")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:poll/poll_poll-oneoff" +// )] +// fn wit_import(_: i32, _: i32, _: i32); +// } +// wit_import(ptr0, len0, ptr1); +// let base2 = *((ptr1 + 0) as *const i32); +// let len2 = *((ptr1 + 4) as *const i32); +// let mut result2 = Vec::with_capacity(len2 as usize); +// for i in 0..len2 { +// let base = base2 + i * 1; +// result2.push({ +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::(i32::from( +// *((base + 0) as *const u8), +// ) +// as u8) +// } +// #[cfg(debug_assertions)] +// { +// match i32::from(*((base + 0) as *const u8)) { +// 0 => false, +// 1 => true, +// _ => panic!("invalid bool discriminant"), +// } +// } +// }); +// } +// wit_bindgen::rt::dealloc(base2, (len2 as usize) * 1, 1); +// result2 +// } +// } +// } +// } +// pub mod random { - #[allow(clippy::all)] - pub mod random { - #[used] - #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; +// #[allow(clippy::all)] +// pub mod random { +// #[used] +// #[doc(hidden)] +// #[cfg(target_arch = "wasm32")] +// static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; - #[allow(clippy::all)] - /// Return `len` cryptographically-secure pseudo-random bytes. - /// - /// This function must produce data from an adequately seeded - /// cryptographically-secure pseudo-random number generator (CSPRNG), so it - /// must not block, from the perspective of the calling program, and the - /// returned data is always unpredictable. - /// - /// This function must always return fresh pseudo-random data. Deterministic - /// environments must omit this function, rather than implementing it with - /// deterministic data. - pub fn get_random_bytes(len: u64) -> wit_bindgen::rt::vec::Vec { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(4))] - struct RetArea([u8; 8]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:random/random")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "get-random-bytes")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:random/random_get-random-bytes" - )] - fn wit_import(_: i64, _: i32); - } - wit_import(wit_bindgen::rt::as_i64(len), ptr0); - let len1 = *((ptr0 + 4) as *const i32) as usize; - Vec::from_raw_parts(*((ptr0 + 0) as *const i32) as *mut _, len1, len1) - } - } - #[allow(clippy::all)] - /// Return a cryptographically-secure pseudo-random `u64` value. - /// - /// This function returns the same type of pseudo-random data as - /// `get-random-bytes`, represented as a `u64`. - pub fn get_random_u64() -> u64 { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[link(wasm_import_module = "wasi:random/random")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "get-random-u64")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:random/random_get-random-u64" - )] - fn wit_import() -> i64; - } - let ret = wit_import(); - ret as u64 - } - } - } +// #[allow(clippy::all)] +// /// Return `len` cryptographically-secure pseudo-random bytes. +// /// +// /// This function must produce data from an adequately seeded +// /// cryptographically-secure pseudo-random number generator (CSPRNG), so it +// /// must not block, from the perspective of the calling program, and the +// /// returned data is always unpredictable. +// /// +// /// This function must always return fresh pseudo-random data. Deterministic +// /// environments must omit this function, rather than implementing it with +// /// deterministic data. +// pub fn get_random_bytes(len: u64) -> wit_bindgen::rt::vec::Vec { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(4))] +// struct RetArea([u8; 8]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:random/random")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "get-random-bytes")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:random/random_get-random-bytes" +// )] +// fn wit_import(_: i64, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i64(len), ptr0); +// let len1 = *((ptr0 + 4) as *const i32) as usize; +// Vec::from_raw_parts(*((ptr0 + 0) as *const i32) as *mut _, len1, len1) +// } +// } +// #[allow(clippy::all)] +// /// Return a cryptographically-secure pseudo-random `u64` value. +// /// +// /// This function returns the same type of pseudo-random data as +// /// `get-random-bytes`, represented as a `u64`. +// pub fn get_random_u64() -> u64 { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[link(wasm_import_module = "wasi:random/random")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "get-random-u64")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:random/random_get-random-u64" +// )] +// fn wit_import() -> i64; +// } +// let ret = wit_import(); +// ret as u64 +// } +// } +// } - #[allow(clippy::all)] - pub mod insecure { - #[used] - #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; +// #[allow(clippy::all)] +// pub mod insecure { +// #[used] +// #[doc(hidden)] +// #[cfg(target_arch = "wasm32")] +// static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; - #[allow(clippy::all)] - /// Return `len` insecure pseudo-random bytes. - /// - /// This function is not cryptographically secure. Do not use it for - /// anything related to security. - /// - /// There are no requirements on the values of the returned bytes, however - /// implementations are encouraged to return evenly distributed values with - /// a long period. - pub fn get_insecure_random_bytes(len: u64) -> wit_bindgen::rt::vec::Vec { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(4))] - struct RetArea([u8; 8]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:random/insecure")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "get-insecure-random-bytes")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:random/insecure_get-insecure-random-bytes" - )] - fn wit_import(_: i64, _: i32); - } - wit_import(wit_bindgen::rt::as_i64(len), ptr0); - let len1 = *((ptr0 + 4) as *const i32) as usize; - Vec::from_raw_parts(*((ptr0 + 0) as *const i32) as *mut _, len1, len1) - } - } - #[allow(clippy::all)] - /// Return an insecure pseudo-random `u64` value. - /// - /// This function returns the same type of pseudo-random data as - /// `get-insecure-random-bytes`, represented as a `u64`. - pub fn get_insecure_random_u64() -> u64 { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[link(wasm_import_module = "wasi:random/insecure")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "get-insecure-random-u64")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:random/insecure_get-insecure-random-u64" - )] - fn wit_import() -> i64; - } - let ret = wit_import(); - ret as u64 - } - } - } +// #[allow(clippy::all)] +// /// Return `len` insecure pseudo-random bytes. +// /// +// /// This function is not cryptographically secure. Do not use it for +// /// anything related to security. +// /// +// /// There are no requirements on the values of the returned bytes, however +// /// implementations are encouraged to return evenly distributed values with +// /// a long period. +// pub fn get_insecure_random_bytes(len: u64) -> wit_bindgen::rt::vec::Vec { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(4))] +// struct RetArea([u8; 8]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:random/insecure")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "get-insecure-random-bytes")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:random/insecure_get-insecure-random-bytes" +// )] +// fn wit_import(_: i64, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i64(len), ptr0); +// let len1 = *((ptr0 + 4) as *const i32) as usize; +// Vec::from_raw_parts(*((ptr0 + 0) as *const i32) as *mut _, len1, len1) +// } +// } +// #[allow(clippy::all)] +// /// Return an insecure pseudo-random `u64` value. +// /// +// /// This function returns the same type of pseudo-random data as +// /// `get-insecure-random-bytes`, represented as a `u64`. +// pub fn get_insecure_random_u64() -> u64 { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[link(wasm_import_module = "wasi:random/insecure")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "get-insecure-random-u64")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:random/insecure_get-insecure-random-u64" +// )] +// fn wit_import() -> i64; +// } +// let ret = wit_import(); +// ret as u64 +// } +// } +// } - #[allow(clippy::all)] - pub mod insecure_seed { - #[used] - #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; +// #[allow(clippy::all)] +// pub mod insecure_seed { +// #[used] +// #[doc(hidden)] +// #[cfg(target_arch = "wasm32")] +// static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; - #[allow(clippy::all)] - /// Return a 128-bit value that may contain a pseudo-random value. - /// - /// The returned value is not required to be computed from a CSPRNG, and may - /// even be entirely deterministic. Host implementations are encouraged to - /// provide pseudo-random values to any program exposed to - /// attacker-controlled content, to enable DoS protection built into many - /// languages' hash-map implementations. - /// - /// This function is intended to only be called once, by a source language - /// to initialize Denial Of Service (DoS) protection in its hash-map - /// implementation. - /// - /// # Expected future evolution - /// - /// This will likely be changed to a value import, to prevent it from being - /// called multiple times and potentially used for purposes other than DoS - /// protection. - pub fn insecure_seed() -> (u64, u64) { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(8))] - struct RetArea([u8; 16]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:random/insecure-seed")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "insecure-seed")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:random/insecure-seed_insecure-seed" - )] - fn wit_import(_: i32); - } - wit_import(ptr0); - ( - *((ptr0 + 0) as *const i64) as u64, - *((ptr0 + 8) as *const i64) as u64, - ) - } - } - } - } - pub mod sockets { +// #[allow(clippy::all)] +// /// Return a 128-bit value that may contain a pseudo-random value. +// /// +// /// The returned value is not required to be computed from a CSPRNG, and may +// /// even be entirely deterministic. Host implementations are encouraged to +// /// provide pseudo-random values to any program exposed to +// /// attacker-controlled content, to enable DoS protection built into many +// /// languages' hash-map implementations. +// /// +// /// This function is intended to only be called once, by a source language +// /// to initialize Denial Of Service (DoS) protection in its hash-map +// /// implementation. +// /// +// /// # Expected future evolution +// /// +// /// This will likely be changed to a value import, to prevent it from being +// /// called multiple times and potentially used for purposes other than DoS +// /// protection. +// pub fn insecure_seed() -> (u64, u64) { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(8))] +// struct RetArea([u8; 16]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:random/insecure-seed")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "insecure-seed")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:random/insecure-seed_insecure-seed" +// )] +// fn wit_import(_: i32); +// } +// wit_import(ptr0); +// ( +// *((ptr0 + 0) as *const i64) as u64, +// *((ptr0 + 8) as *const i64) as u64, +// ) +// } +// } +// } +// } +// pub mod sockets { - #[allow(clippy::all)] - pub mod network { - #[used] - #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; +// #[allow(clippy::all)] +// pub mod network { +// #[used] +// #[doc(hidden)] +// #[cfg(target_arch = "wasm32")] +// static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; - /// An opaque resource that represents access to (a subset of) the network. - /// This enables context-based security for networking. - /// There is no need for this to map 1:1 to a physical network interface. - /// - /// FYI, In the future this will be replaced by handle types. - pub type Network = u32; - pub type Ipv6Address = (u16, u16, u16, u16, u16, u16, u16, u16); - #[repr(C)] - #[derive(Copy, Clone)] - pub struct Ipv6SocketAddress { - pub port: u16, - pub flow_info: u32, - pub address: Ipv6Address, - pub scope_id: u32, - } - impl ::core::fmt::Debug for Ipv6SocketAddress { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - f.debug_struct("Ipv6SocketAddress") - .field("port", &self.port) - .field("flow-info", &self.flow_info) - .field("address", &self.address) - .field("scope-id", &self.scope_id) - .finish() - } - } - pub type Ipv4Address = (u8, u8, u8, u8); - #[repr(C)] - #[derive(Copy, Clone)] - pub struct Ipv4SocketAddress { - pub port: u16, - pub address: Ipv4Address, - } - impl ::core::fmt::Debug for Ipv4SocketAddress { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - f.debug_struct("Ipv4SocketAddress") - .field("port", &self.port) - .field("address", &self.address) - .finish() - } - } - #[derive(Clone, Copy)] - pub enum IpSocketAddress { - Ipv4(Ipv4SocketAddress), - Ipv6(Ipv6SocketAddress), - } - impl ::core::fmt::Debug for IpSocketAddress { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - match self { - IpSocketAddress::Ipv4(e) => { - f.debug_tuple("IpSocketAddress::Ipv4").field(e).finish() - } - IpSocketAddress::Ipv6(e) => { - f.debug_tuple("IpSocketAddress::Ipv6").field(e).finish() - } - } - } - } - #[repr(u8)] - #[derive(Clone, Copy, PartialEq, Eq)] - pub enum IpAddressFamily { - /// Similar to `AF_INET` in POSIX. - Ipv4, - /// Similar to `AF_INET6` in POSIX. - Ipv6, - } - impl ::core::fmt::Debug for IpAddressFamily { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - match self { - IpAddressFamily::Ipv4 => f.debug_tuple("IpAddressFamily::Ipv4").finish(), - IpAddressFamily::Ipv6 => f.debug_tuple("IpAddressFamily::Ipv6").finish(), - } - } - } - #[derive(Clone, Copy)] - pub enum IpAddress { - Ipv4(Ipv4Address), - Ipv6(Ipv6Address), - } - impl ::core::fmt::Debug for IpAddress { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - match self { - IpAddress::Ipv4(e) => f.debug_tuple("IpAddress::Ipv4").field(e).finish(), - IpAddress::Ipv6(e) => f.debug_tuple("IpAddress::Ipv6").field(e).finish(), - } - } - } - /// Error codes. - /// - /// In theory, every API can return any error code. - /// In practice, API's typically only return the errors documented per API - /// combined with a couple of errors that are always possible: - /// - `unknown` - /// - `access-denied` - /// - `not-supported` - /// - `out-of-memory` - /// - /// See each individual API for what the POSIX equivalents are. They sometimes differ per API. - #[repr(u8)] - #[derive(Clone, Copy, PartialEq, Eq)] - pub enum ErrorCode { - /// Unknown error - Unknown, - /// Access denied. - /// - /// POSIX equivalent: EACCES, EPERM - AccessDenied, - /// The operation is not supported. - /// - /// POSIX equivalent: EOPNOTSUPP - NotSupported, - /// Not enough memory to complete the operation. - /// - /// POSIX equivalent: ENOMEM, ENOBUFS, EAI_MEMORY - OutOfMemory, - /// The operation timed out before it could finish completely. - Timeout, - /// This operation is incompatible with another asynchronous operation that is already in progress. - ConcurrencyConflict, - /// Trying to finish an asynchronous operation that: - /// - has not been started yet, or: - /// - was already finished by a previous `finish-*` call. - /// - /// Note: this is scheduled to be removed when `future`s are natively supported. - NotInProgress, - /// The operation has been aborted because it could not be completed immediately. - /// - /// Note: this is scheduled to be removed when `future`s are natively supported. - WouldBlock, - /// The specified address-family is not supported. - AddressFamilyNotSupported, - /// An IPv4 address was passed to an IPv6 resource, or vice versa. - AddressFamilyMismatch, - /// The socket address is not a valid remote address. E.g. the IP address is set to INADDR_ANY, or the port is set to 0. - InvalidRemoteAddress, - /// The operation is only supported on IPv4 resources. - Ipv4OnlyOperation, - /// The operation is only supported on IPv6 resources. - Ipv6OnlyOperation, - /// A new socket resource could not be created because of a system limit. - NewSocketLimit, - /// The socket is already attached to another network. - AlreadyAttached, - /// The socket is already bound. - AlreadyBound, - /// The socket is already in the Connection state. - AlreadyConnected, - /// The socket is not bound to any local address. - NotBound, - /// The socket is not in the Connection state. - NotConnected, - /// A bind operation failed because the provided address is not an address that the `network` can bind to. - AddressNotBindable, - /// A bind operation failed because the provided address is already in use. - AddressInUse, - /// A bind operation failed because there are no ephemeral ports available. - EphemeralPortsExhausted, - /// The remote address is not reachable - RemoteUnreachable, - /// The socket is already in the Listener state. - AlreadyListening, - /// The socket is already in the Listener state. - NotListening, - /// The connection was forcefully rejected - ConnectionRefused, - /// The connection was reset. - ConnectionReset, - DatagramTooLarge, - /// The provided name is a syntactically invalid domain name. - InvalidName, - /// Name does not exist or has no suitable associated IP addresses. - NameUnresolvable, - /// A temporary failure in name resolution occurred. - TemporaryResolverFailure, - /// A permanent failure in name resolution occurred. - PermanentResolverFailure, - } - impl ErrorCode { - pub fn name(&self) -> &'static str { - match self { - ErrorCode::Unknown => "unknown", - ErrorCode::AccessDenied => "access-denied", - ErrorCode::NotSupported => "not-supported", - ErrorCode::OutOfMemory => "out-of-memory", - ErrorCode::Timeout => "timeout", - ErrorCode::ConcurrencyConflict => "concurrency-conflict", - ErrorCode::NotInProgress => "not-in-progress", - ErrorCode::WouldBlock => "would-block", - ErrorCode::AddressFamilyNotSupported => "address-family-not-supported", - ErrorCode::AddressFamilyMismatch => "address-family-mismatch", - ErrorCode::InvalidRemoteAddress => "invalid-remote-address", - ErrorCode::Ipv4OnlyOperation => "ipv4-only-operation", - ErrorCode::Ipv6OnlyOperation => "ipv6-only-operation", - ErrorCode::NewSocketLimit => "new-socket-limit", - ErrorCode::AlreadyAttached => "already-attached", - ErrorCode::AlreadyBound => "already-bound", - ErrorCode::AlreadyConnected => "already-connected", - ErrorCode::NotBound => "not-bound", - ErrorCode::NotConnected => "not-connected", - ErrorCode::AddressNotBindable => "address-not-bindable", - ErrorCode::AddressInUse => "address-in-use", - ErrorCode::EphemeralPortsExhausted => "ephemeral-ports-exhausted", - ErrorCode::RemoteUnreachable => "remote-unreachable", - ErrorCode::AlreadyListening => "already-listening", - ErrorCode::NotListening => "not-listening", - ErrorCode::ConnectionRefused => "connection-refused", - ErrorCode::ConnectionReset => "connection-reset", - ErrorCode::DatagramTooLarge => "datagram-too-large", - ErrorCode::InvalidName => "invalid-name", - ErrorCode::NameUnresolvable => "name-unresolvable", - ErrorCode::TemporaryResolverFailure => "temporary-resolver-failure", - ErrorCode::PermanentResolverFailure => "permanent-resolver-failure", - } - } - pub fn message(&self) -> &'static str { - match self { - ErrorCode::Unknown => "Unknown error", - ErrorCode::AccessDenied => "Access denied. +// /// An opaque resource that represents access to (a subset of) the network. +// /// This enables context-based security for networking. +// /// There is no need for this to map 1:1 to a physical network interface. +// /// +// /// FYI, In the future this will be replaced by handle types. +// pub type Network = u32; +// pub type Ipv6Address = (u16, u16, u16, u16, u16, u16, u16, u16); +// #[repr(C)] +// #[derive(Copy, Clone)] +// pub struct Ipv6SocketAddress { +// pub port: u16, +// pub flow_info: u32, +// pub address: Ipv6Address, +// pub scope_id: u32, +// } +// impl ::core::fmt::Debug for Ipv6SocketAddress { +// fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { +// f.debug_struct("Ipv6SocketAddress") +// .field("port", &self.port) +// .field("flow-info", &self.flow_info) +// .field("address", &self.address) +// .field("scope-id", &self.scope_id) +// .finish() +// } +// } +// pub type Ipv4Address = (u8, u8, u8, u8); +// #[repr(C)] +// #[derive(Copy, Clone)] +// pub struct Ipv4SocketAddress { +// pub port: u16, +// pub address: Ipv4Address, +// } +// impl ::core::fmt::Debug for Ipv4SocketAddress { +// fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { +// f.debug_struct("Ipv4SocketAddress") +// .field("port", &self.port) +// .field("address", &self.address) +// .finish() +// } +// } +// #[derive(Clone, Copy)] +// pub enum IpSocketAddress { +// Ipv4(Ipv4SocketAddress), +// Ipv6(Ipv6SocketAddress), +// } +// impl ::core::fmt::Debug for IpSocketAddress { +// fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { +// match self { +// IpSocketAddress::Ipv4(e) => { +// f.debug_tuple("IpSocketAddress::Ipv4").field(e).finish() +// } +// IpSocketAddress::Ipv6(e) => { +// f.debug_tuple("IpSocketAddress::Ipv6").field(e).finish() +// } +// } +// } +// } +// #[repr(u8)] +// #[derive(Clone, Copy, PartialEq, Eq)] +// pub enum IpAddressFamily { +// /// Similar to `AF_INET` in POSIX. +// Ipv4, +// /// Similar to `AF_INET6` in POSIX. +// Ipv6, +// } +// impl ::core::fmt::Debug for IpAddressFamily { +// fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { +// match self { +// IpAddressFamily::Ipv4 => f.debug_tuple("IpAddressFamily::Ipv4").finish(), +// IpAddressFamily::Ipv6 => f.debug_tuple("IpAddressFamily::Ipv6").finish(), +// } +// } +// } +// #[derive(Clone, Copy)] +// pub enum IpAddress { +// Ipv4(Ipv4Address), +// Ipv6(Ipv6Address), +// } +// impl ::core::fmt::Debug for IpAddress { +// fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { +// match self { +// IpAddress::Ipv4(e) => f.debug_tuple("IpAddress::Ipv4").field(e).finish(), +// IpAddress::Ipv6(e) => f.debug_tuple("IpAddress::Ipv6").field(e).finish(), +// } +// } +// } +// /// Error codes. +// /// +// /// In theory, every API can return any error code. +// /// In practice, API's typically only return the errors documented per API +// /// combined with a couple of errors that are always possible: +// /// - `unknown` +// /// - `access-denied` +// /// - `not-supported` +// /// - `out-of-memory` +// /// +// /// See each individual API for what the POSIX equivalents are. They sometimes differ per API. +// #[repr(u8)] +// #[derive(Clone, Copy, PartialEq, Eq)] +// pub enum ErrorCode { +// /// Unknown error +// Unknown, +// /// Access denied. +// /// +// /// POSIX equivalent: EACCES, EPERM +// AccessDenied, +// /// The operation is not supported. +// /// +// /// POSIX equivalent: EOPNOTSUPP +// NotSupported, +// /// Not enough memory to complete the operation. +// /// +// /// POSIX equivalent: ENOMEM, ENOBUFS, EAI_MEMORY +// OutOfMemory, +// /// The operation timed out before it could finish completely. +// Timeout, +// /// This operation is incompatible with another asynchronous operation that is already in progress. +// ConcurrencyConflict, +// /// Trying to finish an asynchronous operation that: +// /// - has not been started yet, or: +// /// - was already finished by a previous `finish-*` call. +// /// +// /// Note: this is scheduled to be removed when `future`s are natively supported. +// NotInProgress, +// /// The operation has been aborted because it could not be completed immediately. +// /// +// /// Note: this is scheduled to be removed when `future`s are natively supported. +// WouldBlock, +// /// The specified address-family is not supported. +// AddressFamilyNotSupported, +// /// An IPv4 address was passed to an IPv6 resource, or vice versa. +// AddressFamilyMismatch, +// /// The socket address is not a valid remote address. E.g. the IP address is set to INADDR_ANY, or the port is set to 0. +// InvalidRemoteAddress, +// /// The operation is only supported on IPv4 resources. +// Ipv4OnlyOperation, +// /// The operation is only supported on IPv6 resources. +// Ipv6OnlyOperation, +// /// A new socket resource could not be created because of a system limit. +// NewSocketLimit, +// /// The socket is already attached to another network. +// AlreadyAttached, +// /// The socket is already bound. +// AlreadyBound, +// /// The socket is already in the Connection state. +// AlreadyConnected, +// /// The socket is not bound to any local address. +// NotBound, +// /// The socket is not in the Connection state. +// NotConnected, +// /// A bind operation failed because the provided address is not an address that the `network` can bind to. +// AddressNotBindable, +// /// A bind operation failed because the provided address is already in use. +// AddressInUse, +// /// A bind operation failed because there are no ephemeral ports available. +// EphemeralPortsExhausted, +// /// The remote address is not reachable +// RemoteUnreachable, +// /// The socket is already in the Listener state. +// AlreadyListening, +// /// The socket is already in the Listener state. +// NotListening, +// /// The connection was forcefully rejected +// ConnectionRefused, +// /// The connection was reset. +// ConnectionReset, +// DatagramTooLarge, +// /// The provided name is a syntactically invalid domain name. +// InvalidName, +// /// Name does not exist or has no suitable associated IP addresses. +// NameUnresolvable, +// /// A temporary failure in name resolution occurred. +// TemporaryResolverFailure, +// /// A permanent failure in name resolution occurred. +// PermanentResolverFailure, +// } +// impl ErrorCode { +// pub fn name(&self) -> &'static str { +// match self { +// ErrorCode::Unknown => "unknown", +// ErrorCode::AccessDenied => "access-denied", +// ErrorCode::NotSupported => "not-supported", +// ErrorCode::OutOfMemory => "out-of-memory", +// ErrorCode::Timeout => "timeout", +// ErrorCode::ConcurrencyConflict => "concurrency-conflict", +// ErrorCode::NotInProgress => "not-in-progress", +// ErrorCode::WouldBlock => "would-block", +// ErrorCode::AddressFamilyNotSupported => "address-family-not-supported", +// ErrorCode::AddressFamilyMismatch => "address-family-mismatch", +// ErrorCode::InvalidRemoteAddress => "invalid-remote-address", +// ErrorCode::Ipv4OnlyOperation => "ipv4-only-operation", +// ErrorCode::Ipv6OnlyOperation => "ipv6-only-operation", +// ErrorCode::NewSocketLimit => "new-socket-limit", +// ErrorCode::AlreadyAttached => "already-attached", +// ErrorCode::AlreadyBound => "already-bound", +// ErrorCode::AlreadyConnected => "already-connected", +// ErrorCode::NotBound => "not-bound", +// ErrorCode::NotConnected => "not-connected", +// ErrorCode::AddressNotBindable => "address-not-bindable", +// ErrorCode::AddressInUse => "address-in-use", +// ErrorCode::EphemeralPortsExhausted => "ephemeral-ports-exhausted", +// ErrorCode::RemoteUnreachable => "remote-unreachable", +// ErrorCode::AlreadyListening => "already-listening", +// ErrorCode::NotListening => "not-listening", +// ErrorCode::ConnectionRefused => "connection-refused", +// ErrorCode::ConnectionReset => "connection-reset", +// ErrorCode::DatagramTooLarge => "datagram-too-large", +// ErrorCode::InvalidName => "invalid-name", +// ErrorCode::NameUnresolvable => "name-unresolvable", +// ErrorCode::TemporaryResolverFailure => "temporary-resolver-failure", +// ErrorCode::PermanentResolverFailure => "permanent-resolver-failure", +// } +// } +// pub fn message(&self) -> &'static str { +// match self { +// ErrorCode::Unknown => "Unknown error", +// ErrorCode::AccessDenied => "Access denied. - POSIX equivalent: EACCES, EPERM", - ErrorCode::NotSupported => "The operation is not supported. +// POSIX equivalent: EACCES, EPERM", +// ErrorCode::NotSupported => "The operation is not supported. - POSIX equivalent: EOPNOTSUPP", - ErrorCode::OutOfMemory => "Not enough memory to complete the operation. +// POSIX equivalent: EOPNOTSUPP", +// ErrorCode::OutOfMemory => "Not enough memory to complete the operation. - POSIX equivalent: ENOMEM, ENOBUFS, EAI_MEMORY", - ErrorCode::Timeout => "The operation timed out before it could finish completely.", - ErrorCode::ConcurrencyConflict => "This operation is incompatible with another asynchronous operation that is already in progress.", - ErrorCode::NotInProgress => "Trying to finish an asynchronous operation that: - - has not been started yet, or: - - was already finished by a previous `finish-*` call. +// POSIX equivalent: ENOMEM, ENOBUFS, EAI_MEMORY", +// ErrorCode::Timeout => "The operation timed out before it could finish completely.", +// ErrorCode::ConcurrencyConflict => "This operation is incompatible with another asynchronous operation that is already in progress.", +// ErrorCode::NotInProgress => "Trying to finish an asynchronous operation that: +// - has not been started yet, or: +// - was already finished by a previous `finish-*` call. - Note: this is scheduled to be removed when `future`s are natively supported.", - ErrorCode::WouldBlock => "The operation has been aborted because it could not be completed immediately. +// Note: this is scheduled to be removed when `future`s are natively supported.", +// ErrorCode::WouldBlock => "The operation has been aborted because it could not be completed immediately. - Note: this is scheduled to be removed when `future`s are natively supported.", - ErrorCode::AddressFamilyNotSupported => "The specified address-family is not supported.", - ErrorCode::AddressFamilyMismatch => "An IPv4 address was passed to an IPv6 resource, or vice versa.", - ErrorCode::InvalidRemoteAddress => "The socket address is not a valid remote address. E.g. the IP address is set to INADDR_ANY, or the port is set to 0.", - ErrorCode::Ipv4OnlyOperation => "The operation is only supported on IPv4 resources.", - ErrorCode::Ipv6OnlyOperation => "The operation is only supported on IPv6 resources.", - ErrorCode::NewSocketLimit => "A new socket resource could not be created because of a system limit.", - ErrorCode::AlreadyAttached => "The socket is already attached to another network.", - ErrorCode::AlreadyBound => "The socket is already bound.", - ErrorCode::AlreadyConnected => "The socket is already in the Connection state.", - ErrorCode::NotBound => "The socket is not bound to any local address.", - ErrorCode::NotConnected => "The socket is not in the Connection state.", - ErrorCode::AddressNotBindable => "A bind operation failed because the provided address is not an address that the `network` can bind to.", - ErrorCode::AddressInUse => "A bind operation failed because the provided address is already in use.", - ErrorCode::EphemeralPortsExhausted => "A bind operation failed because there are no ephemeral ports available.", - ErrorCode::RemoteUnreachable => "The remote address is not reachable", - ErrorCode::AlreadyListening => "The socket is already in the Listener state.", - ErrorCode::NotListening => "The socket is already in the Listener state.", - ErrorCode::ConnectionRefused => "The connection was forcefully rejected", - ErrorCode::ConnectionReset => "The connection was reset.", - ErrorCode::DatagramTooLarge => "", - ErrorCode::InvalidName => "The provided name is a syntactically invalid domain name.", - ErrorCode::NameUnresolvable => "Name does not exist or has no suitable associated IP addresses.", - ErrorCode::TemporaryResolverFailure => "A temporary failure in name resolution occurred.", - ErrorCode::PermanentResolverFailure => "A permanent failure in name resolution occurred.", - } - } - } - impl ::core::fmt::Debug for ErrorCode { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - f.debug_struct("ErrorCode") - .field("code", &(*self as i32)) - .field("name", &self.name()) - .field("message", &self.message()) - .finish() - } - } - impl ::core::fmt::Display for ErrorCode { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - write!(f, "{} (error {})", self.name(), *self as i32) - } - } +// Note: this is scheduled to be removed when `future`s are natively supported.", +// ErrorCode::AddressFamilyNotSupported => "The specified address-family is not supported.", +// ErrorCode::AddressFamilyMismatch => "An IPv4 address was passed to an IPv6 resource, or vice versa.", +// ErrorCode::InvalidRemoteAddress => "The socket address is not a valid remote address. E.g. the IP address is set to INADDR_ANY, or the port is set to 0.", +// ErrorCode::Ipv4OnlyOperation => "The operation is only supported on IPv4 resources.", +// ErrorCode::Ipv6OnlyOperation => "The operation is only supported on IPv6 resources.", +// ErrorCode::NewSocketLimit => "A new socket resource could not be created because of a system limit.", +// ErrorCode::AlreadyAttached => "The socket is already attached to another network.", +// ErrorCode::AlreadyBound => "The socket is already bound.", +// ErrorCode::AlreadyConnected => "The socket is already in the Connection state.", +// ErrorCode::NotBound => "The socket is not bound to any local address.", +// ErrorCode::NotConnected => "The socket is not in the Connection state.", +// ErrorCode::AddressNotBindable => "A bind operation failed because the provided address is not an address that the `network` can bind to.", +// ErrorCode::AddressInUse => "A bind operation failed because the provided address is already in use.", +// ErrorCode::EphemeralPortsExhausted => "A bind operation failed because there are no ephemeral ports available.", +// ErrorCode::RemoteUnreachable => "The remote address is not reachable", +// ErrorCode::AlreadyListening => "The socket is already in the Listener state.", +// ErrorCode::NotListening => "The socket is already in the Listener state.", +// ErrorCode::ConnectionRefused => "The connection was forcefully rejected", +// ErrorCode::ConnectionReset => "The connection was reset.", +// ErrorCode::DatagramTooLarge => "", +// ErrorCode::InvalidName => "The provided name is a syntactically invalid domain name.", +// ErrorCode::NameUnresolvable => "Name does not exist or has no suitable associated IP addresses.", +// ErrorCode::TemporaryResolverFailure => "A temporary failure in name resolution occurred.", +// ErrorCode::PermanentResolverFailure => "A permanent failure in name resolution occurred.", +// } +// } +// } +// impl ::core::fmt::Debug for ErrorCode { +// fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { +// f.debug_struct("ErrorCode") +// .field("code", &(*self as i32)) +// .field("name", &self.name()) +// .field("message", &self.message()) +// .finish() +// } +// } +// impl ::core::fmt::Display for ErrorCode { +// fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { +// write!(f, "{} (error {})", self.name(), *self as i32) +// } +// } - impl std::error::Error for ErrorCode {} - #[allow(clippy::all)] - /// Dispose of the specified `network`, after which it may no longer be used. - /// - /// Note: this function is scheduled to be removed when Resources are natively supported in Wit. - pub fn drop_network(this: Network) { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[link(wasm_import_module = "wasi:sockets/network")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "drop-network")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/network_drop-network" - )] - fn wit_import(_: i32); - } - wit_import(wit_bindgen::rt::as_i32(this)); - } - } - } +// impl std::error::Error for ErrorCode {} +// #[allow(clippy::all)] +// /// Dispose of the specified `network`, after which it may no longer be used. +// /// +// /// Note: this function is scheduled to be removed when Resources are natively supported in Wit. +// pub fn drop_network(this: Network) { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[link(wasm_import_module = "wasi:sockets/network")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "drop-network")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/network_drop-network" +// )] +// fn wit_import(_: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this)); +// } +// } +// } - #[allow(clippy::all)] - pub mod instance_network { - #[used] - #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; +// #[allow(clippy::all)] +// pub mod instance_network { +// #[used] +// #[doc(hidden)] +// #[cfg(target_arch = "wasm32")] +// static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; - pub type Network = super::super::super::wasi::sockets::network::Network; - #[allow(clippy::all)] - /// Get a handle to the default network. - pub fn instance_network() -> Network { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[link(wasm_import_module = "wasi:sockets/instance-network")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "instance-network")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/instance-network_instance-network" - )] - fn wit_import() -> i32; - } - let ret = wit_import(); - ret as u32 - } - } - } +// pub type Network = super::super::super::wasi::sockets::network::Network; +// #[allow(clippy::all)] +// /// Get a handle to the default network. +// pub fn instance_network() -> Network { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[link(wasm_import_module = "wasi:sockets/instance-network")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "instance-network")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/instance-network_instance-network" +// )] +// fn wit_import() -> i32; +// } +// let ret = wit_import(); +// ret as u32 +// } +// } +// } - #[allow(clippy::all)] - pub mod ip_name_lookup { - #[used] - #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; +// #[allow(clippy::all)] +// pub mod ip_name_lookup { +// #[used] +// #[doc(hidden)] +// #[cfg(target_arch = "wasm32")] +// static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; - pub type Pollable = super::super::super::wasi::poll::poll::Pollable; - pub type Network = super::super::super::wasi::sockets::network::Network; - pub type ErrorCode = super::super::super::wasi::sockets::network::ErrorCode; - pub type IpAddress = super::super::super::wasi::sockets::network::IpAddress; - pub type IpAddressFamily = super::super::super::wasi::sockets::network::IpAddressFamily; - pub type ResolveAddressStream = u32; - #[allow(clippy::all)] - /// Resolve an internet host name to a list of IP addresses. - /// - /// See the wasi-socket proposal README.md for a comparison with getaddrinfo. - /// - /// # Parameters - /// - `name`: The name to look up. IP addresses are not allowed. Unicode domain names are automatically converted - /// to ASCII using IDNA encoding. - /// - `address-family`: If provided, limit the results to addresses of this specific address family. - /// - `include-unavailable`: When set to true, this function will also return addresses of which the runtime - /// thinks (or knows) can't be connected to at the moment. For example, this will return IPv6 addresses on - /// systems without an active IPv6 interface. Notes: - /// - Even when no public IPv6 interfaces are present or active, names like "localhost" can still resolve to an IPv6 address. - /// - Whatever is "available" or "unavailable" is volatile and can change everytime a network cable is unplugged. - /// - /// This function never blocks. It either immediately fails or immediately returns successfully with a `resolve-address-stream` - /// that can be used to (asynchronously) fetch the results. - /// - /// At the moment, the stream never completes successfully with 0 items. Ie. the first call - /// to `resolve-next-address` never returns `ok(none)`. This may change in the future. - /// - /// # Typical errors - /// - `invalid-name`: `name` is a syntactically invalid domain name. - /// - `invalid-name`: `name` is an IP address. - /// - `address-family-not-supported`: The specified `address-family` is not supported. (EAI_FAMILY) - /// - /// # References: - /// - - /// - - /// - - /// - - pub fn resolve_addresses( - network: Network, - name: &str, - address_family: Option, - include_unavailable: bool, - ) -> Result { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(4))] - struct RetArea([u8; 8]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let vec0 = name; - let ptr0 = vec0.as_ptr() as i32; - let len0 = vec0.len() as i32; - let (result1_0,result1_1,) = match address_family { - Some(e) => (1i32, match e { - super::super::super::wasi::sockets::network::IpAddressFamily::Ipv4 => 0, - super::super::super::wasi::sockets::network::IpAddressFamily::Ipv6 => 1, - }), - None => { - (0i32, 0i32) - }, - }; - let ptr2 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/ip-name-lookup")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "resolve-addresses")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/ip-name-lookup_resolve-addresses" - )] - fn wit_import(_: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32); - } - wit_import( - wit_bindgen::rt::as_i32(network), - ptr0, - len0, - result1_0, - result1_1, - match include_unavailable { - true => 1, - false => 0, - }, - ptr2, - ); - match i32::from(*((ptr2 + 0) as *const u8)) { - 0 => Ok(*((ptr2 + 4) as *const i32) as u32), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr2 + 4) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr2 + 4) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Returns the next address from the resolver. - /// - /// This function should be called multiple times. On each call, it will - /// return the next address in connection order preference. If all - /// addresses have been exhausted, this function returns `none`. - /// After which, you should release the stream with `drop-resolve-address-stream`. - /// - /// This function never returns IPv4-mapped IPv6 addresses. - /// - /// # Typical errors - /// - `name-unresolvable`: Name does not exist or has no suitable associated IP addresses. (EAI_NONAME, EAI_NODATA, EAI_ADDRFAMILY) - /// - `temporary-resolver-failure`: A temporary failure in name resolution occurred. (EAI_AGAIN) - /// - `permanent-resolver-failure`: A permanent failure in name resolution occurred. (EAI_FAIL) - /// - `would-block`: A result is not available yet. (EWOULDBLOCK, EAGAIN) - pub fn resolve_next_address( - this: ResolveAddressStream, - ) -> Result, ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(2))] - struct RetArea([u8; 22]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/ip-name-lookup")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "resolve-next-address")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/ip-name-lookup_resolve-next-address" - )] - fn wit_import(_: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(match i32::from(*((ptr0 + 2) as *const u8)) { - 0 => None, - 1 => Some({ - { - match i32::from(*((ptr0 + 4) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::IpAddress::Ipv4((i32::from(*((ptr0 + 6) as *const u8)) as u8, i32::from(*((ptr0 + 7) as *const u8)) as u8, i32::from(*((ptr0 + 8) as *const u8)) as u8, i32::from(*((ptr0 + 9) as *const u8)) as u8)), - #[cfg(debug_assertions)]1 => super::super::super::wasi::sockets::network::IpAddress::Ipv6((i32::from(*((ptr0 + 6) as *const u16)) as u16, i32::from(*((ptr0 + 8) as *const u16)) as u16, i32::from(*((ptr0 + 10) as *const u16)) as u16, i32::from(*((ptr0 + 12) as *const u16)) as u16, i32::from(*((ptr0 + 14) as *const u16)) as u16, i32::from(*((ptr0 + 16) as *const u16)) as u16, i32::from(*((ptr0 + 18) as *const u16)) as u16, i32::from(*((ptr0 + 20) as *const u16)) as u16)), - #[cfg(not(debug_assertions))]_ => super::super::super::wasi::sockets::network::IpAddress::Ipv6((i32::from(*((ptr0 + 6) as *const u16)) as u16, i32::from(*((ptr0 + 8) as *const u16)) as u16, i32::from(*((ptr0 + 10) as *const u16)) as u16, i32::from(*((ptr0 + 12) as *const u16)) as u16, i32::from(*((ptr0 + 14) as *const u16)) as u16, i32::from(*((ptr0 + 16) as *const u16)) as u16, i32::from(*((ptr0 + 18) as *const u16)) as u16, i32::from(*((ptr0 + 20) as *const u16)) as u16)), - #[cfg(debug_assertions)]_ => panic!("invalid enum discriminant"), - } - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - }), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 2) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr0 + 2) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Dispose of the specified `resolve-address-stream`, after which it may no longer be used. - /// - /// Note: this function is scheduled to be removed when Resources are natively supported in Wit. - pub fn drop_resolve_address_stream(this: ResolveAddressStream) { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[link(wasm_import_module = "wasi:sockets/ip-name-lookup")] - extern "C" { - #[cfg_attr( - target_arch = "wasm32", - link_name = "drop-resolve-address-stream" - )] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/ip-name-lookup_drop-resolve-address-stream" - )] - fn wit_import(_: i32); - } - wit_import(wit_bindgen::rt::as_i32(this)); - } - } - #[allow(clippy::all)] - /// Create a `pollable` which will resolve once the stream is ready for I/O. - /// - /// Note: this function is here for WASI Preview2 only. - /// It's planned to be removed when `future` is natively supported in Preview3. - pub fn subscribe(this: ResolveAddressStream) -> Pollable { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[link(wasm_import_module = "wasi:sockets/ip-name-lookup")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "subscribe")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/ip-name-lookup_subscribe" - )] - fn wit_import(_: i32) -> i32; - } - let ret = wit_import(wit_bindgen::rt::as_i32(this)); - ret as u32 - } - } - } +// pub type Pollable = super::super::super::wasi::poll::poll::Pollable; +// pub type Network = super::super::super::wasi::sockets::network::Network; +// pub type ErrorCode = super::super::super::wasi::sockets::network::ErrorCode; +// pub type IpAddress = super::super::super::wasi::sockets::network::IpAddress; +// pub type IpAddressFamily = super::super::super::wasi::sockets::network::IpAddressFamily; +// pub type ResolveAddressStream = u32; +// #[allow(clippy::all)] +// /// Resolve an internet host name to a list of IP addresses. +// /// +// /// See the wasi-socket proposal README.md for a comparison with getaddrinfo. +// /// +// /// # Parameters +// /// - `name`: The name to look up. IP addresses are not allowed. Unicode domain names are automatically converted +// /// to ASCII using IDNA encoding. +// /// - `address-family`: If provided, limit the results to addresses of this specific address family. +// /// - `include-unavailable`: When set to true, this function will also return addresses of which the runtime +// /// thinks (or knows) can't be connected to at the moment. For example, this will return IPv6 addresses on +// /// systems without an active IPv6 interface. Notes: +// /// - Even when no public IPv6 interfaces are present or active, names like "localhost" can still resolve to an IPv6 address. +// /// - Whatever is "available" or "unavailable" is volatile and can change everytime a network cable is unplugged. +// /// +// /// This function never blocks. It either immediately fails or immediately returns successfully with a `resolve-address-stream` +// /// that can be used to (asynchronously) fetch the results. +// /// +// /// At the moment, the stream never completes successfully with 0 items. Ie. the first call +// /// to `resolve-next-address` never returns `ok(none)`. This may change in the future. +// /// +// /// # Typical errors +// /// - `invalid-name`: `name` is a syntactically invalid domain name. +// /// - `invalid-name`: `name` is an IP address. +// /// - `address-family-not-supported`: The specified `address-family` is not supported. (EAI_FAMILY) +// /// +// /// # References: +// /// - +// /// - +// /// - +// /// - +// pub fn resolve_addresses( +// network: Network, +// name: &str, +// address_family: Option, +// include_unavailable: bool, +// ) -> Result { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(4))] +// struct RetArea([u8; 8]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let vec0 = name; +// let ptr0 = vec0.as_ptr() as i32; +// let len0 = vec0.len() as i32; +// let (result1_0,result1_1,) = match address_family { +// Some(e) => (1i32, match e { +// super::super::super::wasi::sockets::network::IpAddressFamily::Ipv4 => 0, +// super::super::super::wasi::sockets::network::IpAddressFamily::Ipv6 => 1, +// }), +// None => { +// (0i32, 0i32) +// }, +// }; +// let ptr2 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/ip-name-lookup")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "resolve-addresses")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/ip-name-lookup_resolve-addresses" +// )] +// fn wit_import(_: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32); +// } +// wit_import( +// wit_bindgen::rt::as_i32(network), +// ptr0, +// len0, +// result1_0, +// result1_1, +// match include_unavailable { +// true => 1, +// false => 0, +// }, +// ptr2, +// ); +// match i32::from(*((ptr2 + 0) as *const u8)) { +// 0 => Ok(*((ptr2 + 4) as *const i32) as u32), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr2 + 4) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr2 + 4) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Returns the next address from the resolver. +// /// +// /// This function should be called multiple times. On each call, it will +// /// return the next address in connection order preference. If all +// /// addresses have been exhausted, this function returns `none`. +// /// After which, you should release the stream with `drop-resolve-address-stream`. +// /// +// /// This function never returns IPv4-mapped IPv6 addresses. +// /// +// /// # Typical errors +// /// - `name-unresolvable`: Name does not exist or has no suitable associated IP addresses. (EAI_NONAME, EAI_NODATA, EAI_ADDRFAMILY) +// /// - `temporary-resolver-failure`: A temporary failure in name resolution occurred. (EAI_AGAIN) +// /// - `permanent-resolver-failure`: A permanent failure in name resolution occurred. (EAI_FAIL) +// /// - `would-block`: A result is not available yet. (EWOULDBLOCK, EAGAIN) +// pub fn resolve_next_address( +// this: ResolveAddressStream, +// ) -> Result, ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(2))] +// struct RetArea([u8; 22]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/ip-name-lookup")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "resolve-next-address")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/ip-name-lookup_resolve-next-address" +// )] +// fn wit_import(_: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(match i32::from(*((ptr0 + 2) as *const u8)) { +// 0 => None, +// 1 => Some({ +// { +// match i32::from(*((ptr0 + 4) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::IpAddress::Ipv4((i32::from(*((ptr0 + 6) as *const u8)) as u8, i32::from(*((ptr0 + 7) as *const u8)) as u8, i32::from(*((ptr0 + 8) as *const u8)) as u8, i32::from(*((ptr0 + 9) as *const u8)) as u8)), +// #[cfg(debug_assertions)]1 => super::super::super::wasi::sockets::network::IpAddress::Ipv6((i32::from(*((ptr0 + 6) as *const u16)) as u16, i32::from(*((ptr0 + 8) as *const u16)) as u16, i32::from(*((ptr0 + 10) as *const u16)) as u16, i32::from(*((ptr0 + 12) as *const u16)) as u16, i32::from(*((ptr0 + 14) as *const u16)) as u16, i32::from(*((ptr0 + 16) as *const u16)) as u16, i32::from(*((ptr0 + 18) as *const u16)) as u16, i32::from(*((ptr0 + 20) as *const u16)) as u16)), +// #[cfg(not(debug_assertions))]_ => super::super::super::wasi::sockets::network::IpAddress::Ipv6((i32::from(*((ptr0 + 6) as *const u16)) as u16, i32::from(*((ptr0 + 8) as *const u16)) as u16, i32::from(*((ptr0 + 10) as *const u16)) as u16, i32::from(*((ptr0 + 12) as *const u16)) as u16, i32::from(*((ptr0 + 14) as *const u16)) as u16, i32::from(*((ptr0 + 16) as *const u16)) as u16, i32::from(*((ptr0 + 18) as *const u16)) as u16, i32::from(*((ptr0 + 20) as *const u16)) as u16)), +// #[cfg(debug_assertions)]_ => panic!("invalid enum discriminant"), +// } +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// }), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 2) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr0 + 2) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Dispose of the specified `resolve-address-stream`, after which it may no longer be used. +// /// +// /// Note: this function is scheduled to be removed when Resources are natively supported in Wit. +// pub fn drop_resolve_address_stream(this: ResolveAddressStream) { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[link(wasm_import_module = "wasi:sockets/ip-name-lookup")] +// extern "C" { +// #[cfg_attr( +// target_arch = "wasm32", +// link_name = "drop-resolve-address-stream" +// )] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/ip-name-lookup_drop-resolve-address-stream" +// )] +// fn wit_import(_: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this)); +// } +// } +// #[allow(clippy::all)] +// /// Create a `pollable` which will resolve once the stream is ready for I/O. +// /// +// /// Note: this function is here for WASI Preview2 only. +// /// It's planned to be removed when `future` is natively supported in Preview3. +// pub fn subscribe(this: ResolveAddressStream) -> Pollable { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[link(wasm_import_module = "wasi:sockets/ip-name-lookup")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "subscribe")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/ip-name-lookup_subscribe" +// )] +// fn wit_import(_: i32) -> i32; +// } +// let ret = wit_import(wit_bindgen::rt::as_i32(this)); +// ret as u32 +// } +// } +// } - #[allow(clippy::all)] - pub mod tcp { - #[used] - #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; +// #[allow(clippy::all)] +// pub mod tcp { +// #[used] +// #[doc(hidden)] +// #[cfg(target_arch = "wasm32")] +// static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; - pub type InputStream = super::super::super::wasi::io::streams::InputStream; - pub type OutputStream = super::super::super::wasi::io::streams::OutputStream; - pub type Pollable = super::super::super::wasi::poll::poll::Pollable; - pub type Network = super::super::super::wasi::sockets::network::Network; - pub type ErrorCode = super::super::super::wasi::sockets::network::ErrorCode; - pub type IpSocketAddress = super::super::super::wasi::sockets::network::IpSocketAddress; - pub type IpAddressFamily = super::super::super::wasi::sockets::network::IpAddressFamily; - /// A TCP socket handle. - pub type TcpSocket = u32; - #[repr(u8)] - #[derive(Clone, Copy, PartialEq, Eq)] - pub enum ShutdownType { - /// Similar to `SHUT_RD` in POSIX. - Receive, - /// Similar to `SHUT_WR` in POSIX. - Send, - /// Similar to `SHUT_RDWR` in POSIX. - Both, - } - impl ::core::fmt::Debug for ShutdownType { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - match self { - ShutdownType::Receive => f.debug_tuple("ShutdownType::Receive").finish(), - ShutdownType::Send => f.debug_tuple("ShutdownType::Send").finish(), - ShutdownType::Both => f.debug_tuple("ShutdownType::Both").finish(), - } - } - } - #[allow(clippy::all)] - /// Bind the socket to a specific network on the provided IP address and port. - /// - /// If the IP address is zero (`0.0.0.0` in IPv4, `::` in IPv6), it is left to the implementation to decide which - /// network interface(s) to bind to. - /// If the TCP/UDP port is zero, the socket will be bound to a random free port. - /// - /// When a socket is not explicitly bound, the first invocation to a listen or connect operation will - /// implicitly bind the socket. - /// - /// Unlike in POSIX, this function is async. This enables interactive WASI hosts to inject permission prompts. - /// - /// # Typical `start` errors - /// - `address-family-mismatch`: The `local-address` has the wrong address family. (EINVAL) - /// - `already-bound`: The socket is already bound. (EINVAL) - /// - `concurrency-conflict`: Another `bind`, `connect` or `listen` operation is already in progress. (EALREADY) - /// - /// # Typical `finish` errors - /// - `ephemeral-ports-exhausted`: No ephemeral ports available. (EADDRINUSE, ENOBUFS on Windows) - /// - `address-in-use`: Address is already in use. (EADDRINUSE) - /// - `address-not-bindable`: `local-address` is not an address that the `network` can bind to. (EADDRNOTAVAIL) - /// - `not-in-progress`: A `bind` operation is not in progress. - /// - `would-block`: Can't finish the operation, it is still in progress. (EWOULDBLOCK, EAGAIN) - /// - /// # References - /// - - /// - - /// - - /// - - pub fn start_bind( - this: TcpSocket, - network: Network, - local_address: IpSocketAddress, - ) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ( - result4_0, - result4_1, - result4_2, - result4_3, - result4_4, - result4_5, - result4_6, - result4_7, - result4_8, - result4_9, - result4_10, - result4_11, - ) = match local_address { - super::super::super::wasi::sockets::network::IpSocketAddress::Ipv4(e) => { - let super::super::super::wasi::sockets::network::Ipv4SocketAddress { - port: port0, - address: address0, - } = e; - let (t1_0, t1_1, t1_2, t1_3) = address0; +// pub type InputStream = super::super::super::wasi::io::streams::InputStream; +// pub type OutputStream = super::super::super::wasi::io::streams::OutputStream; +// pub type Pollable = super::super::super::wasi::poll::poll::Pollable; +// pub type Network = super::super::super::wasi::sockets::network::Network; +// pub type ErrorCode = super::super::super::wasi::sockets::network::ErrorCode; +// pub type IpSocketAddress = super::super::super::wasi::sockets::network::IpSocketAddress; +// pub type IpAddressFamily = super::super::super::wasi::sockets::network::IpAddressFamily; +// /// A TCP socket handle. +// pub type TcpSocket = u32; +// #[repr(u8)] +// #[derive(Clone, Copy, PartialEq, Eq)] +// pub enum ShutdownType { +// /// Similar to `SHUT_RD` in POSIX. +// Receive, +// /// Similar to `SHUT_WR` in POSIX. +// Send, +// /// Similar to `SHUT_RDWR` in POSIX. +// Both, +// } +// impl ::core::fmt::Debug for ShutdownType { +// fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { +// match self { +// ShutdownType::Receive => f.debug_tuple("ShutdownType::Receive").finish(), +// ShutdownType::Send => f.debug_tuple("ShutdownType::Send").finish(), +// ShutdownType::Both => f.debug_tuple("ShutdownType::Both").finish(), +// } +// } +// } +// #[allow(clippy::all)] +// /// Bind the socket to a specific network on the provided IP address and port. +// /// +// /// If the IP address is zero (`0.0.0.0` in IPv4, `::` in IPv6), it is left to the implementation to decide which +// /// network interface(s) to bind to. +// /// If the TCP/UDP port is zero, the socket will be bound to a random free port. +// /// +// /// When a socket is not explicitly bound, the first invocation to a listen or connect operation will +// /// implicitly bind the socket. +// /// +// /// Unlike in POSIX, this function is async. This enables interactive WASI hosts to inject permission prompts. +// /// +// /// # Typical `start` errors +// /// - `address-family-mismatch`: The `local-address` has the wrong address family. (EINVAL) +// /// - `already-bound`: The socket is already bound. (EINVAL) +// /// - `concurrency-conflict`: Another `bind`, `connect` or `listen` operation is already in progress. (EALREADY) +// /// +// /// # Typical `finish` errors +// /// - `ephemeral-ports-exhausted`: No ephemeral ports available. (EADDRINUSE, ENOBUFS on Windows) +// /// - `address-in-use`: Address is already in use. (EADDRINUSE) +// /// - `address-not-bindable`: `local-address` is not an address that the `network` can bind to. (EADDRNOTAVAIL) +// /// - `not-in-progress`: A `bind` operation is not in progress. +// /// - `would-block`: Can't finish the operation, it is still in progress. (EWOULDBLOCK, EAGAIN) +// /// +// /// # References +// /// - +// /// - +// /// - +// /// - +// pub fn start_bind( +// this: TcpSocket, +// network: Network, +// local_address: IpSocketAddress, +// ) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ( +// result4_0, +// result4_1, +// result4_2, +// result4_3, +// result4_4, +// result4_5, +// result4_6, +// result4_7, +// result4_8, +// result4_9, +// result4_10, +// result4_11, +// ) = match local_address { +// super::super::super::wasi::sockets::network::IpSocketAddress::Ipv4(e) => { +// let super::super::super::wasi::sockets::network::Ipv4SocketAddress { +// port: port0, +// address: address0, +// } = e; +// let (t1_0, t1_1, t1_2, t1_3) = address0; - ( - 0i32, - wit_bindgen::rt::as_i32(port0), - wit_bindgen::rt::as_i32(t1_0), - wit_bindgen::rt::as_i32(t1_1), - wit_bindgen::rt::as_i32(t1_2), - wit_bindgen::rt::as_i32(t1_3), - 0i32, - 0i32, - 0i32, - 0i32, - 0i32, - 0i32, - ) - } - super::super::super::wasi::sockets::network::IpSocketAddress::Ipv6(e) => { - let super::super::super::wasi::sockets::network::Ipv6SocketAddress { - port: port2, - flow_info: flow_info2, - address: address2, - scope_id: scope_id2, - } = e; - let (t3_0, t3_1, t3_2, t3_3, t3_4, t3_5, t3_6, t3_7) = address2; +// ( +// 0i32, +// wit_bindgen::rt::as_i32(port0), +// wit_bindgen::rt::as_i32(t1_0), +// wit_bindgen::rt::as_i32(t1_1), +// wit_bindgen::rt::as_i32(t1_2), +// wit_bindgen::rt::as_i32(t1_3), +// 0i32, +// 0i32, +// 0i32, +// 0i32, +// 0i32, +// 0i32, +// ) +// } +// super::super::super::wasi::sockets::network::IpSocketAddress::Ipv6(e) => { +// let super::super::super::wasi::sockets::network::Ipv6SocketAddress { +// port: port2, +// flow_info: flow_info2, +// address: address2, +// scope_id: scope_id2, +// } = e; +// let (t3_0, t3_1, t3_2, t3_3, t3_4, t3_5, t3_6, t3_7) = address2; - ( - 1i32, - wit_bindgen::rt::as_i32(port2), - wit_bindgen::rt::as_i32(flow_info2), - wit_bindgen::rt::as_i32(t3_0), - wit_bindgen::rt::as_i32(t3_1), - wit_bindgen::rt::as_i32(t3_2), - wit_bindgen::rt::as_i32(t3_3), - wit_bindgen::rt::as_i32(t3_4), - wit_bindgen::rt::as_i32(t3_5), - wit_bindgen::rt::as_i32(t3_6), - wit_bindgen::rt::as_i32(t3_7), - wit_bindgen::rt::as_i32(scope_id2), - ) - } - }; - let ptr5 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/tcp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "start-bind")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/tcp_start-bind" - )] - fn wit_import( - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - ); - } - wit_import( - wit_bindgen::rt::as_i32(this), - wit_bindgen::rt::as_i32(network), - result4_0, - result4_1, - result4_2, - result4_3, - result4_4, - result4_5, - result4_6, - result4_7, - result4_8, - result4_9, - result4_10, - result4_11, - ptr5, - ); - match i32::from(*((ptr5 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr5 + 1) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr5 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - pub fn finish_bind(this: TcpSocket) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/tcp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "finish-bind")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/tcp_finish-bind" - )] - fn wit_import(_: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 1) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr0 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Connect to a remote endpoint. - /// - /// On success: - /// - the socket is transitioned into the Connection state - /// - a pair of streams is returned that can be used to read & write to the connection - /// - /// # Typical `start` errors - /// - `address-family-mismatch`: The `remote-address` has the wrong address family. (EAFNOSUPPORT) - /// - `invalid-remote-address`: The IP address in `remote-address` is set to INADDR_ANY (`0.0.0.0` / `::`). (EADDRNOTAVAIL on Windows) - /// - `invalid-remote-address`: The port in `remote-address` is set to 0. (EADDRNOTAVAIL on Windows) - /// - `already-attached`: The socket is already attached to a different network. The `network` passed to `connect` must be identical to the one passed to `bind`. - /// - `already-connected`: The socket is already in the Connection state. (EISCONN) - /// - `already-listening`: The socket is already in the Listener state. (EOPNOTSUPP, EINVAL on Windows) - /// - `concurrency-conflict`: Another `bind`, `connect` or `listen` operation is already in progress. (EALREADY) - /// - /// # Typical `finish` errors - /// - `timeout`: Connection timed out. (ETIMEDOUT) - /// - `connection-refused`: The connection was forcefully rejected. (ECONNREFUSED) - /// - `connection-reset`: The connection was reset. (ECONNRESET) - /// - `remote-unreachable`: The remote address is not reachable. (EHOSTUNREACH, EHOSTDOWN, ENETUNREACH, ENETDOWN) - /// - `ephemeral-ports-exhausted`: Tried to perform an implicit bind, but there were no ephemeral ports available. (EADDRINUSE, EADDRNOTAVAIL on Linux, EAGAIN on BSD) - /// - `not-in-progress`: A `connect` operation is not in progress. - /// - `would-block`: Can't finish the operation, it is still in progress. (EWOULDBLOCK, EAGAIN) - /// - /// # References - /// - - /// - - /// - - /// - - pub fn start_connect( - this: TcpSocket, - network: Network, - remote_address: IpSocketAddress, - ) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ( - result4_0, - result4_1, - result4_2, - result4_3, - result4_4, - result4_5, - result4_6, - result4_7, - result4_8, - result4_9, - result4_10, - result4_11, - ) = match remote_address { - super::super::super::wasi::sockets::network::IpSocketAddress::Ipv4(e) => { - let super::super::super::wasi::sockets::network::Ipv4SocketAddress { - port: port0, - address: address0, - } = e; - let (t1_0, t1_1, t1_2, t1_3) = address0; +// ( +// 1i32, +// wit_bindgen::rt::as_i32(port2), +// wit_bindgen::rt::as_i32(flow_info2), +// wit_bindgen::rt::as_i32(t3_0), +// wit_bindgen::rt::as_i32(t3_1), +// wit_bindgen::rt::as_i32(t3_2), +// wit_bindgen::rt::as_i32(t3_3), +// wit_bindgen::rt::as_i32(t3_4), +// wit_bindgen::rt::as_i32(t3_5), +// wit_bindgen::rt::as_i32(t3_6), +// wit_bindgen::rt::as_i32(t3_7), +// wit_bindgen::rt::as_i32(scope_id2), +// ) +// } +// }; +// let ptr5 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/tcp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "start-bind")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/tcp_start-bind" +// )] +// fn wit_import( +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// ); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// wit_bindgen::rt::as_i32(network), +// result4_0, +// result4_1, +// result4_2, +// result4_3, +// result4_4, +// result4_5, +// result4_6, +// result4_7, +// result4_8, +// result4_9, +// result4_10, +// result4_11, +// ptr5, +// ); +// match i32::from(*((ptr5 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr5 + 1) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr5 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// pub fn finish_bind(this: TcpSocket) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/tcp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "finish-bind")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/tcp_finish-bind" +// )] +// fn wit_import(_: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 1) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr0 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Connect to a remote endpoint. +// /// +// /// On success: +// /// - the socket is transitioned into the Connection state +// /// - a pair of streams is returned that can be used to read & write to the connection +// /// +// /// # Typical `start` errors +// /// - `address-family-mismatch`: The `remote-address` has the wrong address family. (EAFNOSUPPORT) +// /// - `invalid-remote-address`: The IP address in `remote-address` is set to INADDR_ANY (`0.0.0.0` / `::`). (EADDRNOTAVAIL on Windows) +// /// - `invalid-remote-address`: The port in `remote-address` is set to 0. (EADDRNOTAVAIL on Windows) +// /// - `already-attached`: The socket is already attached to a different network. The `network` passed to `connect` must be identical to the one passed to `bind`. +// /// - `already-connected`: The socket is already in the Connection state. (EISCONN) +// /// - `already-listening`: The socket is already in the Listener state. (EOPNOTSUPP, EINVAL on Windows) +// /// - `concurrency-conflict`: Another `bind`, `connect` or `listen` operation is already in progress. (EALREADY) +// /// +// /// # Typical `finish` errors +// /// - `timeout`: Connection timed out. (ETIMEDOUT) +// /// - `connection-refused`: The connection was forcefully rejected. (ECONNREFUSED) +// /// - `connection-reset`: The connection was reset. (ECONNRESET) +// /// - `remote-unreachable`: The remote address is not reachable. (EHOSTUNREACH, EHOSTDOWN, ENETUNREACH, ENETDOWN) +// /// - `ephemeral-ports-exhausted`: Tried to perform an implicit bind, but there were no ephemeral ports available. (EADDRINUSE, EADDRNOTAVAIL on Linux, EAGAIN on BSD) +// /// - `not-in-progress`: A `connect` operation is not in progress. +// /// - `would-block`: Can't finish the operation, it is still in progress. (EWOULDBLOCK, EAGAIN) +// /// +// /// # References +// /// - +// /// - +// /// - +// /// - +// pub fn start_connect( +// this: TcpSocket, +// network: Network, +// remote_address: IpSocketAddress, +// ) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ( +// result4_0, +// result4_1, +// result4_2, +// result4_3, +// result4_4, +// result4_5, +// result4_6, +// result4_7, +// result4_8, +// result4_9, +// result4_10, +// result4_11, +// ) = match remote_address { +// super::super::super::wasi::sockets::network::IpSocketAddress::Ipv4(e) => { +// let super::super::super::wasi::sockets::network::Ipv4SocketAddress { +// port: port0, +// address: address0, +// } = e; +// let (t1_0, t1_1, t1_2, t1_3) = address0; - ( - 0i32, - wit_bindgen::rt::as_i32(port0), - wit_bindgen::rt::as_i32(t1_0), - wit_bindgen::rt::as_i32(t1_1), - wit_bindgen::rt::as_i32(t1_2), - wit_bindgen::rt::as_i32(t1_3), - 0i32, - 0i32, - 0i32, - 0i32, - 0i32, - 0i32, - ) - } - super::super::super::wasi::sockets::network::IpSocketAddress::Ipv6(e) => { - let super::super::super::wasi::sockets::network::Ipv6SocketAddress { - port: port2, - flow_info: flow_info2, - address: address2, - scope_id: scope_id2, - } = e; - let (t3_0, t3_1, t3_2, t3_3, t3_4, t3_5, t3_6, t3_7) = address2; +// ( +// 0i32, +// wit_bindgen::rt::as_i32(port0), +// wit_bindgen::rt::as_i32(t1_0), +// wit_bindgen::rt::as_i32(t1_1), +// wit_bindgen::rt::as_i32(t1_2), +// wit_bindgen::rt::as_i32(t1_3), +// 0i32, +// 0i32, +// 0i32, +// 0i32, +// 0i32, +// 0i32, +// ) +// } +// super::super::super::wasi::sockets::network::IpSocketAddress::Ipv6(e) => { +// let super::super::super::wasi::sockets::network::Ipv6SocketAddress { +// port: port2, +// flow_info: flow_info2, +// address: address2, +// scope_id: scope_id2, +// } = e; +// let (t3_0, t3_1, t3_2, t3_3, t3_4, t3_5, t3_6, t3_7) = address2; - ( - 1i32, - wit_bindgen::rt::as_i32(port2), - wit_bindgen::rt::as_i32(flow_info2), - wit_bindgen::rt::as_i32(t3_0), - wit_bindgen::rt::as_i32(t3_1), - wit_bindgen::rt::as_i32(t3_2), - wit_bindgen::rt::as_i32(t3_3), - wit_bindgen::rt::as_i32(t3_4), - wit_bindgen::rt::as_i32(t3_5), - wit_bindgen::rt::as_i32(t3_6), - wit_bindgen::rt::as_i32(t3_7), - wit_bindgen::rt::as_i32(scope_id2), - ) - } - }; - let ptr5 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/tcp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "start-connect")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/tcp_start-connect" - )] - fn wit_import( - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - ); - } - wit_import( - wit_bindgen::rt::as_i32(this), - wit_bindgen::rt::as_i32(network), - result4_0, - result4_1, - result4_2, - result4_3, - result4_4, - result4_5, - result4_6, - result4_7, - result4_8, - result4_9, - result4_10, - result4_11, - ptr5, - ); - match i32::from(*((ptr5 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr5 + 1) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr5 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - pub fn finish_connect( - this: TcpSocket, - ) -> Result<(InputStream, OutputStream), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(4))] - struct RetArea([u8; 12]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/tcp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "finish-connect")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/tcp_finish-connect" - )] - fn wit_import(_: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(( - *((ptr0 + 4) as *const i32) as u32, - *((ptr0 + 8) as *const i32) as u32, - )), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 4) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr0 + 4) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Start listening for new connections. - /// - /// Transitions the socket into the Listener state. - /// - /// Unlike in POSIX, this function is async. This enables interactive WASI hosts to inject permission prompts. - /// - /// # Typical `start` errors - /// - `already-attached`: The socket is already attached to a different network. The `network` passed to `listen` must be identical to the one passed to `bind`. - /// - `already-connected`: The socket is already in the Connection state. (EISCONN, EINVAL on BSD) - /// - `already-listening`: The socket is already in the Listener state. - /// - `concurrency-conflict`: Another `bind`, `connect` or `listen` operation is already in progress. (EINVAL on BSD) - /// - /// # Typical `finish` errors - /// - `ephemeral-ports-exhausted`: Tried to perform an implicit bind, but there were no ephemeral ports available. (EADDRINUSE) - /// - `not-in-progress`: A `listen` operation is not in progress. - /// - `would-block`: Can't finish the operation, it is still in progress. (EWOULDBLOCK, EAGAIN) - /// - /// # References - /// - - /// - - /// - - /// - - pub fn start_listen(this: TcpSocket, network: Network) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/tcp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "start-listen")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/tcp_start-listen" - )] - fn wit_import(_: i32, _: i32, _: i32); - } - wit_import( - wit_bindgen::rt::as_i32(this), - wit_bindgen::rt::as_i32(network), - ptr0, - ); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 1) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr0 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - pub fn finish_listen(this: TcpSocket) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/tcp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "finish-listen")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/tcp_finish-listen" - )] - fn wit_import(_: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 1) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr0 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Accept a new client socket. - /// - /// The returned socket is bound and in the Connection state. - /// - /// On success, this function returns the newly accepted client socket along with - /// a pair of streams that can be used to read & write to the connection. - /// - /// # Typical errors - /// - `not-listening`: Socket is not in the Listener state. (EINVAL) - /// - `would-block`: No pending connections at the moment. (EWOULDBLOCK, EAGAIN) - /// - /// Host implementations must skip over transient errors returned by the native accept syscall. - /// - /// # References - /// - - /// - - /// - - /// - - pub fn accept( - this: TcpSocket, - ) -> Result<(TcpSocket, InputStream, OutputStream), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(4))] - struct RetArea([u8; 16]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/tcp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "accept")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/tcp_accept" - )] - fn wit_import(_: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(( - *((ptr0 + 4) as *const i32) as u32, - *((ptr0 + 8) as *const i32) as u32, - *((ptr0 + 12) as *const i32) as u32, - )), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 4) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr0 + 4) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Get the bound local address. - /// - /// # Typical errors - /// - `not-bound`: The socket is not bound to any local address. - /// - /// # References - /// - - /// - - /// - - /// - - pub fn local_address(this: TcpSocket) -> Result { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(4))] - struct RetArea([u8; 36]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/tcp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "local-address")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/tcp_local-address" - )] - fn wit_import(_: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok({ - { - match i32::from(*((ptr0 + 4) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::IpSocketAddress::Ipv4(super::super::super::wasi::sockets::network::Ipv4SocketAddress{port:i32::from(*((ptr0 + 8) as *const u16)) as u16, address:(i32::from(*((ptr0 + 10) as *const u8)) as u8, i32::from(*((ptr0 + 11) as *const u8)) as u8, i32::from(*((ptr0 + 12) as *const u8)) as u8, i32::from(*((ptr0 + 13) as *const u8)) as u8), }), - #[cfg(debug_assertions)]1 => super::super::super::wasi::sockets::network::IpSocketAddress::Ipv6(super::super::super::wasi::sockets::network::Ipv6SocketAddress{port:i32::from(*((ptr0 + 8) as *const u16)) as u16, flow_info:*((ptr0 + 12) as *const i32) as u32, address:(i32::from(*((ptr0 + 16) as *const u16)) as u16, i32::from(*((ptr0 + 18) as *const u16)) as u16, i32::from(*((ptr0 + 20) as *const u16)) as u16, i32::from(*((ptr0 + 22) as *const u16)) as u16, i32::from(*((ptr0 + 24) as *const u16)) as u16, i32::from(*((ptr0 + 26) as *const u16)) as u16, i32::from(*((ptr0 + 28) as *const u16)) as u16, i32::from(*((ptr0 + 30) as *const u16)) as u16), scope_id:*((ptr0 + 32) as *const i32) as u32, }), - #[cfg(not(debug_assertions))]_ => super::super::super::wasi::sockets::network::IpSocketAddress::Ipv6(super::super::super::wasi::sockets::network::Ipv6SocketAddress{port:i32::from(*((ptr0 + 8) as *const u16)) as u16, flow_info:*((ptr0 + 12) as *const i32) as u32, address:(i32::from(*((ptr0 + 16) as *const u16)) as u16, i32::from(*((ptr0 + 18) as *const u16)) as u16, i32::from(*((ptr0 + 20) as *const u16)) as u16, i32::from(*((ptr0 + 22) as *const u16)) as u16, i32::from(*((ptr0 + 24) as *const u16)) as u16, i32::from(*((ptr0 + 26) as *const u16)) as u16, i32::from(*((ptr0 + 28) as *const u16)) as u16, i32::from(*((ptr0 + 30) as *const u16)) as u16), scope_id:*((ptr0 + 32) as *const i32) as u32, }), - #[cfg(debug_assertions)]_ => panic!("invalid enum discriminant"), - } - } - }), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 4) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr0 + 4) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Get the bound remote address. - /// - /// # Typical errors - /// - `not-connected`: The socket is not connected to a remote address. (ENOTCONN) - /// - /// # References - /// - - /// - - /// - - /// - - pub fn remote_address(this: TcpSocket) -> Result { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(4))] - struct RetArea([u8; 36]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/tcp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "remote-address")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/tcp_remote-address" - )] - fn wit_import(_: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok({ - { - match i32::from(*((ptr0 + 4) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::IpSocketAddress::Ipv4(super::super::super::wasi::sockets::network::Ipv4SocketAddress{port:i32::from(*((ptr0 + 8) as *const u16)) as u16, address:(i32::from(*((ptr0 + 10) as *const u8)) as u8, i32::from(*((ptr0 + 11) as *const u8)) as u8, i32::from(*((ptr0 + 12) as *const u8)) as u8, i32::from(*((ptr0 + 13) as *const u8)) as u8), }), - #[cfg(debug_assertions)]1 => super::super::super::wasi::sockets::network::IpSocketAddress::Ipv6(super::super::super::wasi::sockets::network::Ipv6SocketAddress{port:i32::from(*((ptr0 + 8) as *const u16)) as u16, flow_info:*((ptr0 + 12) as *const i32) as u32, address:(i32::from(*((ptr0 + 16) as *const u16)) as u16, i32::from(*((ptr0 + 18) as *const u16)) as u16, i32::from(*((ptr0 + 20) as *const u16)) as u16, i32::from(*((ptr0 + 22) as *const u16)) as u16, i32::from(*((ptr0 + 24) as *const u16)) as u16, i32::from(*((ptr0 + 26) as *const u16)) as u16, i32::from(*((ptr0 + 28) as *const u16)) as u16, i32::from(*((ptr0 + 30) as *const u16)) as u16), scope_id:*((ptr0 + 32) as *const i32) as u32, }), - #[cfg(not(debug_assertions))]_ => super::super::super::wasi::sockets::network::IpSocketAddress::Ipv6(super::super::super::wasi::sockets::network::Ipv6SocketAddress{port:i32::from(*((ptr0 + 8) as *const u16)) as u16, flow_info:*((ptr0 + 12) as *const i32) as u32, address:(i32::from(*((ptr0 + 16) as *const u16)) as u16, i32::from(*((ptr0 + 18) as *const u16)) as u16, i32::from(*((ptr0 + 20) as *const u16)) as u16, i32::from(*((ptr0 + 22) as *const u16)) as u16, i32::from(*((ptr0 + 24) as *const u16)) as u16, i32::from(*((ptr0 + 26) as *const u16)) as u16, i32::from(*((ptr0 + 28) as *const u16)) as u16, i32::from(*((ptr0 + 30) as *const u16)) as u16), scope_id:*((ptr0 + 32) as *const i32) as u32, }), - #[cfg(debug_assertions)]_ => panic!("invalid enum discriminant"), - } - } - }), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 4) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr0 + 4) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Whether this is a IPv4 or IPv6 socket. - /// - /// Equivalent to the SO_DOMAIN socket option. - pub fn address_family(this: TcpSocket) -> IpAddressFamily { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[link(wasm_import_module = "wasi:sockets/tcp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "address-family")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/tcp_address-family" - )] - fn wit_import(_: i32) -> i32; - } - let ret = wit_import(wit_bindgen::rt::as_i32(this)); - { - #[cfg(debug_assertions)] - { - match ret { - 0 => super::super::super::wasi::sockets::network::IpAddressFamily::Ipv4, - 1 => super::super::super::wasi::sockets::network::IpAddressFamily::Ipv6, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::IpAddressFamily, - >(ret as u8) - } - } - } - } - #[allow(clippy::all)] - /// Whether IPv4 compatibility (dual-stack) mode is disabled or not. - /// - /// Equivalent to the IPV6_V6ONLY socket option. - /// - /// # Typical errors - /// - `ipv6-only-operation`: (get/set) `this` socket is an IPv4 socket. - /// - `already-bound`: (set) The socket is already bound. - /// - `not-supported`: (set) Host does not support dual-stack sockets. (Implementations are not required to.) - /// - `concurrency-conflict`: (set) A `bind`, `connect` or `listen` operation is already in progress. (EALREADY) - pub fn ipv6_only(this: TcpSocket) -> Result { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/tcp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "ipv6-only")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/tcp_ipv6-only" - )] - fn wit_import(_: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok({ - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::(i32::from( - *((ptr0 + 1) as *const u8), - ) - as u8) - } - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 1) as *const u8)) { - 0 => false, - 1 => true, - _ => panic!("invalid bool discriminant"), - } - } - }), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 1) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr0 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - pub fn set_ipv6_only(this: TcpSocket, value: bool) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/tcp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "set-ipv6-only")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/tcp_set-ipv6-only" - )] - fn wit_import(_: i32, _: i32, _: i32); - } - wit_import( - wit_bindgen::rt::as_i32(this), - match value { - true => 1, - false => 0, - }, - ptr0, - ); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 1) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr0 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Hints the desired listen queue size. Implementations are free to ignore this. - /// - /// # Typical errors - /// - `already-connected`: (set) The socket is already in the Connection state. - /// - `concurrency-conflict`: (set) A `bind`, `connect` or `listen` operation is already in progress. (EALREADY) - pub fn set_listen_backlog_size(this: TcpSocket, value: u64) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/tcp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "set-listen-backlog-size")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/tcp_set-listen-backlog-size" - )] - fn wit_import(_: i32, _: i64, _: i32); - } - wit_import( - wit_bindgen::rt::as_i32(this), - wit_bindgen::rt::as_i64(value), - ptr0, - ); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 1) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr0 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Equivalent to the SO_KEEPALIVE socket option. - /// - /// # Typical errors - /// - `concurrency-conflict`: (set) A `bind`, `connect` or `listen` operation is already in progress. (EALREADY) - pub fn keep_alive(this: TcpSocket) -> Result { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/tcp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "keep-alive")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/tcp_keep-alive" - )] - fn wit_import(_: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok({ - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::(i32::from( - *((ptr0 + 1) as *const u8), - ) - as u8) - } - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 1) as *const u8)) { - 0 => false, - 1 => true, - _ => panic!("invalid bool discriminant"), - } - } - }), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 1) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr0 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - pub fn set_keep_alive(this: TcpSocket, value: bool) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/tcp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "set-keep-alive")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/tcp_set-keep-alive" - )] - fn wit_import(_: i32, _: i32, _: i32); - } - wit_import( - wit_bindgen::rt::as_i32(this), - match value { - true => 1, - false => 0, - }, - ptr0, - ); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 1) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr0 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Equivalent to the TCP_NODELAY socket option. - /// - /// # Typical errors - /// - `concurrency-conflict`: (set) A `bind`, `connect` or `listen` operation is already in progress. (EALREADY) - pub fn no_delay(this: TcpSocket) -> Result { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/tcp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "no-delay")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/tcp_no-delay" - )] - fn wit_import(_: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok({ - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::(i32::from( - *((ptr0 + 1) as *const u8), - ) - as u8) - } - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 1) as *const u8)) { - 0 => false, - 1 => true, - _ => panic!("invalid bool discriminant"), - } - } - }), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 1) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr0 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - pub fn set_no_delay(this: TcpSocket, value: bool) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/tcp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "set-no-delay")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/tcp_set-no-delay" - )] - fn wit_import(_: i32, _: i32, _: i32); - } - wit_import( - wit_bindgen::rt::as_i32(this), - match value { - true => 1, - false => 0, - }, - ptr0, - ); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 1) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr0 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Equivalent to the IP_TTL & IPV6_UNICAST_HOPS socket options. - /// - /// # Typical errors - /// - `already-connected`: (set) The socket is already in the Connection state. - /// - `already-listening`: (set) The socket is already in the Listener state. - /// - `concurrency-conflict`: (set) A `bind`, `connect` or `listen` operation is already in progress. (EALREADY) - pub fn unicast_hop_limit(this: TcpSocket) -> Result { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/tcp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "unicast-hop-limit")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/tcp_unicast-hop-limit" - )] - fn wit_import(_: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(i32::from(*((ptr0 + 1) as *const u8)) as u8), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 1) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr0 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - pub fn set_unicast_hop_limit(this: TcpSocket, value: u8) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/tcp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "set-unicast-hop-limit")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/tcp_set-unicast-hop-limit" - )] - fn wit_import(_: i32, _: i32, _: i32); - } - wit_import( - wit_bindgen::rt::as_i32(this), - wit_bindgen::rt::as_i32(value), - ptr0, - ); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 1) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr0 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// The kernel buffer space reserved for sends/receives on this socket. - /// - /// Note #1: an implementation may choose to cap or round the buffer size when setting the value. - /// In other words, after setting a value, reading the same setting back may return a different value. - /// - /// Note #2: there is not necessarily a direct relationship between the kernel buffer size and the bytes of - /// actual data to be sent/received by the application, because the kernel might also use the buffer space - /// for internal metadata structures. - /// - /// Equivalent to the SO_RCVBUF and SO_SNDBUF socket options. - /// - /// # Typical errors - /// - `already-connected`: (set) The socket is already in the Connection state. - /// - `already-listening`: (set) The socket is already in the Listener state. - /// - `concurrency-conflict`: (set) A `bind`, `connect` or `listen` operation is already in progress. (EALREADY) - pub fn receive_buffer_size(this: TcpSocket) -> Result { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(8))] - struct RetArea([u8; 16]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/tcp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "receive-buffer-size")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/tcp_receive-buffer-size" - )] - fn wit_import(_: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(*((ptr0 + 8) as *const i64) as u64), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 8) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr0 + 8) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - pub fn set_receive_buffer_size(this: TcpSocket, value: u64) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/tcp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "set-receive-buffer-size")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/tcp_set-receive-buffer-size" - )] - fn wit_import(_: i32, _: i64, _: i32); - } - wit_import( - wit_bindgen::rt::as_i32(this), - wit_bindgen::rt::as_i64(value), - ptr0, - ); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 1) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr0 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - pub fn send_buffer_size(this: TcpSocket) -> Result { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(8))] - struct RetArea([u8; 16]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/tcp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "send-buffer-size")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/tcp_send-buffer-size" - )] - fn wit_import(_: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(*((ptr0 + 8) as *const i64) as u64), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 8) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr0 + 8) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - pub fn set_send_buffer_size(this: TcpSocket, value: u64) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/tcp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "set-send-buffer-size")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/tcp_set-send-buffer-size" - )] - fn wit_import(_: i32, _: i64, _: i32); - } - wit_import( - wit_bindgen::rt::as_i32(this), - wit_bindgen::rt::as_i64(value), - ptr0, - ); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 1) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr0 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Create a `pollable` which will resolve once the socket is ready for I/O. - /// - /// Note: this function is here for WASI Preview2 only. - /// It's planned to be removed when `future` is natively supported in Preview3. - pub fn subscribe(this: TcpSocket) -> Pollable { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[link(wasm_import_module = "wasi:sockets/tcp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "subscribe")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/tcp_subscribe" - )] - fn wit_import(_: i32) -> i32; - } - let ret = wit_import(wit_bindgen::rt::as_i32(this)); - ret as u32 - } - } - #[allow(clippy::all)] - /// Initiate a graceful shutdown. - /// - /// - receive: the socket is not expecting to receive any more data from the peer. All subsequent read - /// operations on the `input-stream` associated with this socket will return an End Of Stream indication. - /// Any data still in the receive queue at time of calling `shutdown` will be discarded. - /// - send: the socket is not expecting to send any more data to the peer. All subsequent write - /// operations on the `output-stream` associated with this socket will return an error. - /// - both: same effect as receive & send combined. - /// - /// The shutdown function does not close (drop) the socket. - /// - /// # Typical errors - /// - `not-connected`: The socket is not in the Connection state. (ENOTCONN) - /// - /// # References - /// - - /// - - /// - - /// - - pub fn shutdown(this: TcpSocket, shutdown_type: ShutdownType) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/tcp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "shutdown")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/tcp_shutdown" - )] - fn wit_import(_: i32, _: i32, _: i32); - } - wit_import( - wit_bindgen::rt::as_i32(this), - match shutdown_type { - ShutdownType::Receive => 0, - ShutdownType::Send => 1, - ShutdownType::Both => 2, - }, - ptr0, - ); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 1) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr0 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Dispose of the specified `tcp-socket`, after which it may no longer be used. - /// - /// Similar to the POSIX `close` function. - /// - /// Note: this function is scheduled to be removed when Resources are natively supported in Wit. - pub fn drop_tcp_socket(this: TcpSocket) { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[link(wasm_import_module = "wasi:sockets/tcp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "drop-tcp-socket")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/tcp_drop-tcp-socket" - )] - fn wit_import(_: i32); - } - wit_import(wit_bindgen::rt::as_i32(this)); - } - } - } +// ( +// 1i32, +// wit_bindgen::rt::as_i32(port2), +// wit_bindgen::rt::as_i32(flow_info2), +// wit_bindgen::rt::as_i32(t3_0), +// wit_bindgen::rt::as_i32(t3_1), +// wit_bindgen::rt::as_i32(t3_2), +// wit_bindgen::rt::as_i32(t3_3), +// wit_bindgen::rt::as_i32(t3_4), +// wit_bindgen::rt::as_i32(t3_5), +// wit_bindgen::rt::as_i32(t3_6), +// wit_bindgen::rt::as_i32(t3_7), +// wit_bindgen::rt::as_i32(scope_id2), +// ) +// } +// }; +// let ptr5 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/tcp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "start-connect")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/tcp_start-connect" +// )] +// fn wit_import( +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// ); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// wit_bindgen::rt::as_i32(network), +// result4_0, +// result4_1, +// result4_2, +// result4_3, +// result4_4, +// result4_5, +// result4_6, +// result4_7, +// result4_8, +// result4_9, +// result4_10, +// result4_11, +// ptr5, +// ); +// match i32::from(*((ptr5 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr5 + 1) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr5 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// pub fn finish_connect( +// this: TcpSocket, +// ) -> Result<(InputStream, OutputStream), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(4))] +// struct RetArea([u8; 12]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/tcp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "finish-connect")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/tcp_finish-connect" +// )] +// fn wit_import(_: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(( +// *((ptr0 + 4) as *const i32) as u32, +// *((ptr0 + 8) as *const i32) as u32, +// )), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 4) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr0 + 4) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Start listening for new connections. +// /// +// /// Transitions the socket into the Listener state. +// /// +// /// Unlike in POSIX, this function is async. This enables interactive WASI hosts to inject permission prompts. +// /// +// /// # Typical `start` errors +// /// - `already-attached`: The socket is already attached to a different network. The `network` passed to `listen` must be identical to the one passed to `bind`. +// /// - `already-connected`: The socket is already in the Connection state. (EISCONN, EINVAL on BSD) +// /// - `already-listening`: The socket is already in the Listener state. +// /// - `concurrency-conflict`: Another `bind`, `connect` or `listen` operation is already in progress. (EINVAL on BSD) +// /// +// /// # Typical `finish` errors +// /// - `ephemeral-ports-exhausted`: Tried to perform an implicit bind, but there were no ephemeral ports available. (EADDRINUSE) +// /// - `not-in-progress`: A `listen` operation is not in progress. +// /// - `would-block`: Can't finish the operation, it is still in progress. (EWOULDBLOCK, EAGAIN) +// /// +// /// # References +// /// - +// /// - +// /// - +// /// - +// pub fn start_listen(this: TcpSocket, network: Network) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/tcp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "start-listen")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/tcp_start-listen" +// )] +// fn wit_import(_: i32, _: i32, _: i32); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// wit_bindgen::rt::as_i32(network), +// ptr0, +// ); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 1) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr0 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// pub fn finish_listen(this: TcpSocket) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/tcp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "finish-listen")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/tcp_finish-listen" +// )] +// fn wit_import(_: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 1) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr0 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Accept a new client socket. +// /// +// /// The returned socket is bound and in the Connection state. +// /// +// /// On success, this function returns the newly accepted client socket along with +// /// a pair of streams that can be used to read & write to the connection. +// /// +// /// # Typical errors +// /// - `not-listening`: Socket is not in the Listener state. (EINVAL) +// /// - `would-block`: No pending connections at the moment. (EWOULDBLOCK, EAGAIN) +// /// +// /// Host implementations must skip over transient errors returned by the native accept syscall. +// /// +// /// # References +// /// - +// /// - +// /// - +// /// - +// pub fn accept( +// this: TcpSocket, +// ) -> Result<(TcpSocket, InputStream, OutputStream), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(4))] +// struct RetArea([u8; 16]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/tcp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "accept")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/tcp_accept" +// )] +// fn wit_import(_: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(( +// *((ptr0 + 4) as *const i32) as u32, +// *((ptr0 + 8) as *const i32) as u32, +// *((ptr0 + 12) as *const i32) as u32, +// )), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 4) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr0 + 4) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Get the bound local address. +// /// +// /// # Typical errors +// /// - `not-bound`: The socket is not bound to any local address. +// /// +// /// # References +// /// - +// /// - +// /// - +// /// - +// pub fn local_address(this: TcpSocket) -> Result { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(4))] +// struct RetArea([u8; 36]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/tcp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "local-address")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/tcp_local-address" +// )] +// fn wit_import(_: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok({ +// { +// match i32::from(*((ptr0 + 4) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::IpSocketAddress::Ipv4(super::super::super::wasi::sockets::network::Ipv4SocketAddress{port:i32::from(*((ptr0 + 8) as *const u16)) as u16, address:(i32::from(*((ptr0 + 10) as *const u8)) as u8, i32::from(*((ptr0 + 11) as *const u8)) as u8, i32::from(*((ptr0 + 12) as *const u8)) as u8, i32::from(*((ptr0 + 13) as *const u8)) as u8), }), +// #[cfg(debug_assertions)]1 => super::super::super::wasi::sockets::network::IpSocketAddress::Ipv6(super::super::super::wasi::sockets::network::Ipv6SocketAddress{port:i32::from(*((ptr0 + 8) as *const u16)) as u16, flow_info:*((ptr0 + 12) as *const i32) as u32, address:(i32::from(*((ptr0 + 16) as *const u16)) as u16, i32::from(*((ptr0 + 18) as *const u16)) as u16, i32::from(*((ptr0 + 20) as *const u16)) as u16, i32::from(*((ptr0 + 22) as *const u16)) as u16, i32::from(*((ptr0 + 24) as *const u16)) as u16, i32::from(*((ptr0 + 26) as *const u16)) as u16, i32::from(*((ptr0 + 28) as *const u16)) as u16, i32::from(*((ptr0 + 30) as *const u16)) as u16), scope_id:*((ptr0 + 32) as *const i32) as u32, }), +// #[cfg(not(debug_assertions))]_ => super::super::super::wasi::sockets::network::IpSocketAddress::Ipv6(super::super::super::wasi::sockets::network::Ipv6SocketAddress{port:i32::from(*((ptr0 + 8) as *const u16)) as u16, flow_info:*((ptr0 + 12) as *const i32) as u32, address:(i32::from(*((ptr0 + 16) as *const u16)) as u16, i32::from(*((ptr0 + 18) as *const u16)) as u16, i32::from(*((ptr0 + 20) as *const u16)) as u16, i32::from(*((ptr0 + 22) as *const u16)) as u16, i32::from(*((ptr0 + 24) as *const u16)) as u16, i32::from(*((ptr0 + 26) as *const u16)) as u16, i32::from(*((ptr0 + 28) as *const u16)) as u16, i32::from(*((ptr0 + 30) as *const u16)) as u16), scope_id:*((ptr0 + 32) as *const i32) as u32, }), +// #[cfg(debug_assertions)]_ => panic!("invalid enum discriminant"), +// } +// } +// }), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 4) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr0 + 4) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Get the bound remote address. +// /// +// /// # Typical errors +// /// - `not-connected`: The socket is not connected to a remote address. (ENOTCONN) +// /// +// /// # References +// /// - +// /// - +// /// - +// /// - +// pub fn remote_address(this: TcpSocket) -> Result { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(4))] +// struct RetArea([u8; 36]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/tcp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "remote-address")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/tcp_remote-address" +// )] +// fn wit_import(_: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok({ +// { +// match i32::from(*((ptr0 + 4) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::IpSocketAddress::Ipv4(super::super::super::wasi::sockets::network::Ipv4SocketAddress{port:i32::from(*((ptr0 + 8) as *const u16)) as u16, address:(i32::from(*((ptr0 + 10) as *const u8)) as u8, i32::from(*((ptr0 + 11) as *const u8)) as u8, i32::from(*((ptr0 + 12) as *const u8)) as u8, i32::from(*((ptr0 + 13) as *const u8)) as u8), }), +// #[cfg(debug_assertions)]1 => super::super::super::wasi::sockets::network::IpSocketAddress::Ipv6(super::super::super::wasi::sockets::network::Ipv6SocketAddress{port:i32::from(*((ptr0 + 8) as *const u16)) as u16, flow_info:*((ptr0 + 12) as *const i32) as u32, address:(i32::from(*((ptr0 + 16) as *const u16)) as u16, i32::from(*((ptr0 + 18) as *const u16)) as u16, i32::from(*((ptr0 + 20) as *const u16)) as u16, i32::from(*((ptr0 + 22) as *const u16)) as u16, i32::from(*((ptr0 + 24) as *const u16)) as u16, i32::from(*((ptr0 + 26) as *const u16)) as u16, i32::from(*((ptr0 + 28) as *const u16)) as u16, i32::from(*((ptr0 + 30) as *const u16)) as u16), scope_id:*((ptr0 + 32) as *const i32) as u32, }), +// #[cfg(not(debug_assertions))]_ => super::super::super::wasi::sockets::network::IpSocketAddress::Ipv6(super::super::super::wasi::sockets::network::Ipv6SocketAddress{port:i32::from(*((ptr0 + 8) as *const u16)) as u16, flow_info:*((ptr0 + 12) as *const i32) as u32, address:(i32::from(*((ptr0 + 16) as *const u16)) as u16, i32::from(*((ptr0 + 18) as *const u16)) as u16, i32::from(*((ptr0 + 20) as *const u16)) as u16, i32::from(*((ptr0 + 22) as *const u16)) as u16, i32::from(*((ptr0 + 24) as *const u16)) as u16, i32::from(*((ptr0 + 26) as *const u16)) as u16, i32::from(*((ptr0 + 28) as *const u16)) as u16, i32::from(*((ptr0 + 30) as *const u16)) as u16), scope_id:*((ptr0 + 32) as *const i32) as u32, }), +// #[cfg(debug_assertions)]_ => panic!("invalid enum discriminant"), +// } +// } +// }), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 4) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr0 + 4) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Whether this is a IPv4 or IPv6 socket. +// /// +// /// Equivalent to the SO_DOMAIN socket option. +// pub fn address_family(this: TcpSocket) -> IpAddressFamily { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[link(wasm_import_module = "wasi:sockets/tcp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "address-family")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/tcp_address-family" +// )] +// fn wit_import(_: i32) -> i32; +// } +// let ret = wit_import(wit_bindgen::rt::as_i32(this)); +// { +// #[cfg(debug_assertions)] +// { +// match ret { +// 0 => super::super::super::wasi::sockets::network::IpAddressFamily::Ipv4, +// 1 => super::super::super::wasi::sockets::network::IpAddressFamily::Ipv6, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::IpAddressFamily, +// >(ret as u8) +// } +// } +// } +// } +// #[allow(clippy::all)] +// /// Whether IPv4 compatibility (dual-stack) mode is disabled or not. +// /// +// /// Equivalent to the IPV6_V6ONLY socket option. +// /// +// /// # Typical errors +// /// - `ipv6-only-operation`: (get/set) `this` socket is an IPv4 socket. +// /// - `already-bound`: (set) The socket is already bound. +// /// - `not-supported`: (set) Host does not support dual-stack sockets. (Implementations are not required to.) +// /// - `concurrency-conflict`: (set) A `bind`, `connect` or `listen` operation is already in progress. (EALREADY) +// pub fn ipv6_only(this: TcpSocket) -> Result { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/tcp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "ipv6-only")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/tcp_ipv6-only" +// )] +// fn wit_import(_: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok({ +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::(i32::from( +// *((ptr0 + 1) as *const u8), +// ) +// as u8) +// } +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 1) as *const u8)) { +// 0 => false, +// 1 => true, +// _ => panic!("invalid bool discriminant"), +// } +// } +// }), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 1) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr0 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// pub fn set_ipv6_only(this: TcpSocket, value: bool) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/tcp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "set-ipv6-only")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/tcp_set-ipv6-only" +// )] +// fn wit_import(_: i32, _: i32, _: i32); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// match value { +// true => 1, +// false => 0, +// }, +// ptr0, +// ); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 1) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr0 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Hints the desired listen queue size. Implementations are free to ignore this. +// /// +// /// # Typical errors +// /// - `already-connected`: (set) The socket is already in the Connection state. +// /// - `concurrency-conflict`: (set) A `bind`, `connect` or `listen` operation is already in progress. (EALREADY) +// pub fn set_listen_backlog_size(this: TcpSocket, value: u64) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/tcp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "set-listen-backlog-size")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/tcp_set-listen-backlog-size" +// )] +// fn wit_import(_: i32, _: i64, _: i32); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// wit_bindgen::rt::as_i64(value), +// ptr0, +// ); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 1) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr0 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Equivalent to the SO_KEEPALIVE socket option. +// /// +// /// # Typical errors +// /// - `concurrency-conflict`: (set) A `bind`, `connect` or `listen` operation is already in progress. (EALREADY) +// pub fn keep_alive(this: TcpSocket) -> Result { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/tcp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "keep-alive")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/tcp_keep-alive" +// )] +// fn wit_import(_: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok({ +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::(i32::from( +// *((ptr0 + 1) as *const u8), +// ) +// as u8) +// } +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 1) as *const u8)) { +// 0 => false, +// 1 => true, +// _ => panic!("invalid bool discriminant"), +// } +// } +// }), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 1) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr0 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// pub fn set_keep_alive(this: TcpSocket, value: bool) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/tcp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "set-keep-alive")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/tcp_set-keep-alive" +// )] +// fn wit_import(_: i32, _: i32, _: i32); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// match value { +// true => 1, +// false => 0, +// }, +// ptr0, +// ); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 1) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr0 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Equivalent to the TCP_NODELAY socket option. +// /// +// /// # Typical errors +// /// - `concurrency-conflict`: (set) A `bind`, `connect` or `listen` operation is already in progress. (EALREADY) +// pub fn no_delay(this: TcpSocket) -> Result { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/tcp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "no-delay")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/tcp_no-delay" +// )] +// fn wit_import(_: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok({ +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::(i32::from( +// *((ptr0 + 1) as *const u8), +// ) +// as u8) +// } +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 1) as *const u8)) { +// 0 => false, +// 1 => true, +// _ => panic!("invalid bool discriminant"), +// } +// } +// }), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 1) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr0 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// pub fn set_no_delay(this: TcpSocket, value: bool) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/tcp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "set-no-delay")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/tcp_set-no-delay" +// )] +// fn wit_import(_: i32, _: i32, _: i32); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// match value { +// true => 1, +// false => 0, +// }, +// ptr0, +// ); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 1) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr0 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Equivalent to the IP_TTL & IPV6_UNICAST_HOPS socket options. +// /// +// /// # Typical errors +// /// - `already-connected`: (set) The socket is already in the Connection state. +// /// - `already-listening`: (set) The socket is already in the Listener state. +// /// - `concurrency-conflict`: (set) A `bind`, `connect` or `listen` operation is already in progress. (EALREADY) +// pub fn unicast_hop_limit(this: TcpSocket) -> Result { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/tcp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "unicast-hop-limit")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/tcp_unicast-hop-limit" +// )] +// fn wit_import(_: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(i32::from(*((ptr0 + 1) as *const u8)) as u8), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 1) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr0 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// pub fn set_unicast_hop_limit(this: TcpSocket, value: u8) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/tcp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "set-unicast-hop-limit")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/tcp_set-unicast-hop-limit" +// )] +// fn wit_import(_: i32, _: i32, _: i32); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// wit_bindgen::rt::as_i32(value), +// ptr0, +// ); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 1) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr0 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// The kernel buffer space reserved for sends/receives on this socket. +// /// +// /// Note #1: an implementation may choose to cap or round the buffer size when setting the value. +// /// In other words, after setting a value, reading the same setting back may return a different value. +// /// +// /// Note #2: there is not necessarily a direct relationship between the kernel buffer size and the bytes of +// /// actual data to be sent/received by the application, because the kernel might also use the buffer space +// /// for internal metadata structures. +// /// +// /// Equivalent to the SO_RCVBUF and SO_SNDBUF socket options. +// /// +// /// # Typical errors +// /// - `already-connected`: (set) The socket is already in the Connection state. +// /// - `already-listening`: (set) The socket is already in the Listener state. +// /// - `concurrency-conflict`: (set) A `bind`, `connect` or `listen` operation is already in progress. (EALREADY) +// pub fn receive_buffer_size(this: TcpSocket) -> Result { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(8))] +// struct RetArea([u8; 16]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/tcp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "receive-buffer-size")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/tcp_receive-buffer-size" +// )] +// fn wit_import(_: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(*((ptr0 + 8) as *const i64) as u64), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 8) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr0 + 8) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// pub fn set_receive_buffer_size(this: TcpSocket, value: u64) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/tcp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "set-receive-buffer-size")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/tcp_set-receive-buffer-size" +// )] +// fn wit_import(_: i32, _: i64, _: i32); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// wit_bindgen::rt::as_i64(value), +// ptr0, +// ); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 1) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr0 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// pub fn send_buffer_size(this: TcpSocket) -> Result { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(8))] +// struct RetArea([u8; 16]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/tcp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "send-buffer-size")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/tcp_send-buffer-size" +// )] +// fn wit_import(_: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(*((ptr0 + 8) as *const i64) as u64), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 8) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr0 + 8) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// pub fn set_send_buffer_size(this: TcpSocket, value: u64) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/tcp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "set-send-buffer-size")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/tcp_set-send-buffer-size" +// )] +// fn wit_import(_: i32, _: i64, _: i32); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// wit_bindgen::rt::as_i64(value), +// ptr0, +// ); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 1) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr0 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Create a `pollable` which will resolve once the socket is ready for I/O. +// /// +// /// Note: this function is here for WASI Preview2 only. +// /// It's planned to be removed when `future` is natively supported in Preview3. +// pub fn subscribe(this: TcpSocket) -> Pollable { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[link(wasm_import_module = "wasi:sockets/tcp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "subscribe")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/tcp_subscribe" +// )] +// fn wit_import(_: i32) -> i32; +// } +// let ret = wit_import(wit_bindgen::rt::as_i32(this)); +// ret as u32 +// } +// } +// #[allow(clippy::all)] +// /// Initiate a graceful shutdown. +// /// +// /// - receive: the socket is not expecting to receive any more data from the peer. All subsequent read +// /// operations on the `input-stream` associated with this socket will return an End Of Stream indication. +// /// Any data still in the receive queue at time of calling `shutdown` will be discarded. +// /// - send: the socket is not expecting to send any more data to the peer. All subsequent write +// /// operations on the `output-stream` associated with this socket will return an error. +// /// - both: same effect as receive & send combined. +// /// +// /// The shutdown function does not close (drop) the socket. +// /// +// /// # Typical errors +// /// - `not-connected`: The socket is not in the Connection state. (ENOTCONN) +// /// +// /// # References +// /// - +// /// - +// /// - +// /// - +// pub fn shutdown(this: TcpSocket, shutdown_type: ShutdownType) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/tcp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "shutdown")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/tcp_shutdown" +// )] +// fn wit_import(_: i32, _: i32, _: i32); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// match shutdown_type { +// ShutdownType::Receive => 0, +// ShutdownType::Send => 1, +// ShutdownType::Both => 2, +// }, +// ptr0, +// ); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 1) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr0 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Dispose of the specified `tcp-socket`, after which it may no longer be used. +// /// +// /// Similar to the POSIX `close` function. +// /// +// /// Note: this function is scheduled to be removed when Resources are natively supported in Wit. +// pub fn drop_tcp_socket(this: TcpSocket) { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[link(wasm_import_module = "wasi:sockets/tcp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "drop-tcp-socket")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/tcp_drop-tcp-socket" +// )] +// fn wit_import(_: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this)); +// } +// } +// } - #[allow(clippy::all)] - pub mod tcp_create_socket { - #[used] - #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; +// #[allow(clippy::all)] +// pub mod tcp_create_socket { +// #[used] +// #[doc(hidden)] +// #[cfg(target_arch = "wasm32")] +// static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; - pub type ErrorCode = super::super::super::wasi::sockets::network::ErrorCode; - pub type IpAddressFamily = super::super::super::wasi::sockets::network::IpAddressFamily; - pub type TcpSocket = super::super::super::wasi::sockets::tcp::TcpSocket; - #[allow(clippy::all)] - /// Create a new TCP socket. - /// - /// Similar to `socket(AF_INET or AF_INET6, SOCK_STREAM, IPPROTO_TCP)` in POSIX. - /// - /// This function does not require a network capability handle. This is considered to be safe because - /// at time of creation, the socket is not bound to any `network` yet. Up to the moment `bind`/`listen`/`connect` - /// is called, the socket is effectively an in-memory configuration object, unable to communicate with the outside world. - /// - /// All sockets are non-blocking. Use the wasi-poll interface to block on asynchronous operations. - /// - /// # Typical errors - /// - `not-supported`: The host does not support TCP sockets. (EOPNOTSUPP) - /// - `address-family-not-supported`: The specified `address-family` is not supported. (EAFNOSUPPORT) - /// - `new-socket-limit`: The new socket resource could not be created because of a system limit. (EMFILE, ENFILE) - /// - /// # References - /// - - /// - - /// - - /// - - pub fn create_tcp_socket( - address_family: IpAddressFamily, - ) -> Result { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(4))] - struct RetArea([u8; 8]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/tcp-create-socket")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "create-tcp-socket")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/tcp-create-socket_create-tcp-socket" - )] - fn wit_import(_: i32, _: i32); - } - wit_import( - match address_family { - super::super::super::wasi::sockets::network::IpAddressFamily::Ipv4 => 0, - super::super::super::wasi::sockets::network::IpAddressFamily::Ipv6 => 1, - }, - ptr0, - ); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(*((ptr0 + 4) as *const i32) as u32), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 4) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr0 + 4) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - } +// pub type ErrorCode = super::super::super::wasi::sockets::network::ErrorCode; +// pub type IpAddressFamily = super::super::super::wasi::sockets::network::IpAddressFamily; +// pub type TcpSocket = super::super::super::wasi::sockets::tcp::TcpSocket; +// #[allow(clippy::all)] +// /// Create a new TCP socket. +// /// +// /// Similar to `socket(AF_INET or AF_INET6, SOCK_STREAM, IPPROTO_TCP)` in POSIX. +// /// +// /// This function does not require a network capability handle. This is considered to be safe because +// /// at time of creation, the socket is not bound to any `network` yet. Up to the moment `bind`/`listen`/`connect` +// /// is called, the socket is effectively an in-memory configuration object, unable to communicate with the outside world. +// /// +// /// All sockets are non-blocking. Use the wasi-poll interface to block on asynchronous operations. +// /// +// /// # Typical errors +// /// - `not-supported`: The host does not support TCP sockets. (EOPNOTSUPP) +// /// - `address-family-not-supported`: The specified `address-family` is not supported. (EAFNOSUPPORT) +// /// - `new-socket-limit`: The new socket resource could not be created because of a system limit. (EMFILE, ENFILE) +// /// +// /// # References +// /// - +// /// - +// /// - +// /// - +// pub fn create_tcp_socket( +// address_family: IpAddressFamily, +// ) -> Result { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(4))] +// struct RetArea([u8; 8]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/tcp-create-socket")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "create-tcp-socket")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/tcp-create-socket_create-tcp-socket" +// )] +// fn wit_import(_: i32, _: i32); +// } +// wit_import( +// match address_family { +// super::super::super::wasi::sockets::network::IpAddressFamily::Ipv4 => 0, +// super::super::super::wasi::sockets::network::IpAddressFamily::Ipv6 => 1, +// }, +// ptr0, +// ); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(*((ptr0 + 4) as *const i32) as u32), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 4) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr0 + 4) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// } - #[allow(clippy::all)] - pub mod udp { - #[used] - #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; +// #[allow(clippy::all)] +// pub mod udp { +// #[used] +// #[doc(hidden)] +// #[cfg(target_arch = "wasm32")] +// static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; - pub type Pollable = super::super::super::wasi::poll::poll::Pollable; - pub type Network = super::super::super::wasi::sockets::network::Network; - pub type ErrorCode = super::super::super::wasi::sockets::network::ErrorCode; - pub type IpSocketAddress = super::super::super::wasi::sockets::network::IpSocketAddress; - pub type IpAddressFamily = super::super::super::wasi::sockets::network::IpAddressFamily; - /// A UDP socket handle. - pub type UdpSocket = u32; - #[derive(Clone)] - pub struct Datagram { - pub data: wit_bindgen::rt::vec::Vec, - pub remote_address: IpSocketAddress, - } - impl ::core::fmt::Debug for Datagram { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - f.debug_struct("Datagram") - .field("data", &self.data) - .field("remote-address", &self.remote_address) - .finish() - } - } - #[allow(clippy::all)] - /// Bind the socket to a specific network on the provided IP address and port. - /// - /// If the IP address is zero (`0.0.0.0` in IPv4, `::` in IPv6), it is left to the implementation to decide which - /// network interface(s) to bind to. - /// If the TCP/UDP port is zero, the socket will be bound to a random free port. - /// - /// When a socket is not explicitly bound, the first invocation to connect will implicitly bind the socket. - /// - /// Unlike in POSIX, this function is async. This enables interactive WASI hosts to inject permission prompts. - /// - /// # Typical `start` errors - /// - `address-family-mismatch`: The `local-address` has the wrong address family. (EINVAL) - /// - `already-bound`: The socket is already bound. (EINVAL) - /// - `concurrency-conflict`: Another `bind` or `connect` operation is already in progress. (EALREADY) - /// - /// # Typical `finish` errors - /// - `ephemeral-ports-exhausted`: No ephemeral ports available. (EADDRINUSE, ENOBUFS on Windows) - /// - `address-in-use`: Address is already in use. (EADDRINUSE) - /// - `address-not-bindable`: `local-address` is not an address that the `network` can bind to. (EADDRNOTAVAIL) - /// - `not-in-progress`: A `bind` operation is not in progress. - /// - `would-block`: Can't finish the operation, it is still in progress. (EWOULDBLOCK, EAGAIN) - /// - /// # References - /// - - /// - - /// - - /// - - pub fn start_bind( - this: UdpSocket, - network: Network, - local_address: IpSocketAddress, - ) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ( - result4_0, - result4_1, - result4_2, - result4_3, - result4_4, - result4_5, - result4_6, - result4_7, - result4_8, - result4_9, - result4_10, - result4_11, - ) = match local_address { - super::super::super::wasi::sockets::network::IpSocketAddress::Ipv4(e) => { - let super::super::super::wasi::sockets::network::Ipv4SocketAddress { - port: port0, - address: address0, - } = e; - let (t1_0, t1_1, t1_2, t1_3) = address0; +// pub type Pollable = super::super::super::wasi::poll::poll::Pollable; +// pub type Network = super::super::super::wasi::sockets::network::Network; +// pub type ErrorCode = super::super::super::wasi::sockets::network::ErrorCode; +// pub type IpSocketAddress = super::super::super::wasi::sockets::network::IpSocketAddress; +// pub type IpAddressFamily = super::super::super::wasi::sockets::network::IpAddressFamily; +// /// A UDP socket handle. +// pub type UdpSocket = u32; +// #[derive(Clone)] +// pub struct Datagram { +// pub data: wit_bindgen::rt::vec::Vec, +// pub remote_address: IpSocketAddress, +// } +// impl ::core::fmt::Debug for Datagram { +// fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { +// f.debug_struct("Datagram") +// .field("data", &self.data) +// .field("remote-address", &self.remote_address) +// .finish() +// } +// } +// #[allow(clippy::all)] +// /// Bind the socket to a specific network on the provided IP address and port. +// /// +// /// If the IP address is zero (`0.0.0.0` in IPv4, `::` in IPv6), it is left to the implementation to decide which +// /// network interface(s) to bind to. +// /// If the TCP/UDP port is zero, the socket will be bound to a random free port. +// /// +// /// When a socket is not explicitly bound, the first invocation to connect will implicitly bind the socket. +// /// +// /// Unlike in POSIX, this function is async. This enables interactive WASI hosts to inject permission prompts. +// /// +// /// # Typical `start` errors +// /// - `address-family-mismatch`: The `local-address` has the wrong address family. (EINVAL) +// /// - `already-bound`: The socket is already bound. (EINVAL) +// /// - `concurrency-conflict`: Another `bind` or `connect` operation is already in progress. (EALREADY) +// /// +// /// # Typical `finish` errors +// /// - `ephemeral-ports-exhausted`: No ephemeral ports available. (EADDRINUSE, ENOBUFS on Windows) +// /// - `address-in-use`: Address is already in use. (EADDRINUSE) +// /// - `address-not-bindable`: `local-address` is not an address that the `network` can bind to. (EADDRNOTAVAIL) +// /// - `not-in-progress`: A `bind` operation is not in progress. +// /// - `would-block`: Can't finish the operation, it is still in progress. (EWOULDBLOCK, EAGAIN) +// /// +// /// # References +// /// - +// /// - +// /// - +// /// - +// pub fn start_bind( +// this: UdpSocket, +// network: Network, +// local_address: IpSocketAddress, +// ) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ( +// result4_0, +// result4_1, +// result4_2, +// result4_3, +// result4_4, +// result4_5, +// result4_6, +// result4_7, +// result4_8, +// result4_9, +// result4_10, +// result4_11, +// ) = match local_address { +// super::super::super::wasi::sockets::network::IpSocketAddress::Ipv4(e) => { +// let super::super::super::wasi::sockets::network::Ipv4SocketAddress { +// port: port0, +// address: address0, +// } = e; +// let (t1_0, t1_1, t1_2, t1_3) = address0; - ( - 0i32, - wit_bindgen::rt::as_i32(port0), - wit_bindgen::rt::as_i32(t1_0), - wit_bindgen::rt::as_i32(t1_1), - wit_bindgen::rt::as_i32(t1_2), - wit_bindgen::rt::as_i32(t1_3), - 0i32, - 0i32, - 0i32, - 0i32, - 0i32, - 0i32, - ) - } - super::super::super::wasi::sockets::network::IpSocketAddress::Ipv6(e) => { - let super::super::super::wasi::sockets::network::Ipv6SocketAddress { - port: port2, - flow_info: flow_info2, - address: address2, - scope_id: scope_id2, - } = e; - let (t3_0, t3_1, t3_2, t3_3, t3_4, t3_5, t3_6, t3_7) = address2; +// ( +// 0i32, +// wit_bindgen::rt::as_i32(port0), +// wit_bindgen::rt::as_i32(t1_0), +// wit_bindgen::rt::as_i32(t1_1), +// wit_bindgen::rt::as_i32(t1_2), +// wit_bindgen::rt::as_i32(t1_3), +// 0i32, +// 0i32, +// 0i32, +// 0i32, +// 0i32, +// 0i32, +// ) +// } +// super::super::super::wasi::sockets::network::IpSocketAddress::Ipv6(e) => { +// let super::super::super::wasi::sockets::network::Ipv6SocketAddress { +// port: port2, +// flow_info: flow_info2, +// address: address2, +// scope_id: scope_id2, +// } = e; +// let (t3_0, t3_1, t3_2, t3_3, t3_4, t3_5, t3_6, t3_7) = address2; - ( - 1i32, - wit_bindgen::rt::as_i32(port2), - wit_bindgen::rt::as_i32(flow_info2), - wit_bindgen::rt::as_i32(t3_0), - wit_bindgen::rt::as_i32(t3_1), - wit_bindgen::rt::as_i32(t3_2), - wit_bindgen::rt::as_i32(t3_3), - wit_bindgen::rt::as_i32(t3_4), - wit_bindgen::rt::as_i32(t3_5), - wit_bindgen::rt::as_i32(t3_6), - wit_bindgen::rt::as_i32(t3_7), - wit_bindgen::rt::as_i32(scope_id2), - ) - } - }; - let ptr5 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/udp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "start-bind")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/udp_start-bind" - )] - fn wit_import( - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - ); - } - wit_import( - wit_bindgen::rt::as_i32(this), - wit_bindgen::rt::as_i32(network), - result4_0, - result4_1, - result4_2, - result4_3, - result4_4, - result4_5, - result4_6, - result4_7, - result4_8, - result4_9, - result4_10, - result4_11, - ptr5, - ); - match i32::from(*((ptr5 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr5 + 1) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr5 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - pub fn finish_bind(this: UdpSocket) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/udp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "finish-bind")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/udp_finish-bind" - )] - fn wit_import(_: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 1) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr0 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Set the destination address. - /// - /// The local-address is updated based on the best network path to `remote-address`. - /// - /// When a destination address is set: - /// - all receive operations will only return datagrams sent from the provided `remote-address`. - /// - the `send` function can only be used to send to this destination. - /// - /// Note that this function does not generate any network traffic and the peer is not aware of this "connection". - /// - /// Unlike in POSIX, this function is async. This enables interactive WASI hosts to inject permission prompts. - /// - /// # Typical `start` errors - /// - `address-family-mismatch`: The `remote-address` has the wrong address family. (EAFNOSUPPORT) - /// - `invalid-remote-address`: The IP address in `remote-address` is set to INADDR_ANY (`0.0.0.0` / `::`). (EDESTADDRREQ, EADDRNOTAVAIL) - /// - `invalid-remote-address`: The port in `remote-address` is set to 0. (EDESTADDRREQ, EADDRNOTAVAIL) - /// - `already-attached`: The socket is already bound to a different network. The `network` passed to `connect` must be identical to the one passed to `bind`. - /// - `concurrency-conflict`: Another `bind` or `connect` operation is already in progress. (EALREADY) - /// - /// # Typical `finish` errors - /// - `ephemeral-ports-exhausted`: Tried to perform an implicit bind, but there were no ephemeral ports available. (EADDRINUSE, EADDRNOTAVAIL on Linux, EAGAIN on BSD) - /// - `not-in-progress`: A `connect` operation is not in progress. - /// - `would-block`: Can't finish the operation, it is still in progress. (EWOULDBLOCK, EAGAIN) - /// - /// # References - /// - - /// - - /// - - /// - - pub fn start_connect( - this: UdpSocket, - network: Network, - remote_address: IpSocketAddress, - ) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ( - result4_0, - result4_1, - result4_2, - result4_3, - result4_4, - result4_5, - result4_6, - result4_7, - result4_8, - result4_9, - result4_10, - result4_11, - ) = match remote_address { - super::super::super::wasi::sockets::network::IpSocketAddress::Ipv4(e) => { - let super::super::super::wasi::sockets::network::Ipv4SocketAddress { - port: port0, - address: address0, - } = e; - let (t1_0, t1_1, t1_2, t1_3) = address0; +// ( +// 1i32, +// wit_bindgen::rt::as_i32(port2), +// wit_bindgen::rt::as_i32(flow_info2), +// wit_bindgen::rt::as_i32(t3_0), +// wit_bindgen::rt::as_i32(t3_1), +// wit_bindgen::rt::as_i32(t3_2), +// wit_bindgen::rt::as_i32(t3_3), +// wit_bindgen::rt::as_i32(t3_4), +// wit_bindgen::rt::as_i32(t3_5), +// wit_bindgen::rt::as_i32(t3_6), +// wit_bindgen::rt::as_i32(t3_7), +// wit_bindgen::rt::as_i32(scope_id2), +// ) +// } +// }; +// let ptr5 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/udp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "start-bind")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/udp_start-bind" +// )] +// fn wit_import( +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// ); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// wit_bindgen::rt::as_i32(network), +// result4_0, +// result4_1, +// result4_2, +// result4_3, +// result4_4, +// result4_5, +// result4_6, +// result4_7, +// result4_8, +// result4_9, +// result4_10, +// result4_11, +// ptr5, +// ); +// match i32::from(*((ptr5 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr5 + 1) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr5 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// pub fn finish_bind(this: UdpSocket) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/udp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "finish-bind")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/udp_finish-bind" +// )] +// fn wit_import(_: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 1) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr0 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Set the destination address. +// /// +// /// The local-address is updated based on the best network path to `remote-address`. +// /// +// /// When a destination address is set: +// /// - all receive operations will only return datagrams sent from the provided `remote-address`. +// /// - the `send` function can only be used to send to this destination. +// /// +// /// Note that this function does not generate any network traffic and the peer is not aware of this "connection". +// /// +// /// Unlike in POSIX, this function is async. This enables interactive WASI hosts to inject permission prompts. +// /// +// /// # Typical `start` errors +// /// - `address-family-mismatch`: The `remote-address` has the wrong address family. (EAFNOSUPPORT) +// /// - `invalid-remote-address`: The IP address in `remote-address` is set to INADDR_ANY (`0.0.0.0` / `::`). (EDESTADDRREQ, EADDRNOTAVAIL) +// /// - `invalid-remote-address`: The port in `remote-address` is set to 0. (EDESTADDRREQ, EADDRNOTAVAIL) +// /// - `already-attached`: The socket is already bound to a different network. The `network` passed to `connect` must be identical to the one passed to `bind`. +// /// - `concurrency-conflict`: Another `bind` or `connect` operation is already in progress. (EALREADY) +// /// +// /// # Typical `finish` errors +// /// - `ephemeral-ports-exhausted`: Tried to perform an implicit bind, but there were no ephemeral ports available. (EADDRINUSE, EADDRNOTAVAIL on Linux, EAGAIN on BSD) +// /// - `not-in-progress`: A `connect` operation is not in progress. +// /// - `would-block`: Can't finish the operation, it is still in progress. (EWOULDBLOCK, EAGAIN) +// /// +// /// # References +// /// - +// /// - +// /// - +// /// - +// pub fn start_connect( +// this: UdpSocket, +// network: Network, +// remote_address: IpSocketAddress, +// ) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ( +// result4_0, +// result4_1, +// result4_2, +// result4_3, +// result4_4, +// result4_5, +// result4_6, +// result4_7, +// result4_8, +// result4_9, +// result4_10, +// result4_11, +// ) = match remote_address { +// super::super::super::wasi::sockets::network::IpSocketAddress::Ipv4(e) => { +// let super::super::super::wasi::sockets::network::Ipv4SocketAddress { +// port: port0, +// address: address0, +// } = e; +// let (t1_0, t1_1, t1_2, t1_3) = address0; - ( - 0i32, - wit_bindgen::rt::as_i32(port0), - wit_bindgen::rt::as_i32(t1_0), - wit_bindgen::rt::as_i32(t1_1), - wit_bindgen::rt::as_i32(t1_2), - wit_bindgen::rt::as_i32(t1_3), - 0i32, - 0i32, - 0i32, - 0i32, - 0i32, - 0i32, - ) - } - super::super::super::wasi::sockets::network::IpSocketAddress::Ipv6(e) => { - let super::super::super::wasi::sockets::network::Ipv6SocketAddress { - port: port2, - flow_info: flow_info2, - address: address2, - scope_id: scope_id2, - } = e; - let (t3_0, t3_1, t3_2, t3_3, t3_4, t3_5, t3_6, t3_7) = address2; +// ( +// 0i32, +// wit_bindgen::rt::as_i32(port0), +// wit_bindgen::rt::as_i32(t1_0), +// wit_bindgen::rt::as_i32(t1_1), +// wit_bindgen::rt::as_i32(t1_2), +// wit_bindgen::rt::as_i32(t1_3), +// 0i32, +// 0i32, +// 0i32, +// 0i32, +// 0i32, +// 0i32, +// ) +// } +// super::super::super::wasi::sockets::network::IpSocketAddress::Ipv6(e) => { +// let super::super::super::wasi::sockets::network::Ipv6SocketAddress { +// port: port2, +// flow_info: flow_info2, +// address: address2, +// scope_id: scope_id2, +// } = e; +// let (t3_0, t3_1, t3_2, t3_3, t3_4, t3_5, t3_6, t3_7) = address2; - ( - 1i32, - wit_bindgen::rt::as_i32(port2), - wit_bindgen::rt::as_i32(flow_info2), - wit_bindgen::rt::as_i32(t3_0), - wit_bindgen::rt::as_i32(t3_1), - wit_bindgen::rt::as_i32(t3_2), - wit_bindgen::rt::as_i32(t3_3), - wit_bindgen::rt::as_i32(t3_4), - wit_bindgen::rt::as_i32(t3_5), - wit_bindgen::rt::as_i32(t3_6), - wit_bindgen::rt::as_i32(t3_7), - wit_bindgen::rt::as_i32(scope_id2), - ) - } - }; - let ptr5 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/udp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "start-connect")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/udp_start-connect" - )] - fn wit_import( - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - ); - } - wit_import( - wit_bindgen::rt::as_i32(this), - wit_bindgen::rt::as_i32(network), - result4_0, - result4_1, - result4_2, - result4_3, - result4_4, - result4_5, - result4_6, - result4_7, - result4_8, - result4_9, - result4_10, - result4_11, - ptr5, - ); - match i32::from(*((ptr5 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr5 + 1) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr5 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - pub fn finish_connect(this: UdpSocket) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/udp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "finish-connect")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/udp_finish-connect" - )] - fn wit_import(_: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 1) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr0 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Receive a message. - /// - /// Returns: - /// - The sender address of the datagram - /// - The number of bytes read. - /// - /// # Typical errors - /// - `not-bound`: The socket is not bound to any local address. (EINVAL) - /// - `remote-unreachable`: The remote address is not reachable. (ECONNREFUSED, ECONNRESET, ENETRESET on Windows, EHOSTUNREACH, EHOSTDOWN, ENETUNREACH, ENETDOWN) - /// - `would-block`: There is no pending data available to be read at the moment. (EWOULDBLOCK, EAGAIN) - /// - /// # References - /// - - /// - - /// - - /// - - /// - - /// - - /// - - pub fn receive(this: UdpSocket) -> Result { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(4))] - struct RetArea([u8; 44]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/udp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "receive")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/udp_receive" - )] - fn wit_import(_: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok({ - let len1 = *((ptr0 + 8) as *const i32) as usize; +// ( +// 1i32, +// wit_bindgen::rt::as_i32(port2), +// wit_bindgen::rt::as_i32(flow_info2), +// wit_bindgen::rt::as_i32(t3_0), +// wit_bindgen::rt::as_i32(t3_1), +// wit_bindgen::rt::as_i32(t3_2), +// wit_bindgen::rt::as_i32(t3_3), +// wit_bindgen::rt::as_i32(t3_4), +// wit_bindgen::rt::as_i32(t3_5), +// wit_bindgen::rt::as_i32(t3_6), +// wit_bindgen::rt::as_i32(t3_7), +// wit_bindgen::rt::as_i32(scope_id2), +// ) +// } +// }; +// let ptr5 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/udp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "start-connect")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/udp_start-connect" +// )] +// fn wit_import( +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// ); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// wit_bindgen::rt::as_i32(network), +// result4_0, +// result4_1, +// result4_2, +// result4_3, +// result4_4, +// result4_5, +// result4_6, +// result4_7, +// result4_8, +// result4_9, +// result4_10, +// result4_11, +// ptr5, +// ); +// match i32::from(*((ptr5 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr5 + 1) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr5 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// pub fn finish_connect(this: UdpSocket) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/udp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "finish-connect")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/udp_finish-connect" +// )] +// fn wit_import(_: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 1) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr0 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Receive a message. +// /// +// /// Returns: +// /// - The sender address of the datagram +// /// - The number of bytes read. +// /// +// /// # Typical errors +// /// - `not-bound`: The socket is not bound to any local address. (EINVAL) +// /// - `remote-unreachable`: The remote address is not reachable. (ECONNREFUSED, ECONNRESET, ENETRESET on Windows, EHOSTUNREACH, EHOSTDOWN, ENETUNREACH, ENETDOWN) +// /// - `would-block`: There is no pending data available to be read at the moment. (EWOULDBLOCK, EAGAIN) +// /// +// /// # References +// /// - +// /// - +// /// - +// /// - +// /// - +// /// - +// /// - +// pub fn receive(this: UdpSocket) -> Result { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(4))] +// struct RetArea([u8; 44]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/udp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "receive")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/udp_receive" +// )] +// fn wit_import(_: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok({ +// let len1 = *((ptr0 + 8) as *const i32) as usize; - Datagram { - data: Vec::from_raw_parts( - *((ptr0 + 4) as *const i32) as *mut _, - len1, - len1, - ), - remote_address: { - { - match i32::from(*((ptr0 + 12) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::IpSocketAddress::Ipv4(super::super::super::wasi::sockets::network::Ipv4SocketAddress{port:i32::from(*((ptr0 + 16) as *const u16)) as u16, address:(i32::from(*((ptr0 + 18) as *const u8)) as u8, i32::from(*((ptr0 + 19) as *const u8)) as u8, i32::from(*((ptr0 + 20) as *const u8)) as u8, i32::from(*((ptr0 + 21) as *const u8)) as u8), }), - #[cfg(debug_assertions)]1 => super::super::super::wasi::sockets::network::IpSocketAddress::Ipv6(super::super::super::wasi::sockets::network::Ipv6SocketAddress{port:i32::from(*((ptr0 + 16) as *const u16)) as u16, flow_info:*((ptr0 + 20) as *const i32) as u32, address:(i32::from(*((ptr0 + 24) as *const u16)) as u16, i32::from(*((ptr0 + 26) as *const u16)) as u16, i32::from(*((ptr0 + 28) as *const u16)) as u16, i32::from(*((ptr0 + 30) as *const u16)) as u16, i32::from(*((ptr0 + 32) as *const u16)) as u16, i32::from(*((ptr0 + 34) as *const u16)) as u16, i32::from(*((ptr0 + 36) as *const u16)) as u16, i32::from(*((ptr0 + 38) as *const u16)) as u16), scope_id:*((ptr0 + 40) as *const i32) as u32, }), - #[cfg(not(debug_assertions))]_ => super::super::super::wasi::sockets::network::IpSocketAddress::Ipv6(super::super::super::wasi::sockets::network::Ipv6SocketAddress{port:i32::from(*((ptr0 + 16) as *const u16)) as u16, flow_info:*((ptr0 + 20) as *const i32) as u32, address:(i32::from(*((ptr0 + 24) as *const u16)) as u16, i32::from(*((ptr0 + 26) as *const u16)) as u16, i32::from(*((ptr0 + 28) as *const u16)) as u16, i32::from(*((ptr0 + 30) as *const u16)) as u16, i32::from(*((ptr0 + 32) as *const u16)) as u16, i32::from(*((ptr0 + 34) as *const u16)) as u16, i32::from(*((ptr0 + 36) as *const u16)) as u16, i32::from(*((ptr0 + 38) as *const u16)) as u16), scope_id:*((ptr0 + 40) as *const i32) as u32, }), - #[cfg(debug_assertions)]_ => panic!("invalid enum discriminant"), - } - } - }, - } - }), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 4) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr0 + 4) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Send a message to a specific destination address. - /// - /// The remote address option is required. To send a message to the "connected" peer, - /// call `remote-address` to get their address. - /// - /// # Typical errors - /// - `address-family-mismatch`: The `remote-address` has the wrong address family. (EAFNOSUPPORT) - /// - `invalid-remote-address`: The IP address in `remote-address` is set to INADDR_ANY (`0.0.0.0` / `::`). (EDESTADDRREQ, EADDRNOTAVAIL) - /// - `invalid-remote-address`: The port in `remote-address` is set to 0. (EDESTADDRREQ, EADDRNOTAVAIL) - /// - `already-connected`: The socket is in "connected" mode and the `datagram.remote-address` does not match the address passed to `connect`. (EISCONN) - /// - `not-bound`: The socket is not bound to any local address. Unlike POSIX, this function does not perform an implicit bind. - /// - `remote-unreachable`: The remote address is not reachable. (ECONNREFUSED, ECONNRESET, ENETRESET on Windows, EHOSTUNREACH, EHOSTDOWN, ENETUNREACH, ENETDOWN) - /// - `datagram-too-large`: The datagram is too large. (EMSGSIZE) - /// - `would-block`: The send buffer is currently full. (EWOULDBLOCK, EAGAIN) - /// - /// # References - /// - - /// - - /// - - /// - - /// - - /// - - /// - - pub fn send(this: UdpSocket, datagram: &Datagram) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let Datagram { - data: data0, - remote_address: remote_address0, - } = datagram; - let vec1 = data0; - let ptr1 = vec1.as_ptr() as i32; - let len1 = vec1.len() as i32; - let ( - result6_0, - result6_1, - result6_2, - result6_3, - result6_4, - result6_5, - result6_6, - result6_7, - result6_8, - result6_9, - result6_10, - result6_11, - ) = match remote_address0 { - super::super::super::wasi::sockets::network::IpSocketAddress::Ipv4(e) => { - let super::super::super::wasi::sockets::network::Ipv4SocketAddress { - port: port2, - address: address2, - } = e; - let (t3_0, t3_1, t3_2, t3_3) = address2; +// Datagram { +// data: Vec::from_raw_parts( +// *((ptr0 + 4) as *const i32) as *mut _, +// len1, +// len1, +// ), +// remote_address: { +// { +// match i32::from(*((ptr0 + 12) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::IpSocketAddress::Ipv4(super::super::super::wasi::sockets::network::Ipv4SocketAddress{port:i32::from(*((ptr0 + 16) as *const u16)) as u16, address:(i32::from(*((ptr0 + 18) as *const u8)) as u8, i32::from(*((ptr0 + 19) as *const u8)) as u8, i32::from(*((ptr0 + 20) as *const u8)) as u8, i32::from(*((ptr0 + 21) as *const u8)) as u8), }), +// #[cfg(debug_assertions)]1 => super::super::super::wasi::sockets::network::IpSocketAddress::Ipv6(super::super::super::wasi::sockets::network::Ipv6SocketAddress{port:i32::from(*((ptr0 + 16) as *const u16)) as u16, flow_info:*((ptr0 + 20) as *const i32) as u32, address:(i32::from(*((ptr0 + 24) as *const u16)) as u16, i32::from(*((ptr0 + 26) as *const u16)) as u16, i32::from(*((ptr0 + 28) as *const u16)) as u16, i32::from(*((ptr0 + 30) as *const u16)) as u16, i32::from(*((ptr0 + 32) as *const u16)) as u16, i32::from(*((ptr0 + 34) as *const u16)) as u16, i32::from(*((ptr0 + 36) as *const u16)) as u16, i32::from(*((ptr0 + 38) as *const u16)) as u16), scope_id:*((ptr0 + 40) as *const i32) as u32, }), +// #[cfg(not(debug_assertions))]_ => super::super::super::wasi::sockets::network::IpSocketAddress::Ipv6(super::super::super::wasi::sockets::network::Ipv6SocketAddress{port:i32::from(*((ptr0 + 16) as *const u16)) as u16, flow_info:*((ptr0 + 20) as *const i32) as u32, address:(i32::from(*((ptr0 + 24) as *const u16)) as u16, i32::from(*((ptr0 + 26) as *const u16)) as u16, i32::from(*((ptr0 + 28) as *const u16)) as u16, i32::from(*((ptr0 + 30) as *const u16)) as u16, i32::from(*((ptr0 + 32) as *const u16)) as u16, i32::from(*((ptr0 + 34) as *const u16)) as u16, i32::from(*((ptr0 + 36) as *const u16)) as u16, i32::from(*((ptr0 + 38) as *const u16)) as u16), scope_id:*((ptr0 + 40) as *const i32) as u32, }), +// #[cfg(debug_assertions)]_ => panic!("invalid enum discriminant"), +// } +// } +// }, +// } +// }), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 4) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr0 + 4) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Send a message to a specific destination address. +// /// +// /// The remote address option is required. To send a message to the "connected" peer, +// /// call `remote-address` to get their address. +// /// +// /// # Typical errors +// /// - `address-family-mismatch`: The `remote-address` has the wrong address family. (EAFNOSUPPORT) +// /// - `invalid-remote-address`: The IP address in `remote-address` is set to INADDR_ANY (`0.0.0.0` / `::`). (EDESTADDRREQ, EADDRNOTAVAIL) +// /// - `invalid-remote-address`: The port in `remote-address` is set to 0. (EDESTADDRREQ, EADDRNOTAVAIL) +// /// - `already-connected`: The socket is in "connected" mode and the `datagram.remote-address` does not match the address passed to `connect`. (EISCONN) +// /// - `not-bound`: The socket is not bound to any local address. Unlike POSIX, this function does not perform an implicit bind. +// /// - `remote-unreachable`: The remote address is not reachable. (ECONNREFUSED, ECONNRESET, ENETRESET on Windows, EHOSTUNREACH, EHOSTDOWN, ENETUNREACH, ENETDOWN) +// /// - `datagram-too-large`: The datagram is too large. (EMSGSIZE) +// /// - `would-block`: The send buffer is currently full. (EWOULDBLOCK, EAGAIN) +// /// +// /// # References +// /// - +// /// - +// /// - +// /// - +// /// - +// /// - +// /// - +// pub fn send(this: UdpSocket, datagram: &Datagram) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let Datagram { +// data: data0, +// remote_address: remote_address0, +// } = datagram; +// let vec1 = data0; +// let ptr1 = vec1.as_ptr() as i32; +// let len1 = vec1.len() as i32; +// let ( +// result6_0, +// result6_1, +// result6_2, +// result6_3, +// result6_4, +// result6_5, +// result6_6, +// result6_7, +// result6_8, +// result6_9, +// result6_10, +// result6_11, +// ) = match remote_address0 { +// super::super::super::wasi::sockets::network::IpSocketAddress::Ipv4(e) => { +// let super::super::super::wasi::sockets::network::Ipv4SocketAddress { +// port: port2, +// address: address2, +// } = e; +// let (t3_0, t3_1, t3_2, t3_3) = address2; - ( - 0i32, - wit_bindgen::rt::as_i32(port2), - wit_bindgen::rt::as_i32(t3_0), - wit_bindgen::rt::as_i32(t3_1), - wit_bindgen::rt::as_i32(t3_2), - wit_bindgen::rt::as_i32(t3_3), - 0i32, - 0i32, - 0i32, - 0i32, - 0i32, - 0i32, - ) - } - super::super::super::wasi::sockets::network::IpSocketAddress::Ipv6(e) => { - let super::super::super::wasi::sockets::network::Ipv6SocketAddress { - port: port4, - flow_info: flow_info4, - address: address4, - scope_id: scope_id4, - } = e; - let (t5_0, t5_1, t5_2, t5_3, t5_4, t5_5, t5_6, t5_7) = address4; +// ( +// 0i32, +// wit_bindgen::rt::as_i32(port2), +// wit_bindgen::rt::as_i32(t3_0), +// wit_bindgen::rt::as_i32(t3_1), +// wit_bindgen::rt::as_i32(t3_2), +// wit_bindgen::rt::as_i32(t3_3), +// 0i32, +// 0i32, +// 0i32, +// 0i32, +// 0i32, +// 0i32, +// ) +// } +// super::super::super::wasi::sockets::network::IpSocketAddress::Ipv6(e) => { +// let super::super::super::wasi::sockets::network::Ipv6SocketAddress { +// port: port4, +// flow_info: flow_info4, +// address: address4, +// scope_id: scope_id4, +// } = e; +// let (t5_0, t5_1, t5_2, t5_3, t5_4, t5_5, t5_6, t5_7) = address4; - ( - 1i32, - wit_bindgen::rt::as_i32(port4), - wit_bindgen::rt::as_i32(flow_info4), - wit_bindgen::rt::as_i32(t5_0), - wit_bindgen::rt::as_i32(t5_1), - wit_bindgen::rt::as_i32(t5_2), - wit_bindgen::rt::as_i32(t5_3), - wit_bindgen::rt::as_i32(t5_4), - wit_bindgen::rt::as_i32(t5_5), - wit_bindgen::rt::as_i32(t5_6), - wit_bindgen::rt::as_i32(t5_7), - wit_bindgen::rt::as_i32(scope_id4), - ) - } - }; - let ptr7 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/udp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "send")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/udp_send" - )] - fn wit_import( - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - _: i32, - ); - } - wit_import( - wit_bindgen::rt::as_i32(this), - ptr1, - len1, - result6_0, - result6_1, - result6_2, - result6_3, - result6_4, - result6_5, - result6_6, - result6_7, - result6_8, - result6_9, - result6_10, - result6_11, - ptr7, - ); - match i32::from(*((ptr7 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr7 + 1) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr7 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Get the current bound address. - /// - /// # Typical errors - /// - `not-bound`: The socket is not bound to any local address. - /// - /// # References - /// - - /// - - /// - - /// - - pub fn local_address(this: UdpSocket) -> Result { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(4))] - struct RetArea([u8; 36]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/udp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "local-address")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/udp_local-address" - )] - fn wit_import(_: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok({ - { - match i32::from(*((ptr0 + 4) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::IpSocketAddress::Ipv4(super::super::super::wasi::sockets::network::Ipv4SocketAddress{port:i32::from(*((ptr0 + 8) as *const u16)) as u16, address:(i32::from(*((ptr0 + 10) as *const u8)) as u8, i32::from(*((ptr0 + 11) as *const u8)) as u8, i32::from(*((ptr0 + 12) as *const u8)) as u8, i32::from(*((ptr0 + 13) as *const u8)) as u8), }), - #[cfg(debug_assertions)]1 => super::super::super::wasi::sockets::network::IpSocketAddress::Ipv6(super::super::super::wasi::sockets::network::Ipv6SocketAddress{port:i32::from(*((ptr0 + 8) as *const u16)) as u16, flow_info:*((ptr0 + 12) as *const i32) as u32, address:(i32::from(*((ptr0 + 16) as *const u16)) as u16, i32::from(*((ptr0 + 18) as *const u16)) as u16, i32::from(*((ptr0 + 20) as *const u16)) as u16, i32::from(*((ptr0 + 22) as *const u16)) as u16, i32::from(*((ptr0 + 24) as *const u16)) as u16, i32::from(*((ptr0 + 26) as *const u16)) as u16, i32::from(*((ptr0 + 28) as *const u16)) as u16, i32::from(*((ptr0 + 30) as *const u16)) as u16), scope_id:*((ptr0 + 32) as *const i32) as u32, }), - #[cfg(not(debug_assertions))]_ => super::super::super::wasi::sockets::network::IpSocketAddress::Ipv6(super::super::super::wasi::sockets::network::Ipv6SocketAddress{port:i32::from(*((ptr0 + 8) as *const u16)) as u16, flow_info:*((ptr0 + 12) as *const i32) as u32, address:(i32::from(*((ptr0 + 16) as *const u16)) as u16, i32::from(*((ptr0 + 18) as *const u16)) as u16, i32::from(*((ptr0 + 20) as *const u16)) as u16, i32::from(*((ptr0 + 22) as *const u16)) as u16, i32::from(*((ptr0 + 24) as *const u16)) as u16, i32::from(*((ptr0 + 26) as *const u16)) as u16, i32::from(*((ptr0 + 28) as *const u16)) as u16, i32::from(*((ptr0 + 30) as *const u16)) as u16), scope_id:*((ptr0 + 32) as *const i32) as u32, }), - #[cfg(debug_assertions)]_ => panic!("invalid enum discriminant"), - } - } - }), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 4) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr0 + 4) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Get the address set with `connect`. - /// - /// # Typical errors - /// - `not-connected`: The socket is not connected to a remote address. (ENOTCONN) - /// - /// # References - /// - - /// - - /// - - /// - - pub fn remote_address(this: UdpSocket) -> Result { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(4))] - struct RetArea([u8; 36]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/udp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "remote-address")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/udp_remote-address" - )] - fn wit_import(_: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok({ - { - match i32::from(*((ptr0 + 4) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::IpSocketAddress::Ipv4(super::super::super::wasi::sockets::network::Ipv4SocketAddress{port:i32::from(*((ptr0 + 8) as *const u16)) as u16, address:(i32::from(*((ptr0 + 10) as *const u8)) as u8, i32::from(*((ptr0 + 11) as *const u8)) as u8, i32::from(*((ptr0 + 12) as *const u8)) as u8, i32::from(*((ptr0 + 13) as *const u8)) as u8), }), - #[cfg(debug_assertions)]1 => super::super::super::wasi::sockets::network::IpSocketAddress::Ipv6(super::super::super::wasi::sockets::network::Ipv6SocketAddress{port:i32::from(*((ptr0 + 8) as *const u16)) as u16, flow_info:*((ptr0 + 12) as *const i32) as u32, address:(i32::from(*((ptr0 + 16) as *const u16)) as u16, i32::from(*((ptr0 + 18) as *const u16)) as u16, i32::from(*((ptr0 + 20) as *const u16)) as u16, i32::from(*((ptr0 + 22) as *const u16)) as u16, i32::from(*((ptr0 + 24) as *const u16)) as u16, i32::from(*((ptr0 + 26) as *const u16)) as u16, i32::from(*((ptr0 + 28) as *const u16)) as u16, i32::from(*((ptr0 + 30) as *const u16)) as u16), scope_id:*((ptr0 + 32) as *const i32) as u32, }), - #[cfg(not(debug_assertions))]_ => super::super::super::wasi::sockets::network::IpSocketAddress::Ipv6(super::super::super::wasi::sockets::network::Ipv6SocketAddress{port:i32::from(*((ptr0 + 8) as *const u16)) as u16, flow_info:*((ptr0 + 12) as *const i32) as u32, address:(i32::from(*((ptr0 + 16) as *const u16)) as u16, i32::from(*((ptr0 + 18) as *const u16)) as u16, i32::from(*((ptr0 + 20) as *const u16)) as u16, i32::from(*((ptr0 + 22) as *const u16)) as u16, i32::from(*((ptr0 + 24) as *const u16)) as u16, i32::from(*((ptr0 + 26) as *const u16)) as u16, i32::from(*((ptr0 + 28) as *const u16)) as u16, i32::from(*((ptr0 + 30) as *const u16)) as u16), scope_id:*((ptr0 + 32) as *const i32) as u32, }), - #[cfg(debug_assertions)]_ => panic!("invalid enum discriminant"), - } - } - }), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 4) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr0 + 4) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Whether this is a IPv4 or IPv6 socket. - /// - /// Equivalent to the SO_DOMAIN socket option. - pub fn address_family(this: UdpSocket) -> IpAddressFamily { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[link(wasm_import_module = "wasi:sockets/udp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "address-family")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/udp_address-family" - )] - fn wit_import(_: i32) -> i32; - } - let ret = wit_import(wit_bindgen::rt::as_i32(this)); - { - #[cfg(debug_assertions)] - { - match ret { - 0 => super::super::super::wasi::sockets::network::IpAddressFamily::Ipv4, - 1 => super::super::super::wasi::sockets::network::IpAddressFamily::Ipv6, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::IpAddressFamily, - >(ret as u8) - } - } - } - } - #[allow(clippy::all)] - /// Whether IPv4 compatibility (dual-stack) mode is disabled or not. - /// - /// Equivalent to the IPV6_V6ONLY socket option. - /// - /// # Typical errors - /// - `ipv6-only-operation`: (get/set) `this` socket is an IPv4 socket. - /// - `already-bound`: (set) The socket is already bound. - /// - `not-supported`: (set) Host does not support dual-stack sockets. (Implementations are not required to.) - /// - `concurrency-conflict`: (set) Another `bind` or `connect` operation is already in progress. (EALREADY) - pub fn ipv6_only(this: UdpSocket) -> Result { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/udp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "ipv6-only")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/udp_ipv6-only" - )] - fn wit_import(_: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok({ - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::(i32::from( - *((ptr0 + 1) as *const u8), - ) - as u8) - } - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 1) as *const u8)) { - 0 => false, - 1 => true, - _ => panic!("invalid bool discriminant"), - } - } - }), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 1) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr0 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - pub fn set_ipv6_only(this: UdpSocket, value: bool) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/udp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "set-ipv6-only")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/udp_set-ipv6-only" - )] - fn wit_import(_: i32, _: i32, _: i32); - } - wit_import( - wit_bindgen::rt::as_i32(this), - match value { - true => 1, - false => 0, - }, - ptr0, - ); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 1) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr0 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Equivalent to the IP_TTL & IPV6_UNICAST_HOPS socket options. - /// - /// # Typical errors - /// - `concurrency-conflict`: (set) Another `bind` or `connect` operation is already in progress. (EALREADY) - pub fn unicast_hop_limit(this: UdpSocket) -> Result { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/udp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "unicast-hop-limit")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/udp_unicast-hop-limit" - )] - fn wit_import(_: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(i32::from(*((ptr0 + 1) as *const u8)) as u8), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 1) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr0 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - pub fn set_unicast_hop_limit(this: UdpSocket, value: u8) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/udp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "set-unicast-hop-limit")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/udp_set-unicast-hop-limit" - )] - fn wit_import(_: i32, _: i32, _: i32); - } - wit_import( - wit_bindgen::rt::as_i32(this), - wit_bindgen::rt::as_i32(value), - ptr0, - ); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 1) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr0 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// The kernel buffer space reserved for sends/receives on this socket. - /// - /// Note #1: an implementation may choose to cap or round the buffer size when setting the value. - /// In other words, after setting a value, reading the same setting back may return a different value. - /// - /// Note #2: there is not necessarily a direct relationship between the kernel buffer size and the bytes of - /// actual data to be sent/received by the application, because the kernel might also use the buffer space - /// for internal metadata structures. - /// - /// Fails when this socket is in the Listening state. - /// - /// Equivalent to the SO_RCVBUF and SO_SNDBUF socket options. - /// - /// # Typical errors - /// - `concurrency-conflict`: (set) Another `bind` or `connect` operation is already in progress. (EALREADY) - pub fn receive_buffer_size(this: UdpSocket) -> Result { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(8))] - struct RetArea([u8; 16]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/udp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "receive-buffer-size")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/udp_receive-buffer-size" - )] - fn wit_import(_: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(*((ptr0 + 8) as *const i64) as u64), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 8) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr0 + 8) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - pub fn set_receive_buffer_size(this: UdpSocket, value: u64) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/udp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "set-receive-buffer-size")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/udp_set-receive-buffer-size" - )] - fn wit_import(_: i32, _: i64, _: i32); - } - wit_import( - wit_bindgen::rt::as_i32(this), - wit_bindgen::rt::as_i64(value), - ptr0, - ); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 1) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr0 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - pub fn send_buffer_size(this: UdpSocket) -> Result { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(8))] - struct RetArea([u8; 16]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/udp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "send-buffer-size")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/udp_send-buffer-size" - )] - fn wit_import(_: i32, _: i32); - } - wit_import(wit_bindgen::rt::as_i32(this), ptr0); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(*((ptr0 + 8) as *const i64) as u64), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 8) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr0 + 8) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - pub fn set_send_buffer_size(this: UdpSocket, value: u64) -> Result<(), ErrorCode> { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(1))] - struct RetArea([u8; 2]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/udp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "set-send-buffer-size")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/udp_set-send-buffer-size" - )] - fn wit_import(_: i32, _: i64, _: i32); - } - wit_import( - wit_bindgen::rt::as_i32(this), - wit_bindgen::rt::as_i64(value), - ptr0, - ); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(()), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 1) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr0 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - #[allow(clippy::all)] - /// Create a `pollable` which will resolve once the socket is ready for I/O. - /// - /// Note: this function is here for WASI Preview2 only. - /// It's planned to be removed when `future` is natively supported in Preview3. - pub fn subscribe(this: UdpSocket) -> Pollable { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[link(wasm_import_module = "wasi:sockets/udp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "subscribe")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/udp_subscribe" - )] - fn wit_import(_: i32) -> i32; - } - let ret = wit_import(wit_bindgen::rt::as_i32(this)); - ret as u32 - } - } - #[allow(clippy::all)] - /// Dispose of the specified `udp-socket`, after which it may no longer be used. - /// - /// Note: this function is scheduled to be removed when Resources are natively supported in Wit. - pub fn drop_udp_socket(this: UdpSocket) { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[link(wasm_import_module = "wasi:sockets/udp")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "drop-udp-socket")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/udp_drop-udp-socket" - )] - fn wit_import(_: i32); - } - wit_import(wit_bindgen::rt::as_i32(this)); - } - } - } +// ( +// 1i32, +// wit_bindgen::rt::as_i32(port4), +// wit_bindgen::rt::as_i32(flow_info4), +// wit_bindgen::rt::as_i32(t5_0), +// wit_bindgen::rt::as_i32(t5_1), +// wit_bindgen::rt::as_i32(t5_2), +// wit_bindgen::rt::as_i32(t5_3), +// wit_bindgen::rt::as_i32(t5_4), +// wit_bindgen::rt::as_i32(t5_5), +// wit_bindgen::rt::as_i32(t5_6), +// wit_bindgen::rt::as_i32(t5_7), +// wit_bindgen::rt::as_i32(scope_id4), +// ) +// } +// }; +// let ptr7 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/udp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "send")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/udp_send" +// )] +// fn wit_import( +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// _: i32, +// ); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// ptr1, +// len1, +// result6_0, +// result6_1, +// result6_2, +// result6_3, +// result6_4, +// result6_5, +// result6_6, +// result6_7, +// result6_8, +// result6_9, +// result6_10, +// result6_11, +// ptr7, +// ); +// match i32::from(*((ptr7 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr7 + 1) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr7 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Get the current bound address. +// /// +// /// # Typical errors +// /// - `not-bound`: The socket is not bound to any local address. +// /// +// /// # References +// /// - +// /// - +// /// - +// /// - +// pub fn local_address(this: UdpSocket) -> Result { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(4))] +// struct RetArea([u8; 36]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/udp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "local-address")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/udp_local-address" +// )] +// fn wit_import(_: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok({ +// { +// match i32::from(*((ptr0 + 4) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::IpSocketAddress::Ipv4(super::super::super::wasi::sockets::network::Ipv4SocketAddress{port:i32::from(*((ptr0 + 8) as *const u16)) as u16, address:(i32::from(*((ptr0 + 10) as *const u8)) as u8, i32::from(*((ptr0 + 11) as *const u8)) as u8, i32::from(*((ptr0 + 12) as *const u8)) as u8, i32::from(*((ptr0 + 13) as *const u8)) as u8), }), +// #[cfg(debug_assertions)]1 => super::super::super::wasi::sockets::network::IpSocketAddress::Ipv6(super::super::super::wasi::sockets::network::Ipv6SocketAddress{port:i32::from(*((ptr0 + 8) as *const u16)) as u16, flow_info:*((ptr0 + 12) as *const i32) as u32, address:(i32::from(*((ptr0 + 16) as *const u16)) as u16, i32::from(*((ptr0 + 18) as *const u16)) as u16, i32::from(*((ptr0 + 20) as *const u16)) as u16, i32::from(*((ptr0 + 22) as *const u16)) as u16, i32::from(*((ptr0 + 24) as *const u16)) as u16, i32::from(*((ptr0 + 26) as *const u16)) as u16, i32::from(*((ptr0 + 28) as *const u16)) as u16, i32::from(*((ptr0 + 30) as *const u16)) as u16), scope_id:*((ptr0 + 32) as *const i32) as u32, }), +// #[cfg(not(debug_assertions))]_ => super::super::super::wasi::sockets::network::IpSocketAddress::Ipv6(super::super::super::wasi::sockets::network::Ipv6SocketAddress{port:i32::from(*((ptr0 + 8) as *const u16)) as u16, flow_info:*((ptr0 + 12) as *const i32) as u32, address:(i32::from(*((ptr0 + 16) as *const u16)) as u16, i32::from(*((ptr0 + 18) as *const u16)) as u16, i32::from(*((ptr0 + 20) as *const u16)) as u16, i32::from(*((ptr0 + 22) as *const u16)) as u16, i32::from(*((ptr0 + 24) as *const u16)) as u16, i32::from(*((ptr0 + 26) as *const u16)) as u16, i32::from(*((ptr0 + 28) as *const u16)) as u16, i32::from(*((ptr0 + 30) as *const u16)) as u16), scope_id:*((ptr0 + 32) as *const i32) as u32, }), +// #[cfg(debug_assertions)]_ => panic!("invalid enum discriminant"), +// } +// } +// }), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 4) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr0 + 4) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Get the address set with `connect`. +// /// +// /// # Typical errors +// /// - `not-connected`: The socket is not connected to a remote address. (ENOTCONN) +// /// +// /// # References +// /// - +// /// - +// /// - +// /// - +// pub fn remote_address(this: UdpSocket) -> Result { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(4))] +// struct RetArea([u8; 36]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/udp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "remote-address")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/udp_remote-address" +// )] +// fn wit_import(_: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok({ +// { +// match i32::from(*((ptr0 + 4) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::IpSocketAddress::Ipv4(super::super::super::wasi::sockets::network::Ipv4SocketAddress{port:i32::from(*((ptr0 + 8) as *const u16)) as u16, address:(i32::from(*((ptr0 + 10) as *const u8)) as u8, i32::from(*((ptr0 + 11) as *const u8)) as u8, i32::from(*((ptr0 + 12) as *const u8)) as u8, i32::from(*((ptr0 + 13) as *const u8)) as u8), }), +// #[cfg(debug_assertions)]1 => super::super::super::wasi::sockets::network::IpSocketAddress::Ipv6(super::super::super::wasi::sockets::network::Ipv6SocketAddress{port:i32::from(*((ptr0 + 8) as *const u16)) as u16, flow_info:*((ptr0 + 12) as *const i32) as u32, address:(i32::from(*((ptr0 + 16) as *const u16)) as u16, i32::from(*((ptr0 + 18) as *const u16)) as u16, i32::from(*((ptr0 + 20) as *const u16)) as u16, i32::from(*((ptr0 + 22) as *const u16)) as u16, i32::from(*((ptr0 + 24) as *const u16)) as u16, i32::from(*((ptr0 + 26) as *const u16)) as u16, i32::from(*((ptr0 + 28) as *const u16)) as u16, i32::from(*((ptr0 + 30) as *const u16)) as u16), scope_id:*((ptr0 + 32) as *const i32) as u32, }), +// #[cfg(not(debug_assertions))]_ => super::super::super::wasi::sockets::network::IpSocketAddress::Ipv6(super::super::super::wasi::sockets::network::Ipv6SocketAddress{port:i32::from(*((ptr0 + 8) as *const u16)) as u16, flow_info:*((ptr0 + 12) as *const i32) as u32, address:(i32::from(*((ptr0 + 16) as *const u16)) as u16, i32::from(*((ptr0 + 18) as *const u16)) as u16, i32::from(*((ptr0 + 20) as *const u16)) as u16, i32::from(*((ptr0 + 22) as *const u16)) as u16, i32::from(*((ptr0 + 24) as *const u16)) as u16, i32::from(*((ptr0 + 26) as *const u16)) as u16, i32::from(*((ptr0 + 28) as *const u16)) as u16, i32::from(*((ptr0 + 30) as *const u16)) as u16), scope_id:*((ptr0 + 32) as *const i32) as u32, }), +// #[cfg(debug_assertions)]_ => panic!("invalid enum discriminant"), +// } +// } +// }), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 4) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr0 + 4) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Whether this is a IPv4 or IPv6 socket. +// /// +// /// Equivalent to the SO_DOMAIN socket option. +// pub fn address_family(this: UdpSocket) -> IpAddressFamily { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[link(wasm_import_module = "wasi:sockets/udp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "address-family")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/udp_address-family" +// )] +// fn wit_import(_: i32) -> i32; +// } +// let ret = wit_import(wit_bindgen::rt::as_i32(this)); +// { +// #[cfg(debug_assertions)] +// { +// match ret { +// 0 => super::super::super::wasi::sockets::network::IpAddressFamily::Ipv4, +// 1 => super::super::super::wasi::sockets::network::IpAddressFamily::Ipv6, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::IpAddressFamily, +// >(ret as u8) +// } +// } +// } +// } +// #[allow(clippy::all)] +// /// Whether IPv4 compatibility (dual-stack) mode is disabled or not. +// /// +// /// Equivalent to the IPV6_V6ONLY socket option. +// /// +// /// # Typical errors +// /// - `ipv6-only-operation`: (get/set) `this` socket is an IPv4 socket. +// /// - `already-bound`: (set) The socket is already bound. +// /// - `not-supported`: (set) Host does not support dual-stack sockets. (Implementations are not required to.) +// /// - `concurrency-conflict`: (set) Another `bind` or `connect` operation is already in progress. (EALREADY) +// pub fn ipv6_only(this: UdpSocket) -> Result { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/udp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "ipv6-only")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/udp_ipv6-only" +// )] +// fn wit_import(_: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok({ +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::(i32::from( +// *((ptr0 + 1) as *const u8), +// ) +// as u8) +// } +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 1) as *const u8)) { +// 0 => false, +// 1 => true, +// _ => panic!("invalid bool discriminant"), +// } +// } +// }), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 1) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr0 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// pub fn set_ipv6_only(this: UdpSocket, value: bool) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/udp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "set-ipv6-only")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/udp_set-ipv6-only" +// )] +// fn wit_import(_: i32, _: i32, _: i32); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// match value { +// true => 1, +// false => 0, +// }, +// ptr0, +// ); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 1) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr0 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Equivalent to the IP_TTL & IPV6_UNICAST_HOPS socket options. +// /// +// /// # Typical errors +// /// - `concurrency-conflict`: (set) Another `bind` or `connect` operation is already in progress. (EALREADY) +// pub fn unicast_hop_limit(this: UdpSocket) -> Result { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/udp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "unicast-hop-limit")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/udp_unicast-hop-limit" +// )] +// fn wit_import(_: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(i32::from(*((ptr0 + 1) as *const u8)) as u8), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 1) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr0 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// pub fn set_unicast_hop_limit(this: UdpSocket, value: u8) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/udp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "set-unicast-hop-limit")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/udp_set-unicast-hop-limit" +// )] +// fn wit_import(_: i32, _: i32, _: i32); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// wit_bindgen::rt::as_i32(value), +// ptr0, +// ); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 1) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr0 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// The kernel buffer space reserved for sends/receives on this socket. +// /// +// /// Note #1: an implementation may choose to cap or round the buffer size when setting the value. +// /// In other words, after setting a value, reading the same setting back may return a different value. +// /// +// /// Note #2: there is not necessarily a direct relationship between the kernel buffer size and the bytes of +// /// actual data to be sent/received by the application, because the kernel might also use the buffer space +// /// for internal metadata structures. +// /// +// /// Fails when this socket is in the Listening state. +// /// +// /// Equivalent to the SO_RCVBUF and SO_SNDBUF socket options. +// /// +// /// # Typical errors +// /// - `concurrency-conflict`: (set) Another `bind` or `connect` operation is already in progress. (EALREADY) +// pub fn receive_buffer_size(this: UdpSocket) -> Result { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(8))] +// struct RetArea([u8; 16]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/udp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "receive-buffer-size")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/udp_receive-buffer-size" +// )] +// fn wit_import(_: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(*((ptr0 + 8) as *const i64) as u64), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 8) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr0 + 8) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// pub fn set_receive_buffer_size(this: UdpSocket, value: u64) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/udp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "set-receive-buffer-size")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/udp_set-receive-buffer-size" +// )] +// fn wit_import(_: i32, _: i64, _: i32); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// wit_bindgen::rt::as_i64(value), +// ptr0, +// ); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 1) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr0 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// pub fn send_buffer_size(this: UdpSocket) -> Result { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(8))] +// struct RetArea([u8; 16]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/udp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "send-buffer-size")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/udp_send-buffer-size" +// )] +// fn wit_import(_: i32, _: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this), ptr0); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(*((ptr0 + 8) as *const i64) as u64), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 8) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr0 + 8) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// pub fn set_send_buffer_size(this: UdpSocket, value: u64) -> Result<(), ErrorCode> { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(1))] +// struct RetArea([u8; 2]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/udp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "set-send-buffer-size")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/udp_set-send-buffer-size" +// )] +// fn wit_import(_: i32, _: i64, _: i32); +// } +// wit_import( +// wit_bindgen::rt::as_i32(this), +// wit_bindgen::rt::as_i64(value), +// ptr0, +// ); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(()), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 1) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr0 + 1) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// #[allow(clippy::all)] +// /// Create a `pollable` which will resolve once the socket is ready for I/O. +// /// +// /// Note: this function is here for WASI Preview2 only. +// /// It's planned to be removed when `future` is natively supported in Preview3. +// pub fn subscribe(this: UdpSocket) -> Pollable { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[link(wasm_import_module = "wasi:sockets/udp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "subscribe")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/udp_subscribe" +// )] +// fn wit_import(_: i32) -> i32; +// } +// let ret = wit_import(wit_bindgen::rt::as_i32(this)); +// ret as u32 +// } +// } +// #[allow(clippy::all)] +// /// Dispose of the specified `udp-socket`, after which it may no longer be used. +// /// +// /// Note: this function is scheduled to be removed when Resources are natively supported in Wit. +// pub fn drop_udp_socket(this: UdpSocket) { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[link(wasm_import_module = "wasi:sockets/udp")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "drop-udp-socket")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/udp_drop-udp-socket" +// )] +// fn wit_import(_: i32); +// } +// wit_import(wit_bindgen::rt::as_i32(this)); +// } +// } +// } - #[allow(clippy::all)] - pub mod udp_create_socket { - #[used] - #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; +// #[allow(clippy::all)] +// pub mod udp_create_socket { +// #[used] +// #[doc(hidden)] +// #[cfg(target_arch = "wasm32")] +// static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; - pub type ErrorCode = super::super::super::wasi::sockets::network::ErrorCode; - pub type IpAddressFamily = super::super::super::wasi::sockets::network::IpAddressFamily; - pub type UdpSocket = super::super::super::wasi::sockets::udp::UdpSocket; - #[allow(clippy::all)] - /// Create a new UDP socket. - /// - /// Similar to `socket(AF_INET or AF_INET6, SOCK_DGRAM, IPPROTO_UDP)` in POSIX. - /// - /// This function does not require a network capability handle. This is considered to be safe because - /// at time of creation, the socket is not bound to any `network` yet. Up to the moment `bind`/`connect` is called, - /// the socket is effectively an in-memory configuration object, unable to communicate with the outside world. - /// - /// All sockets are non-blocking. Use the wasi-poll interface to block on asynchronous operations. - /// - /// # Typical errors - /// - `not-supported`: The host does not support UDP sockets. (EOPNOTSUPP) - /// - `address-family-not-supported`: The specified `address-family` is not supported. (EAFNOSUPPORT) - /// - `new-socket-limit`: The new socket resource could not be created because of a system limit. (EMFILE, ENFILE) - /// - /// # References: - /// - - /// - - /// - - /// - - pub fn create_udp_socket( - address_family: IpAddressFamily, - ) -> Result { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, string::String, vec::Vec}; - unsafe { - #[repr(align(4))] - struct RetArea([u8; 8]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[link(wasm_import_module = "wasi:sockets/udp-create-socket")] - extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "create-udp-socket")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "wasi:sockets/udp-create-socket_create-udp-socket" - )] - fn wit_import(_: i32, _: i32); - } - wit_import( - match address_family { - super::super::super::wasi::sockets::network::IpAddressFamily::Ipv4 => 0, - super::super::super::wasi::sockets::network::IpAddressFamily::Ipv6 => 1, - }, - ptr0, - ); - match i32::from(*((ptr0 + 0) as *const u8)) { - 0 => Ok(*((ptr0 + 4) as *const i32) as u32), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr0 + 4) as *const u8)) { - 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, - 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, - 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, - 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, - 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, - 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, - 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, - 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, - 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, - 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, - 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, - 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, - 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, - 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, - 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, - 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, - 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, - 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, - 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, - 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, - 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, - 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, - 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, - 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, - 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, - 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, - 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, - 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, - 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, - 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, - 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, - 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, - _ => panic!("invalid enum discriminant"), - } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::< - _, - super::super::super::wasi::sockets::network::ErrorCode, - >(i32::from( - *((ptr0 + 4) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - } - } - } - } - } -} +// pub type ErrorCode = super::super::super::wasi::sockets::network::ErrorCode; +// pub type IpAddressFamily = super::super::super::wasi::sockets::network::IpAddressFamily; +// pub type UdpSocket = super::super::super::wasi::sockets::udp::UdpSocket; +// #[allow(clippy::all)] +// /// Create a new UDP socket. +// /// +// /// Similar to `socket(AF_INET or AF_INET6, SOCK_DGRAM, IPPROTO_UDP)` in POSIX. +// /// +// /// This function does not require a network capability handle. This is considered to be safe because +// /// at time of creation, the socket is not bound to any `network` yet. Up to the moment `bind`/`connect` is called, +// /// the socket is effectively an in-memory configuration object, unable to communicate with the outside world. +// /// +// /// All sockets are non-blocking. Use the wasi-poll interface to block on asynchronous operations. +// /// +// /// # Typical errors +// /// - `not-supported`: The host does not support UDP sockets. (EOPNOTSUPP) +// /// - `address-family-not-supported`: The specified `address-family` is not supported. (EAFNOSUPPORT) +// /// - `new-socket-limit`: The new socket resource could not be created because of a system limit. (EMFILE, ENFILE) +// /// +// /// # References: +// /// - +// /// - +// /// - +// /// - +// pub fn create_udp_socket( +// address_family: IpAddressFamily, +// ) -> Result { +// #[allow(unused_imports)] +// use wit_bindgen::rt::{alloc, string::String, vec::Vec}; +// unsafe { +// #[repr(align(4))] +// struct RetArea([u8; 8]); +// let mut ret_area = ::core::mem::MaybeUninit::::uninit(); +// let ptr0 = ret_area.as_mut_ptr() as i32; +// #[link(wasm_import_module = "wasi:sockets/udp-create-socket")] +// extern "C" { +// #[cfg_attr(target_arch = "wasm32", link_name = "create-udp-socket")] +// #[cfg_attr( +// not(target_arch = "wasm32"), +// link_name = "wasi:sockets/udp-create-socket_create-udp-socket" +// )] +// fn wit_import(_: i32, _: i32); +// } +// wit_import( +// match address_family { +// super::super::super::wasi::sockets::network::IpAddressFamily::Ipv4 => 0, +// super::super::super::wasi::sockets::network::IpAddressFamily::Ipv6 => 1, +// }, +// ptr0, +// ); +// match i32::from(*((ptr0 + 0) as *const u8)) { +// 0 => Ok(*((ptr0 + 4) as *const i32) as u32), +// 1 => Err({ +// #[cfg(debug_assertions)] +// { +// match i32::from(*((ptr0 + 4) as *const u8)) { +// 0 => super::super::super::wasi::sockets::network::ErrorCode::Unknown, +// 1 => super::super::super::wasi::sockets::network::ErrorCode::AccessDenied, +// 2 => super::super::super::wasi::sockets::network::ErrorCode::NotSupported, +// 3 => super::super::super::wasi::sockets::network::ErrorCode::OutOfMemory, +// 4 => super::super::super::wasi::sockets::network::ErrorCode::Timeout, +// 5 => super::super::super::wasi::sockets::network::ErrorCode::ConcurrencyConflict, +// 6 => super::super::super::wasi::sockets::network::ErrorCode::NotInProgress, +// 7 => super::super::super::wasi::sockets::network::ErrorCode::WouldBlock, +// 8 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyNotSupported, +// 9 => super::super::super::wasi::sockets::network::ErrorCode::AddressFamilyMismatch, +// 10 => super::super::super::wasi::sockets::network::ErrorCode::InvalidRemoteAddress, +// 11 => super::super::super::wasi::sockets::network::ErrorCode::Ipv4OnlyOperation, +// 12 => super::super::super::wasi::sockets::network::ErrorCode::Ipv6OnlyOperation, +// 13 => super::super::super::wasi::sockets::network::ErrorCode::NewSocketLimit, +// 14 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyAttached, +// 15 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyBound, +// 16 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyConnected, +// 17 => super::super::super::wasi::sockets::network::ErrorCode::NotBound, +// 18 => super::super::super::wasi::sockets::network::ErrorCode::NotConnected, +// 19 => super::super::super::wasi::sockets::network::ErrorCode::AddressNotBindable, +// 20 => super::super::super::wasi::sockets::network::ErrorCode::AddressInUse, +// 21 => super::super::super::wasi::sockets::network::ErrorCode::EphemeralPortsExhausted, +// 22 => super::super::super::wasi::sockets::network::ErrorCode::RemoteUnreachable, +// 23 => super::super::super::wasi::sockets::network::ErrorCode::AlreadyListening, +// 24 => super::super::super::wasi::sockets::network::ErrorCode::NotListening, +// 25 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionRefused, +// 26 => super::super::super::wasi::sockets::network::ErrorCode::ConnectionReset, +// 27 => super::super::super::wasi::sockets::network::ErrorCode::DatagramTooLarge, +// 28 => super::super::super::wasi::sockets::network::ErrorCode::InvalidName, +// 29 => super::super::super::wasi::sockets::network::ErrorCode::NameUnresolvable, +// 30 => super::super::super::wasi::sockets::network::ErrorCode::TemporaryResolverFailure, +// 31 => super::super::super::wasi::sockets::network::ErrorCode::PermanentResolverFailure, +// _ => panic!("invalid enum discriminant"), +// } +// } +// #[cfg(not(debug_assertions))] +// { +// ::core::mem::transmute::< +// _, +// super::super::super::wasi::sockets::network::ErrorCode, +// >(i32::from( +// *((ptr0 + 4) as *const u8), +// ) +// as u8) +// } +// }), +// #[cfg(not(debug_assertions))] +// _ => ::core::hint::unreachable_unchecked(), +// #[cfg(debug_assertions)] +// _ => panic!("invalid enum discriminant"), +// } +// } +// } +// } +// } +// } -#[cfg(target_arch = "wasm32")] -#[link_section = "component-type:command"] -#[doc(hidden)] -pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 12651] = [ - 3, 0, 7, 99, 111, 109, 109, 97, 110, 100, 0, 97, 115, 109, 13, 0, 1, 0, 7, 248, 97, 1, 65, 4, - 1, 65, 56, 1, 66, 5, 1, 114, 2, 7, 115, 101, 99, 111, 110, 100, 115, 119, 11, 110, 97, 110, - 111, 115, 101, 99, 111, 110, 100, 115, 121, 4, 0, 8, 100, 97, 116, 101, 116, 105, 109, 101, 3, - 0, 0, 1, 64, 0, 0, 1, 4, 0, 3, 110, 111, 119, 1, 2, 4, 0, 10, 114, 101, 115, 111, 108, 117, - 116, 105, 111, 110, 1, 2, 3, 1, 22, 119, 97, 115, 105, 58, 99, 108, 111, 99, 107, 115, 47, 119, - 97, 108, 108, 45, 99, 108, 111, 99, 107, 5, 0, 1, 66, 8, 1, 121, 4, 0, 8, 112, 111, 108, 108, - 97, 98, 108, 101, 3, 0, 0, 1, 64, 1, 4, 116, 104, 105, 115, 1, 1, 0, 4, 0, 13, 100, 114, 111, - 112, 45, 112, 111, 108, 108, 97, 98, 108, 101, 1, 2, 1, 112, 1, 1, 112, 127, 1, 64, 1, 2, 105, - 110, 3, 0, 4, 4, 0, 11, 112, 111, 108, 108, 45, 111, 110, 101, 111, 102, 102, 1, 5, 3, 1, 14, - 119, 97, 115, 105, 58, 112, 111, 108, 108, 47, 112, 111, 108, 108, 5, 1, 2, 3, 0, 1, 8, 112, - 111, 108, 108, 97, 98, 108, 101, 1, 66, 9, 2, 3, 2, 1, 2, 4, 0, 8, 112, 111, 108, 108, 97, 98, - 108, 101, 3, 0, 0, 1, 119, 4, 0, 7, 105, 110, 115, 116, 97, 110, 116, 3, 0, 2, 1, 64, 0, 0, 3, - 4, 0, 3, 110, 111, 119, 1, 4, 4, 0, 10, 114, 101, 115, 111, 108, 117, 116, 105, 111, 110, 1, 4, - 1, 64, 2, 4, 119, 104, 101, 110, 3, 8, 97, 98, 115, 111, 108, 117, 116, 101, 127, 0, 1, 4, 0, - 9, 115, 117, 98, 115, 99, 114, 105, 98, 101, 1, 5, 3, 1, 27, 119, 97, 115, 105, 58, 99, 108, - 111, 99, 107, 115, 47, 109, 111, 110, 111, 116, 111, 110, 105, 99, 45, 99, 108, 111, 99, 107, - 5, 3, 2, 3, 0, 0, 8, 100, 97, 116, 101, 116, 105, 109, 101, 1, 66, 12, 2, 3, 2, 1, 4, 4, 0, 8, - 100, 97, 116, 101, 116, 105, 109, 101, 3, 0, 0, 1, 114, 3, 10, 117, 116, 99, 45, 111, 102, 102, - 115, 101, 116, 122, 4, 110, 97, 109, 101, 115, 23, 105, 110, 45, 100, 97, 121, 108, 105, 103, - 104, 116, 45, 115, 97, 118, 105, 110, 103, 45, 116, 105, 109, 101, 127, 4, 0, 16, 116, 105, - 109, 101, 122, 111, 110, 101, 45, 100, 105, 115, 112, 108, 97, 121, 3, 0, 2, 1, 121, 4, 0, 8, - 116, 105, 109, 101, 122, 111, 110, 101, 3, 0, 4, 1, 64, 2, 4, 116, 104, 105, 115, 5, 4, 119, - 104, 101, 110, 1, 0, 3, 4, 0, 7, 100, 105, 115, 112, 108, 97, 121, 1, 6, 1, 64, 2, 4, 116, 104, - 105, 115, 5, 4, 119, 104, 101, 110, 1, 0, 122, 4, 0, 10, 117, 116, 99, 45, 111, 102, 102, 115, - 101, 116, 1, 7, 1, 64, 1, 4, 116, 104, 105, 115, 5, 1, 0, 4, 0, 13, 100, 114, 111, 112, 45, - 116, 105, 109, 101, 122, 111, 110, 101, 1, 8, 3, 1, 20, 119, 97, 115, 105, 58, 99, 108, 111, - 99, 107, 115, 47, 116, 105, 109, 101, 122, 111, 110, 101, 5, 5, 1, 66, 39, 2, 3, 2, 1, 2, 4, 0, - 8, 112, 111, 108, 108, 97, 98, 108, 101, 3, 0, 0, 1, 114, 0, 4, 0, 12, 115, 116, 114, 101, 97, - 109, 45, 101, 114, 114, 111, 114, 3, 0, 2, 1, 121, 4, 0, 13, 111, 117, 116, 112, 117, 116, 45, - 115, 116, 114, 101, 97, 109, 3, 0, 4, 1, 121, 4, 0, 12, 105, 110, 112, 117, 116, 45, 115, 116, - 114, 101, 97, 109, 3, 0, 6, 1, 112, 125, 1, 111, 2, 8, 127, 1, 106, 1, 9, 1, 3, 1, 64, 2, 4, - 116, 104, 105, 115, 7, 3, 108, 101, 110, 119, 0, 10, 4, 0, 4, 114, 101, 97, 100, 1, 11, 4, 0, - 13, 98, 108, 111, 99, 107, 105, 110, 103, 45, 114, 101, 97, 100, 1, 11, 1, 111, 2, 119, 127, 1, - 106, 1, 12, 1, 3, 1, 64, 2, 4, 116, 104, 105, 115, 7, 3, 108, 101, 110, 119, 0, 13, 4, 0, 4, - 115, 107, 105, 112, 1, 14, 4, 0, 13, 98, 108, 111, 99, 107, 105, 110, 103, 45, 115, 107, 105, - 112, 1, 14, 1, 64, 1, 4, 116, 104, 105, 115, 7, 0, 1, 4, 0, 25, 115, 117, 98, 115, 99, 114, - 105, 98, 101, 45, 116, 111, 45, 105, 110, 112, 117, 116, 45, 115, 116, 114, 101, 97, 109, 1, - 15, 1, 64, 1, 4, 116, 104, 105, 115, 7, 1, 0, 4, 0, 17, 100, 114, 111, 112, 45, 105, 110, 112, - 117, 116, 45, 115, 116, 114, 101, 97, 109, 1, 16, 1, 106, 1, 119, 1, 3, 1, 64, 2, 4, 116, 104, - 105, 115, 5, 3, 98, 117, 102, 8, 0, 17, 4, 0, 5, 119, 114, 105, 116, 101, 1, 18, 4, 0, 14, 98, - 108, 111, 99, 107, 105, 110, 103, 45, 119, 114, 105, 116, 101, 1, 18, 1, 64, 2, 4, 116, 104, - 105, 115, 5, 3, 108, 101, 110, 119, 0, 17, 4, 0, 12, 119, 114, 105, 116, 101, 45, 122, 101, - 114, 111, 101, 115, 1, 19, 4, 0, 21, 98, 108, 111, 99, 107, 105, 110, 103, 45, 119, 114, 105, - 116, 101, 45, 122, 101, 114, 111, 101, 115, 1, 19, 1, 64, 3, 4, 116, 104, 105, 115, 5, 3, 115, - 114, 99, 7, 3, 108, 101, 110, 119, 0, 13, 4, 0, 6, 115, 112, 108, 105, 99, 101, 1, 20, 4, 0, - 15, 98, 108, 111, 99, 107, 105, 110, 103, 45, 115, 112, 108, 105, 99, 101, 1, 20, 1, 64, 2, 4, - 116, 104, 105, 115, 5, 3, 115, 114, 99, 7, 0, 17, 4, 0, 7, 102, 111, 114, 119, 97, 114, 100, 1, - 21, 1, 64, 1, 4, 116, 104, 105, 115, 5, 0, 1, 4, 0, 26, 115, 117, 98, 115, 99, 114, 105, 98, - 101, 45, 116, 111, 45, 111, 117, 116, 112, 117, 116, 45, 115, 116, 114, 101, 97, 109, 1, 22, 1, - 64, 1, 4, 116, 104, 105, 115, 5, 1, 0, 4, 0, 18, 100, 114, 111, 112, 45, 111, 117, 116, 112, - 117, 116, 45, 115, 116, 114, 101, 97, 109, 1, 23, 3, 1, 15, 119, 97, 115, 105, 58, 105, 111, - 47, 115, 116, 114, 101, 97, 109, 115, 5, 6, 2, 3, 0, 4, 12, 105, 110, 112, 117, 116, 45, 115, - 116, 114, 101, 97, 109, 2, 3, 0, 4, 13, 111, 117, 116, 112, 117, 116, 45, 115, 116, 114, 101, - 97, 109, 1, 66, 117, 2, 3, 2, 1, 7, 4, 0, 12, 105, 110, 112, 117, 116, 45, 115, 116, 114, 101, - 97, 109, 3, 0, 0, 2, 3, 2, 1, 8, 4, 0, 13, 111, 117, 116, 112, 117, 116, 45, 115, 116, 114, - 101, 97, 109, 3, 0, 2, 2, 3, 2, 1, 4, 4, 0, 8, 100, 97, 116, 101, 116, 105, 109, 101, 3, 0, 4, - 1, 110, 1, 14, 115, 121, 109, 108, 105, 110, 107, 45, 102, 111, 108, 108, 111, 119, 4, 0, 10, - 112, 97, 116, 104, 45, 102, 108, 97, 103, 115, 3, 0, 6, 1, 110, 4, 6, 99, 114, 101, 97, 116, - 101, 9, 100, 105, 114, 101, 99, 116, 111, 114, 121, 9, 101, 120, 99, 108, 117, 115, 105, 118, - 101, 8, 116, 114, 117, 110, 99, 97, 116, 101, 4, 0, 10, 111, 112, 101, 110, 45, 102, 108, 97, - 103, 115, 3, 0, 8, 1, 110, 3, 8, 114, 101, 97, 100, 97, 98, 108, 101, 8, 119, 114, 105, 116, - 97, 98, 108, 101, 10, 101, 120, 101, 99, 117, 116, 97, 98, 108, 101, 4, 0, 5, 109, 111, 100, - 101, 115, 3, 0, 10, 1, 119, 4, 0, 10, 108, 105, 110, 107, 45, 99, 111, 117, 110, 116, 3, 0, 12, - 1, 119, 4, 0, 5, 105, 110, 111, 100, 101, 3, 0, 14, 1, 119, 4, 0, 8, 102, 105, 108, 101, 115, - 105, 122, 101, 3, 0, 16, 1, 109, 37, 6, 97, 99, 99, 101, 115, 115, 11, 119, 111, 117, 108, 100, - 45, 98, 108, 111, 99, 107, 7, 97, 108, 114, 101, 97, 100, 121, 14, 98, 97, 100, 45, 100, 101, - 115, 99, 114, 105, 112, 116, 111, 114, 4, 98, 117, 115, 121, 8, 100, 101, 97, 100, 108, 111, - 99, 107, 5, 113, 117, 111, 116, 97, 5, 101, 120, 105, 115, 116, 14, 102, 105, 108, 101, 45, - 116, 111, 111, 45, 108, 97, 114, 103, 101, 21, 105, 108, 108, 101, 103, 97, 108, 45, 98, 121, - 116, 101, 45, 115, 101, 113, 117, 101, 110, 99, 101, 11, 105, 110, 45, 112, 114, 111, 103, 114, - 101, 115, 115, 11, 105, 110, 116, 101, 114, 114, 117, 112, 116, 101, 100, 7, 105, 110, 118, 97, - 108, 105, 100, 2, 105, 111, 12, 105, 115, 45, 100, 105, 114, 101, 99, 116, 111, 114, 121, 4, - 108, 111, 111, 112, 14, 116, 111, 111, 45, 109, 97, 110, 121, 45, 108, 105, 110, 107, 115, 12, - 109, 101, 115, 115, 97, 103, 101, 45, 115, 105, 122, 101, 13, 110, 97, 109, 101, 45, 116, 111, - 111, 45, 108, 111, 110, 103, 9, 110, 111, 45, 100, 101, 118, 105, 99, 101, 8, 110, 111, 45, - 101, 110, 116, 114, 121, 7, 110, 111, 45, 108, 111, 99, 107, 19, 105, 110, 115, 117, 102, 102, - 105, 99, 105, 101, 110, 116, 45, 109, 101, 109, 111, 114, 121, 18, 105, 110, 115, 117, 102, - 102, 105, 99, 105, 101, 110, 116, 45, 115, 112, 97, 99, 101, 13, 110, 111, 116, 45, 100, 105, - 114, 101, 99, 116, 111, 114, 121, 9, 110, 111, 116, 45, 101, 109, 112, 116, 121, 15, 110, 111, - 116, 45, 114, 101, 99, 111, 118, 101, 114, 97, 98, 108, 101, 11, 117, 110, 115, 117, 112, 112, - 111, 114, 116, 101, 100, 6, 110, 111, 45, 116, 116, 121, 14, 110, 111, 45, 115, 117, 99, 104, - 45, 100, 101, 118, 105, 99, 101, 8, 111, 118, 101, 114, 102, 108, 111, 119, 13, 110, 111, 116, - 45, 112, 101, 114, 109, 105, 116, 116, 101, 100, 4, 112, 105, 112, 101, 9, 114, 101, 97, 100, - 45, 111, 110, 108, 121, 12, 105, 110, 118, 97, 108, 105, 100, 45, 115, 101, 101, 107, 14, 116, - 101, 120, 116, 45, 102, 105, 108, 101, 45, 98, 117, 115, 121, 12, 99, 114, 111, 115, 115, 45, - 100, 101, 118, 105, 99, 101, 4, 0, 10, 101, 114, 114, 111, 114, 45, 99, 111, 100, 101, 3, 0, - 18, 1, 121, 4, 0, 22, 100, 105, 114, 101, 99, 116, 111, 114, 121, 45, 101, 110, 116, 114, 121, - 45, 115, 116, 114, 101, 97, 109, 3, 0, 20, 1, 119, 4, 0, 6, 100, 101, 118, 105, 99, 101, 3, 0, - 22, 1, 109, 8, 7, 117, 110, 107, 110, 111, 119, 110, 12, 98, 108, 111, 99, 107, 45, 100, 101, - 118, 105, 99, 101, 16, 99, 104, 97, 114, 97, 99, 116, 101, 114, 45, 100, 101, 118, 105, 99, - 101, 9, 100, 105, 114, 101, 99, 116, 111, 114, 121, 4, 102, 105, 102, 111, 13, 115, 121, 109, - 98, 111, 108, 105, 99, 45, 108, 105, 110, 107, 12, 114, 101, 103, 117, 108, 97, 114, 45, 102, - 105, 108, 101, 6, 115, 111, 99, 107, 101, 116, 4, 0, 15, 100, 101, 115, 99, 114, 105, 112, 116, - 111, 114, 45, 116, 121, 112, 101, 3, 0, 24, 1, 107, 15, 1, 114, 3, 5, 105, 110, 111, 100, 101, - 26, 4, 116, 121, 112, 101, 25, 4, 110, 97, 109, 101, 115, 4, 0, 15, 100, 105, 114, 101, 99, - 116, 111, 114, 121, 45, 101, 110, 116, 114, 121, 3, 0, 27, 1, 110, 6, 4, 114, 101, 97, 100, 5, - 119, 114, 105, 116, 101, 19, 102, 105, 108, 101, 45, 105, 110, 116, 101, 103, 114, 105, 116, - 121, 45, 115, 121, 110, 99, 19, 100, 97, 116, 97, 45, 105, 110, 116, 101, 103, 114, 105, 116, - 121, 45, 115, 121, 110, 99, 20, 114, 101, 113, 117, 101, 115, 116, 101, 100, 45, 119, 114, 105, - 116, 101, 45, 115, 121, 110, 99, 16, 109, 117, 116, 97, 116, 101, 45, 100, 105, 114, 101, 99, - 116, 111, 114, 121, 4, 0, 16, 100, 101, 115, 99, 114, 105, 112, 116, 111, 114, 45, 102, 108, - 97, 103, 115, 3, 0, 29, 1, 121, 4, 0, 10, 100, 101, 115, 99, 114, 105, 112, 116, 111, 114, 3, - 0, 31, 1, 113, 3, 9, 110, 111, 45, 99, 104, 97, 110, 103, 101, 0, 0, 3, 110, 111, 119, 0, 0, 9, - 116, 105, 109, 101, 115, 116, 97, 109, 112, 1, 5, 0, 4, 0, 13, 110, 101, 119, 45, 116, 105, - 109, 101, 115, 116, 97, 109, 112, 3, 0, 33, 1, 114, 8, 6, 100, 101, 118, 105, 99, 101, 23, 5, - 105, 110, 111, 100, 101, 15, 4, 116, 121, 112, 101, 25, 10, 108, 105, 110, 107, 45, 99, 111, - 117, 110, 116, 13, 4, 115, 105, 122, 101, 17, 21, 100, 97, 116, 97, 45, 97, 99, 99, 101, 115, - 115, 45, 116, 105, 109, 101, 115, 116, 97, 109, 112, 5, 27, 100, 97, 116, 97, 45, 109, 111, - 100, 105, 102, 105, 99, 97, 116, 105, 111, 110, 45, 116, 105, 109, 101, 115, 116, 97, 109, 112, - 5, 23, 115, 116, 97, 116, 117, 115, 45, 99, 104, 97, 110, 103, 101, 45, 116, 105, 109, 101, - 115, 116, 97, 109, 112, 5, 4, 0, 15, 100, 101, 115, 99, 114, 105, 112, 116, 111, 114, 45, 115, - 116, 97, 116, 3, 0, 35, 1, 109, 6, 6, 110, 111, 114, 109, 97, 108, 10, 115, 101, 113, 117, 101, - 110, 116, 105, 97, 108, 6, 114, 97, 110, 100, 111, 109, 9, 119, 105, 108, 108, 45, 110, 101, - 101, 100, 9, 100, 111, 110, 116, 45, 110, 101, 101, 100, 8, 110, 111, 45, 114, 101, 117, 115, - 101, 4, 0, 6, 97, 100, 118, 105, 99, 101, 3, 0, 37, 1, 113, 2, 6, 97, 99, 99, 101, 115, 115, 1, - 11, 0, 6, 101, 120, 105, 115, 116, 115, 0, 0, 4, 0, 11, 97, 99, 99, 101, 115, 115, 45, 116, - 121, 112, 101, 3, 0, 39, 1, 106, 1, 1, 1, 19, 1, 64, 2, 4, 116, 104, 105, 115, 32, 6, 111, 102, - 102, 115, 101, 116, 17, 0, 41, 4, 0, 15, 114, 101, 97, 100, 45, 118, 105, 97, 45, 115, 116, - 114, 101, 97, 109, 1, 42, 1, 106, 1, 3, 1, 19, 1, 64, 2, 4, 116, 104, 105, 115, 32, 6, 111, - 102, 102, 115, 101, 116, 17, 0, 43, 4, 0, 16, 119, 114, 105, 116, 101, 45, 118, 105, 97, 45, - 115, 116, 114, 101, 97, 109, 1, 44, 1, 64, 1, 4, 116, 104, 105, 115, 32, 0, 43, 4, 0, 17, 97, - 112, 112, 101, 110, 100, 45, 118, 105, 97, 45, 115, 116, 114, 101, 97, 109, 1, 45, 1, 106, 0, - 1, 19, 1, 64, 4, 4, 116, 104, 105, 115, 32, 6, 111, 102, 102, 115, 101, 116, 17, 6, 108, 101, - 110, 103, 116, 104, 17, 6, 97, 100, 118, 105, 99, 101, 38, 0, 46, 4, 0, 6, 97, 100, 118, 105, - 115, 101, 1, 47, 1, 64, 1, 4, 116, 104, 105, 115, 32, 0, 46, 4, 0, 9, 115, 121, 110, 99, 45, - 100, 97, 116, 97, 1, 48, 1, 106, 1, 30, 1, 19, 1, 64, 1, 4, 116, 104, 105, 115, 32, 0, 49, 4, - 0, 9, 103, 101, 116, 45, 102, 108, 97, 103, 115, 1, 50, 1, 106, 1, 25, 1, 19, 1, 64, 1, 4, 116, - 104, 105, 115, 32, 0, 51, 4, 0, 8, 103, 101, 116, 45, 116, 121, 112, 101, 1, 52, 1, 64, 2, 4, - 116, 104, 105, 115, 32, 4, 115, 105, 122, 101, 17, 0, 46, 4, 0, 8, 115, 101, 116, 45, 115, 105, - 122, 101, 1, 53, 1, 64, 3, 4, 116, 104, 105, 115, 32, 21, 100, 97, 116, 97, 45, 97, 99, 99, - 101, 115, 115, 45, 116, 105, 109, 101, 115, 116, 97, 109, 112, 34, 27, 100, 97, 116, 97, 45, - 109, 111, 100, 105, 102, 105, 99, 97, 116, 105, 111, 110, 45, 116, 105, 109, 101, 115, 116, 97, - 109, 112, 34, 0, 46, 4, 0, 9, 115, 101, 116, 45, 116, 105, 109, 101, 115, 1, 54, 1, 112, 125, - 1, 111, 2, 55, 127, 1, 106, 1, 56, 1, 19, 1, 64, 3, 4, 116, 104, 105, 115, 32, 6, 108, 101, - 110, 103, 116, 104, 17, 6, 111, 102, 102, 115, 101, 116, 17, 0, 57, 4, 0, 4, 114, 101, 97, 100, - 1, 58, 1, 106, 1, 17, 1, 19, 1, 64, 3, 4, 116, 104, 105, 115, 32, 6, 98, 117, 102, 102, 101, - 114, 55, 6, 111, 102, 102, 115, 101, 116, 17, 0, 59, 4, 0, 5, 119, 114, 105, 116, 101, 1, 60, - 1, 106, 1, 21, 1, 19, 1, 64, 1, 4, 116, 104, 105, 115, 32, 0, 61, 4, 0, 14, 114, 101, 97, 100, - 45, 100, 105, 114, 101, 99, 116, 111, 114, 121, 1, 62, 4, 0, 4, 115, 121, 110, 99, 1, 48, 1, - 64, 2, 4, 116, 104, 105, 115, 32, 4, 112, 97, 116, 104, 115, 0, 46, 4, 0, 19, 99, 114, 101, 97, - 116, 101, 45, 100, 105, 114, 101, 99, 116, 111, 114, 121, 45, 97, 116, 1, 63, 1, 106, 1, 36, 1, - 19, 1, 64, 1, 4, 116, 104, 105, 115, 32, 0, 192, 0, 4, 0, 4, 115, 116, 97, 116, 1, 65, 1, 64, - 3, 4, 116, 104, 105, 115, 32, 10, 112, 97, 116, 104, 45, 102, 108, 97, 103, 115, 7, 4, 112, 97, - 116, 104, 115, 0, 192, 0, 4, 0, 7, 115, 116, 97, 116, 45, 97, 116, 1, 66, 1, 64, 5, 4, 116, - 104, 105, 115, 32, 10, 112, 97, 116, 104, 45, 102, 108, 97, 103, 115, 7, 4, 112, 97, 116, 104, - 115, 21, 100, 97, 116, 97, 45, 97, 99, 99, 101, 115, 115, 45, 116, 105, 109, 101, 115, 116, 97, - 109, 112, 34, 27, 100, 97, 116, 97, 45, 109, 111, 100, 105, 102, 105, 99, 97, 116, 105, 111, - 110, 45, 116, 105, 109, 101, 115, 116, 97, 109, 112, 34, 0, 46, 4, 0, 12, 115, 101, 116, 45, - 116, 105, 109, 101, 115, 45, 97, 116, 1, 67, 1, 64, 5, 4, 116, 104, 105, 115, 32, 14, 111, 108, - 100, 45, 112, 97, 116, 104, 45, 102, 108, 97, 103, 115, 7, 8, 111, 108, 100, 45, 112, 97, 116, - 104, 115, 14, 110, 101, 119, 45, 100, 101, 115, 99, 114, 105, 112, 116, 111, 114, 32, 8, 110, - 101, 119, 45, 112, 97, 116, 104, 115, 0, 46, 4, 0, 7, 108, 105, 110, 107, 45, 97, 116, 1, 68, - 1, 106, 1, 32, 1, 19, 1, 64, 6, 4, 116, 104, 105, 115, 32, 10, 112, 97, 116, 104, 45, 102, 108, - 97, 103, 115, 7, 4, 112, 97, 116, 104, 115, 10, 111, 112, 101, 110, 45, 102, 108, 97, 103, 115, - 9, 5, 102, 108, 97, 103, 115, 30, 5, 109, 111, 100, 101, 115, 11, 0, 197, 0, 4, 0, 7, 111, 112, - 101, 110, 45, 97, 116, 1, 70, 1, 106, 1, 115, 1, 19, 1, 64, 2, 4, 116, 104, 105, 115, 32, 4, - 112, 97, 116, 104, 115, 0, 199, 0, 4, 0, 11, 114, 101, 97, 100, 108, 105, 110, 107, 45, 97, - 116, 1, 72, 4, 0, 19, 114, 101, 109, 111, 118, 101, 45, 100, 105, 114, 101, 99, 116, 111, 114, - 121, 45, 97, 116, 1, 63, 1, 64, 4, 4, 116, 104, 105, 115, 32, 8, 111, 108, 100, 45, 112, 97, - 116, 104, 115, 14, 110, 101, 119, 45, 100, 101, 115, 99, 114, 105, 112, 116, 111, 114, 32, 8, - 110, 101, 119, 45, 112, 97, 116, 104, 115, 0, 46, 4, 0, 9, 114, 101, 110, 97, 109, 101, 45, 97, - 116, 1, 73, 1, 64, 3, 4, 116, 104, 105, 115, 32, 8, 111, 108, 100, 45, 112, 97, 116, 104, 115, - 8, 110, 101, 119, 45, 112, 97, 116, 104, 115, 0, 46, 4, 0, 10, 115, 121, 109, 108, 105, 110, - 107, 45, 97, 116, 1, 74, 1, 64, 4, 4, 116, 104, 105, 115, 32, 10, 112, 97, 116, 104, 45, 102, - 108, 97, 103, 115, 7, 4, 112, 97, 116, 104, 115, 4, 116, 121, 112, 101, 40, 0, 46, 4, 0, 9, 97, - 99, 99, 101, 115, 115, 45, 97, 116, 1, 75, 4, 0, 14, 117, 110, 108, 105, 110, 107, 45, 102, - 105, 108, 101, 45, 97, 116, 1, 63, 1, 64, 4, 4, 116, 104, 105, 115, 32, 10, 112, 97, 116, 104, - 45, 102, 108, 97, 103, 115, 7, 4, 112, 97, 116, 104, 115, 5, 109, 111, 100, 101, 115, 11, 0, - 46, 4, 0, 26, 99, 104, 97, 110, 103, 101, 45, 102, 105, 108, 101, 45, 112, 101, 114, 109, 105, - 115, 115, 105, 111, 110, 115, 45, 97, 116, 1, 76, 4, 0, 31, 99, 104, 97, 110, 103, 101, 45, - 100, 105, 114, 101, 99, 116, 111, 114, 121, 45, 112, 101, 114, 109, 105, 115, 115, 105, 111, - 110, 115, 45, 97, 116, 1, 76, 4, 0, 11, 108, 111, 99, 107, 45, 115, 104, 97, 114, 101, 100, 1, - 48, 4, 0, 14, 108, 111, 99, 107, 45, 101, 120, 99, 108, 117, 115, 105, 118, 101, 1, 48, 4, 0, - 15, 116, 114, 121, 45, 108, 111, 99, 107, 45, 115, 104, 97, 114, 101, 100, 1, 48, 4, 0, 18, - 116, 114, 121, 45, 108, 111, 99, 107, 45, 101, 120, 99, 108, 117, 115, 105, 118, 101, 1, 48, 4, - 0, 6, 117, 110, 108, 111, 99, 107, 1, 48, 1, 64, 1, 4, 116, 104, 105, 115, 32, 1, 0, 4, 0, 15, - 100, 114, 111, 112, 45, 100, 101, 115, 99, 114, 105, 112, 116, 111, 114, 1, 77, 1, 107, 28, 1, - 106, 1, 206, 0, 1, 19, 1, 64, 1, 4, 116, 104, 105, 115, 21, 0, 207, 0, 4, 0, 20, 114, 101, 97, - 100, 45, 100, 105, 114, 101, 99, 116, 111, 114, 121, 45, 101, 110, 116, 114, 121, 1, 80, 1, 64, - 1, 4, 116, 104, 105, 115, 21, 1, 0, 4, 0, 27, 100, 114, 111, 112, 45, 100, 105, 114, 101, 99, - 116, 111, 114, 121, 45, 101, 110, 116, 114, 121, 45, 115, 116, 114, 101, 97, 109, 1, 81, 3, 1, - 26, 119, 97, 115, 105, 58, 102, 105, 108, 101, 115, 121, 115, 116, 101, 109, 47, 102, 105, 108, - 101, 115, 121, 115, 116, 101, 109, 5, 9, 1, 66, 20, 1, 121, 4, 0, 7, 110, 101, 116, 119, 111, - 114, 107, 3, 0, 0, 1, 111, 8, 123, 123, 123, 123, 123, 123, 123, 123, 4, 0, 12, 105, 112, 118, - 54, 45, 97, 100, 100, 114, 101, 115, 115, 3, 0, 2, 1, 114, 4, 4, 112, 111, 114, 116, 123, 9, - 102, 108, 111, 119, 45, 105, 110, 102, 111, 121, 7, 97, 100, 100, 114, 101, 115, 115, 3, 8, - 115, 99, 111, 112, 101, 45, 105, 100, 121, 4, 0, 19, 105, 112, 118, 54, 45, 115, 111, 99, 107, - 101, 116, 45, 97, 100, 100, 114, 101, 115, 115, 3, 0, 4, 1, 111, 4, 125, 125, 125, 125, 4, 0, - 12, 105, 112, 118, 52, 45, 97, 100, 100, 114, 101, 115, 115, 3, 0, 6, 1, 114, 2, 4, 112, 111, - 114, 116, 123, 7, 97, 100, 100, 114, 101, 115, 115, 7, 4, 0, 19, 105, 112, 118, 52, 45, 115, - 111, 99, 107, 101, 116, 45, 97, 100, 100, 114, 101, 115, 115, 3, 0, 8, 1, 113, 2, 4, 105, 112, - 118, 52, 1, 9, 0, 4, 105, 112, 118, 54, 1, 5, 0, 4, 0, 17, 105, 112, 45, 115, 111, 99, 107, - 101, 116, 45, 97, 100, 100, 114, 101, 115, 115, 3, 0, 10, 1, 109, 2, 4, 105, 112, 118, 52, 4, - 105, 112, 118, 54, 4, 0, 17, 105, 112, 45, 97, 100, 100, 114, 101, 115, 115, 45, 102, 97, 109, - 105, 108, 121, 3, 0, 12, 1, 113, 2, 4, 105, 112, 118, 52, 1, 7, 0, 4, 105, 112, 118, 54, 1, 3, - 0, 4, 0, 10, 105, 112, 45, 97, 100, 100, 114, 101, 115, 115, 3, 0, 14, 1, 109, 32, 7, 117, 110, - 107, 110, 111, 119, 110, 13, 97, 99, 99, 101, 115, 115, 45, 100, 101, 110, 105, 101, 100, 13, - 110, 111, 116, 45, 115, 117, 112, 112, 111, 114, 116, 101, 100, 13, 111, 117, 116, 45, 111, - 102, 45, 109, 101, 109, 111, 114, 121, 7, 116, 105, 109, 101, 111, 117, 116, 20, 99, 111, 110, - 99, 117, 114, 114, 101, 110, 99, 121, 45, 99, 111, 110, 102, 108, 105, 99, 116, 15, 110, 111, - 116, 45, 105, 110, 45, 112, 114, 111, 103, 114, 101, 115, 115, 11, 119, 111, 117, 108, 100, 45, - 98, 108, 111, 99, 107, 28, 97, 100, 100, 114, 101, 115, 115, 45, 102, 97, 109, 105, 108, 121, - 45, 110, 111, 116, 45, 115, 117, 112, 112, 111, 114, 116, 101, 100, 23, 97, 100, 100, 114, 101, - 115, 115, 45, 102, 97, 109, 105, 108, 121, 45, 109, 105, 115, 109, 97, 116, 99, 104, 22, 105, - 110, 118, 97, 108, 105, 100, 45, 114, 101, 109, 111, 116, 101, 45, 97, 100, 100, 114, 101, 115, - 115, 19, 105, 112, 118, 52, 45, 111, 110, 108, 121, 45, 111, 112, 101, 114, 97, 116, 105, 111, - 110, 19, 105, 112, 118, 54, 45, 111, 110, 108, 121, 45, 111, 112, 101, 114, 97, 116, 105, 111, - 110, 16, 110, 101, 119, 45, 115, 111, 99, 107, 101, 116, 45, 108, 105, 109, 105, 116, 16, 97, - 108, 114, 101, 97, 100, 121, 45, 97, 116, 116, 97, 99, 104, 101, 100, 13, 97, 108, 114, 101, - 97, 100, 121, 45, 98, 111, 117, 110, 100, 17, 97, 108, 114, 101, 97, 100, 121, 45, 99, 111, - 110, 110, 101, 99, 116, 101, 100, 9, 110, 111, 116, 45, 98, 111, 117, 110, 100, 13, 110, 111, - 116, 45, 99, 111, 110, 110, 101, 99, 116, 101, 100, 20, 97, 100, 100, 114, 101, 115, 115, 45, - 110, 111, 116, 45, 98, 105, 110, 100, 97, 98, 108, 101, 14, 97, 100, 100, 114, 101, 115, 115, - 45, 105, 110, 45, 117, 115, 101, 25, 101, 112, 104, 101, 109, 101, 114, 97, 108, 45, 112, 111, - 114, 116, 115, 45, 101, 120, 104, 97, 117, 115, 116, 101, 100, 18, 114, 101, 109, 111, 116, - 101, 45, 117, 110, 114, 101, 97, 99, 104, 97, 98, 108, 101, 17, 97, 108, 114, 101, 97, 100, - 121, 45, 108, 105, 115, 116, 101, 110, 105, 110, 103, 13, 110, 111, 116, 45, 108, 105, 115, - 116, 101, 110, 105, 110, 103, 18, 99, 111, 110, 110, 101, 99, 116, 105, 111, 110, 45, 114, 101, - 102, 117, 115, 101, 100, 16, 99, 111, 110, 110, 101, 99, 116, 105, 111, 110, 45, 114, 101, 115, - 101, 116, 18, 100, 97, 116, 97, 103, 114, 97, 109, 45, 116, 111, 111, 45, 108, 97, 114, 103, - 101, 12, 105, 110, 118, 97, 108, 105, 100, 45, 110, 97, 109, 101, 17, 110, 97, 109, 101, 45, - 117, 110, 114, 101, 115, 111, 108, 118, 97, 98, 108, 101, 26, 116, 101, 109, 112, 111, 114, 97, - 114, 121, 45, 114, 101, 115, 111, 108, 118, 101, 114, 45, 102, 97, 105, 108, 117, 114, 101, 26, - 112, 101, 114, 109, 97, 110, 101, 110, 116, 45, 114, 101, 115, 111, 108, 118, 101, 114, 45, - 102, 97, 105, 108, 117, 114, 101, 4, 0, 10, 101, 114, 114, 111, 114, 45, 99, 111, 100, 101, 3, - 0, 16, 1, 64, 1, 4, 116, 104, 105, 115, 1, 1, 0, 4, 0, 12, 100, 114, 111, 112, 45, 110, 101, - 116, 119, 111, 114, 107, 1, 18, 3, 1, 20, 119, 97, 115, 105, 58, 115, 111, 99, 107, 101, 116, - 115, 47, 110, 101, 116, 119, 111, 114, 107, 5, 10, 2, 3, 0, 6, 7, 110, 101, 116, 119, 111, 114, - 107, 1, 66, 4, 2, 3, 2, 1, 11, 4, 0, 7, 110, 101, 116, 119, 111, 114, 107, 3, 0, 0, 1, 64, 0, - 0, 1, 4, 0, 16, 105, 110, 115, 116, 97, 110, 99, 101, 45, 110, 101, 116, 119, 111, 114, 107, 1, - 2, 3, 1, 29, 119, 97, 115, 105, 58, 115, 111, 99, 107, 101, 116, 115, 47, 105, 110, 115, 116, - 97, 110, 99, 101, 45, 110, 101, 116, 119, 111, 114, 107, 5, 12, 2, 3, 0, 6, 10, 101, 114, 114, - 111, 114, 45, 99, 111, 100, 101, 2, 3, 0, 6, 10, 105, 112, 45, 97, 100, 100, 114, 101, 115, - 115, 2, 3, 0, 6, 17, 105, 112, 45, 97, 100, 100, 114, 101, 115, 115, 45, 102, 97, 109, 105, - 108, 121, 1, 66, 24, 2, 3, 2, 1, 2, 4, 0, 8, 112, 111, 108, 108, 97, 98, 108, 101, 3, 0, 0, 2, - 3, 2, 1, 11, 4, 0, 7, 110, 101, 116, 119, 111, 114, 107, 3, 0, 2, 2, 3, 2, 1, 13, 4, 0, 10, - 101, 114, 114, 111, 114, 45, 99, 111, 100, 101, 3, 0, 4, 2, 3, 2, 1, 14, 4, 0, 10, 105, 112, - 45, 97, 100, 100, 114, 101, 115, 115, 3, 0, 6, 2, 3, 2, 1, 15, 4, 0, 17, 105, 112, 45, 97, 100, - 100, 114, 101, 115, 115, 45, 102, 97, 109, 105, 108, 121, 3, 0, 8, 1, 121, 4, 0, 22, 114, 101, - 115, 111, 108, 118, 101, 45, 97, 100, 100, 114, 101, 115, 115, 45, 115, 116, 114, 101, 97, 109, - 3, 0, 10, 1, 107, 9, 1, 106, 1, 11, 1, 5, 1, 64, 4, 7, 110, 101, 116, 119, 111, 114, 107, 3, 4, - 110, 97, 109, 101, 115, 14, 97, 100, 100, 114, 101, 115, 115, 45, 102, 97, 109, 105, 108, 121, - 12, 19, 105, 110, 99, 108, 117, 100, 101, 45, 117, 110, 97, 118, 97, 105, 108, 97, 98, 108, - 101, 127, 0, 13, 4, 0, 17, 114, 101, 115, 111, 108, 118, 101, 45, 97, 100, 100, 114, 101, 115, - 115, 101, 115, 1, 14, 1, 107, 7, 1, 106, 1, 15, 1, 5, 1, 64, 1, 4, 116, 104, 105, 115, 11, 0, - 16, 4, 0, 20, 114, 101, 115, 111, 108, 118, 101, 45, 110, 101, 120, 116, 45, 97, 100, 100, 114, - 101, 115, 115, 1, 17, 1, 64, 1, 4, 116, 104, 105, 115, 11, 1, 0, 4, 0, 27, 100, 114, 111, 112, - 45, 114, 101, 115, 111, 108, 118, 101, 45, 97, 100, 100, 114, 101, 115, 115, 45, 115, 116, 114, - 101, 97, 109, 1, 18, 1, 64, 1, 4, 116, 104, 105, 115, 11, 0, 1, 4, 0, 9, 115, 117, 98, 115, 99, - 114, 105, 98, 101, 1, 19, 3, 1, 27, 119, 97, 115, 105, 58, 115, 111, 99, 107, 101, 116, 115, - 47, 105, 112, 45, 110, 97, 109, 101, 45, 108, 111, 111, 107, 117, 112, 5, 16, 2, 3, 0, 6, 17, - 105, 112, 45, 115, 111, 99, 107, 101, 116, 45, 97, 100, 100, 114, 101, 115, 115, 1, 66, 70, 2, - 3, 2, 1, 7, 4, 0, 12, 105, 110, 112, 117, 116, 45, 115, 116, 114, 101, 97, 109, 3, 0, 0, 2, 3, - 2, 1, 8, 4, 0, 13, 111, 117, 116, 112, 117, 116, 45, 115, 116, 114, 101, 97, 109, 3, 0, 2, 2, - 3, 2, 1, 2, 4, 0, 8, 112, 111, 108, 108, 97, 98, 108, 101, 3, 0, 4, 2, 3, 2, 1, 11, 4, 0, 7, - 110, 101, 116, 119, 111, 114, 107, 3, 0, 6, 2, 3, 2, 1, 13, 4, 0, 10, 101, 114, 114, 111, 114, - 45, 99, 111, 100, 101, 3, 0, 8, 2, 3, 2, 1, 17, 4, 0, 17, 105, 112, 45, 115, 111, 99, 107, 101, - 116, 45, 97, 100, 100, 114, 101, 115, 115, 3, 0, 10, 2, 3, 2, 1, 15, 4, 0, 17, 105, 112, 45, - 97, 100, 100, 114, 101, 115, 115, 45, 102, 97, 109, 105, 108, 121, 3, 0, 12, 1, 121, 4, 0, 10, - 116, 99, 112, 45, 115, 111, 99, 107, 101, 116, 3, 0, 14, 1, 109, 3, 7, 114, 101, 99, 101, 105, - 118, 101, 4, 115, 101, 110, 100, 4, 98, 111, 116, 104, 4, 0, 13, 115, 104, 117, 116, 100, 111, - 119, 110, 45, 116, 121, 112, 101, 3, 0, 16, 1, 106, 0, 1, 9, 1, 64, 3, 4, 116, 104, 105, 115, - 15, 7, 110, 101, 116, 119, 111, 114, 107, 7, 13, 108, 111, 99, 97, 108, 45, 97, 100, 100, 114, - 101, 115, 115, 11, 0, 18, 4, 0, 10, 115, 116, 97, 114, 116, 45, 98, 105, 110, 100, 1, 19, 1, - 64, 1, 4, 116, 104, 105, 115, 15, 0, 18, 4, 0, 11, 102, 105, 110, 105, 115, 104, 45, 98, 105, - 110, 100, 1, 20, 1, 64, 3, 4, 116, 104, 105, 115, 15, 7, 110, 101, 116, 119, 111, 114, 107, 7, - 14, 114, 101, 109, 111, 116, 101, 45, 97, 100, 100, 114, 101, 115, 115, 11, 0, 18, 4, 0, 13, - 115, 116, 97, 114, 116, 45, 99, 111, 110, 110, 101, 99, 116, 1, 21, 1, 111, 2, 1, 3, 1, 106, 1, - 22, 1, 9, 1, 64, 1, 4, 116, 104, 105, 115, 15, 0, 23, 4, 0, 14, 102, 105, 110, 105, 115, 104, - 45, 99, 111, 110, 110, 101, 99, 116, 1, 24, 1, 64, 2, 4, 116, 104, 105, 115, 15, 7, 110, 101, - 116, 119, 111, 114, 107, 7, 0, 18, 4, 0, 12, 115, 116, 97, 114, 116, 45, 108, 105, 115, 116, - 101, 110, 1, 25, 4, 0, 13, 102, 105, 110, 105, 115, 104, 45, 108, 105, 115, 116, 101, 110, 1, - 20, 1, 111, 3, 15, 1, 3, 1, 106, 1, 26, 1, 9, 1, 64, 1, 4, 116, 104, 105, 115, 15, 0, 27, 4, 0, - 6, 97, 99, 99, 101, 112, 116, 1, 28, 1, 106, 1, 11, 1, 9, 1, 64, 1, 4, 116, 104, 105, 115, 15, - 0, 29, 4, 0, 13, 108, 111, 99, 97, 108, 45, 97, 100, 100, 114, 101, 115, 115, 1, 30, 4, 0, 14, - 114, 101, 109, 111, 116, 101, 45, 97, 100, 100, 114, 101, 115, 115, 1, 30, 1, 64, 1, 4, 116, - 104, 105, 115, 15, 0, 13, 4, 0, 14, 97, 100, 100, 114, 101, 115, 115, 45, 102, 97, 109, 105, - 108, 121, 1, 31, 1, 106, 1, 127, 1, 9, 1, 64, 1, 4, 116, 104, 105, 115, 15, 0, 32, 4, 0, 9, - 105, 112, 118, 54, 45, 111, 110, 108, 121, 1, 33, 1, 64, 2, 4, 116, 104, 105, 115, 15, 5, 118, - 97, 108, 117, 101, 127, 0, 18, 4, 0, 13, 115, 101, 116, 45, 105, 112, 118, 54, 45, 111, 110, - 108, 121, 1, 34, 1, 64, 2, 4, 116, 104, 105, 115, 15, 5, 118, 97, 108, 117, 101, 119, 0, 18, 4, - 0, 23, 115, 101, 116, 45, 108, 105, 115, 116, 101, 110, 45, 98, 97, 99, 107, 108, 111, 103, 45, - 115, 105, 122, 101, 1, 35, 4, 0, 10, 107, 101, 101, 112, 45, 97, 108, 105, 118, 101, 1, 33, 4, - 0, 14, 115, 101, 116, 45, 107, 101, 101, 112, 45, 97, 108, 105, 118, 101, 1, 34, 4, 0, 8, 110, - 111, 45, 100, 101, 108, 97, 121, 1, 33, 4, 0, 12, 115, 101, 116, 45, 110, 111, 45, 100, 101, - 108, 97, 121, 1, 34, 1, 106, 1, 125, 1, 9, 1, 64, 1, 4, 116, 104, 105, 115, 15, 0, 36, 4, 0, - 17, 117, 110, 105, 99, 97, 115, 116, 45, 104, 111, 112, 45, 108, 105, 109, 105, 116, 1, 37, 1, - 64, 2, 4, 116, 104, 105, 115, 15, 5, 118, 97, 108, 117, 101, 125, 0, 18, 4, 0, 21, 115, 101, - 116, 45, 117, 110, 105, 99, 97, 115, 116, 45, 104, 111, 112, 45, 108, 105, 109, 105, 116, 1, - 38, 1, 106, 1, 119, 1, 9, 1, 64, 1, 4, 116, 104, 105, 115, 15, 0, 39, 4, 0, 19, 114, 101, 99, - 101, 105, 118, 101, 45, 98, 117, 102, 102, 101, 114, 45, 115, 105, 122, 101, 1, 40, 4, 0, 23, - 115, 101, 116, 45, 114, 101, 99, 101, 105, 118, 101, 45, 98, 117, 102, 102, 101, 114, 45, 115, - 105, 122, 101, 1, 35, 4, 0, 16, 115, 101, 110, 100, 45, 98, 117, 102, 102, 101, 114, 45, 115, - 105, 122, 101, 1, 40, 4, 0, 20, 115, 101, 116, 45, 115, 101, 110, 100, 45, 98, 117, 102, 102, - 101, 114, 45, 115, 105, 122, 101, 1, 35, 1, 64, 1, 4, 116, 104, 105, 115, 15, 0, 5, 4, 0, 9, - 115, 117, 98, 115, 99, 114, 105, 98, 101, 1, 41, 1, 64, 2, 4, 116, 104, 105, 115, 15, 13, 115, - 104, 117, 116, 100, 111, 119, 110, 45, 116, 121, 112, 101, 17, 0, 18, 4, 0, 8, 115, 104, 117, - 116, 100, 111, 119, 110, 1, 42, 1, 64, 1, 4, 116, 104, 105, 115, 15, 1, 0, 4, 0, 15, 100, 114, - 111, 112, 45, 116, 99, 112, 45, 115, 111, 99, 107, 101, 116, 1, 43, 3, 1, 16, 119, 97, 115, - 105, 58, 115, 111, 99, 107, 101, 116, 115, 47, 116, 99, 112, 5, 18, 2, 3, 0, 9, 10, 116, 99, - 112, 45, 115, 111, 99, 107, 101, 116, 1, 66, 11, 2, 3, 2, 1, 11, 4, 0, 7, 110, 101, 116, 119, - 111, 114, 107, 3, 0, 0, 2, 3, 2, 1, 13, 4, 0, 10, 101, 114, 114, 111, 114, 45, 99, 111, 100, - 101, 3, 0, 2, 2, 3, 2, 1, 15, 4, 0, 17, 105, 112, 45, 97, 100, 100, 114, 101, 115, 115, 45, - 102, 97, 109, 105, 108, 121, 3, 0, 4, 2, 3, 2, 1, 19, 4, 0, 10, 116, 99, 112, 45, 115, 111, 99, - 107, 101, 116, 3, 0, 6, 1, 106, 1, 7, 1, 3, 1, 64, 1, 14, 97, 100, 100, 114, 101, 115, 115, 45, - 102, 97, 109, 105, 108, 121, 5, 0, 8, 4, 0, 17, 99, 114, 101, 97, 116, 101, 45, 116, 99, 112, - 45, 115, 111, 99, 107, 101, 116, 1, 9, 3, 1, 30, 119, 97, 115, 105, 58, 115, 111, 99, 107, 101, - 116, 115, 47, 116, 99, 112, 45, 99, 114, 101, 97, 116, 101, 45, 115, 111, 99, 107, 101, 116, 5, - 20, 1, 66, 55, 2, 3, 2, 1, 2, 4, 0, 8, 112, 111, 108, 108, 97, 98, 108, 101, 3, 0, 0, 2, 3, 2, - 1, 11, 4, 0, 7, 110, 101, 116, 119, 111, 114, 107, 3, 0, 2, 2, 3, 2, 1, 13, 4, 0, 10, 101, 114, - 114, 111, 114, 45, 99, 111, 100, 101, 3, 0, 4, 2, 3, 2, 1, 17, 4, 0, 17, 105, 112, 45, 115, - 111, 99, 107, 101, 116, 45, 97, 100, 100, 114, 101, 115, 115, 3, 0, 6, 2, 3, 2, 1, 15, 4, 0, - 17, 105, 112, 45, 97, 100, 100, 114, 101, 115, 115, 45, 102, 97, 109, 105, 108, 121, 3, 0, 8, - 1, 121, 4, 0, 10, 117, 100, 112, 45, 115, 111, 99, 107, 101, 116, 3, 0, 10, 1, 112, 125, 1, - 114, 2, 4, 100, 97, 116, 97, 12, 14, 114, 101, 109, 111, 116, 101, 45, 97, 100, 100, 114, 101, - 115, 115, 7, 4, 0, 8, 100, 97, 116, 97, 103, 114, 97, 109, 3, 0, 13, 1, 106, 0, 1, 5, 1, 64, 3, - 4, 116, 104, 105, 115, 11, 7, 110, 101, 116, 119, 111, 114, 107, 3, 13, 108, 111, 99, 97, 108, - 45, 97, 100, 100, 114, 101, 115, 115, 7, 0, 15, 4, 0, 10, 115, 116, 97, 114, 116, 45, 98, 105, - 110, 100, 1, 16, 1, 64, 1, 4, 116, 104, 105, 115, 11, 0, 15, 4, 0, 11, 102, 105, 110, 105, 115, - 104, 45, 98, 105, 110, 100, 1, 17, 1, 64, 3, 4, 116, 104, 105, 115, 11, 7, 110, 101, 116, 119, - 111, 114, 107, 3, 14, 114, 101, 109, 111, 116, 101, 45, 97, 100, 100, 114, 101, 115, 115, 7, 0, - 15, 4, 0, 13, 115, 116, 97, 114, 116, 45, 99, 111, 110, 110, 101, 99, 116, 1, 18, 4, 0, 14, - 102, 105, 110, 105, 115, 104, 45, 99, 111, 110, 110, 101, 99, 116, 1, 17, 1, 106, 1, 14, 1, 5, - 1, 64, 1, 4, 116, 104, 105, 115, 11, 0, 19, 4, 0, 7, 114, 101, 99, 101, 105, 118, 101, 1, 20, - 1, 64, 2, 4, 116, 104, 105, 115, 11, 8, 100, 97, 116, 97, 103, 114, 97, 109, 14, 0, 15, 4, 0, - 4, 115, 101, 110, 100, 1, 21, 1, 106, 1, 7, 1, 5, 1, 64, 1, 4, 116, 104, 105, 115, 11, 0, 22, - 4, 0, 13, 108, 111, 99, 97, 108, 45, 97, 100, 100, 114, 101, 115, 115, 1, 23, 4, 0, 14, 114, - 101, 109, 111, 116, 101, 45, 97, 100, 100, 114, 101, 115, 115, 1, 23, 1, 64, 1, 4, 116, 104, - 105, 115, 11, 0, 9, 4, 0, 14, 97, 100, 100, 114, 101, 115, 115, 45, 102, 97, 109, 105, 108, - 121, 1, 24, 1, 106, 1, 127, 1, 5, 1, 64, 1, 4, 116, 104, 105, 115, 11, 0, 25, 4, 0, 9, 105, - 112, 118, 54, 45, 111, 110, 108, 121, 1, 26, 1, 64, 2, 4, 116, 104, 105, 115, 11, 5, 118, 97, - 108, 117, 101, 127, 0, 15, 4, 0, 13, 115, 101, 116, 45, 105, 112, 118, 54, 45, 111, 110, 108, - 121, 1, 27, 1, 106, 1, 125, 1, 5, 1, 64, 1, 4, 116, 104, 105, 115, 11, 0, 28, 4, 0, 17, 117, - 110, 105, 99, 97, 115, 116, 45, 104, 111, 112, 45, 108, 105, 109, 105, 116, 1, 29, 1, 64, 2, 4, - 116, 104, 105, 115, 11, 5, 118, 97, 108, 117, 101, 125, 0, 15, 4, 0, 21, 115, 101, 116, 45, - 117, 110, 105, 99, 97, 115, 116, 45, 104, 111, 112, 45, 108, 105, 109, 105, 116, 1, 30, 1, 106, - 1, 119, 1, 5, 1, 64, 1, 4, 116, 104, 105, 115, 11, 0, 31, 4, 0, 19, 114, 101, 99, 101, 105, - 118, 101, 45, 98, 117, 102, 102, 101, 114, 45, 115, 105, 122, 101, 1, 32, 1, 64, 2, 4, 116, - 104, 105, 115, 11, 5, 118, 97, 108, 117, 101, 119, 0, 15, 4, 0, 23, 115, 101, 116, 45, 114, - 101, 99, 101, 105, 118, 101, 45, 98, 117, 102, 102, 101, 114, 45, 115, 105, 122, 101, 1, 33, 4, - 0, 16, 115, 101, 110, 100, 45, 98, 117, 102, 102, 101, 114, 45, 115, 105, 122, 101, 1, 32, 4, - 0, 20, 115, 101, 116, 45, 115, 101, 110, 100, 45, 98, 117, 102, 102, 101, 114, 45, 115, 105, - 122, 101, 1, 33, 1, 64, 1, 4, 116, 104, 105, 115, 11, 0, 1, 4, 0, 9, 115, 117, 98, 115, 99, - 114, 105, 98, 101, 1, 34, 1, 64, 1, 4, 116, 104, 105, 115, 11, 1, 0, 4, 0, 15, 100, 114, 111, - 112, 45, 117, 100, 112, 45, 115, 111, 99, 107, 101, 116, 1, 35, 3, 1, 16, 119, 97, 115, 105, - 58, 115, 111, 99, 107, 101, 116, 115, 47, 117, 100, 112, 5, 21, 2, 3, 0, 11, 10, 117, 100, 112, - 45, 115, 111, 99, 107, 101, 116, 1, 66, 11, 2, 3, 2, 1, 11, 4, 0, 7, 110, 101, 116, 119, 111, - 114, 107, 3, 0, 0, 2, 3, 2, 1, 13, 4, 0, 10, 101, 114, 114, 111, 114, 45, 99, 111, 100, 101, 3, - 0, 2, 2, 3, 2, 1, 15, 4, 0, 17, 105, 112, 45, 97, 100, 100, 114, 101, 115, 115, 45, 102, 97, - 109, 105, 108, 121, 3, 0, 4, 2, 3, 2, 1, 22, 4, 0, 10, 117, 100, 112, 45, 115, 111, 99, 107, - 101, 116, 3, 0, 6, 1, 106, 1, 7, 1, 3, 1, 64, 1, 14, 97, 100, 100, 114, 101, 115, 115, 45, 102, - 97, 109, 105, 108, 121, 5, 0, 8, 4, 0, 17, 99, 114, 101, 97, 116, 101, 45, 117, 100, 112, 45, - 115, 111, 99, 107, 101, 116, 1, 9, 3, 1, 30, 119, 97, 115, 105, 58, 115, 111, 99, 107, 101, - 116, 115, 47, 117, 100, 112, 45, 99, 114, 101, 97, 116, 101, 45, 115, 111, 99, 107, 101, 116, - 5, 23, 1, 66, 5, 1, 112, 125, 1, 64, 1, 3, 108, 101, 110, 119, 0, 0, 4, 0, 16, 103, 101, 116, - 45, 114, 97, 110, 100, 111, 109, 45, 98, 121, 116, 101, 115, 1, 1, 1, 64, 0, 0, 119, 4, 0, 14, - 103, 101, 116, 45, 114, 97, 110, 100, 111, 109, 45, 117, 54, 52, 1, 2, 3, 1, 18, 119, 97, 115, - 105, 58, 114, 97, 110, 100, 111, 109, 47, 114, 97, 110, 100, 111, 109, 5, 24, 1, 66, 5, 1, 112, - 125, 1, 64, 1, 3, 108, 101, 110, 119, 0, 0, 4, 0, 25, 103, 101, 116, 45, 105, 110, 115, 101, - 99, 117, 114, 101, 45, 114, 97, 110, 100, 111, 109, 45, 98, 121, 116, 101, 115, 1, 1, 1, 64, 0, - 0, 119, 4, 0, 23, 103, 101, 116, 45, 105, 110, 115, 101, 99, 117, 114, 101, 45, 114, 97, 110, - 100, 111, 109, 45, 117, 54, 52, 1, 2, 3, 1, 20, 119, 97, 115, 105, 58, 114, 97, 110, 100, 111, - 109, 47, 105, 110, 115, 101, 99, 117, 114, 101, 5, 25, 1, 66, 3, 1, 111, 2, 119, 119, 1, 64, 0, - 0, 0, 4, 0, 13, 105, 110, 115, 101, 99, 117, 114, 101, 45, 115, 101, 101, 100, 1, 1, 3, 1, 25, - 119, 97, 115, 105, 58, 114, 97, 110, 100, 111, 109, 47, 105, 110, 115, 101, 99, 117, 114, 101, - 45, 115, 101, 101, 100, 5, 26, 1, 66, 7, 1, 111, 2, 115, 115, 1, 112, 0, 1, 64, 0, 0, 1, 4, 0, - 15, 103, 101, 116, 45, 101, 110, 118, 105, 114, 111, 110, 109, 101, 110, 116, 1, 2, 1, 112, - 115, 1, 64, 0, 0, 3, 4, 0, 13, 103, 101, 116, 45, 97, 114, 103, 117, 109, 101, 110, 116, 115, - 1, 4, 3, 1, 25, 119, 97, 115, 105, 58, 99, 108, 105, 45, 98, 97, 115, 101, 47, 101, 110, 118, - 105, 114, 111, 110, 109, 101, 110, 116, 5, 27, 2, 3, 0, 5, 10, 100, 101, 115, 99, 114, 105, - 112, 116, 111, 114, 1, 66, 10, 2, 3, 2, 1, 28, 4, 0, 10, 100, 101, 115, 99, 114, 105, 112, 116, - 111, 114, 3, 0, 0, 2, 3, 2, 1, 7, 4, 0, 12, 105, 110, 112, 117, 116, 45, 115, 116, 114, 101, - 97, 109, 3, 0, 2, 2, 3, 2, 1, 8, 4, 0, 13, 111, 117, 116, 112, 117, 116, 45, 115, 116, 114, - 101, 97, 109, 3, 0, 4, 1, 111, 2, 1, 115, 1, 112, 6, 1, 64, 0, 0, 7, 4, 0, 15, 103, 101, 116, - 45, 100, 105, 114, 101, 99, 116, 111, 114, 105, 101, 115, 1, 8, 3, 1, 22, 119, 97, 115, 105, - 58, 99, 108, 105, 45, 98, 97, 115, 101, 47, 112, 114, 101, 111, 112, 101, 110, 115, 5, 29, 1, - 66, 3, 1, 106, 0, 0, 1, 64, 1, 6, 115, 116, 97, 116, 117, 115, 0, 1, 0, 4, 0, 4, 101, 120, 105, - 116, 1, 1, 3, 1, 18, 119, 97, 115, 105, 58, 99, 108, 105, 45, 98, 97, 115, 101, 47, 101, 120, - 105, 116, 5, 30, 1, 66, 4, 2, 3, 2, 1, 7, 4, 0, 12, 105, 110, 112, 117, 116, 45, 115, 116, 114, - 101, 97, 109, 3, 0, 0, 1, 64, 0, 0, 1, 4, 0, 9, 103, 101, 116, 45, 115, 116, 100, 105, 110, 1, - 2, 3, 1, 19, 119, 97, 115, 105, 58, 99, 108, 105, 45, 98, 97, 115, 101, 47, 115, 116, 100, 105, - 110, 5, 31, 1, 66, 4, 2, 3, 2, 1, 8, 4, 0, 13, 111, 117, 116, 112, 117, 116, 45, 115, 116, 114, - 101, 97, 109, 3, 0, 0, 1, 64, 0, 0, 1, 4, 0, 10, 103, 101, 116, 45, 115, 116, 100, 111, 117, - 116, 1, 2, 3, 1, 20, 119, 97, 115, 105, 58, 99, 108, 105, 45, 98, 97, 115, 101, 47, 115, 116, - 100, 111, 117, 116, 5, 32, 1, 66, 4, 2, 3, 2, 1, 8, 4, 0, 13, 111, 117, 116, 112, 117, 116, 45, - 115, 116, 114, 101, 97, 109, 3, 0, 0, 1, 64, 0, 0, 1, 4, 0, 10, 103, 101, 116, 45, 115, 116, - 100, 101, 114, 114, 1, 2, 3, 1, 20, 119, 97, 115, 105, 58, 99, 108, 105, 45, 98, 97, 115, 101, - 47, 115, 116, 100, 101, 114, 114, 5, 33, 4, 1, 19, 117, 110, 117, 115, 101, 100, 58, 109, 97, - 105, 110, 47, 99, 111, 109, 109, 97, 110, 100, 4, 0, 1, 65, 32, 1, 66, 7, 1, 111, 2, 115, 115, - 1, 112, 0, 1, 64, 0, 0, 1, 4, 0, 15, 103, 101, 116, 45, 101, 110, 118, 105, 114, 111, 110, 109, - 101, 110, 116, 1, 2, 1, 112, 115, 1, 64, 0, 0, 3, 4, 0, 13, 103, 101, 116, 45, 97, 114, 103, - 117, 109, 101, 110, 116, 115, 1, 4, 3, 1, 25, 119, 97, 115, 105, 58, 99, 108, 105, 45, 98, 97, - 115, 101, 47, 101, 110, 118, 105, 114, 111, 110, 109, 101, 110, 116, 5, 0, 1, 66, 8, 1, 121, 4, - 0, 8, 112, 111, 108, 108, 97, 98, 108, 101, 3, 0, 0, 1, 64, 1, 4, 116, 104, 105, 115, 1, 1, 0, - 4, 0, 13, 100, 114, 111, 112, 45, 112, 111, 108, 108, 97, 98, 108, 101, 1, 2, 1, 112, 1, 1, - 112, 127, 1, 64, 1, 2, 105, 110, 3, 0, 4, 4, 0, 11, 112, 111, 108, 108, 45, 111, 110, 101, 111, - 102, 102, 1, 5, 3, 1, 14, 119, 97, 115, 105, 58, 112, 111, 108, 108, 47, 112, 111, 108, 108, 5, - 1, 2, 3, 0, 1, 8, 112, 111, 108, 108, 97, 98, 108, 101, 1, 66, 39, 2, 3, 2, 1, 2, 4, 0, 8, 112, - 111, 108, 108, 97, 98, 108, 101, 3, 0, 0, 1, 114, 0, 4, 0, 12, 115, 116, 114, 101, 97, 109, 45, - 101, 114, 114, 111, 114, 3, 0, 2, 1, 121, 4, 0, 13, 111, 117, 116, 112, 117, 116, 45, 115, 116, - 114, 101, 97, 109, 3, 0, 4, 1, 121, 4, 0, 12, 105, 110, 112, 117, 116, 45, 115, 116, 114, 101, - 97, 109, 3, 0, 6, 1, 112, 125, 1, 111, 2, 8, 127, 1, 106, 1, 9, 1, 3, 1, 64, 2, 4, 116, 104, - 105, 115, 7, 3, 108, 101, 110, 119, 0, 10, 4, 0, 4, 114, 101, 97, 100, 1, 11, 4, 0, 13, 98, - 108, 111, 99, 107, 105, 110, 103, 45, 114, 101, 97, 100, 1, 11, 1, 111, 2, 119, 127, 1, 106, 1, - 12, 1, 3, 1, 64, 2, 4, 116, 104, 105, 115, 7, 3, 108, 101, 110, 119, 0, 13, 4, 0, 4, 115, 107, - 105, 112, 1, 14, 4, 0, 13, 98, 108, 111, 99, 107, 105, 110, 103, 45, 115, 107, 105, 112, 1, 14, - 1, 64, 1, 4, 116, 104, 105, 115, 7, 0, 1, 4, 0, 25, 115, 117, 98, 115, 99, 114, 105, 98, 101, - 45, 116, 111, 45, 105, 110, 112, 117, 116, 45, 115, 116, 114, 101, 97, 109, 1, 15, 1, 64, 1, 4, - 116, 104, 105, 115, 7, 1, 0, 4, 0, 17, 100, 114, 111, 112, 45, 105, 110, 112, 117, 116, 45, - 115, 116, 114, 101, 97, 109, 1, 16, 1, 106, 1, 119, 1, 3, 1, 64, 2, 4, 116, 104, 105, 115, 5, - 3, 98, 117, 102, 8, 0, 17, 4, 0, 5, 119, 114, 105, 116, 101, 1, 18, 4, 0, 14, 98, 108, 111, 99, - 107, 105, 110, 103, 45, 119, 114, 105, 116, 101, 1, 18, 1, 64, 2, 4, 116, 104, 105, 115, 5, 3, - 108, 101, 110, 119, 0, 17, 4, 0, 12, 119, 114, 105, 116, 101, 45, 122, 101, 114, 111, 101, 115, - 1, 19, 4, 0, 21, 98, 108, 111, 99, 107, 105, 110, 103, 45, 119, 114, 105, 116, 101, 45, 122, - 101, 114, 111, 101, 115, 1, 19, 1, 64, 3, 4, 116, 104, 105, 115, 5, 3, 115, 114, 99, 7, 3, 108, - 101, 110, 119, 0, 13, 4, 0, 6, 115, 112, 108, 105, 99, 101, 1, 20, 4, 0, 15, 98, 108, 111, 99, - 107, 105, 110, 103, 45, 115, 112, 108, 105, 99, 101, 1, 20, 1, 64, 2, 4, 116, 104, 105, 115, 5, - 3, 115, 114, 99, 7, 0, 17, 4, 0, 7, 102, 111, 114, 119, 97, 114, 100, 1, 21, 1, 64, 1, 4, 116, - 104, 105, 115, 5, 0, 1, 4, 0, 26, 115, 117, 98, 115, 99, 114, 105, 98, 101, 45, 116, 111, 45, - 111, 117, 116, 112, 117, 116, 45, 115, 116, 114, 101, 97, 109, 1, 22, 1, 64, 1, 4, 116, 104, - 105, 115, 5, 1, 0, 4, 0, 18, 100, 114, 111, 112, 45, 111, 117, 116, 112, 117, 116, 45, 115, - 116, 114, 101, 97, 109, 1, 23, 3, 1, 15, 119, 97, 115, 105, 58, 105, 111, 47, 115, 116, 114, - 101, 97, 109, 115, 5, 3, 1, 66, 5, 1, 114, 2, 7, 115, 101, 99, 111, 110, 100, 115, 119, 11, - 110, 97, 110, 111, 115, 101, 99, 111, 110, 100, 115, 121, 4, 0, 8, 100, 97, 116, 101, 116, 105, - 109, 101, 3, 0, 0, 1, 64, 0, 0, 1, 4, 0, 3, 110, 111, 119, 1, 2, 4, 0, 10, 114, 101, 115, 111, - 108, 117, 116, 105, 111, 110, 1, 2, 3, 1, 22, 119, 97, 115, 105, 58, 99, 108, 111, 99, 107, - 115, 47, 119, 97, 108, 108, 45, 99, 108, 111, 99, 107, 5, 4, 2, 3, 0, 2, 12, 105, 110, 112, - 117, 116, 45, 115, 116, 114, 101, 97, 109, 2, 3, 0, 2, 13, 111, 117, 116, 112, 117, 116, 45, - 115, 116, 114, 101, 97, 109, 2, 3, 0, 3, 8, 100, 97, 116, 101, 116, 105, 109, 101, 1, 66, 117, - 2, 3, 2, 1, 5, 4, 0, 12, 105, 110, 112, 117, 116, 45, 115, 116, 114, 101, 97, 109, 3, 0, 0, 2, - 3, 2, 1, 6, 4, 0, 13, 111, 117, 116, 112, 117, 116, 45, 115, 116, 114, 101, 97, 109, 3, 0, 2, - 2, 3, 2, 1, 7, 4, 0, 8, 100, 97, 116, 101, 116, 105, 109, 101, 3, 0, 4, 1, 110, 1, 14, 115, - 121, 109, 108, 105, 110, 107, 45, 102, 111, 108, 108, 111, 119, 4, 0, 10, 112, 97, 116, 104, - 45, 102, 108, 97, 103, 115, 3, 0, 6, 1, 110, 4, 6, 99, 114, 101, 97, 116, 101, 9, 100, 105, - 114, 101, 99, 116, 111, 114, 121, 9, 101, 120, 99, 108, 117, 115, 105, 118, 101, 8, 116, 114, - 117, 110, 99, 97, 116, 101, 4, 0, 10, 111, 112, 101, 110, 45, 102, 108, 97, 103, 115, 3, 0, 8, - 1, 110, 3, 8, 114, 101, 97, 100, 97, 98, 108, 101, 8, 119, 114, 105, 116, 97, 98, 108, 101, 10, - 101, 120, 101, 99, 117, 116, 97, 98, 108, 101, 4, 0, 5, 109, 111, 100, 101, 115, 3, 0, 10, 1, - 119, 4, 0, 10, 108, 105, 110, 107, 45, 99, 111, 117, 110, 116, 3, 0, 12, 1, 119, 4, 0, 5, 105, - 110, 111, 100, 101, 3, 0, 14, 1, 119, 4, 0, 8, 102, 105, 108, 101, 115, 105, 122, 101, 3, 0, - 16, 1, 109, 37, 6, 97, 99, 99, 101, 115, 115, 11, 119, 111, 117, 108, 100, 45, 98, 108, 111, - 99, 107, 7, 97, 108, 114, 101, 97, 100, 121, 14, 98, 97, 100, 45, 100, 101, 115, 99, 114, 105, - 112, 116, 111, 114, 4, 98, 117, 115, 121, 8, 100, 101, 97, 100, 108, 111, 99, 107, 5, 113, 117, - 111, 116, 97, 5, 101, 120, 105, 115, 116, 14, 102, 105, 108, 101, 45, 116, 111, 111, 45, 108, - 97, 114, 103, 101, 21, 105, 108, 108, 101, 103, 97, 108, 45, 98, 121, 116, 101, 45, 115, 101, - 113, 117, 101, 110, 99, 101, 11, 105, 110, 45, 112, 114, 111, 103, 114, 101, 115, 115, 11, 105, - 110, 116, 101, 114, 114, 117, 112, 116, 101, 100, 7, 105, 110, 118, 97, 108, 105, 100, 2, 105, - 111, 12, 105, 115, 45, 100, 105, 114, 101, 99, 116, 111, 114, 121, 4, 108, 111, 111, 112, 14, - 116, 111, 111, 45, 109, 97, 110, 121, 45, 108, 105, 110, 107, 115, 12, 109, 101, 115, 115, 97, - 103, 101, 45, 115, 105, 122, 101, 13, 110, 97, 109, 101, 45, 116, 111, 111, 45, 108, 111, 110, - 103, 9, 110, 111, 45, 100, 101, 118, 105, 99, 101, 8, 110, 111, 45, 101, 110, 116, 114, 121, 7, - 110, 111, 45, 108, 111, 99, 107, 19, 105, 110, 115, 117, 102, 102, 105, 99, 105, 101, 110, 116, - 45, 109, 101, 109, 111, 114, 121, 18, 105, 110, 115, 117, 102, 102, 105, 99, 105, 101, 110, - 116, 45, 115, 112, 97, 99, 101, 13, 110, 111, 116, 45, 100, 105, 114, 101, 99, 116, 111, 114, - 121, 9, 110, 111, 116, 45, 101, 109, 112, 116, 121, 15, 110, 111, 116, 45, 114, 101, 99, 111, - 118, 101, 114, 97, 98, 108, 101, 11, 117, 110, 115, 117, 112, 112, 111, 114, 116, 101, 100, 6, - 110, 111, 45, 116, 116, 121, 14, 110, 111, 45, 115, 117, 99, 104, 45, 100, 101, 118, 105, 99, - 101, 8, 111, 118, 101, 114, 102, 108, 111, 119, 13, 110, 111, 116, 45, 112, 101, 114, 109, 105, - 116, 116, 101, 100, 4, 112, 105, 112, 101, 9, 114, 101, 97, 100, 45, 111, 110, 108, 121, 12, - 105, 110, 118, 97, 108, 105, 100, 45, 115, 101, 101, 107, 14, 116, 101, 120, 116, 45, 102, 105, - 108, 101, 45, 98, 117, 115, 121, 12, 99, 114, 111, 115, 115, 45, 100, 101, 118, 105, 99, 101, - 4, 0, 10, 101, 114, 114, 111, 114, 45, 99, 111, 100, 101, 3, 0, 18, 1, 121, 4, 0, 22, 100, 105, - 114, 101, 99, 116, 111, 114, 121, 45, 101, 110, 116, 114, 121, 45, 115, 116, 114, 101, 97, 109, - 3, 0, 20, 1, 119, 4, 0, 6, 100, 101, 118, 105, 99, 101, 3, 0, 22, 1, 109, 8, 7, 117, 110, 107, - 110, 111, 119, 110, 12, 98, 108, 111, 99, 107, 45, 100, 101, 118, 105, 99, 101, 16, 99, 104, - 97, 114, 97, 99, 116, 101, 114, 45, 100, 101, 118, 105, 99, 101, 9, 100, 105, 114, 101, 99, - 116, 111, 114, 121, 4, 102, 105, 102, 111, 13, 115, 121, 109, 98, 111, 108, 105, 99, 45, 108, - 105, 110, 107, 12, 114, 101, 103, 117, 108, 97, 114, 45, 102, 105, 108, 101, 6, 115, 111, 99, - 107, 101, 116, 4, 0, 15, 100, 101, 115, 99, 114, 105, 112, 116, 111, 114, 45, 116, 121, 112, - 101, 3, 0, 24, 1, 107, 15, 1, 114, 3, 5, 105, 110, 111, 100, 101, 26, 4, 116, 121, 112, 101, - 25, 4, 110, 97, 109, 101, 115, 4, 0, 15, 100, 105, 114, 101, 99, 116, 111, 114, 121, 45, 101, - 110, 116, 114, 121, 3, 0, 27, 1, 110, 6, 4, 114, 101, 97, 100, 5, 119, 114, 105, 116, 101, 19, - 102, 105, 108, 101, 45, 105, 110, 116, 101, 103, 114, 105, 116, 121, 45, 115, 121, 110, 99, 19, - 100, 97, 116, 97, 45, 105, 110, 116, 101, 103, 114, 105, 116, 121, 45, 115, 121, 110, 99, 20, - 114, 101, 113, 117, 101, 115, 116, 101, 100, 45, 119, 114, 105, 116, 101, 45, 115, 121, 110, - 99, 16, 109, 117, 116, 97, 116, 101, 45, 100, 105, 114, 101, 99, 116, 111, 114, 121, 4, 0, 16, - 100, 101, 115, 99, 114, 105, 112, 116, 111, 114, 45, 102, 108, 97, 103, 115, 3, 0, 29, 1, 121, - 4, 0, 10, 100, 101, 115, 99, 114, 105, 112, 116, 111, 114, 3, 0, 31, 1, 113, 3, 9, 110, 111, - 45, 99, 104, 97, 110, 103, 101, 0, 0, 3, 110, 111, 119, 0, 0, 9, 116, 105, 109, 101, 115, 116, - 97, 109, 112, 1, 5, 0, 4, 0, 13, 110, 101, 119, 45, 116, 105, 109, 101, 115, 116, 97, 109, 112, - 3, 0, 33, 1, 114, 8, 6, 100, 101, 118, 105, 99, 101, 23, 5, 105, 110, 111, 100, 101, 15, 4, - 116, 121, 112, 101, 25, 10, 108, 105, 110, 107, 45, 99, 111, 117, 110, 116, 13, 4, 115, 105, - 122, 101, 17, 21, 100, 97, 116, 97, 45, 97, 99, 99, 101, 115, 115, 45, 116, 105, 109, 101, 115, - 116, 97, 109, 112, 5, 27, 100, 97, 116, 97, 45, 109, 111, 100, 105, 102, 105, 99, 97, 116, 105, - 111, 110, 45, 116, 105, 109, 101, 115, 116, 97, 109, 112, 5, 23, 115, 116, 97, 116, 117, 115, - 45, 99, 104, 97, 110, 103, 101, 45, 116, 105, 109, 101, 115, 116, 97, 109, 112, 5, 4, 0, 15, - 100, 101, 115, 99, 114, 105, 112, 116, 111, 114, 45, 115, 116, 97, 116, 3, 0, 35, 1, 109, 6, 6, - 110, 111, 114, 109, 97, 108, 10, 115, 101, 113, 117, 101, 110, 116, 105, 97, 108, 6, 114, 97, - 110, 100, 111, 109, 9, 119, 105, 108, 108, 45, 110, 101, 101, 100, 9, 100, 111, 110, 116, 45, - 110, 101, 101, 100, 8, 110, 111, 45, 114, 101, 117, 115, 101, 4, 0, 6, 97, 100, 118, 105, 99, - 101, 3, 0, 37, 1, 113, 2, 6, 97, 99, 99, 101, 115, 115, 1, 11, 0, 6, 101, 120, 105, 115, 116, - 115, 0, 0, 4, 0, 11, 97, 99, 99, 101, 115, 115, 45, 116, 121, 112, 101, 3, 0, 39, 1, 106, 1, 1, - 1, 19, 1, 64, 2, 4, 116, 104, 105, 115, 32, 6, 111, 102, 102, 115, 101, 116, 17, 0, 41, 4, 0, - 15, 114, 101, 97, 100, 45, 118, 105, 97, 45, 115, 116, 114, 101, 97, 109, 1, 42, 1, 106, 1, 3, - 1, 19, 1, 64, 2, 4, 116, 104, 105, 115, 32, 6, 111, 102, 102, 115, 101, 116, 17, 0, 43, 4, 0, - 16, 119, 114, 105, 116, 101, 45, 118, 105, 97, 45, 115, 116, 114, 101, 97, 109, 1, 44, 1, 64, - 1, 4, 116, 104, 105, 115, 32, 0, 43, 4, 0, 17, 97, 112, 112, 101, 110, 100, 45, 118, 105, 97, - 45, 115, 116, 114, 101, 97, 109, 1, 45, 1, 106, 0, 1, 19, 1, 64, 4, 4, 116, 104, 105, 115, 32, - 6, 111, 102, 102, 115, 101, 116, 17, 6, 108, 101, 110, 103, 116, 104, 17, 6, 97, 100, 118, 105, - 99, 101, 38, 0, 46, 4, 0, 6, 97, 100, 118, 105, 115, 101, 1, 47, 1, 64, 1, 4, 116, 104, 105, - 115, 32, 0, 46, 4, 0, 9, 115, 121, 110, 99, 45, 100, 97, 116, 97, 1, 48, 1, 106, 1, 30, 1, 19, - 1, 64, 1, 4, 116, 104, 105, 115, 32, 0, 49, 4, 0, 9, 103, 101, 116, 45, 102, 108, 97, 103, 115, - 1, 50, 1, 106, 1, 25, 1, 19, 1, 64, 1, 4, 116, 104, 105, 115, 32, 0, 51, 4, 0, 8, 103, 101, - 116, 45, 116, 121, 112, 101, 1, 52, 1, 64, 2, 4, 116, 104, 105, 115, 32, 4, 115, 105, 122, 101, - 17, 0, 46, 4, 0, 8, 115, 101, 116, 45, 115, 105, 122, 101, 1, 53, 1, 64, 3, 4, 116, 104, 105, - 115, 32, 21, 100, 97, 116, 97, 45, 97, 99, 99, 101, 115, 115, 45, 116, 105, 109, 101, 115, 116, - 97, 109, 112, 34, 27, 100, 97, 116, 97, 45, 109, 111, 100, 105, 102, 105, 99, 97, 116, 105, - 111, 110, 45, 116, 105, 109, 101, 115, 116, 97, 109, 112, 34, 0, 46, 4, 0, 9, 115, 101, 116, - 45, 116, 105, 109, 101, 115, 1, 54, 1, 112, 125, 1, 111, 2, 55, 127, 1, 106, 1, 56, 1, 19, 1, - 64, 3, 4, 116, 104, 105, 115, 32, 6, 108, 101, 110, 103, 116, 104, 17, 6, 111, 102, 102, 115, - 101, 116, 17, 0, 57, 4, 0, 4, 114, 101, 97, 100, 1, 58, 1, 106, 1, 17, 1, 19, 1, 64, 3, 4, 116, - 104, 105, 115, 32, 6, 98, 117, 102, 102, 101, 114, 55, 6, 111, 102, 102, 115, 101, 116, 17, 0, - 59, 4, 0, 5, 119, 114, 105, 116, 101, 1, 60, 1, 106, 1, 21, 1, 19, 1, 64, 1, 4, 116, 104, 105, - 115, 32, 0, 61, 4, 0, 14, 114, 101, 97, 100, 45, 100, 105, 114, 101, 99, 116, 111, 114, 121, 1, - 62, 4, 0, 4, 115, 121, 110, 99, 1, 48, 1, 64, 2, 4, 116, 104, 105, 115, 32, 4, 112, 97, 116, - 104, 115, 0, 46, 4, 0, 19, 99, 114, 101, 97, 116, 101, 45, 100, 105, 114, 101, 99, 116, 111, - 114, 121, 45, 97, 116, 1, 63, 1, 106, 1, 36, 1, 19, 1, 64, 1, 4, 116, 104, 105, 115, 32, 0, - 192, 0, 4, 0, 4, 115, 116, 97, 116, 1, 65, 1, 64, 3, 4, 116, 104, 105, 115, 32, 10, 112, 97, - 116, 104, 45, 102, 108, 97, 103, 115, 7, 4, 112, 97, 116, 104, 115, 0, 192, 0, 4, 0, 7, 115, - 116, 97, 116, 45, 97, 116, 1, 66, 1, 64, 5, 4, 116, 104, 105, 115, 32, 10, 112, 97, 116, 104, - 45, 102, 108, 97, 103, 115, 7, 4, 112, 97, 116, 104, 115, 21, 100, 97, 116, 97, 45, 97, 99, 99, - 101, 115, 115, 45, 116, 105, 109, 101, 115, 116, 97, 109, 112, 34, 27, 100, 97, 116, 97, 45, - 109, 111, 100, 105, 102, 105, 99, 97, 116, 105, 111, 110, 45, 116, 105, 109, 101, 115, 116, 97, - 109, 112, 34, 0, 46, 4, 0, 12, 115, 101, 116, 45, 116, 105, 109, 101, 115, 45, 97, 116, 1, 67, - 1, 64, 5, 4, 116, 104, 105, 115, 32, 14, 111, 108, 100, 45, 112, 97, 116, 104, 45, 102, 108, - 97, 103, 115, 7, 8, 111, 108, 100, 45, 112, 97, 116, 104, 115, 14, 110, 101, 119, 45, 100, 101, - 115, 99, 114, 105, 112, 116, 111, 114, 32, 8, 110, 101, 119, 45, 112, 97, 116, 104, 115, 0, 46, - 4, 0, 7, 108, 105, 110, 107, 45, 97, 116, 1, 68, 1, 106, 1, 32, 1, 19, 1, 64, 6, 4, 116, 104, - 105, 115, 32, 10, 112, 97, 116, 104, 45, 102, 108, 97, 103, 115, 7, 4, 112, 97, 116, 104, 115, - 10, 111, 112, 101, 110, 45, 102, 108, 97, 103, 115, 9, 5, 102, 108, 97, 103, 115, 30, 5, 109, - 111, 100, 101, 115, 11, 0, 197, 0, 4, 0, 7, 111, 112, 101, 110, 45, 97, 116, 1, 70, 1, 106, 1, - 115, 1, 19, 1, 64, 2, 4, 116, 104, 105, 115, 32, 4, 112, 97, 116, 104, 115, 0, 199, 0, 4, 0, - 11, 114, 101, 97, 100, 108, 105, 110, 107, 45, 97, 116, 1, 72, 4, 0, 19, 114, 101, 109, 111, - 118, 101, 45, 100, 105, 114, 101, 99, 116, 111, 114, 121, 45, 97, 116, 1, 63, 1, 64, 4, 4, 116, - 104, 105, 115, 32, 8, 111, 108, 100, 45, 112, 97, 116, 104, 115, 14, 110, 101, 119, 45, 100, - 101, 115, 99, 114, 105, 112, 116, 111, 114, 32, 8, 110, 101, 119, 45, 112, 97, 116, 104, 115, - 0, 46, 4, 0, 9, 114, 101, 110, 97, 109, 101, 45, 97, 116, 1, 73, 1, 64, 3, 4, 116, 104, 105, - 115, 32, 8, 111, 108, 100, 45, 112, 97, 116, 104, 115, 8, 110, 101, 119, 45, 112, 97, 116, 104, - 115, 0, 46, 4, 0, 10, 115, 121, 109, 108, 105, 110, 107, 45, 97, 116, 1, 74, 1, 64, 4, 4, 116, - 104, 105, 115, 32, 10, 112, 97, 116, 104, 45, 102, 108, 97, 103, 115, 7, 4, 112, 97, 116, 104, - 115, 4, 116, 121, 112, 101, 40, 0, 46, 4, 0, 9, 97, 99, 99, 101, 115, 115, 45, 97, 116, 1, 75, - 4, 0, 14, 117, 110, 108, 105, 110, 107, 45, 102, 105, 108, 101, 45, 97, 116, 1, 63, 1, 64, 4, - 4, 116, 104, 105, 115, 32, 10, 112, 97, 116, 104, 45, 102, 108, 97, 103, 115, 7, 4, 112, 97, - 116, 104, 115, 5, 109, 111, 100, 101, 115, 11, 0, 46, 4, 0, 26, 99, 104, 97, 110, 103, 101, 45, - 102, 105, 108, 101, 45, 112, 101, 114, 109, 105, 115, 115, 105, 111, 110, 115, 45, 97, 116, 1, - 76, 4, 0, 31, 99, 104, 97, 110, 103, 101, 45, 100, 105, 114, 101, 99, 116, 111, 114, 121, 45, - 112, 101, 114, 109, 105, 115, 115, 105, 111, 110, 115, 45, 97, 116, 1, 76, 4, 0, 11, 108, 111, - 99, 107, 45, 115, 104, 97, 114, 101, 100, 1, 48, 4, 0, 14, 108, 111, 99, 107, 45, 101, 120, 99, - 108, 117, 115, 105, 118, 101, 1, 48, 4, 0, 15, 116, 114, 121, 45, 108, 111, 99, 107, 45, 115, - 104, 97, 114, 101, 100, 1, 48, 4, 0, 18, 116, 114, 121, 45, 108, 111, 99, 107, 45, 101, 120, - 99, 108, 117, 115, 105, 118, 101, 1, 48, 4, 0, 6, 117, 110, 108, 111, 99, 107, 1, 48, 1, 64, 1, - 4, 116, 104, 105, 115, 32, 1, 0, 4, 0, 15, 100, 114, 111, 112, 45, 100, 101, 115, 99, 114, 105, - 112, 116, 111, 114, 1, 77, 1, 107, 28, 1, 106, 1, 206, 0, 1, 19, 1, 64, 1, 4, 116, 104, 105, - 115, 21, 0, 207, 0, 4, 0, 20, 114, 101, 97, 100, 45, 100, 105, 114, 101, 99, 116, 111, 114, - 121, 45, 101, 110, 116, 114, 121, 1, 80, 1, 64, 1, 4, 116, 104, 105, 115, 21, 1, 0, 4, 0, 27, - 100, 114, 111, 112, 45, 100, 105, 114, 101, 99, 116, 111, 114, 121, 45, 101, 110, 116, 114, - 121, 45, 115, 116, 114, 101, 97, 109, 1, 81, 3, 1, 26, 119, 97, 115, 105, 58, 102, 105, 108, - 101, 115, 121, 115, 116, 101, 109, 47, 102, 105, 108, 101, 115, 121, 115, 116, 101, 109, 5, 8, - 2, 3, 0, 4, 10, 100, 101, 115, 99, 114, 105, 112, 116, 111, 114, 1, 66, 10, 2, 3, 2, 1, 9, 4, - 0, 10, 100, 101, 115, 99, 114, 105, 112, 116, 111, 114, 3, 0, 0, 2, 3, 2, 1, 5, 4, 0, 12, 105, - 110, 112, 117, 116, 45, 115, 116, 114, 101, 97, 109, 3, 0, 2, 2, 3, 2, 1, 6, 4, 0, 13, 111, - 117, 116, 112, 117, 116, 45, 115, 116, 114, 101, 97, 109, 3, 0, 4, 1, 111, 2, 1, 115, 1, 112, - 6, 1, 64, 0, 0, 7, 4, 0, 15, 103, 101, 116, 45, 100, 105, 114, 101, 99, 116, 111, 114, 105, - 101, 115, 1, 8, 3, 1, 22, 119, 97, 115, 105, 58, 99, 108, 105, 45, 98, 97, 115, 101, 47, 112, - 114, 101, 111, 112, 101, 110, 115, 5, 10, 1, 66, 3, 1, 106, 0, 0, 1, 64, 1, 6, 115, 116, 97, - 116, 117, 115, 0, 1, 0, 4, 0, 4, 101, 120, 105, 116, 1, 1, 3, 1, 18, 119, 97, 115, 105, 58, 99, - 108, 105, 45, 98, 97, 115, 101, 47, 101, 120, 105, 116, 5, 11, 3, 0, 13, 111, 117, 116, 112, - 117, 116, 45, 115, 116, 114, 101, 97, 109, 3, 0, 6, 2, 3, 0, 4, 15, 100, 101, 115, 99, 114, - 105, 112, 116, 111, 114, 45, 115, 116, 97, 116, 3, 0, 15, 100, 101, 115, 99, 114, 105, 112, - 116, 111, 114, 45, 115, 116, 97, 116, 3, 0, 13, 1, 112, 115, 1, 64, 1, 1, 115, 15, 0, 121, 4, - 0, 11, 97, 100, 100, 45, 115, 116, 114, 105, 110, 103, 115, 1, 16, 1, 64, 0, 0, 15, 4, 0, 11, - 103, 101, 116, 45, 115, 116, 114, 105, 110, 103, 115, 1, 17, 1, 106, 0, 0, 1, 64, 1, 1, 111, - 12, 0, 18, 4, 0, 16, 119, 114, 105, 116, 101, 45, 115, 116, 114, 105, 110, 103, 115, 45, 116, - 111, 1, 19, 1, 64, 1, 1, 100, 14, 0, 115, 4, 0, 23, 112, 97, 115, 115, 45, 97, 110, 45, 105, - 109, 112, 111, 114, 116, 101, 100, 45, 114, 101, 99, 111, 114, 100, 1, 20, 4, 1, 24, 117, 110, - 117, 115, 101, 100, 58, 109, 97, 105, 110, 47, 116, 101, 115, 116, 45, 114, 101, 97, 99, 116, - 111, 114, 4, 1, 0, 69, 9, 112, 114, 111, 100, 117, 99, 101, 114, 115, 1, 12, 112, 114, 111, 99, - 101, 115, 115, 101, 100, 45, 98, 121, 2, 13, 119, 105, 116, 45, 99, 111, 109, 112, 111, 110, - 101, 110, 116, 6, 48, 46, 49, 49, 46, 48, 16, 119, 105, 116, 45, 98, 105, 110, 100, 103, 101, - 110, 45, 114, 117, 115, 116, 5, 48, 46, 56, 46, 48, 11, 21, 1, 1, 15, 117, 110, 117, 115, 101, - 100, 58, 109, 97, 105, 110, 47, 119, 105, 116, 3, 0, 0, -]; +// #[cfg(target_arch = "wasm32")] +// #[link_section = "component-type:command"] +// #[doc(hidden)] +// pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 12651] = [ +// 3, 0, 7, 99, 111, 109, 109, 97, 110, 100, 0, 97, 115, 109, 13, 0, 1, 0, 7, 248, 97, 1, 65, 4, +// 1, 65, 56, 1, 66, 5, 1, 114, 2, 7, 115, 101, 99, 111, 110, 100, 115, 119, 11, 110, 97, 110, +// 111, 115, 101, 99, 111, 110, 100, 115, 121, 4, 0, 8, 100, 97, 116, 101, 116, 105, 109, 101, 3, +// 0, 0, 1, 64, 0, 0, 1, 4, 0, 3, 110, 111, 119, 1, 2, 4, 0, 10, 114, 101, 115, 111, 108, 117, +// 116, 105, 111, 110, 1, 2, 3, 1, 22, 119, 97, 115, 105, 58, 99, 108, 111, 99, 107, 115, 47, 119, +// 97, 108, 108, 45, 99, 108, 111, 99, 107, 5, 0, 1, 66, 8, 1, 121, 4, 0, 8, 112, 111, 108, 108, +// 97, 98, 108, 101, 3, 0, 0, 1, 64, 1, 4, 116, 104, 105, 115, 1, 1, 0, 4, 0, 13, 100, 114, 111, +// 112, 45, 112, 111, 108, 108, 97, 98, 108, 101, 1, 2, 1, 112, 1, 1, 112, 127, 1, 64, 1, 2, 105, +// 110, 3, 0, 4, 4, 0, 11, 112, 111, 108, 108, 45, 111, 110, 101, 111, 102, 102, 1, 5, 3, 1, 14, +// 119, 97, 115, 105, 58, 112, 111, 108, 108, 47, 112, 111, 108, 108, 5, 1, 2, 3, 0, 1, 8, 112, +// 111, 108, 108, 97, 98, 108, 101, 1, 66, 9, 2, 3, 2, 1, 2, 4, 0, 8, 112, 111, 108, 108, 97, 98, +// 108, 101, 3, 0, 0, 1, 119, 4, 0, 7, 105, 110, 115, 116, 97, 110, 116, 3, 0, 2, 1, 64, 0, 0, 3, +// 4, 0, 3, 110, 111, 119, 1, 4, 4, 0, 10, 114, 101, 115, 111, 108, 117, 116, 105, 111, 110, 1, 4, +// 1, 64, 2, 4, 119, 104, 101, 110, 3, 8, 97, 98, 115, 111, 108, 117, 116, 101, 127, 0, 1, 4, 0, +// 9, 115, 117, 98, 115, 99, 114, 105, 98, 101, 1, 5, 3, 1, 27, 119, 97, 115, 105, 58, 99, 108, +// 111, 99, 107, 115, 47, 109, 111, 110, 111, 116, 111, 110, 105, 99, 45, 99, 108, 111, 99, 107, +// 5, 3, 2, 3, 0, 0, 8, 100, 97, 116, 101, 116, 105, 109, 101, 1, 66, 12, 2, 3, 2, 1, 4, 4, 0, 8, +// 100, 97, 116, 101, 116, 105, 109, 101, 3, 0, 0, 1, 114, 3, 10, 117, 116, 99, 45, 111, 102, 102, +// 115, 101, 116, 122, 4, 110, 97, 109, 101, 115, 23, 105, 110, 45, 100, 97, 121, 108, 105, 103, +// 104, 116, 45, 115, 97, 118, 105, 110, 103, 45, 116, 105, 109, 101, 127, 4, 0, 16, 116, 105, +// 109, 101, 122, 111, 110, 101, 45, 100, 105, 115, 112, 108, 97, 121, 3, 0, 2, 1, 121, 4, 0, 8, +// 116, 105, 109, 101, 122, 111, 110, 101, 3, 0, 4, 1, 64, 2, 4, 116, 104, 105, 115, 5, 4, 119, +// 104, 101, 110, 1, 0, 3, 4, 0, 7, 100, 105, 115, 112, 108, 97, 121, 1, 6, 1, 64, 2, 4, 116, 104, +// 105, 115, 5, 4, 119, 104, 101, 110, 1, 0, 122, 4, 0, 10, 117, 116, 99, 45, 111, 102, 102, 115, +// 101, 116, 1, 7, 1, 64, 1, 4, 116, 104, 105, 115, 5, 1, 0, 4, 0, 13, 100, 114, 111, 112, 45, +// 116, 105, 109, 101, 122, 111, 110, 101, 1, 8, 3, 1, 20, 119, 97, 115, 105, 58, 99, 108, 111, +// 99, 107, 115, 47, 116, 105, 109, 101, 122, 111, 110, 101, 5, 5, 1, 66, 39, 2, 3, 2, 1, 2, 4, 0, +// 8, 112, 111, 108, 108, 97, 98, 108, 101, 3, 0, 0, 1, 114, 0, 4, 0, 12, 115, 116, 114, 101, 97, +// 109, 45, 101, 114, 114, 111, 114, 3, 0, 2, 1, 121, 4, 0, 13, 111, 117, 116, 112, 117, 116, 45, +// 115, 116, 114, 101, 97, 109, 3, 0, 4, 1, 121, 4, 0, 12, 105, 110, 112, 117, 116, 45, 115, 116, +// 114, 101, 97, 109, 3, 0, 6, 1, 112, 125, 1, 111, 2, 8, 127, 1, 106, 1, 9, 1, 3, 1, 64, 2, 4, +// 116, 104, 105, 115, 7, 3, 108, 101, 110, 119, 0, 10, 4, 0, 4, 114, 101, 97, 100, 1, 11, 4, 0, +// 13, 98, 108, 111, 99, 107, 105, 110, 103, 45, 114, 101, 97, 100, 1, 11, 1, 111, 2, 119, 127, 1, +// 106, 1, 12, 1, 3, 1, 64, 2, 4, 116, 104, 105, 115, 7, 3, 108, 101, 110, 119, 0, 13, 4, 0, 4, +// 115, 107, 105, 112, 1, 14, 4, 0, 13, 98, 108, 111, 99, 107, 105, 110, 103, 45, 115, 107, 105, +// 112, 1, 14, 1, 64, 1, 4, 116, 104, 105, 115, 7, 0, 1, 4, 0, 25, 115, 117, 98, 115, 99, 114, +// 105, 98, 101, 45, 116, 111, 45, 105, 110, 112, 117, 116, 45, 115, 116, 114, 101, 97, 109, 1, +// 15, 1, 64, 1, 4, 116, 104, 105, 115, 7, 1, 0, 4, 0, 17, 100, 114, 111, 112, 45, 105, 110, 112, +// 117, 116, 45, 115, 116, 114, 101, 97, 109, 1, 16, 1, 106, 1, 119, 1, 3, 1, 64, 2, 4, 116, 104, +// 105, 115, 5, 3, 98, 117, 102, 8, 0, 17, 4, 0, 5, 119, 114, 105, 116, 101, 1, 18, 4, 0, 14, 98, +// 108, 111, 99, 107, 105, 110, 103, 45, 119, 114, 105, 116, 101, 1, 18, 1, 64, 2, 4, 116, 104, +// 105, 115, 5, 3, 108, 101, 110, 119, 0, 17, 4, 0, 12, 119, 114, 105, 116, 101, 45, 122, 101, +// 114, 111, 101, 115, 1, 19, 4, 0, 21, 98, 108, 111, 99, 107, 105, 110, 103, 45, 119, 114, 105, +// 116, 101, 45, 122, 101, 114, 111, 101, 115, 1, 19, 1, 64, 3, 4, 116, 104, 105, 115, 5, 3, 115, +// 114, 99, 7, 3, 108, 101, 110, 119, 0, 13, 4, 0, 6, 115, 112, 108, 105, 99, 101, 1, 20, 4, 0, +// 15, 98, 108, 111, 99, 107, 105, 110, 103, 45, 115, 112, 108, 105, 99, 101, 1, 20, 1, 64, 2, 4, +// 116, 104, 105, 115, 5, 3, 115, 114, 99, 7, 0, 17, 4, 0, 7, 102, 111, 114, 119, 97, 114, 100, 1, +// 21, 1, 64, 1, 4, 116, 104, 105, 115, 5, 0, 1, 4, 0, 26, 115, 117, 98, 115, 99, 114, 105, 98, +// 101, 45, 116, 111, 45, 111, 117, 116, 112, 117, 116, 45, 115, 116, 114, 101, 97, 109, 1, 22, 1, +// 64, 1, 4, 116, 104, 105, 115, 5, 1, 0, 4, 0, 18, 100, 114, 111, 112, 45, 111, 117, 116, 112, +// 117, 116, 45, 115, 116, 114, 101, 97, 109, 1, 23, 3, 1, 15, 119, 97, 115, 105, 58, 105, 111, +// 47, 115, 116, 114, 101, 97, 109, 115, 5, 6, 2, 3, 0, 4, 12, 105, 110, 112, 117, 116, 45, 115, +// 116, 114, 101, 97, 109, 2, 3, 0, 4, 13, 111, 117, 116, 112, 117, 116, 45, 115, 116, 114, 101, +// 97, 109, 1, 66, 117, 2, 3, 2, 1, 7, 4, 0, 12, 105, 110, 112, 117, 116, 45, 115, 116, 114, 101, +// 97, 109, 3, 0, 0, 2, 3, 2, 1, 8, 4, 0, 13, 111, 117, 116, 112, 117, 116, 45, 115, 116, 114, +// 101, 97, 109, 3, 0, 2, 2, 3, 2, 1, 4, 4, 0, 8, 100, 97, 116, 101, 116, 105, 109, 101, 3, 0, 4, +// 1, 110, 1, 14, 115, 121, 109, 108, 105, 110, 107, 45, 102, 111, 108, 108, 111, 119, 4, 0, 10, +// 112, 97, 116, 104, 45, 102, 108, 97, 103, 115, 3, 0, 6, 1, 110, 4, 6, 99, 114, 101, 97, 116, +// 101, 9, 100, 105, 114, 101, 99, 116, 111, 114, 121, 9, 101, 120, 99, 108, 117, 115, 105, 118, +// 101, 8, 116, 114, 117, 110, 99, 97, 116, 101, 4, 0, 10, 111, 112, 101, 110, 45, 102, 108, 97, +// 103, 115, 3, 0, 8, 1, 110, 3, 8, 114, 101, 97, 100, 97, 98, 108, 101, 8, 119, 114, 105, 116, +// 97, 98, 108, 101, 10, 101, 120, 101, 99, 117, 116, 97, 98, 108, 101, 4, 0, 5, 109, 111, 100, +// 101, 115, 3, 0, 10, 1, 119, 4, 0, 10, 108, 105, 110, 107, 45, 99, 111, 117, 110, 116, 3, 0, 12, +// 1, 119, 4, 0, 5, 105, 110, 111, 100, 101, 3, 0, 14, 1, 119, 4, 0, 8, 102, 105, 108, 101, 115, +// 105, 122, 101, 3, 0, 16, 1, 109, 37, 6, 97, 99, 99, 101, 115, 115, 11, 119, 111, 117, 108, 100, +// 45, 98, 108, 111, 99, 107, 7, 97, 108, 114, 101, 97, 100, 121, 14, 98, 97, 100, 45, 100, 101, +// 115, 99, 114, 105, 112, 116, 111, 114, 4, 98, 117, 115, 121, 8, 100, 101, 97, 100, 108, 111, +// 99, 107, 5, 113, 117, 111, 116, 97, 5, 101, 120, 105, 115, 116, 14, 102, 105, 108, 101, 45, +// 116, 111, 111, 45, 108, 97, 114, 103, 101, 21, 105, 108, 108, 101, 103, 97, 108, 45, 98, 121, +// 116, 101, 45, 115, 101, 113, 117, 101, 110, 99, 101, 11, 105, 110, 45, 112, 114, 111, 103, 114, +// 101, 115, 115, 11, 105, 110, 116, 101, 114, 114, 117, 112, 116, 101, 100, 7, 105, 110, 118, 97, +// 108, 105, 100, 2, 105, 111, 12, 105, 115, 45, 100, 105, 114, 101, 99, 116, 111, 114, 121, 4, +// 108, 111, 111, 112, 14, 116, 111, 111, 45, 109, 97, 110, 121, 45, 108, 105, 110, 107, 115, 12, +// 109, 101, 115, 115, 97, 103, 101, 45, 115, 105, 122, 101, 13, 110, 97, 109, 101, 45, 116, 111, +// 111, 45, 108, 111, 110, 103, 9, 110, 111, 45, 100, 101, 118, 105, 99, 101, 8, 110, 111, 45, +// 101, 110, 116, 114, 121, 7, 110, 111, 45, 108, 111, 99, 107, 19, 105, 110, 115, 117, 102, 102, +// 105, 99, 105, 101, 110, 116, 45, 109, 101, 109, 111, 114, 121, 18, 105, 110, 115, 117, 102, +// 102, 105, 99, 105, 101, 110, 116, 45, 115, 112, 97, 99, 101, 13, 110, 111, 116, 45, 100, 105, +// 114, 101, 99, 116, 111, 114, 121, 9, 110, 111, 116, 45, 101, 109, 112, 116, 121, 15, 110, 111, +// 116, 45, 114, 101, 99, 111, 118, 101, 114, 97, 98, 108, 101, 11, 117, 110, 115, 117, 112, 112, +// 111, 114, 116, 101, 100, 6, 110, 111, 45, 116, 116, 121, 14, 110, 111, 45, 115, 117, 99, 104, +// 45, 100, 101, 118, 105, 99, 101, 8, 111, 118, 101, 114, 102, 108, 111, 119, 13, 110, 111, 116, +// 45, 112, 101, 114, 109, 105, 116, 116, 101, 100, 4, 112, 105, 112, 101, 9, 114, 101, 97, 100, +// 45, 111, 110, 108, 121, 12, 105, 110, 118, 97, 108, 105, 100, 45, 115, 101, 101, 107, 14, 116, +// 101, 120, 116, 45, 102, 105, 108, 101, 45, 98, 117, 115, 121, 12, 99, 114, 111, 115, 115, 45, +// 100, 101, 118, 105, 99, 101, 4, 0, 10, 101, 114, 114, 111, 114, 45, 99, 111, 100, 101, 3, 0, +// 18, 1, 121, 4, 0, 22, 100, 105, 114, 101, 99, 116, 111, 114, 121, 45, 101, 110, 116, 114, 121, +// 45, 115, 116, 114, 101, 97, 109, 3, 0, 20, 1, 119, 4, 0, 6, 100, 101, 118, 105, 99, 101, 3, 0, +// 22, 1, 109, 8, 7, 117, 110, 107, 110, 111, 119, 110, 12, 98, 108, 111, 99, 107, 45, 100, 101, +// 118, 105, 99, 101, 16, 99, 104, 97, 114, 97, 99, 116, 101, 114, 45, 100, 101, 118, 105, 99, +// 101, 9, 100, 105, 114, 101, 99, 116, 111, 114, 121, 4, 102, 105, 102, 111, 13, 115, 121, 109, +// 98, 111, 108, 105, 99, 45, 108, 105, 110, 107, 12, 114, 101, 103, 117, 108, 97, 114, 45, 102, +// 105, 108, 101, 6, 115, 111, 99, 107, 101, 116, 4, 0, 15, 100, 101, 115, 99, 114, 105, 112, 116, +// 111, 114, 45, 116, 121, 112, 101, 3, 0, 24, 1, 107, 15, 1, 114, 3, 5, 105, 110, 111, 100, 101, +// 26, 4, 116, 121, 112, 101, 25, 4, 110, 97, 109, 101, 115, 4, 0, 15, 100, 105, 114, 101, 99, +// 116, 111, 114, 121, 45, 101, 110, 116, 114, 121, 3, 0, 27, 1, 110, 6, 4, 114, 101, 97, 100, 5, +// 119, 114, 105, 116, 101, 19, 102, 105, 108, 101, 45, 105, 110, 116, 101, 103, 114, 105, 116, +// 121, 45, 115, 121, 110, 99, 19, 100, 97, 116, 97, 45, 105, 110, 116, 101, 103, 114, 105, 116, +// 121, 45, 115, 121, 110, 99, 20, 114, 101, 113, 117, 101, 115, 116, 101, 100, 45, 119, 114, 105, +// 116, 101, 45, 115, 121, 110, 99, 16, 109, 117, 116, 97, 116, 101, 45, 100, 105, 114, 101, 99, +// 116, 111, 114, 121, 4, 0, 16, 100, 101, 115, 99, 114, 105, 112, 116, 111, 114, 45, 102, 108, +// 97, 103, 115, 3, 0, 29, 1, 121, 4, 0, 10, 100, 101, 115, 99, 114, 105, 112, 116, 111, 114, 3, +// 0, 31, 1, 113, 3, 9, 110, 111, 45, 99, 104, 97, 110, 103, 101, 0, 0, 3, 110, 111, 119, 0, 0, 9, +// 116, 105, 109, 101, 115, 116, 97, 109, 112, 1, 5, 0, 4, 0, 13, 110, 101, 119, 45, 116, 105, +// 109, 101, 115, 116, 97, 109, 112, 3, 0, 33, 1, 114, 8, 6, 100, 101, 118, 105, 99, 101, 23, 5, +// 105, 110, 111, 100, 101, 15, 4, 116, 121, 112, 101, 25, 10, 108, 105, 110, 107, 45, 99, 111, +// 117, 110, 116, 13, 4, 115, 105, 122, 101, 17, 21, 100, 97, 116, 97, 45, 97, 99, 99, 101, 115, +// 115, 45, 116, 105, 109, 101, 115, 116, 97, 109, 112, 5, 27, 100, 97, 116, 97, 45, 109, 111, +// 100, 105, 102, 105, 99, 97, 116, 105, 111, 110, 45, 116, 105, 109, 101, 115, 116, 97, 109, 112, +// 5, 23, 115, 116, 97, 116, 117, 115, 45, 99, 104, 97, 110, 103, 101, 45, 116, 105, 109, 101, +// 115, 116, 97, 109, 112, 5, 4, 0, 15, 100, 101, 115, 99, 114, 105, 112, 116, 111, 114, 45, 115, +// 116, 97, 116, 3, 0, 35, 1, 109, 6, 6, 110, 111, 114, 109, 97, 108, 10, 115, 101, 113, 117, 101, +// 110, 116, 105, 97, 108, 6, 114, 97, 110, 100, 111, 109, 9, 119, 105, 108, 108, 45, 110, 101, +// 101, 100, 9, 100, 111, 110, 116, 45, 110, 101, 101, 100, 8, 110, 111, 45, 114, 101, 117, 115, +// 101, 4, 0, 6, 97, 100, 118, 105, 99, 101, 3, 0, 37, 1, 113, 2, 6, 97, 99, 99, 101, 115, 115, 1, +// 11, 0, 6, 101, 120, 105, 115, 116, 115, 0, 0, 4, 0, 11, 97, 99, 99, 101, 115, 115, 45, 116, +// 121, 112, 101, 3, 0, 39, 1, 106, 1, 1, 1, 19, 1, 64, 2, 4, 116, 104, 105, 115, 32, 6, 111, 102, +// 102, 115, 101, 116, 17, 0, 41, 4, 0, 15, 114, 101, 97, 100, 45, 118, 105, 97, 45, 115, 116, +// 114, 101, 97, 109, 1, 42, 1, 106, 1, 3, 1, 19, 1, 64, 2, 4, 116, 104, 105, 115, 32, 6, 111, +// 102, 102, 115, 101, 116, 17, 0, 43, 4, 0, 16, 119, 114, 105, 116, 101, 45, 118, 105, 97, 45, +// 115, 116, 114, 101, 97, 109, 1, 44, 1, 64, 1, 4, 116, 104, 105, 115, 32, 0, 43, 4, 0, 17, 97, +// 112, 112, 101, 110, 100, 45, 118, 105, 97, 45, 115, 116, 114, 101, 97, 109, 1, 45, 1, 106, 0, +// 1, 19, 1, 64, 4, 4, 116, 104, 105, 115, 32, 6, 111, 102, 102, 115, 101, 116, 17, 6, 108, 101, +// 110, 103, 116, 104, 17, 6, 97, 100, 118, 105, 99, 101, 38, 0, 46, 4, 0, 6, 97, 100, 118, 105, +// 115, 101, 1, 47, 1, 64, 1, 4, 116, 104, 105, 115, 32, 0, 46, 4, 0, 9, 115, 121, 110, 99, 45, +// 100, 97, 116, 97, 1, 48, 1, 106, 1, 30, 1, 19, 1, 64, 1, 4, 116, 104, 105, 115, 32, 0, 49, 4, +// 0, 9, 103, 101, 116, 45, 102, 108, 97, 103, 115, 1, 50, 1, 106, 1, 25, 1, 19, 1, 64, 1, 4, 116, +// 104, 105, 115, 32, 0, 51, 4, 0, 8, 103, 101, 116, 45, 116, 121, 112, 101, 1, 52, 1, 64, 2, 4, +// 116, 104, 105, 115, 32, 4, 115, 105, 122, 101, 17, 0, 46, 4, 0, 8, 115, 101, 116, 45, 115, 105, +// 122, 101, 1, 53, 1, 64, 3, 4, 116, 104, 105, 115, 32, 21, 100, 97, 116, 97, 45, 97, 99, 99, +// 101, 115, 115, 45, 116, 105, 109, 101, 115, 116, 97, 109, 112, 34, 27, 100, 97, 116, 97, 45, +// 109, 111, 100, 105, 102, 105, 99, 97, 116, 105, 111, 110, 45, 116, 105, 109, 101, 115, 116, 97, +// 109, 112, 34, 0, 46, 4, 0, 9, 115, 101, 116, 45, 116, 105, 109, 101, 115, 1, 54, 1, 112, 125, +// 1, 111, 2, 55, 127, 1, 106, 1, 56, 1, 19, 1, 64, 3, 4, 116, 104, 105, 115, 32, 6, 108, 101, +// 110, 103, 116, 104, 17, 6, 111, 102, 102, 115, 101, 116, 17, 0, 57, 4, 0, 4, 114, 101, 97, 100, +// 1, 58, 1, 106, 1, 17, 1, 19, 1, 64, 3, 4, 116, 104, 105, 115, 32, 6, 98, 117, 102, 102, 101, +// 114, 55, 6, 111, 102, 102, 115, 101, 116, 17, 0, 59, 4, 0, 5, 119, 114, 105, 116, 101, 1, 60, +// 1, 106, 1, 21, 1, 19, 1, 64, 1, 4, 116, 104, 105, 115, 32, 0, 61, 4, 0, 14, 114, 101, 97, 100, +// 45, 100, 105, 114, 101, 99, 116, 111, 114, 121, 1, 62, 4, 0, 4, 115, 121, 110, 99, 1, 48, 1, +// 64, 2, 4, 116, 104, 105, 115, 32, 4, 112, 97, 116, 104, 115, 0, 46, 4, 0, 19, 99, 114, 101, 97, +// 116, 101, 45, 100, 105, 114, 101, 99, 116, 111, 114, 121, 45, 97, 116, 1, 63, 1, 106, 1, 36, 1, +// 19, 1, 64, 1, 4, 116, 104, 105, 115, 32, 0, 192, 0, 4, 0, 4, 115, 116, 97, 116, 1, 65, 1, 64, +// 3, 4, 116, 104, 105, 115, 32, 10, 112, 97, 116, 104, 45, 102, 108, 97, 103, 115, 7, 4, 112, 97, +// 116, 104, 115, 0, 192, 0, 4, 0, 7, 115, 116, 97, 116, 45, 97, 116, 1, 66, 1, 64, 5, 4, 116, +// 104, 105, 115, 32, 10, 112, 97, 116, 104, 45, 102, 108, 97, 103, 115, 7, 4, 112, 97, 116, 104, +// 115, 21, 100, 97, 116, 97, 45, 97, 99, 99, 101, 115, 115, 45, 116, 105, 109, 101, 115, 116, 97, +// 109, 112, 34, 27, 100, 97, 116, 97, 45, 109, 111, 100, 105, 102, 105, 99, 97, 116, 105, 111, +// 110, 45, 116, 105, 109, 101, 115, 116, 97, 109, 112, 34, 0, 46, 4, 0, 12, 115, 101, 116, 45, +// 116, 105, 109, 101, 115, 45, 97, 116, 1, 67, 1, 64, 5, 4, 116, 104, 105, 115, 32, 14, 111, 108, +// 100, 45, 112, 97, 116, 104, 45, 102, 108, 97, 103, 115, 7, 8, 111, 108, 100, 45, 112, 97, 116, +// 104, 115, 14, 110, 101, 119, 45, 100, 101, 115, 99, 114, 105, 112, 116, 111, 114, 32, 8, 110, +// 101, 119, 45, 112, 97, 116, 104, 115, 0, 46, 4, 0, 7, 108, 105, 110, 107, 45, 97, 116, 1, 68, +// 1, 106, 1, 32, 1, 19, 1, 64, 6, 4, 116, 104, 105, 115, 32, 10, 112, 97, 116, 104, 45, 102, 108, +// 97, 103, 115, 7, 4, 112, 97, 116, 104, 115, 10, 111, 112, 101, 110, 45, 102, 108, 97, 103, 115, +// 9, 5, 102, 108, 97, 103, 115, 30, 5, 109, 111, 100, 101, 115, 11, 0, 197, 0, 4, 0, 7, 111, 112, +// 101, 110, 45, 97, 116, 1, 70, 1, 106, 1, 115, 1, 19, 1, 64, 2, 4, 116, 104, 105, 115, 32, 4, +// 112, 97, 116, 104, 115, 0, 199, 0, 4, 0, 11, 114, 101, 97, 100, 108, 105, 110, 107, 45, 97, +// 116, 1, 72, 4, 0, 19, 114, 101, 109, 111, 118, 101, 45, 100, 105, 114, 101, 99, 116, 111, 114, +// 121, 45, 97, 116, 1, 63, 1, 64, 4, 4, 116, 104, 105, 115, 32, 8, 111, 108, 100, 45, 112, 97, +// 116, 104, 115, 14, 110, 101, 119, 45, 100, 101, 115, 99, 114, 105, 112, 116, 111, 114, 32, 8, +// 110, 101, 119, 45, 112, 97, 116, 104, 115, 0, 46, 4, 0, 9, 114, 101, 110, 97, 109, 101, 45, 97, +// 116, 1, 73, 1, 64, 3, 4, 116, 104, 105, 115, 32, 8, 111, 108, 100, 45, 112, 97, 116, 104, 115, +// 8, 110, 101, 119, 45, 112, 97, 116, 104, 115, 0, 46, 4, 0, 10, 115, 121, 109, 108, 105, 110, +// 107, 45, 97, 116, 1, 74, 1, 64, 4, 4, 116, 104, 105, 115, 32, 10, 112, 97, 116, 104, 45, 102, +// 108, 97, 103, 115, 7, 4, 112, 97, 116, 104, 115, 4, 116, 121, 112, 101, 40, 0, 46, 4, 0, 9, 97, +// 99, 99, 101, 115, 115, 45, 97, 116, 1, 75, 4, 0, 14, 117, 110, 108, 105, 110, 107, 45, 102, +// 105, 108, 101, 45, 97, 116, 1, 63, 1, 64, 4, 4, 116, 104, 105, 115, 32, 10, 112, 97, 116, 104, +// 45, 102, 108, 97, 103, 115, 7, 4, 112, 97, 116, 104, 115, 5, 109, 111, 100, 101, 115, 11, 0, +// 46, 4, 0, 26, 99, 104, 97, 110, 103, 101, 45, 102, 105, 108, 101, 45, 112, 101, 114, 109, 105, +// 115, 115, 105, 111, 110, 115, 45, 97, 116, 1, 76, 4, 0, 31, 99, 104, 97, 110, 103, 101, 45, +// 100, 105, 114, 101, 99, 116, 111, 114, 121, 45, 112, 101, 114, 109, 105, 115, 115, 105, 111, +// 110, 115, 45, 97, 116, 1, 76, 4, 0, 11, 108, 111, 99, 107, 45, 115, 104, 97, 114, 101, 100, 1, +// 48, 4, 0, 14, 108, 111, 99, 107, 45, 101, 120, 99, 108, 117, 115, 105, 118, 101, 1, 48, 4, 0, +// 15, 116, 114, 121, 45, 108, 111, 99, 107, 45, 115, 104, 97, 114, 101, 100, 1, 48, 4, 0, 18, +// 116, 114, 121, 45, 108, 111, 99, 107, 45, 101, 120, 99, 108, 117, 115, 105, 118, 101, 1, 48, 4, +// 0, 6, 117, 110, 108, 111, 99, 107, 1, 48, 1, 64, 1, 4, 116, 104, 105, 115, 32, 1, 0, 4, 0, 15, +// 100, 114, 111, 112, 45, 100, 101, 115, 99, 114, 105, 112, 116, 111, 114, 1, 77, 1, 107, 28, 1, +// 106, 1, 206, 0, 1, 19, 1, 64, 1, 4, 116, 104, 105, 115, 21, 0, 207, 0, 4, 0, 20, 114, 101, 97, +// 100, 45, 100, 105, 114, 101, 99, 116, 111, 114, 121, 45, 101, 110, 116, 114, 121, 1, 80, 1, 64, +// 1, 4, 116, 104, 105, 115, 21, 1, 0, 4, 0, 27, 100, 114, 111, 112, 45, 100, 105, 114, 101, 99, +// 116, 111, 114, 121, 45, 101, 110, 116, 114, 121, 45, 115, 116, 114, 101, 97, 109, 1, 81, 3, 1, +// 26, 119, 97, 115, 105, 58, 102, 105, 108, 101, 115, 121, 115, 116, 101, 109, 47, 102, 105, 108, +// 101, 115, 121, 115, 116, 101, 109, 5, 9, 1, 66, 20, 1, 121, 4, 0, 7, 110, 101, 116, 119, 111, +// 114, 107, 3, 0, 0, 1, 111, 8, 123, 123, 123, 123, 123, 123, 123, 123, 4, 0, 12, 105, 112, 118, +// 54, 45, 97, 100, 100, 114, 101, 115, 115, 3, 0, 2, 1, 114, 4, 4, 112, 111, 114, 116, 123, 9, +// 102, 108, 111, 119, 45, 105, 110, 102, 111, 121, 7, 97, 100, 100, 114, 101, 115, 115, 3, 8, +// 115, 99, 111, 112, 101, 45, 105, 100, 121, 4, 0, 19, 105, 112, 118, 54, 45, 115, 111, 99, 107, +// 101, 116, 45, 97, 100, 100, 114, 101, 115, 115, 3, 0, 4, 1, 111, 4, 125, 125, 125, 125, 4, 0, +// 12, 105, 112, 118, 52, 45, 97, 100, 100, 114, 101, 115, 115, 3, 0, 6, 1, 114, 2, 4, 112, 111, +// 114, 116, 123, 7, 97, 100, 100, 114, 101, 115, 115, 7, 4, 0, 19, 105, 112, 118, 52, 45, 115, +// 111, 99, 107, 101, 116, 45, 97, 100, 100, 114, 101, 115, 115, 3, 0, 8, 1, 113, 2, 4, 105, 112, +// 118, 52, 1, 9, 0, 4, 105, 112, 118, 54, 1, 5, 0, 4, 0, 17, 105, 112, 45, 115, 111, 99, 107, +// 101, 116, 45, 97, 100, 100, 114, 101, 115, 115, 3, 0, 10, 1, 109, 2, 4, 105, 112, 118, 52, 4, +// 105, 112, 118, 54, 4, 0, 17, 105, 112, 45, 97, 100, 100, 114, 101, 115, 115, 45, 102, 97, 109, +// 105, 108, 121, 3, 0, 12, 1, 113, 2, 4, 105, 112, 118, 52, 1, 7, 0, 4, 105, 112, 118, 54, 1, 3, +// 0, 4, 0, 10, 105, 112, 45, 97, 100, 100, 114, 101, 115, 115, 3, 0, 14, 1, 109, 32, 7, 117, 110, +// 107, 110, 111, 119, 110, 13, 97, 99, 99, 101, 115, 115, 45, 100, 101, 110, 105, 101, 100, 13, +// 110, 111, 116, 45, 115, 117, 112, 112, 111, 114, 116, 101, 100, 13, 111, 117, 116, 45, 111, +// 102, 45, 109, 101, 109, 111, 114, 121, 7, 116, 105, 109, 101, 111, 117, 116, 20, 99, 111, 110, +// 99, 117, 114, 114, 101, 110, 99, 121, 45, 99, 111, 110, 102, 108, 105, 99, 116, 15, 110, 111, +// 116, 45, 105, 110, 45, 112, 114, 111, 103, 114, 101, 115, 115, 11, 119, 111, 117, 108, 100, 45, +// 98, 108, 111, 99, 107, 28, 97, 100, 100, 114, 101, 115, 115, 45, 102, 97, 109, 105, 108, 121, +// 45, 110, 111, 116, 45, 115, 117, 112, 112, 111, 114, 116, 101, 100, 23, 97, 100, 100, 114, 101, +// 115, 115, 45, 102, 97, 109, 105, 108, 121, 45, 109, 105, 115, 109, 97, 116, 99, 104, 22, 105, +// 110, 118, 97, 108, 105, 100, 45, 114, 101, 109, 111, 116, 101, 45, 97, 100, 100, 114, 101, 115, +// 115, 19, 105, 112, 118, 52, 45, 111, 110, 108, 121, 45, 111, 112, 101, 114, 97, 116, 105, 111, +// 110, 19, 105, 112, 118, 54, 45, 111, 110, 108, 121, 45, 111, 112, 101, 114, 97, 116, 105, 111, +// 110, 16, 110, 101, 119, 45, 115, 111, 99, 107, 101, 116, 45, 108, 105, 109, 105, 116, 16, 97, +// 108, 114, 101, 97, 100, 121, 45, 97, 116, 116, 97, 99, 104, 101, 100, 13, 97, 108, 114, 101, +// 97, 100, 121, 45, 98, 111, 117, 110, 100, 17, 97, 108, 114, 101, 97, 100, 121, 45, 99, 111, +// 110, 110, 101, 99, 116, 101, 100, 9, 110, 111, 116, 45, 98, 111, 117, 110, 100, 13, 110, 111, +// 116, 45, 99, 111, 110, 110, 101, 99, 116, 101, 100, 20, 97, 100, 100, 114, 101, 115, 115, 45, +// 110, 111, 116, 45, 98, 105, 110, 100, 97, 98, 108, 101, 14, 97, 100, 100, 114, 101, 115, 115, +// 45, 105, 110, 45, 117, 115, 101, 25, 101, 112, 104, 101, 109, 101, 114, 97, 108, 45, 112, 111, +// 114, 116, 115, 45, 101, 120, 104, 97, 117, 115, 116, 101, 100, 18, 114, 101, 109, 111, 116, +// 101, 45, 117, 110, 114, 101, 97, 99, 104, 97, 98, 108, 101, 17, 97, 108, 114, 101, 97, 100, +// 121, 45, 108, 105, 115, 116, 101, 110, 105, 110, 103, 13, 110, 111, 116, 45, 108, 105, 115, +// 116, 101, 110, 105, 110, 103, 18, 99, 111, 110, 110, 101, 99, 116, 105, 111, 110, 45, 114, 101, +// 102, 117, 115, 101, 100, 16, 99, 111, 110, 110, 101, 99, 116, 105, 111, 110, 45, 114, 101, 115, +// 101, 116, 18, 100, 97, 116, 97, 103, 114, 97, 109, 45, 116, 111, 111, 45, 108, 97, 114, 103, +// 101, 12, 105, 110, 118, 97, 108, 105, 100, 45, 110, 97, 109, 101, 17, 110, 97, 109, 101, 45, +// 117, 110, 114, 101, 115, 111, 108, 118, 97, 98, 108, 101, 26, 116, 101, 109, 112, 111, 114, 97, +// 114, 121, 45, 114, 101, 115, 111, 108, 118, 101, 114, 45, 102, 97, 105, 108, 117, 114, 101, 26, +// 112, 101, 114, 109, 97, 110, 101, 110, 116, 45, 114, 101, 115, 111, 108, 118, 101, 114, 45, +// 102, 97, 105, 108, 117, 114, 101, 4, 0, 10, 101, 114, 114, 111, 114, 45, 99, 111, 100, 101, 3, +// 0, 16, 1, 64, 1, 4, 116, 104, 105, 115, 1, 1, 0, 4, 0, 12, 100, 114, 111, 112, 45, 110, 101, +// 116, 119, 111, 114, 107, 1, 18, 3, 1, 20, 119, 97, 115, 105, 58, 115, 111, 99, 107, 101, 116, +// 115, 47, 110, 101, 116, 119, 111, 114, 107, 5, 10, 2, 3, 0, 6, 7, 110, 101, 116, 119, 111, 114, +// 107, 1, 66, 4, 2, 3, 2, 1, 11, 4, 0, 7, 110, 101, 116, 119, 111, 114, 107, 3, 0, 0, 1, 64, 0, +// 0, 1, 4, 0, 16, 105, 110, 115, 116, 97, 110, 99, 101, 45, 110, 101, 116, 119, 111, 114, 107, 1, +// 2, 3, 1, 29, 119, 97, 115, 105, 58, 115, 111, 99, 107, 101, 116, 115, 47, 105, 110, 115, 116, +// 97, 110, 99, 101, 45, 110, 101, 116, 119, 111, 114, 107, 5, 12, 2, 3, 0, 6, 10, 101, 114, 114, +// 111, 114, 45, 99, 111, 100, 101, 2, 3, 0, 6, 10, 105, 112, 45, 97, 100, 100, 114, 101, 115, +// 115, 2, 3, 0, 6, 17, 105, 112, 45, 97, 100, 100, 114, 101, 115, 115, 45, 102, 97, 109, 105, +// 108, 121, 1, 66, 24, 2, 3, 2, 1, 2, 4, 0, 8, 112, 111, 108, 108, 97, 98, 108, 101, 3, 0, 0, 2, +// 3, 2, 1, 11, 4, 0, 7, 110, 101, 116, 119, 111, 114, 107, 3, 0, 2, 2, 3, 2, 1, 13, 4, 0, 10, +// 101, 114, 114, 111, 114, 45, 99, 111, 100, 101, 3, 0, 4, 2, 3, 2, 1, 14, 4, 0, 10, 105, 112, +// 45, 97, 100, 100, 114, 101, 115, 115, 3, 0, 6, 2, 3, 2, 1, 15, 4, 0, 17, 105, 112, 45, 97, 100, +// 100, 114, 101, 115, 115, 45, 102, 97, 109, 105, 108, 121, 3, 0, 8, 1, 121, 4, 0, 22, 114, 101, +// 115, 111, 108, 118, 101, 45, 97, 100, 100, 114, 101, 115, 115, 45, 115, 116, 114, 101, 97, 109, +// 3, 0, 10, 1, 107, 9, 1, 106, 1, 11, 1, 5, 1, 64, 4, 7, 110, 101, 116, 119, 111, 114, 107, 3, 4, +// 110, 97, 109, 101, 115, 14, 97, 100, 100, 114, 101, 115, 115, 45, 102, 97, 109, 105, 108, 121, +// 12, 19, 105, 110, 99, 108, 117, 100, 101, 45, 117, 110, 97, 118, 97, 105, 108, 97, 98, 108, +// 101, 127, 0, 13, 4, 0, 17, 114, 101, 115, 111, 108, 118, 101, 45, 97, 100, 100, 114, 101, 115, +// 115, 101, 115, 1, 14, 1, 107, 7, 1, 106, 1, 15, 1, 5, 1, 64, 1, 4, 116, 104, 105, 115, 11, 0, +// 16, 4, 0, 20, 114, 101, 115, 111, 108, 118, 101, 45, 110, 101, 120, 116, 45, 97, 100, 100, 114, +// 101, 115, 115, 1, 17, 1, 64, 1, 4, 116, 104, 105, 115, 11, 1, 0, 4, 0, 27, 100, 114, 111, 112, +// 45, 114, 101, 115, 111, 108, 118, 101, 45, 97, 100, 100, 114, 101, 115, 115, 45, 115, 116, 114, +// 101, 97, 109, 1, 18, 1, 64, 1, 4, 116, 104, 105, 115, 11, 0, 1, 4, 0, 9, 115, 117, 98, 115, 99, +// 114, 105, 98, 101, 1, 19, 3, 1, 27, 119, 97, 115, 105, 58, 115, 111, 99, 107, 101, 116, 115, +// 47, 105, 112, 45, 110, 97, 109, 101, 45, 108, 111, 111, 107, 117, 112, 5, 16, 2, 3, 0, 6, 17, +// 105, 112, 45, 115, 111, 99, 107, 101, 116, 45, 97, 100, 100, 114, 101, 115, 115, 1, 66, 70, 2, +// 3, 2, 1, 7, 4, 0, 12, 105, 110, 112, 117, 116, 45, 115, 116, 114, 101, 97, 109, 3, 0, 0, 2, 3, +// 2, 1, 8, 4, 0, 13, 111, 117, 116, 112, 117, 116, 45, 115, 116, 114, 101, 97, 109, 3, 0, 2, 2, +// 3, 2, 1, 2, 4, 0, 8, 112, 111, 108, 108, 97, 98, 108, 101, 3, 0, 4, 2, 3, 2, 1, 11, 4, 0, 7, +// 110, 101, 116, 119, 111, 114, 107, 3, 0, 6, 2, 3, 2, 1, 13, 4, 0, 10, 101, 114, 114, 111, 114, +// 45, 99, 111, 100, 101, 3, 0, 8, 2, 3, 2, 1, 17, 4, 0, 17, 105, 112, 45, 115, 111, 99, 107, 101, +// 116, 45, 97, 100, 100, 114, 101, 115, 115, 3, 0, 10, 2, 3, 2, 1, 15, 4, 0, 17, 105, 112, 45, +// 97, 100, 100, 114, 101, 115, 115, 45, 102, 97, 109, 105, 108, 121, 3, 0, 12, 1, 121, 4, 0, 10, +// 116, 99, 112, 45, 115, 111, 99, 107, 101, 116, 3, 0, 14, 1, 109, 3, 7, 114, 101, 99, 101, 105, +// 118, 101, 4, 115, 101, 110, 100, 4, 98, 111, 116, 104, 4, 0, 13, 115, 104, 117, 116, 100, 111, +// 119, 110, 45, 116, 121, 112, 101, 3, 0, 16, 1, 106, 0, 1, 9, 1, 64, 3, 4, 116, 104, 105, 115, +// 15, 7, 110, 101, 116, 119, 111, 114, 107, 7, 13, 108, 111, 99, 97, 108, 45, 97, 100, 100, 114, +// 101, 115, 115, 11, 0, 18, 4, 0, 10, 115, 116, 97, 114, 116, 45, 98, 105, 110, 100, 1, 19, 1, +// 64, 1, 4, 116, 104, 105, 115, 15, 0, 18, 4, 0, 11, 102, 105, 110, 105, 115, 104, 45, 98, 105, +// 110, 100, 1, 20, 1, 64, 3, 4, 116, 104, 105, 115, 15, 7, 110, 101, 116, 119, 111, 114, 107, 7, +// 14, 114, 101, 109, 111, 116, 101, 45, 97, 100, 100, 114, 101, 115, 115, 11, 0, 18, 4, 0, 13, +// 115, 116, 97, 114, 116, 45, 99, 111, 110, 110, 101, 99, 116, 1, 21, 1, 111, 2, 1, 3, 1, 106, 1, +// 22, 1, 9, 1, 64, 1, 4, 116, 104, 105, 115, 15, 0, 23, 4, 0, 14, 102, 105, 110, 105, 115, 104, +// 45, 99, 111, 110, 110, 101, 99, 116, 1, 24, 1, 64, 2, 4, 116, 104, 105, 115, 15, 7, 110, 101, +// 116, 119, 111, 114, 107, 7, 0, 18, 4, 0, 12, 115, 116, 97, 114, 116, 45, 108, 105, 115, 116, +// 101, 110, 1, 25, 4, 0, 13, 102, 105, 110, 105, 115, 104, 45, 108, 105, 115, 116, 101, 110, 1, +// 20, 1, 111, 3, 15, 1, 3, 1, 106, 1, 26, 1, 9, 1, 64, 1, 4, 116, 104, 105, 115, 15, 0, 27, 4, 0, +// 6, 97, 99, 99, 101, 112, 116, 1, 28, 1, 106, 1, 11, 1, 9, 1, 64, 1, 4, 116, 104, 105, 115, 15, +// 0, 29, 4, 0, 13, 108, 111, 99, 97, 108, 45, 97, 100, 100, 114, 101, 115, 115, 1, 30, 4, 0, 14, +// 114, 101, 109, 111, 116, 101, 45, 97, 100, 100, 114, 101, 115, 115, 1, 30, 1, 64, 1, 4, 116, +// 104, 105, 115, 15, 0, 13, 4, 0, 14, 97, 100, 100, 114, 101, 115, 115, 45, 102, 97, 109, 105, +// 108, 121, 1, 31, 1, 106, 1, 127, 1, 9, 1, 64, 1, 4, 116, 104, 105, 115, 15, 0, 32, 4, 0, 9, +// 105, 112, 118, 54, 45, 111, 110, 108, 121, 1, 33, 1, 64, 2, 4, 116, 104, 105, 115, 15, 5, 118, +// 97, 108, 117, 101, 127, 0, 18, 4, 0, 13, 115, 101, 116, 45, 105, 112, 118, 54, 45, 111, 110, +// 108, 121, 1, 34, 1, 64, 2, 4, 116, 104, 105, 115, 15, 5, 118, 97, 108, 117, 101, 119, 0, 18, 4, +// 0, 23, 115, 101, 116, 45, 108, 105, 115, 116, 101, 110, 45, 98, 97, 99, 107, 108, 111, 103, 45, +// 115, 105, 122, 101, 1, 35, 4, 0, 10, 107, 101, 101, 112, 45, 97, 108, 105, 118, 101, 1, 33, 4, +// 0, 14, 115, 101, 116, 45, 107, 101, 101, 112, 45, 97, 108, 105, 118, 101, 1, 34, 4, 0, 8, 110, +// 111, 45, 100, 101, 108, 97, 121, 1, 33, 4, 0, 12, 115, 101, 116, 45, 110, 111, 45, 100, 101, +// 108, 97, 121, 1, 34, 1, 106, 1, 125, 1, 9, 1, 64, 1, 4, 116, 104, 105, 115, 15, 0, 36, 4, 0, +// 17, 117, 110, 105, 99, 97, 115, 116, 45, 104, 111, 112, 45, 108, 105, 109, 105, 116, 1, 37, 1, +// 64, 2, 4, 116, 104, 105, 115, 15, 5, 118, 97, 108, 117, 101, 125, 0, 18, 4, 0, 21, 115, 101, +// 116, 45, 117, 110, 105, 99, 97, 115, 116, 45, 104, 111, 112, 45, 108, 105, 109, 105, 116, 1, +// 38, 1, 106, 1, 119, 1, 9, 1, 64, 1, 4, 116, 104, 105, 115, 15, 0, 39, 4, 0, 19, 114, 101, 99, +// 101, 105, 118, 101, 45, 98, 117, 102, 102, 101, 114, 45, 115, 105, 122, 101, 1, 40, 4, 0, 23, +// 115, 101, 116, 45, 114, 101, 99, 101, 105, 118, 101, 45, 98, 117, 102, 102, 101, 114, 45, 115, +// 105, 122, 101, 1, 35, 4, 0, 16, 115, 101, 110, 100, 45, 98, 117, 102, 102, 101, 114, 45, 115, +// 105, 122, 101, 1, 40, 4, 0, 20, 115, 101, 116, 45, 115, 101, 110, 100, 45, 98, 117, 102, 102, +// 101, 114, 45, 115, 105, 122, 101, 1, 35, 1, 64, 1, 4, 116, 104, 105, 115, 15, 0, 5, 4, 0, 9, +// 115, 117, 98, 115, 99, 114, 105, 98, 101, 1, 41, 1, 64, 2, 4, 116, 104, 105, 115, 15, 13, 115, +// 104, 117, 116, 100, 111, 119, 110, 45, 116, 121, 112, 101, 17, 0, 18, 4, 0, 8, 115, 104, 117, +// 116, 100, 111, 119, 110, 1, 42, 1, 64, 1, 4, 116, 104, 105, 115, 15, 1, 0, 4, 0, 15, 100, 114, +// 111, 112, 45, 116, 99, 112, 45, 115, 111, 99, 107, 101, 116, 1, 43, 3, 1, 16, 119, 97, 115, +// 105, 58, 115, 111, 99, 107, 101, 116, 115, 47, 116, 99, 112, 5, 18, 2, 3, 0, 9, 10, 116, 99, +// 112, 45, 115, 111, 99, 107, 101, 116, 1, 66, 11, 2, 3, 2, 1, 11, 4, 0, 7, 110, 101, 116, 119, +// 111, 114, 107, 3, 0, 0, 2, 3, 2, 1, 13, 4, 0, 10, 101, 114, 114, 111, 114, 45, 99, 111, 100, +// 101, 3, 0, 2, 2, 3, 2, 1, 15, 4, 0, 17, 105, 112, 45, 97, 100, 100, 114, 101, 115, 115, 45, +// 102, 97, 109, 105, 108, 121, 3, 0, 4, 2, 3, 2, 1, 19, 4, 0, 10, 116, 99, 112, 45, 115, 111, 99, +// 107, 101, 116, 3, 0, 6, 1, 106, 1, 7, 1, 3, 1, 64, 1, 14, 97, 100, 100, 114, 101, 115, 115, 45, +// 102, 97, 109, 105, 108, 121, 5, 0, 8, 4, 0, 17, 99, 114, 101, 97, 116, 101, 45, 116, 99, 112, +// 45, 115, 111, 99, 107, 101, 116, 1, 9, 3, 1, 30, 119, 97, 115, 105, 58, 115, 111, 99, 107, 101, +// 116, 115, 47, 116, 99, 112, 45, 99, 114, 101, 97, 116, 101, 45, 115, 111, 99, 107, 101, 116, 5, +// 20, 1, 66, 55, 2, 3, 2, 1, 2, 4, 0, 8, 112, 111, 108, 108, 97, 98, 108, 101, 3, 0, 0, 2, 3, 2, +// 1, 11, 4, 0, 7, 110, 101, 116, 119, 111, 114, 107, 3, 0, 2, 2, 3, 2, 1, 13, 4, 0, 10, 101, 114, +// 114, 111, 114, 45, 99, 111, 100, 101, 3, 0, 4, 2, 3, 2, 1, 17, 4, 0, 17, 105, 112, 45, 115, +// 111, 99, 107, 101, 116, 45, 97, 100, 100, 114, 101, 115, 115, 3, 0, 6, 2, 3, 2, 1, 15, 4, 0, +// 17, 105, 112, 45, 97, 100, 100, 114, 101, 115, 115, 45, 102, 97, 109, 105, 108, 121, 3, 0, 8, +// 1, 121, 4, 0, 10, 117, 100, 112, 45, 115, 111, 99, 107, 101, 116, 3, 0, 10, 1, 112, 125, 1, +// 114, 2, 4, 100, 97, 116, 97, 12, 14, 114, 101, 109, 111, 116, 101, 45, 97, 100, 100, 114, 101, +// 115, 115, 7, 4, 0, 8, 100, 97, 116, 97, 103, 114, 97, 109, 3, 0, 13, 1, 106, 0, 1, 5, 1, 64, 3, +// 4, 116, 104, 105, 115, 11, 7, 110, 101, 116, 119, 111, 114, 107, 3, 13, 108, 111, 99, 97, 108, +// 45, 97, 100, 100, 114, 101, 115, 115, 7, 0, 15, 4, 0, 10, 115, 116, 97, 114, 116, 45, 98, 105, +// 110, 100, 1, 16, 1, 64, 1, 4, 116, 104, 105, 115, 11, 0, 15, 4, 0, 11, 102, 105, 110, 105, 115, +// 104, 45, 98, 105, 110, 100, 1, 17, 1, 64, 3, 4, 116, 104, 105, 115, 11, 7, 110, 101, 116, 119, +// 111, 114, 107, 3, 14, 114, 101, 109, 111, 116, 101, 45, 97, 100, 100, 114, 101, 115, 115, 7, 0, +// 15, 4, 0, 13, 115, 116, 97, 114, 116, 45, 99, 111, 110, 110, 101, 99, 116, 1, 18, 4, 0, 14, +// 102, 105, 110, 105, 115, 104, 45, 99, 111, 110, 110, 101, 99, 116, 1, 17, 1, 106, 1, 14, 1, 5, +// 1, 64, 1, 4, 116, 104, 105, 115, 11, 0, 19, 4, 0, 7, 114, 101, 99, 101, 105, 118, 101, 1, 20, +// 1, 64, 2, 4, 116, 104, 105, 115, 11, 8, 100, 97, 116, 97, 103, 114, 97, 109, 14, 0, 15, 4, 0, +// 4, 115, 101, 110, 100, 1, 21, 1, 106, 1, 7, 1, 5, 1, 64, 1, 4, 116, 104, 105, 115, 11, 0, 22, +// 4, 0, 13, 108, 111, 99, 97, 108, 45, 97, 100, 100, 114, 101, 115, 115, 1, 23, 4, 0, 14, 114, +// 101, 109, 111, 116, 101, 45, 97, 100, 100, 114, 101, 115, 115, 1, 23, 1, 64, 1, 4, 116, 104, +// 105, 115, 11, 0, 9, 4, 0, 14, 97, 100, 100, 114, 101, 115, 115, 45, 102, 97, 109, 105, 108, +// 121, 1, 24, 1, 106, 1, 127, 1, 5, 1, 64, 1, 4, 116, 104, 105, 115, 11, 0, 25, 4, 0, 9, 105, +// 112, 118, 54, 45, 111, 110, 108, 121, 1, 26, 1, 64, 2, 4, 116, 104, 105, 115, 11, 5, 118, 97, +// 108, 117, 101, 127, 0, 15, 4, 0, 13, 115, 101, 116, 45, 105, 112, 118, 54, 45, 111, 110, 108, +// 121, 1, 27, 1, 106, 1, 125, 1, 5, 1, 64, 1, 4, 116, 104, 105, 115, 11, 0, 28, 4, 0, 17, 117, +// 110, 105, 99, 97, 115, 116, 45, 104, 111, 112, 45, 108, 105, 109, 105, 116, 1, 29, 1, 64, 2, 4, +// 116, 104, 105, 115, 11, 5, 118, 97, 108, 117, 101, 125, 0, 15, 4, 0, 21, 115, 101, 116, 45, +// 117, 110, 105, 99, 97, 115, 116, 45, 104, 111, 112, 45, 108, 105, 109, 105, 116, 1, 30, 1, 106, +// 1, 119, 1, 5, 1, 64, 1, 4, 116, 104, 105, 115, 11, 0, 31, 4, 0, 19, 114, 101, 99, 101, 105, +// 118, 101, 45, 98, 117, 102, 102, 101, 114, 45, 115, 105, 122, 101, 1, 32, 1, 64, 2, 4, 116, +// 104, 105, 115, 11, 5, 118, 97, 108, 117, 101, 119, 0, 15, 4, 0, 23, 115, 101, 116, 45, 114, +// 101, 99, 101, 105, 118, 101, 45, 98, 117, 102, 102, 101, 114, 45, 115, 105, 122, 101, 1, 33, 4, +// 0, 16, 115, 101, 110, 100, 45, 98, 117, 102, 102, 101, 114, 45, 115, 105, 122, 101, 1, 32, 4, +// 0, 20, 115, 101, 116, 45, 115, 101, 110, 100, 45, 98, 117, 102, 102, 101, 114, 45, 115, 105, +// 122, 101, 1, 33, 1, 64, 1, 4, 116, 104, 105, 115, 11, 0, 1, 4, 0, 9, 115, 117, 98, 115, 99, +// 114, 105, 98, 101, 1, 34, 1, 64, 1, 4, 116, 104, 105, 115, 11, 1, 0, 4, 0, 15, 100, 114, 111, +// 112, 45, 117, 100, 112, 45, 115, 111, 99, 107, 101, 116, 1, 35, 3, 1, 16, 119, 97, 115, 105, +// 58, 115, 111, 99, 107, 101, 116, 115, 47, 117, 100, 112, 5, 21, 2, 3, 0, 11, 10, 117, 100, 112, +// 45, 115, 111, 99, 107, 101, 116, 1, 66, 11, 2, 3, 2, 1, 11, 4, 0, 7, 110, 101, 116, 119, 111, +// 114, 107, 3, 0, 0, 2, 3, 2, 1, 13, 4, 0, 10, 101, 114, 114, 111, 114, 45, 99, 111, 100, 101, 3, +// 0, 2, 2, 3, 2, 1, 15, 4, 0, 17, 105, 112, 45, 97, 100, 100, 114, 101, 115, 115, 45, 102, 97, +// 109, 105, 108, 121, 3, 0, 4, 2, 3, 2, 1, 22, 4, 0, 10, 117, 100, 112, 45, 115, 111, 99, 107, +// 101, 116, 3, 0, 6, 1, 106, 1, 7, 1, 3, 1, 64, 1, 14, 97, 100, 100, 114, 101, 115, 115, 45, 102, +// 97, 109, 105, 108, 121, 5, 0, 8, 4, 0, 17, 99, 114, 101, 97, 116, 101, 45, 117, 100, 112, 45, +// 115, 111, 99, 107, 101, 116, 1, 9, 3, 1, 30, 119, 97, 115, 105, 58, 115, 111, 99, 107, 101, +// 116, 115, 47, 117, 100, 112, 45, 99, 114, 101, 97, 116, 101, 45, 115, 111, 99, 107, 101, 116, +// 5, 23, 1, 66, 5, 1, 112, 125, 1, 64, 1, 3, 108, 101, 110, 119, 0, 0, 4, 0, 16, 103, 101, 116, +// 45, 114, 97, 110, 100, 111, 109, 45, 98, 121, 116, 101, 115, 1, 1, 1, 64, 0, 0, 119, 4, 0, 14, +// 103, 101, 116, 45, 114, 97, 110, 100, 111, 109, 45, 117, 54, 52, 1, 2, 3, 1, 18, 119, 97, 115, +// 105, 58, 114, 97, 110, 100, 111, 109, 47, 114, 97, 110, 100, 111, 109, 5, 24, 1, 66, 5, 1, 112, +// 125, 1, 64, 1, 3, 108, 101, 110, 119, 0, 0, 4, 0, 25, 103, 101, 116, 45, 105, 110, 115, 101, +// 99, 117, 114, 101, 45, 114, 97, 110, 100, 111, 109, 45, 98, 121, 116, 101, 115, 1, 1, 1, 64, 0, +// 0, 119, 4, 0, 23, 103, 101, 116, 45, 105, 110, 115, 101, 99, 117, 114, 101, 45, 114, 97, 110, +// 100, 111, 109, 45, 117, 54, 52, 1, 2, 3, 1, 20, 119, 97, 115, 105, 58, 114, 97, 110, 100, 111, +// 109, 47, 105, 110, 115, 101, 99, 117, 114, 101, 5, 25, 1, 66, 3, 1, 111, 2, 119, 119, 1, 64, 0, +// 0, 0, 4, 0, 13, 105, 110, 115, 101, 99, 117, 114, 101, 45, 115, 101, 101, 100, 1, 1, 3, 1, 25, +// 119, 97, 115, 105, 58, 114, 97, 110, 100, 111, 109, 47, 105, 110, 115, 101, 99, 117, 114, 101, +// 45, 115, 101, 101, 100, 5, 26, 1, 66, 7, 1, 111, 2, 115, 115, 1, 112, 0, 1, 64, 0, 0, 1, 4, 0, +// 15, 103, 101, 116, 45, 101, 110, 118, 105, 114, 111, 110, 109, 101, 110, 116, 1, 2, 1, 112, +// 115, 1, 64, 0, 0, 3, 4, 0, 13, 103, 101, 116, 45, 97, 114, 103, 117, 109, 101, 110, 116, 115, +// 1, 4, 3, 1, 25, 119, 97, 115, 105, 58, 99, 108, 105, 45, 98, 97, 115, 101, 47, 101, 110, 118, +// 105, 114, 111, 110, 109, 101, 110, 116, 5, 27, 2, 3, 0, 5, 10, 100, 101, 115, 99, 114, 105, +// 112, 116, 111, 114, 1, 66, 10, 2, 3, 2, 1, 28, 4, 0, 10, 100, 101, 115, 99, 114, 105, 112, 116, +// 111, 114, 3, 0, 0, 2, 3, 2, 1, 7, 4, 0, 12, 105, 110, 112, 117, 116, 45, 115, 116, 114, 101, +// 97, 109, 3, 0, 2, 2, 3, 2, 1, 8, 4, 0, 13, 111, 117, 116, 112, 117, 116, 45, 115, 116, 114, +// 101, 97, 109, 3, 0, 4, 1, 111, 2, 1, 115, 1, 112, 6, 1, 64, 0, 0, 7, 4, 0, 15, 103, 101, 116, +// 45, 100, 105, 114, 101, 99, 116, 111, 114, 105, 101, 115, 1, 8, 3, 1, 22, 119, 97, 115, 105, +// 58, 99, 108, 105, 45, 98, 97, 115, 101, 47, 112, 114, 101, 111, 112, 101, 110, 115, 5, 29, 1, +// 66, 3, 1, 106, 0, 0, 1, 64, 1, 6, 115, 116, 97, 116, 117, 115, 0, 1, 0, 4, 0, 4, 101, 120, 105, +// 116, 1, 1, 3, 1, 18, 119, 97, 115, 105, 58, 99, 108, 105, 45, 98, 97, 115, 101, 47, 101, 120, +// 105, 116, 5, 30, 1, 66, 4, 2, 3, 2, 1, 7, 4, 0, 12, 105, 110, 112, 117, 116, 45, 115, 116, 114, +// 101, 97, 109, 3, 0, 0, 1, 64, 0, 0, 1, 4, 0, 9, 103, 101, 116, 45, 115, 116, 100, 105, 110, 1, +// 2, 3, 1, 19, 119, 97, 115, 105, 58, 99, 108, 105, 45, 98, 97, 115, 101, 47, 115, 116, 100, 105, +// 110, 5, 31, 1, 66, 4, 2, 3, 2, 1, 8, 4, 0, 13, 111, 117, 116, 112, 117, 116, 45, 115, 116, 114, +// 101, 97, 109, 3, 0, 0, 1, 64, 0, 0, 1, 4, 0, 10, 103, 101, 116, 45, 115, 116, 100, 111, 117, +// 116, 1, 2, 3, 1, 20, 119, 97, 115, 105, 58, 99, 108, 105, 45, 98, 97, 115, 101, 47, 115, 116, +// 100, 111, 117, 116, 5, 32, 1, 66, 4, 2, 3, 2, 1, 8, 4, 0, 13, 111, 117, 116, 112, 117, 116, 45, +// 115, 116, 114, 101, 97, 109, 3, 0, 0, 1, 64, 0, 0, 1, 4, 0, 10, 103, 101, 116, 45, 115, 116, +// 100, 101, 114, 114, 1, 2, 3, 1, 20, 119, 97, 115, 105, 58, 99, 108, 105, 45, 98, 97, 115, 101, +// 47, 115, 116, 100, 101, 114, 114, 5, 33, 4, 1, 19, 117, 110, 117, 115, 101, 100, 58, 109, 97, +// 105, 110, 47, 99, 111, 109, 109, 97, 110, 100, 4, 0, 1, 65, 32, 1, 66, 7, 1, 111, 2, 115, 115, +// 1, 112, 0, 1, 64, 0, 0, 1, 4, 0, 15, 103, 101, 116, 45, 101, 110, 118, 105, 114, 111, 110, 109, +// 101, 110, 116, 1, 2, 1, 112, 115, 1, 64, 0, 0, 3, 4, 0, 13, 103, 101, 116, 45, 97, 114, 103, +// 117, 109, 101, 110, 116, 115, 1, 4, 3, 1, 25, 119, 97, 115, 105, 58, 99, 108, 105, 45, 98, 97, +// 115, 101, 47, 101, 110, 118, 105, 114, 111, 110, 109, 101, 110, 116, 5, 0, 1, 66, 8, 1, 121, 4, +// 0, 8, 112, 111, 108, 108, 97, 98, 108, 101, 3, 0, 0, 1, 64, 1, 4, 116, 104, 105, 115, 1, 1, 0, +// 4, 0, 13, 100, 114, 111, 112, 45, 112, 111, 108, 108, 97, 98, 108, 101, 1, 2, 1, 112, 1, 1, +// 112, 127, 1, 64, 1, 2, 105, 110, 3, 0, 4, 4, 0, 11, 112, 111, 108, 108, 45, 111, 110, 101, 111, +// 102, 102, 1, 5, 3, 1, 14, 119, 97, 115, 105, 58, 112, 111, 108, 108, 47, 112, 111, 108, 108, 5, +// 1, 2, 3, 0, 1, 8, 112, 111, 108, 108, 97, 98, 108, 101, 1, 66, 39, 2, 3, 2, 1, 2, 4, 0, 8, 112, +// 111, 108, 108, 97, 98, 108, 101, 3, 0, 0, 1, 114, 0, 4, 0, 12, 115, 116, 114, 101, 97, 109, 45, +// 101, 114, 114, 111, 114, 3, 0, 2, 1, 121, 4, 0, 13, 111, 117, 116, 112, 117, 116, 45, 115, 116, +// 114, 101, 97, 109, 3, 0, 4, 1, 121, 4, 0, 12, 105, 110, 112, 117, 116, 45, 115, 116, 114, 101, +// 97, 109, 3, 0, 6, 1, 112, 125, 1, 111, 2, 8, 127, 1, 106, 1, 9, 1, 3, 1, 64, 2, 4, 116, 104, +// 105, 115, 7, 3, 108, 101, 110, 119, 0, 10, 4, 0, 4, 114, 101, 97, 100, 1, 11, 4, 0, 13, 98, +// 108, 111, 99, 107, 105, 110, 103, 45, 114, 101, 97, 100, 1, 11, 1, 111, 2, 119, 127, 1, 106, 1, +// 12, 1, 3, 1, 64, 2, 4, 116, 104, 105, 115, 7, 3, 108, 101, 110, 119, 0, 13, 4, 0, 4, 115, 107, +// 105, 112, 1, 14, 4, 0, 13, 98, 108, 111, 99, 107, 105, 110, 103, 45, 115, 107, 105, 112, 1, 14, +// 1, 64, 1, 4, 116, 104, 105, 115, 7, 0, 1, 4, 0, 25, 115, 117, 98, 115, 99, 114, 105, 98, 101, +// 45, 116, 111, 45, 105, 110, 112, 117, 116, 45, 115, 116, 114, 101, 97, 109, 1, 15, 1, 64, 1, 4, +// 116, 104, 105, 115, 7, 1, 0, 4, 0, 17, 100, 114, 111, 112, 45, 105, 110, 112, 117, 116, 45, +// 115, 116, 114, 101, 97, 109, 1, 16, 1, 106, 1, 119, 1, 3, 1, 64, 2, 4, 116, 104, 105, 115, 5, +// 3, 98, 117, 102, 8, 0, 17, 4, 0, 5, 119, 114, 105, 116, 101, 1, 18, 4, 0, 14, 98, 108, 111, 99, +// 107, 105, 110, 103, 45, 119, 114, 105, 116, 101, 1, 18, 1, 64, 2, 4, 116, 104, 105, 115, 5, 3, +// 108, 101, 110, 119, 0, 17, 4, 0, 12, 119, 114, 105, 116, 101, 45, 122, 101, 114, 111, 101, 115, +// 1, 19, 4, 0, 21, 98, 108, 111, 99, 107, 105, 110, 103, 45, 119, 114, 105, 116, 101, 45, 122, +// 101, 114, 111, 101, 115, 1, 19, 1, 64, 3, 4, 116, 104, 105, 115, 5, 3, 115, 114, 99, 7, 3, 108, +// 101, 110, 119, 0, 13, 4, 0, 6, 115, 112, 108, 105, 99, 101, 1, 20, 4, 0, 15, 98, 108, 111, 99, +// 107, 105, 110, 103, 45, 115, 112, 108, 105, 99, 101, 1, 20, 1, 64, 2, 4, 116, 104, 105, 115, 5, +// 3, 115, 114, 99, 7, 0, 17, 4, 0, 7, 102, 111, 114, 119, 97, 114, 100, 1, 21, 1, 64, 1, 4, 116, +// 104, 105, 115, 5, 0, 1, 4, 0, 26, 115, 117, 98, 115, 99, 114, 105, 98, 101, 45, 116, 111, 45, +// 111, 117, 116, 112, 117, 116, 45, 115, 116, 114, 101, 97, 109, 1, 22, 1, 64, 1, 4, 116, 104, +// 105, 115, 5, 1, 0, 4, 0, 18, 100, 114, 111, 112, 45, 111, 117, 116, 112, 117, 116, 45, 115, +// 116, 114, 101, 97, 109, 1, 23, 3, 1, 15, 119, 97, 115, 105, 58, 105, 111, 47, 115, 116, 114, +// 101, 97, 109, 115, 5, 3, 1, 66, 5, 1, 114, 2, 7, 115, 101, 99, 111, 110, 100, 115, 119, 11, +// 110, 97, 110, 111, 115, 101, 99, 111, 110, 100, 115, 121, 4, 0, 8, 100, 97, 116, 101, 116, 105, +// 109, 101, 3, 0, 0, 1, 64, 0, 0, 1, 4, 0, 3, 110, 111, 119, 1, 2, 4, 0, 10, 114, 101, 115, 111, +// 108, 117, 116, 105, 111, 110, 1, 2, 3, 1, 22, 119, 97, 115, 105, 58, 99, 108, 111, 99, 107, +// 115, 47, 119, 97, 108, 108, 45, 99, 108, 111, 99, 107, 5, 4, 2, 3, 0, 2, 12, 105, 110, 112, +// 117, 116, 45, 115, 116, 114, 101, 97, 109, 2, 3, 0, 2, 13, 111, 117, 116, 112, 117, 116, 45, +// 115, 116, 114, 101, 97, 109, 2, 3, 0, 3, 8, 100, 97, 116, 101, 116, 105, 109, 101, 1, 66, 117, +// 2, 3, 2, 1, 5, 4, 0, 12, 105, 110, 112, 117, 116, 45, 115, 116, 114, 101, 97, 109, 3, 0, 0, 2, +// 3, 2, 1, 6, 4, 0, 13, 111, 117, 116, 112, 117, 116, 45, 115, 116, 114, 101, 97, 109, 3, 0, 2, +// 2, 3, 2, 1, 7, 4, 0, 8, 100, 97, 116, 101, 116, 105, 109, 101, 3, 0, 4, 1, 110, 1, 14, 115, +// 121, 109, 108, 105, 110, 107, 45, 102, 111, 108, 108, 111, 119, 4, 0, 10, 112, 97, 116, 104, +// 45, 102, 108, 97, 103, 115, 3, 0, 6, 1, 110, 4, 6, 99, 114, 101, 97, 116, 101, 9, 100, 105, +// 114, 101, 99, 116, 111, 114, 121, 9, 101, 120, 99, 108, 117, 115, 105, 118, 101, 8, 116, 114, +// 117, 110, 99, 97, 116, 101, 4, 0, 10, 111, 112, 101, 110, 45, 102, 108, 97, 103, 115, 3, 0, 8, +// 1, 110, 3, 8, 114, 101, 97, 100, 97, 98, 108, 101, 8, 119, 114, 105, 116, 97, 98, 108, 101, 10, +// 101, 120, 101, 99, 117, 116, 97, 98, 108, 101, 4, 0, 5, 109, 111, 100, 101, 115, 3, 0, 10, 1, +// 119, 4, 0, 10, 108, 105, 110, 107, 45, 99, 111, 117, 110, 116, 3, 0, 12, 1, 119, 4, 0, 5, 105, +// 110, 111, 100, 101, 3, 0, 14, 1, 119, 4, 0, 8, 102, 105, 108, 101, 115, 105, 122, 101, 3, 0, +// 16, 1, 109, 37, 6, 97, 99, 99, 101, 115, 115, 11, 119, 111, 117, 108, 100, 45, 98, 108, 111, +// 99, 107, 7, 97, 108, 114, 101, 97, 100, 121, 14, 98, 97, 100, 45, 100, 101, 115, 99, 114, 105, +// 112, 116, 111, 114, 4, 98, 117, 115, 121, 8, 100, 101, 97, 100, 108, 111, 99, 107, 5, 113, 117, +// 111, 116, 97, 5, 101, 120, 105, 115, 116, 14, 102, 105, 108, 101, 45, 116, 111, 111, 45, 108, +// 97, 114, 103, 101, 21, 105, 108, 108, 101, 103, 97, 108, 45, 98, 121, 116, 101, 45, 115, 101, +// 113, 117, 101, 110, 99, 101, 11, 105, 110, 45, 112, 114, 111, 103, 114, 101, 115, 115, 11, 105, +// 110, 116, 101, 114, 114, 117, 112, 116, 101, 100, 7, 105, 110, 118, 97, 108, 105, 100, 2, 105, +// 111, 12, 105, 115, 45, 100, 105, 114, 101, 99, 116, 111, 114, 121, 4, 108, 111, 111, 112, 14, +// 116, 111, 111, 45, 109, 97, 110, 121, 45, 108, 105, 110, 107, 115, 12, 109, 101, 115, 115, 97, +// 103, 101, 45, 115, 105, 122, 101, 13, 110, 97, 109, 101, 45, 116, 111, 111, 45, 108, 111, 110, +// 103, 9, 110, 111, 45, 100, 101, 118, 105, 99, 101, 8, 110, 111, 45, 101, 110, 116, 114, 121, 7, +// 110, 111, 45, 108, 111, 99, 107, 19, 105, 110, 115, 117, 102, 102, 105, 99, 105, 101, 110, 116, +// 45, 109, 101, 109, 111, 114, 121, 18, 105, 110, 115, 117, 102, 102, 105, 99, 105, 101, 110, +// 116, 45, 115, 112, 97, 99, 101, 13, 110, 111, 116, 45, 100, 105, 114, 101, 99, 116, 111, 114, +// 121, 9, 110, 111, 116, 45, 101, 109, 112, 116, 121, 15, 110, 111, 116, 45, 114, 101, 99, 111, +// 118, 101, 114, 97, 98, 108, 101, 11, 117, 110, 115, 117, 112, 112, 111, 114, 116, 101, 100, 6, +// 110, 111, 45, 116, 116, 121, 14, 110, 111, 45, 115, 117, 99, 104, 45, 100, 101, 118, 105, 99, +// 101, 8, 111, 118, 101, 114, 102, 108, 111, 119, 13, 110, 111, 116, 45, 112, 101, 114, 109, 105, +// 116, 116, 101, 100, 4, 112, 105, 112, 101, 9, 114, 101, 97, 100, 45, 111, 110, 108, 121, 12, +// 105, 110, 118, 97, 108, 105, 100, 45, 115, 101, 101, 107, 14, 116, 101, 120, 116, 45, 102, 105, +// 108, 101, 45, 98, 117, 115, 121, 12, 99, 114, 111, 115, 115, 45, 100, 101, 118, 105, 99, 101, +// 4, 0, 10, 101, 114, 114, 111, 114, 45, 99, 111, 100, 101, 3, 0, 18, 1, 121, 4, 0, 22, 100, 105, +// 114, 101, 99, 116, 111, 114, 121, 45, 101, 110, 116, 114, 121, 45, 115, 116, 114, 101, 97, 109, +// 3, 0, 20, 1, 119, 4, 0, 6, 100, 101, 118, 105, 99, 101, 3, 0, 22, 1, 109, 8, 7, 117, 110, 107, +// 110, 111, 119, 110, 12, 98, 108, 111, 99, 107, 45, 100, 101, 118, 105, 99, 101, 16, 99, 104, +// 97, 114, 97, 99, 116, 101, 114, 45, 100, 101, 118, 105, 99, 101, 9, 100, 105, 114, 101, 99, +// 116, 111, 114, 121, 4, 102, 105, 102, 111, 13, 115, 121, 109, 98, 111, 108, 105, 99, 45, 108, +// 105, 110, 107, 12, 114, 101, 103, 117, 108, 97, 114, 45, 102, 105, 108, 101, 6, 115, 111, 99, +// 107, 101, 116, 4, 0, 15, 100, 101, 115, 99, 114, 105, 112, 116, 111, 114, 45, 116, 121, 112, +// 101, 3, 0, 24, 1, 107, 15, 1, 114, 3, 5, 105, 110, 111, 100, 101, 26, 4, 116, 121, 112, 101, +// 25, 4, 110, 97, 109, 101, 115, 4, 0, 15, 100, 105, 114, 101, 99, 116, 111, 114, 121, 45, 101, +// 110, 116, 114, 121, 3, 0, 27, 1, 110, 6, 4, 114, 101, 97, 100, 5, 119, 114, 105, 116, 101, 19, +// 102, 105, 108, 101, 45, 105, 110, 116, 101, 103, 114, 105, 116, 121, 45, 115, 121, 110, 99, 19, +// 100, 97, 116, 97, 45, 105, 110, 116, 101, 103, 114, 105, 116, 121, 45, 115, 121, 110, 99, 20, +// 114, 101, 113, 117, 101, 115, 116, 101, 100, 45, 119, 114, 105, 116, 101, 45, 115, 121, 110, +// 99, 16, 109, 117, 116, 97, 116, 101, 45, 100, 105, 114, 101, 99, 116, 111, 114, 121, 4, 0, 16, +// 100, 101, 115, 99, 114, 105, 112, 116, 111, 114, 45, 102, 108, 97, 103, 115, 3, 0, 29, 1, 121, +// 4, 0, 10, 100, 101, 115, 99, 114, 105, 112, 116, 111, 114, 3, 0, 31, 1, 113, 3, 9, 110, 111, +// 45, 99, 104, 97, 110, 103, 101, 0, 0, 3, 110, 111, 119, 0, 0, 9, 116, 105, 109, 101, 115, 116, +// 97, 109, 112, 1, 5, 0, 4, 0, 13, 110, 101, 119, 45, 116, 105, 109, 101, 115, 116, 97, 109, 112, +// 3, 0, 33, 1, 114, 8, 6, 100, 101, 118, 105, 99, 101, 23, 5, 105, 110, 111, 100, 101, 15, 4, +// 116, 121, 112, 101, 25, 10, 108, 105, 110, 107, 45, 99, 111, 117, 110, 116, 13, 4, 115, 105, +// 122, 101, 17, 21, 100, 97, 116, 97, 45, 97, 99, 99, 101, 115, 115, 45, 116, 105, 109, 101, 115, +// 116, 97, 109, 112, 5, 27, 100, 97, 116, 97, 45, 109, 111, 100, 105, 102, 105, 99, 97, 116, 105, +// 111, 110, 45, 116, 105, 109, 101, 115, 116, 97, 109, 112, 5, 23, 115, 116, 97, 116, 117, 115, +// 45, 99, 104, 97, 110, 103, 101, 45, 116, 105, 109, 101, 115, 116, 97, 109, 112, 5, 4, 0, 15, +// 100, 101, 115, 99, 114, 105, 112, 116, 111, 114, 45, 115, 116, 97, 116, 3, 0, 35, 1, 109, 6, 6, +// 110, 111, 114, 109, 97, 108, 10, 115, 101, 113, 117, 101, 110, 116, 105, 97, 108, 6, 114, 97, +// 110, 100, 111, 109, 9, 119, 105, 108, 108, 45, 110, 101, 101, 100, 9, 100, 111, 110, 116, 45, +// 110, 101, 101, 100, 8, 110, 111, 45, 114, 101, 117, 115, 101, 4, 0, 6, 97, 100, 118, 105, 99, +// 101, 3, 0, 37, 1, 113, 2, 6, 97, 99, 99, 101, 115, 115, 1, 11, 0, 6, 101, 120, 105, 115, 116, +// 115, 0, 0, 4, 0, 11, 97, 99, 99, 101, 115, 115, 45, 116, 121, 112, 101, 3, 0, 39, 1, 106, 1, 1, +// 1, 19, 1, 64, 2, 4, 116, 104, 105, 115, 32, 6, 111, 102, 102, 115, 101, 116, 17, 0, 41, 4, 0, +// 15, 114, 101, 97, 100, 45, 118, 105, 97, 45, 115, 116, 114, 101, 97, 109, 1, 42, 1, 106, 1, 3, +// 1, 19, 1, 64, 2, 4, 116, 104, 105, 115, 32, 6, 111, 102, 102, 115, 101, 116, 17, 0, 43, 4, 0, +// 16, 119, 114, 105, 116, 101, 45, 118, 105, 97, 45, 115, 116, 114, 101, 97, 109, 1, 44, 1, 64, +// 1, 4, 116, 104, 105, 115, 32, 0, 43, 4, 0, 17, 97, 112, 112, 101, 110, 100, 45, 118, 105, 97, +// 45, 115, 116, 114, 101, 97, 109, 1, 45, 1, 106, 0, 1, 19, 1, 64, 4, 4, 116, 104, 105, 115, 32, +// 6, 111, 102, 102, 115, 101, 116, 17, 6, 108, 101, 110, 103, 116, 104, 17, 6, 97, 100, 118, 105, +// 99, 101, 38, 0, 46, 4, 0, 6, 97, 100, 118, 105, 115, 101, 1, 47, 1, 64, 1, 4, 116, 104, 105, +// 115, 32, 0, 46, 4, 0, 9, 115, 121, 110, 99, 45, 100, 97, 116, 97, 1, 48, 1, 106, 1, 30, 1, 19, +// 1, 64, 1, 4, 116, 104, 105, 115, 32, 0, 49, 4, 0, 9, 103, 101, 116, 45, 102, 108, 97, 103, 115, +// 1, 50, 1, 106, 1, 25, 1, 19, 1, 64, 1, 4, 116, 104, 105, 115, 32, 0, 51, 4, 0, 8, 103, 101, +// 116, 45, 116, 121, 112, 101, 1, 52, 1, 64, 2, 4, 116, 104, 105, 115, 32, 4, 115, 105, 122, 101, +// 17, 0, 46, 4, 0, 8, 115, 101, 116, 45, 115, 105, 122, 101, 1, 53, 1, 64, 3, 4, 116, 104, 105, +// 115, 32, 21, 100, 97, 116, 97, 45, 97, 99, 99, 101, 115, 115, 45, 116, 105, 109, 101, 115, 116, +// 97, 109, 112, 34, 27, 100, 97, 116, 97, 45, 109, 111, 100, 105, 102, 105, 99, 97, 116, 105, +// 111, 110, 45, 116, 105, 109, 101, 115, 116, 97, 109, 112, 34, 0, 46, 4, 0, 9, 115, 101, 116, +// 45, 116, 105, 109, 101, 115, 1, 54, 1, 112, 125, 1, 111, 2, 55, 127, 1, 106, 1, 56, 1, 19, 1, +// 64, 3, 4, 116, 104, 105, 115, 32, 6, 108, 101, 110, 103, 116, 104, 17, 6, 111, 102, 102, 115, +// 101, 116, 17, 0, 57, 4, 0, 4, 114, 101, 97, 100, 1, 58, 1, 106, 1, 17, 1, 19, 1, 64, 3, 4, 116, +// 104, 105, 115, 32, 6, 98, 117, 102, 102, 101, 114, 55, 6, 111, 102, 102, 115, 101, 116, 17, 0, +// 59, 4, 0, 5, 119, 114, 105, 116, 101, 1, 60, 1, 106, 1, 21, 1, 19, 1, 64, 1, 4, 116, 104, 105, +// 115, 32, 0, 61, 4, 0, 14, 114, 101, 97, 100, 45, 100, 105, 114, 101, 99, 116, 111, 114, 121, 1, +// 62, 4, 0, 4, 115, 121, 110, 99, 1, 48, 1, 64, 2, 4, 116, 104, 105, 115, 32, 4, 112, 97, 116, +// 104, 115, 0, 46, 4, 0, 19, 99, 114, 101, 97, 116, 101, 45, 100, 105, 114, 101, 99, 116, 111, +// 114, 121, 45, 97, 116, 1, 63, 1, 106, 1, 36, 1, 19, 1, 64, 1, 4, 116, 104, 105, 115, 32, 0, +// 192, 0, 4, 0, 4, 115, 116, 97, 116, 1, 65, 1, 64, 3, 4, 116, 104, 105, 115, 32, 10, 112, 97, +// 116, 104, 45, 102, 108, 97, 103, 115, 7, 4, 112, 97, 116, 104, 115, 0, 192, 0, 4, 0, 7, 115, +// 116, 97, 116, 45, 97, 116, 1, 66, 1, 64, 5, 4, 116, 104, 105, 115, 32, 10, 112, 97, 116, 104, +// 45, 102, 108, 97, 103, 115, 7, 4, 112, 97, 116, 104, 115, 21, 100, 97, 116, 97, 45, 97, 99, 99, +// 101, 115, 115, 45, 116, 105, 109, 101, 115, 116, 97, 109, 112, 34, 27, 100, 97, 116, 97, 45, +// 109, 111, 100, 105, 102, 105, 99, 97, 116, 105, 111, 110, 45, 116, 105, 109, 101, 115, 116, 97, +// 109, 112, 34, 0, 46, 4, 0, 12, 115, 101, 116, 45, 116, 105, 109, 101, 115, 45, 97, 116, 1, 67, +// 1, 64, 5, 4, 116, 104, 105, 115, 32, 14, 111, 108, 100, 45, 112, 97, 116, 104, 45, 102, 108, +// 97, 103, 115, 7, 8, 111, 108, 100, 45, 112, 97, 116, 104, 115, 14, 110, 101, 119, 45, 100, 101, +// 115, 99, 114, 105, 112, 116, 111, 114, 32, 8, 110, 101, 119, 45, 112, 97, 116, 104, 115, 0, 46, +// 4, 0, 7, 108, 105, 110, 107, 45, 97, 116, 1, 68, 1, 106, 1, 32, 1, 19, 1, 64, 6, 4, 116, 104, +// 105, 115, 32, 10, 112, 97, 116, 104, 45, 102, 108, 97, 103, 115, 7, 4, 112, 97, 116, 104, 115, +// 10, 111, 112, 101, 110, 45, 102, 108, 97, 103, 115, 9, 5, 102, 108, 97, 103, 115, 30, 5, 109, +// 111, 100, 101, 115, 11, 0, 197, 0, 4, 0, 7, 111, 112, 101, 110, 45, 97, 116, 1, 70, 1, 106, 1, +// 115, 1, 19, 1, 64, 2, 4, 116, 104, 105, 115, 32, 4, 112, 97, 116, 104, 115, 0, 199, 0, 4, 0, +// 11, 114, 101, 97, 100, 108, 105, 110, 107, 45, 97, 116, 1, 72, 4, 0, 19, 114, 101, 109, 111, +// 118, 101, 45, 100, 105, 114, 101, 99, 116, 111, 114, 121, 45, 97, 116, 1, 63, 1, 64, 4, 4, 116, +// 104, 105, 115, 32, 8, 111, 108, 100, 45, 112, 97, 116, 104, 115, 14, 110, 101, 119, 45, 100, +// 101, 115, 99, 114, 105, 112, 116, 111, 114, 32, 8, 110, 101, 119, 45, 112, 97, 116, 104, 115, +// 0, 46, 4, 0, 9, 114, 101, 110, 97, 109, 101, 45, 97, 116, 1, 73, 1, 64, 3, 4, 116, 104, 105, +// 115, 32, 8, 111, 108, 100, 45, 112, 97, 116, 104, 115, 8, 110, 101, 119, 45, 112, 97, 116, 104, +// 115, 0, 46, 4, 0, 10, 115, 121, 109, 108, 105, 110, 107, 45, 97, 116, 1, 74, 1, 64, 4, 4, 116, +// 104, 105, 115, 32, 10, 112, 97, 116, 104, 45, 102, 108, 97, 103, 115, 7, 4, 112, 97, 116, 104, +// 115, 4, 116, 121, 112, 101, 40, 0, 46, 4, 0, 9, 97, 99, 99, 101, 115, 115, 45, 97, 116, 1, 75, +// 4, 0, 14, 117, 110, 108, 105, 110, 107, 45, 102, 105, 108, 101, 45, 97, 116, 1, 63, 1, 64, 4, +// 4, 116, 104, 105, 115, 32, 10, 112, 97, 116, 104, 45, 102, 108, 97, 103, 115, 7, 4, 112, 97, +// 116, 104, 115, 5, 109, 111, 100, 101, 115, 11, 0, 46, 4, 0, 26, 99, 104, 97, 110, 103, 101, 45, +// 102, 105, 108, 101, 45, 112, 101, 114, 109, 105, 115, 115, 105, 111, 110, 115, 45, 97, 116, 1, +// 76, 4, 0, 31, 99, 104, 97, 110, 103, 101, 45, 100, 105, 114, 101, 99, 116, 111, 114, 121, 45, +// 112, 101, 114, 109, 105, 115, 115, 105, 111, 110, 115, 45, 97, 116, 1, 76, 4, 0, 11, 108, 111, +// 99, 107, 45, 115, 104, 97, 114, 101, 100, 1, 48, 4, 0, 14, 108, 111, 99, 107, 45, 101, 120, 99, +// 108, 117, 115, 105, 118, 101, 1, 48, 4, 0, 15, 116, 114, 121, 45, 108, 111, 99, 107, 45, 115, +// 104, 97, 114, 101, 100, 1, 48, 4, 0, 18, 116, 114, 121, 45, 108, 111, 99, 107, 45, 101, 120, +// 99, 108, 117, 115, 105, 118, 101, 1, 48, 4, 0, 6, 117, 110, 108, 111, 99, 107, 1, 48, 1, 64, 1, +// 4, 116, 104, 105, 115, 32, 1, 0, 4, 0, 15, 100, 114, 111, 112, 45, 100, 101, 115, 99, 114, 105, +// 112, 116, 111, 114, 1, 77, 1, 107, 28, 1, 106, 1, 206, 0, 1, 19, 1, 64, 1, 4, 116, 104, 105, +// 115, 21, 0, 207, 0, 4, 0, 20, 114, 101, 97, 100, 45, 100, 105, 114, 101, 99, 116, 111, 114, +// 121, 45, 101, 110, 116, 114, 121, 1, 80, 1, 64, 1, 4, 116, 104, 105, 115, 21, 1, 0, 4, 0, 27, +// 100, 114, 111, 112, 45, 100, 105, 114, 101, 99, 116, 111, 114, 121, 45, 101, 110, 116, 114, +// 121, 45, 115, 116, 114, 101, 97, 109, 1, 81, 3, 1, 26, 119, 97, 115, 105, 58, 102, 105, 108, +// 101, 115, 121, 115, 116, 101, 109, 47, 102, 105, 108, 101, 115, 121, 115, 116, 101, 109, 5, 8, +// 2, 3, 0, 4, 10, 100, 101, 115, 99, 114, 105, 112, 116, 111, 114, 1, 66, 10, 2, 3, 2, 1, 9, 4, +// 0, 10, 100, 101, 115, 99, 114, 105, 112, 116, 111, 114, 3, 0, 0, 2, 3, 2, 1, 5, 4, 0, 12, 105, +// 110, 112, 117, 116, 45, 115, 116, 114, 101, 97, 109, 3, 0, 2, 2, 3, 2, 1, 6, 4, 0, 13, 111, +// 117, 116, 112, 117, 116, 45, 115, 116, 114, 101, 97, 109, 3, 0, 4, 1, 111, 2, 1, 115, 1, 112, +// 6, 1, 64, 0, 0, 7, 4, 0, 15, 103, 101, 116, 45, 100, 105, 114, 101, 99, 116, 111, 114, 105, +// 101, 115, 1, 8, 3, 1, 22, 119, 97, 115, 105, 58, 99, 108, 105, 45, 98, 97, 115, 101, 47, 112, +// 114, 101, 111, 112, 101, 110, 115, 5, 10, 1, 66, 3, 1, 106, 0, 0, 1, 64, 1, 6, 115, 116, 97, +// 116, 117, 115, 0, 1, 0, 4, 0, 4, 101, 120, 105, 116, 1, 1, 3, 1, 18, 119, 97, 115, 105, 58, 99, +// 108, 105, 45, 98, 97, 115, 101, 47, 101, 120, 105, 116, 5, 11, 3, 0, 13, 111, 117, 116, 112, +// 117, 116, 45, 115, 116, 114, 101, 97, 109, 3, 0, 6, 2, 3, 0, 4, 15, 100, 101, 115, 99, 114, +// 105, 112, 116, 111, 114, 45, 115, 116, 97, 116, 3, 0, 15, 100, 101, 115, 99, 114, 105, 112, +// 116, 111, 114, 45, 115, 116, 97, 116, 3, 0, 13, 1, 112, 115, 1, 64, 1, 1, 115, 15, 0, 121, 4, +// 0, 11, 97, 100, 100, 45, 115, 116, 114, 105, 110, 103, 115, 1, 16, 1, 64, 0, 0, 15, 4, 0, 11, +// 103, 101, 116, 45, 115, 116, 114, 105, 110, 103, 115, 1, 17, 1, 106, 0, 0, 1, 64, 1, 1, 111, +// 12, 0, 18, 4, 0, 16, 119, 114, 105, 116, 101, 45, 115, 116, 114, 105, 110, 103, 115, 45, 116, +// 111, 1, 19, 1, 64, 1, 1, 100, 14, 0, 115, 4, 0, 23, 112, 97, 115, 115, 45, 97, 110, 45, 105, +// 109, 112, 111, 114, 116, 101, 100, 45, 114, 101, 99, 111, 114, 100, 1, 20, 4, 1, 24, 117, 110, +// 117, 115, 101, 100, 58, 109, 97, 105, 110, 47, 116, 101, 115, 116, 45, 114, 101, 97, 99, 116, +// 111, 114, 4, 1, 0, 69, 9, 112, 114, 111, 100, 117, 99, 101, 114, 115, 1, 12, 112, 114, 111, 99, +// 101, 115, 115, 101, 100, 45, 98, 121, 2, 13, 119, 105, 116, 45, 99, 111, 109, 112, 111, 110, +// 101, 110, 116, 6, 48, 46, 49, 49, 46, 48, 16, 119, 105, 116, 45, 98, 105, 110, 100, 103, 101, +// 110, 45, 114, 117, 115, 116, 5, 48, 46, 56, 46, 48, 11, 21, 1, 1, 15, 117, 110, 117, 115, 101, +// 100, 58, 109, 97, 105, 110, 47, 119, 105, 116, 3, 0, 0, +// ]; -#[inline(never)] -#[doc(hidden)] -#[cfg(target_arch = "wasm32")] -pub fn __link_section() {} +// #[inline(never)] +// #[doc(hidden)] +// #[cfg(target_arch = "wasm32")] +// pub fn __link_section() {} diff --git a/core/guest/src/jwt.rs b/core/guest/src/jwt.rs index 647967c1..59bd396f 100644 --- a/core/guest/src/jwt.rs +++ b/core/guest/src/jwt.rs @@ -1,4 +1,4 @@ -// Generated by `wit-bindgen` 0.8.0. DO NOT EDIT! +// Generated by `wit-bindgen` 0.15.0. DO NOT EDIT! pub mod akkoro { pub mod jwt { @@ -8,34 +8,8 @@ pub mod akkoro { #[doc(hidden)] #[cfg(target_arch = "wasm32")] static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; - - #[repr(C)] - #[derive(Copy, Clone)] - pub struct VerifyResult { - pub valid: bool, - } - impl ::core::fmt::Debug for VerifyResult { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - f.debug_struct("VerifyResult") - .field("valid", &self.valid) - .finish() - } - } - #[derive(Clone)] - pub struct ValidationParams<'a> { - pub iss: &'a str, - pub aud: &'a str, - } - impl<'a> ::core::fmt::Debug for ValidationParams<'a> { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - f.debug_struct("ValidationParams") - .field("iss", &self.iss) - .field("aud", &self.aud) - .finish() - } - } #[repr(u8)] - #[derive(Clone, Copy, PartialEq, Eq)] + #[derive(Clone, Copy, Eq, PartialEq)] pub enum JwtError { InvalidToken, InvalidJwks, @@ -70,11 +44,52 @@ pub mod akkoro { } impl std::error::Error for JwtError {} - #[allow(clippy::all)] + + impl JwtError { + pub(crate) unsafe fn _lift(val: u8) -> JwtError { + if !cfg!(debug_assertions) { + return ::core::mem::transmute(val); + } + + match val { + 0 => JwtError::InvalidToken, + 1 => JwtError::InvalidJwks, + + _ => panic!("invalid enum discriminant"), + } + } + } + + #[derive(Clone)] + pub struct ValidationParams { + pub iss: wit_bindgen::rt::string::String, + pub aud: wit_bindgen::rt::string::String, + } + impl ::core::fmt::Debug for ValidationParams { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_struct("ValidationParams") + .field("iss", &self.iss) + .field("aud", &self.aud) + .finish() + } + } + #[repr(C)] + #[derive(Clone, Copy)] + pub struct VerifyResult { + pub valid: bool, + } + impl ::core::fmt::Debug for VerifyResult { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_struct("VerifyResult") + .field("valid", &self.valid) + .finish() + } + } + #[allow(unused_unsafe, clippy::all)] pub fn decode_verify( token: &str, jwks: &str, - params: ValidationParams<'_>, + params: &ValidationParams, ) -> Result { #[allow(unused_imports)] use wit_bindgen::rt::{alloc, string::String, vec::Vec}; @@ -99,13 +114,10 @@ pub mod akkoro { let ptr4 = vec4.as_ptr() as i32; let len4 = vec4.len() as i32; let ptr5 = ret_area.as_mut_ptr() as i32; + #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "akkoro:jwt/decoder")] extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "decode-verify")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "akkoro:jwt/decoder_decode-verify" - )] + #[link_name = "decode-verify"] fn wit_import( _: i32, _: i32, @@ -118,48 +130,43 @@ pub mod akkoro { _: i32, ); } + + #[cfg(not(target_arch = "wasm32"))] + fn wit_import( + _: i32, + _: i32, + _: i32, + _: i32, + _: i32, + _: i32, + _: i32, + _: i32, + _: i32, + ) { + unreachable!() + } wit_import(ptr0, len0, ptr1, len1, ptr3, len3, ptr4, len4, ptr5); - match i32::from(*((ptr5 + 0) as *const u8)) { - 0 => Ok(VerifyResult { - valid: { - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::(i32::from( - *((ptr5 + 1) as *const u8), - ) - as u8) - } - #[cfg(debug_assertions)] - { - match i32::from(*((ptr5 + 1) as *const u8)) { - 0 => false, - 1 => true, - _ => panic!("invalid bool discriminant"), - } - } - }, - }), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr5 + 1) as *const u8)) { - 0 => JwtError::InvalidToken, - 1 => JwtError::InvalidJwks, - _ => panic!("invalid enum discriminant"), + let l6 = i32::from(*((ptr5 + 0) as *const u8)); + match l6 { + 0 => { + let e = { + let l7 = i32::from(*((ptr5 + 1) as *const u8)); + + VerifyResult { + valid: wit_bindgen::rt::bool_lift(l7 as u8), } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, JwtError>(i32::from( - *((ptr5 + 1) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), + }; + Ok(e) + } + 1 => { + let e = { + let l8 = i32::from(*((ptr5 + 1) as *const u8)); + + JwtError::_lift(l8 as u8) + }; + Err(e) + } + _ => wit_bindgen::rt::invalid_enum_discriminant(), } } } @@ -170,31 +177,32 @@ pub mod akkoro { #[cfg(target_arch = "wasm32")] #[link_section = "component-type:jwt"] #[doc(hidden)] -pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 507] = [ - 3, 0, 3, 106, 119, 116, 0, 97, 115, 109, 13, 0, 1, 0, 7, 141, 3, 1, 65, 4, 1, 66, 9, 1, 114, 1, - 5, 118, 97, 108, 105, 100, 127, 4, 0, 13, 118, 101, 114, 105, 102, 121, 45, 114, 101, 115, 117, - 108, 116, 3, 0, 0, 1, 114, 2, 3, 105, 115, 115, 115, 3, 97, 117, 100, 115, 4, 0, 17, 118, 97, - 108, 105, 100, 97, 116, 105, 111, 110, 45, 112, 97, 114, 97, 109, 115, 3, 0, 2, 1, 109, 2, 13, - 105, 110, 118, 97, 108, 105, 100, 45, 116, 111, 107, 101, 110, 12, 105, 110, 118, 97, 108, 105, - 100, 45, 106, 119, 107, 115, 4, 0, 9, 106, 119, 116, 45, 101, 114, 114, 111, 114, 3, 0, 4, 1, - 106, 1, 1, 1, 5, 1, 64, 3, 5, 116, 111, 107, 101, 110, 115, 4, 106, 119, 107, 115, 115, 6, 112, +pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 536] = [ + 3, 0, 3, 106, 119, 116, 0, 97, 115, 109, 13, 0, 1, 0, 7, 189, 1, 1, 65, 2, 1, 66, 9, 1, 109, 2, + 13, 105, 110, 118, 97, 108, 105, 100, 45, 116, 111, 107, 101, 110, 12, 105, 110, 118, 97, 108, + 105, 100, 45, 106, 119, 107, 115, 4, 0, 9, 106, 119, 116, 45, 101, 114, 114, 111, 114, 3, 0, 0, + 1, 114, 2, 3, 105, 115, 115, 115, 3, 97, 117, 100, 115, 4, 0, 17, 118, 97, 108, 105, 100, 97, + 116, 105, 111, 110, 45, 112, 97, 114, 97, 109, 115, 3, 0, 2, 1, 114, 1, 5, 118, 97, 108, 105, + 100, 127, 4, 0, 13, 118, 101, 114, 105, 102, 121, 45, 114, 101, 115, 117, 108, 116, 3, 0, 4, 1, + 106, 1, 5, 1, 1, 1, 64, 3, 5, 116, 111, 107, 101, 110, 115, 4, 106, 119, 107, 115, 115, 6, 112, 97, 114, 97, 109, 115, 3, 0, 6, 4, 0, 13, 100, 101, 99, 111, 100, 101, 45, 118, 101, 114, 105, 102, 121, 1, 7, 4, 1, 18, 97, 107, 107, 111, 114, 111, 58, 106, 119, 116, 47, 100, 101, 99, - 111, 100, 101, 114, 5, 0, 1, 65, 2, 1, 66, 9, 1, 114, 1, 5, 118, 97, 108, 105, 100, 127, 4, 0, - 13, 118, 101, 114, 105, 102, 121, 45, 114, 101, 115, 117, 108, 116, 3, 0, 0, 1, 114, 2, 3, 105, - 115, 115, 115, 3, 97, 117, 100, 115, 4, 0, 17, 118, 97, 108, 105, 100, 97, 116, 105, 111, 110, - 45, 112, 97, 114, 97, 109, 115, 3, 0, 2, 1, 109, 2, 13, 105, 110, 118, 97, 108, 105, 100, 45, - 116, 111, 107, 101, 110, 12, 105, 110, 118, 97, 108, 105, 100, 45, 106, 119, 107, 115, 4, 0, 9, - 106, 119, 116, 45, 101, 114, 114, 111, 114, 3, 0, 4, 1, 106, 1, 1, 1, 5, 1, 64, 3, 5, 116, 111, - 107, 101, 110, 115, 4, 106, 119, 107, 115, 115, 6, 112, 97, 114, 97, 109, 115, 3, 0, 6, 4, 0, - 13, 100, 101, 99, 111, 100, 101, 45, 118, 101, 114, 105, 102, 121, 1, 7, 3, 1, 18, 97, 107, - 107, 111, 114, 111, 58, 106, 119, 116, 47, 100, 101, 99, 111, 100, 101, 114, 5, 0, 4, 1, 14, - 97, 107, 107, 111, 114, 111, 58, 106, 119, 116, 47, 106, 119, 116, 4, 1, 0, 69, 9, 112, 114, - 111, 100, 117, 99, 101, 114, 115, 1, 12, 112, 114, 111, 99, 101, 115, 115, 101, 100, 45, 98, - 121, 2, 13, 119, 105, 116, 45, 99, 111, 109, 112, 111, 110, 101, 110, 116, 6, 48, 46, 49, 49, - 46, 48, 16, 119, 105, 116, 45, 98, 105, 110, 100, 103, 101, 110, 45, 114, 117, 115, 116, 5, 48, - 46, 56, 46, 48, 11, 20, 1, 1, 14, 97, 107, 107, 111, 114, 111, 58, 106, 119, 116, 47, 119, 105, - 116, 3, 0, 0, + 111, 100, 101, 114, 5, 0, 11, 13, 1, 0, 7, 100, 101, 99, 111, 100, 101, 114, 3, 0, 0, 7, 211, + 1, 1, 65, 2, 1, 65, 2, 1, 66, 9, 1, 109, 2, 13, 105, 110, 118, 97, 108, 105, 100, 45, 116, 111, + 107, 101, 110, 12, 105, 110, 118, 97, 108, 105, 100, 45, 106, 119, 107, 115, 4, 0, 9, 106, 119, + 116, 45, 101, 114, 114, 111, 114, 3, 0, 0, 1, 114, 2, 3, 105, 115, 115, 115, 3, 97, 117, 100, + 115, 4, 0, 17, 118, 97, 108, 105, 100, 97, 116, 105, 111, 110, 45, 112, 97, 114, 97, 109, 115, + 3, 0, 2, 1, 114, 1, 5, 118, 97, 108, 105, 100, 127, 4, 0, 13, 118, 101, 114, 105, 102, 121, 45, + 114, 101, 115, 117, 108, 116, 3, 0, 4, 1, 106, 1, 5, 1, 1, 1, 64, 3, 5, 116, 111, 107, 101, + 110, 115, 4, 106, 119, 107, 115, 115, 6, 112, 97, 114, 97, 109, 115, 3, 0, 6, 4, 0, 13, 100, + 101, 99, 111, 100, 101, 45, 118, 101, 114, 105, 102, 121, 1, 7, 3, 1, 18, 97, 107, 107, 111, + 114, 111, 58, 106, 119, 116, 47, 100, 101, 99, 111, 100, 101, 114, 5, 0, 4, 1, 14, 97, 107, + 107, 111, 114, 111, 58, 106, 119, 116, 47, 106, 119, 116, 4, 0, 11, 9, 1, 0, 3, 106, 119, 116, + 3, 2, 0, 0, 16, 12, 112, 97, 99, 107, 97, 103, 101, 45, 100, 111, 99, 115, 0, 123, 125, 0, 70, + 9, 112, 114, 111, 100, 117, 99, 101, 114, 115, 1, 12, 112, 114, 111, 99, 101, 115, 115, 101, + 100, 45, 98, 121, 2, 13, 119, 105, 116, 45, 99, 111, 109, 112, 111, 110, 101, 110, 116, 6, 48, + 46, 49, 56, 46, 50, 16, 119, 105, 116, 45, 98, 105, 110, 100, 103, 101, 110, 45, 114, 117, 115, + 116, 6, 48, 46, 49, 53, 46, 48, ]; #[inline(never)] diff --git a/core/guest/src/lib.rs b/core/guest/src/lib.rs index e5a0eb05..5110440b 100644 --- a/core/guest/src/lib.rs +++ b/core/guest/src/lib.rs @@ -10,10 +10,10 @@ pub use wit_bindgen; pub use assemblylift::akkoro::assemblylift::asml_io; pub use assemblylift::akkoro::assemblylift::asml_rt; pub use assemblylift_core_guest_macros::handler; -pub use command::wasi; +// pub use command::wasi; pub mod assemblylift; -pub mod command; +// pub mod command; pub mod jwt; pub mod opa; pub mod secrets; @@ -29,11 +29,11 @@ impl FunctionContext { } pub fn success(response: String) { - asml_rt::success(response.as_bytes()) + asml_rt::success(&response.as_bytes().to_vec()) } pub fn failure(response: String) { - asml_rt::failure(response.as_bytes()) + asml_rt::failure(&response.as_bytes().to_vec()) } } diff --git a/core/guest/src/opa.rs b/core/guest/src/opa.rs index dcefa3e4..744513b1 100644 --- a/core/guest/src/opa.rs +++ b/core/guest/src/opa.rs @@ -1,4 +1,4 @@ -// Generated by `wit-bindgen` 0.8.0. DO NOT EDIT! +// Generated by `wit-bindgen` 0.15.0. DO NOT EDIT! pub mod akkoro { pub mod opa { @@ -8,9 +8,8 @@ pub mod akkoro { #[doc(hidden)] #[cfg(target_arch = "wasm32")] static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; - #[repr(u8)] - #[derive(Clone, Copy, PartialEq, Eq)] + #[derive(Clone, Copy, Eq, PartialEq)] pub enum PolicyError { InvalidWasm, NoEntrypoint, @@ -45,6 +44,22 @@ pub mod akkoro { } impl std::error::Error for PolicyError {} + + impl PolicyError { + pub(crate) unsafe fn _lift(val: u8) -> PolicyError { + if !cfg!(debug_assertions) { + return ::core::mem::transmute(val); + } + + match val { + 0 => PolicyError::InvalidWasm, + 1 => PolicyError::NoEntrypoint, + + _ => panic!("invalid enum discriminant"), + } + } + } + #[derive(Clone)] pub struct Policy { pub id: wit_bindgen::rt::string::String, @@ -58,7 +73,7 @@ pub mod akkoro { .finish() } } - #[allow(clippy::all)] + #[allow(unused_unsafe, clippy::all)] pub fn new_policy(bytes: &[u8]) -> Result { #[allow(unused_imports)] use wit_bindgen::rt::{alloc, string::String, vec::Vec}; @@ -70,98 +85,66 @@ pub mod akkoro { let ptr0 = vec0.as_ptr() as i32; let len0 = vec0.len() as i32; let ptr1 = ret_area.as_mut_ptr() as i32; + #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "akkoro:opa/module")] extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "new-policy")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "akkoro:opa/module_new-policy" - )] + #[link_name = "new-policy"] fn wit_import(_: i32, _: i32, _: i32); } + + #[cfg(not(target_arch = "wasm32"))] + fn wit_import(_: i32, _: i32, _: i32) { + unreachable!() + } wit_import(ptr0, len0, ptr1); - match i32::from(*((ptr1 + 0) as *const u8)) { - 0 => Ok({ - let len2 = *((ptr1 + 8) as *const i32) as usize; - let base4 = *((ptr1 + 12) as *const i32); - let len4 = *((ptr1 + 16) as *const i32); - let mut result4 = Vec::with_capacity(len4 as usize); - for i in 0..len4 { - let base = base4 + i * 8; - result4.push({ - let len3 = *((base + 4) as *const i32) as usize; + let l2 = i32::from(*((ptr1 + 0) as *const u8)); + match l2 { + 0 => { + let e = { + let l3 = *((ptr1 + 4) as *const i32); + let l4 = *((ptr1 + 8) as *const i32); + let len5 = l4 as usize; + let bytes5 = Vec::from_raw_parts(l3 as *mut _, len5, len5); + let l6 = *((ptr1 + 12) as *const i32); + let l7 = *((ptr1 + 16) as *const i32); + let base11 = l6; + let len11 = l7; + let mut result11 = Vec::with_capacity(len11 as usize); + for i in 0..len11 { + let base = base11 + i * 8; + let e11 = { + let l8 = *((base + 0) as *const i32); + let l9 = *((base + 4) as *const i32); + let len10 = l9 as usize; + let bytes10 = + Vec::from_raw_parts(l8 as *mut _, len10, len10); - { - #[cfg(not(debug_assertions))] - { - String::from_utf8_unchecked(Vec::from_raw_parts( - *((base + 0) as *const i32) as *mut _, - len3, - len3, - )) - } - #[cfg(debug_assertions)] - { - String::from_utf8(Vec::from_raw_parts( - *((base + 0) as *const i32) as *mut _, - len3, - len3, - )) - .unwrap() - } - } - }); - } - wit_bindgen::rt::dealloc(base4, (len4 as usize) * 8, 4); + wit_bindgen::rt::string_lift(bytes10) + }; + result11.push(e11); + } + wit_bindgen::rt::dealloc(base11, (len11 as usize) * 8, 4); - Policy { - id: { - #[cfg(not(debug_assertions))] - { - String::from_utf8_unchecked(Vec::from_raw_parts( - *((ptr1 + 4) as *const i32) as *mut _, - len2, - len2, - )) - } - #[cfg(debug_assertions)] - { - String::from_utf8(Vec::from_raw_parts( - *((ptr1 + 4) as *const i32) as *mut _, - len2, - len2, - )) - .unwrap() - } - }, - entrypoints: result4, - } - }), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr1 + 4) as *const u8)) { - 0 => PolicyError::InvalidWasm, - 1 => PolicyError::NoEntrypoint, - _ => panic!("invalid enum discriminant"), + Policy { + id: wit_bindgen::rt::string_lift(bytes5), + entrypoints: result11, } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, PolicyError>(i32::from( - *((ptr1 + 4) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), + }; + Ok(e) + } + 1 => { + let e = { + let l12 = i32::from(*((ptr1 + 4) as *const u8)); + + PolicyError::_lift(l12 as u8) + }; + Err(e) + } + _ => wit_bindgen::rt::invalid_enum_discriminant(), } } } - #[allow(clippy::all)] + #[allow(unused_unsafe, clippy::all)] pub fn eval(id: &str, data: &str, input: &str) -> wit_bindgen::rt::string::String { #[allow(unused_imports)] use wit_bindgen::rt::{alloc, string::String, vec::Vec}; @@ -179,36 +162,23 @@ pub mod akkoro { let ptr2 = vec2.as_ptr() as i32; let len2 = vec2.len() as i32; let ptr3 = ret_area.as_mut_ptr() as i32; + #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "akkoro:opa/module")] extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "eval")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "akkoro:opa/module_eval" - )] + #[link_name = "eval"] fn wit_import(_: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32); } - wit_import(ptr0, len0, ptr1, len1, ptr2, len2, ptr3); - let len4 = *((ptr3 + 4) as *const i32) as usize; - { - #[cfg(not(debug_assertions))] - { - String::from_utf8_unchecked(Vec::from_raw_parts( - *((ptr3 + 0) as *const i32) as *mut _, - len4, - len4, - )) - } - #[cfg(debug_assertions)] - { - String::from_utf8(Vec::from_raw_parts( - *((ptr3 + 0) as *const i32) as *mut _, - len4, - len4, - )) - .unwrap() - } + + #[cfg(not(target_arch = "wasm32"))] + fn wit_import(_: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32) { + unreachable!() } + wit_import(ptr0, len0, ptr1, len1, ptr2, len2, ptr3); + let l4 = *((ptr3 + 0) as *const i32); + let l5 = *((ptr3 + 4) as *const i32); + let len6 = l5 as usize; + let bytes6 = Vec::from_raw_parts(l4 as *mut _, len6, len6); + wit_bindgen::rt::string_lift(bytes6) } } } @@ -218,8 +188,8 @@ pub mod akkoro { #[cfg(target_arch = "wasm32")] #[link_section = "component-type:opa"] #[doc(hidden)] -pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 485] = [ - 3, 0, 3, 111, 112, 97, 0, 97, 115, 109, 13, 0, 1, 0, 7, 247, 2, 1, 65, 4, 1, 66, 11, 1, 109, 2, +pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 513] = [ + 3, 0, 3, 111, 112, 97, 0, 97, 115, 109, 13, 0, 1, 0, 7, 178, 1, 1, 65, 2, 1, 66, 11, 1, 109, 2, 12, 105, 110, 118, 97, 108, 105, 100, 45, 119, 97, 115, 109, 13, 110, 111, 45, 101, 110, 116, 114, 121, 112, 111, 105, 110, 116, 4, 0, 12, 112, 111, 108, 105, 99, 121, 45, 101, 114, 114, 111, 114, 3, 0, 0, 1, 112, 115, 1, 114, 2, 2, 105, 100, 115, 11, 101, 110, 116, 114, 121, 112, @@ -227,21 +197,22 @@ pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 485] = [ 1, 4, 1, 1, 1, 64, 1, 5, 98, 121, 116, 101, 115, 5, 0, 6, 4, 0, 10, 110, 101, 119, 45, 112, 111, 108, 105, 99, 121, 1, 7, 1, 64, 3, 2, 105, 100, 115, 4, 100, 97, 116, 97, 115, 5, 105, 110, 112, 117, 116, 115, 0, 115, 4, 0, 4, 101, 118, 97, 108, 1, 8, 4, 1, 17, 97, 107, 107, 111, - 114, 111, 58, 111, 112, 97, 47, 109, 111, 100, 117, 108, 101, 5, 0, 1, 65, 2, 1, 66, 11, 1, - 109, 2, 12, 105, 110, 118, 97, 108, 105, 100, 45, 119, 97, 115, 109, 13, 110, 111, 45, 101, - 110, 116, 114, 121, 112, 111, 105, 110, 116, 4, 0, 12, 112, 111, 108, 105, 99, 121, 45, 101, - 114, 114, 111, 114, 3, 0, 0, 1, 112, 115, 1, 114, 2, 2, 105, 100, 115, 11, 101, 110, 116, 114, - 121, 112, 111, 105, 110, 116, 115, 2, 4, 0, 6, 112, 111, 108, 105, 99, 121, 3, 0, 3, 1, 112, - 125, 1, 106, 1, 4, 1, 1, 1, 64, 1, 5, 98, 121, 116, 101, 115, 5, 0, 6, 4, 0, 10, 110, 101, 119, - 45, 112, 111, 108, 105, 99, 121, 1, 7, 1, 64, 3, 2, 105, 100, 115, 4, 100, 97, 116, 97, 115, 5, - 105, 110, 112, 117, 116, 115, 0, 115, 4, 0, 4, 101, 118, 97, 108, 1, 8, 3, 1, 17, 97, 107, 107, - 111, 114, 111, 58, 111, 112, 97, 47, 109, 111, 100, 117, 108, 101, 5, 0, 4, 1, 14, 97, 107, - 107, 111, 114, 111, 58, 111, 112, 97, 47, 111, 112, 97, 4, 1, 0, 69, 9, 112, 114, 111, 100, + 114, 111, 58, 111, 112, 97, 47, 109, 111, 100, 117, 108, 101, 5, 0, 11, 12, 1, 0, 6, 109, 111, + 100, 117, 108, 101, 3, 0, 0, 7, 200, 1, 1, 65, 2, 1, 65, 2, 1, 66, 11, 1, 109, 2, 12, 105, 110, + 118, 97, 108, 105, 100, 45, 119, 97, 115, 109, 13, 110, 111, 45, 101, 110, 116, 114, 121, 112, + 111, 105, 110, 116, 4, 0, 12, 112, 111, 108, 105, 99, 121, 45, 101, 114, 114, 111, 114, 3, 0, + 0, 1, 112, 115, 1, 114, 2, 2, 105, 100, 115, 11, 101, 110, 116, 114, 121, 112, 111, 105, 110, + 116, 115, 2, 4, 0, 6, 112, 111, 108, 105, 99, 121, 3, 0, 3, 1, 112, 125, 1, 106, 1, 4, 1, 1, 1, + 64, 1, 5, 98, 121, 116, 101, 115, 5, 0, 6, 4, 0, 10, 110, 101, 119, 45, 112, 111, 108, 105, 99, + 121, 1, 7, 1, 64, 3, 2, 105, 100, 115, 4, 100, 97, 116, 97, 115, 5, 105, 110, 112, 117, 116, + 115, 0, 115, 4, 0, 4, 101, 118, 97, 108, 1, 8, 3, 1, 17, 97, 107, 107, 111, 114, 111, 58, 111, + 112, 97, 47, 109, 111, 100, 117, 108, 101, 5, 0, 4, 1, 14, 97, 107, 107, 111, 114, 111, 58, + 111, 112, 97, 47, 111, 112, 97, 4, 0, 11, 9, 1, 0, 3, 111, 112, 97, 3, 2, 0, 0, 16, 12, 112, + 97, 99, 107, 97, 103, 101, 45, 100, 111, 99, 115, 0, 123, 125, 0, 70, 9, 112, 114, 111, 100, 117, 99, 101, 114, 115, 1, 12, 112, 114, 111, 99, 101, 115, 115, 101, 100, 45, 98, 121, 2, 13, - 119, 105, 116, 45, 99, 111, 109, 112, 111, 110, 101, 110, 116, 6, 48, 46, 49, 49, 46, 48, 16, - 119, 105, 116, 45, 98, 105, 110, 100, 103, 101, 110, 45, 114, 117, 115, 116, 5, 48, 46, 56, 46, - 48, 11, 20, 1, 1, 14, 97, 107, 107, 111, 114, 111, 58, 111, 112, 97, 47, 119, 105, 116, 3, 0, - 0, + 119, 105, 116, 45, 99, 111, 109, 112, 111, 110, 101, 110, 116, 6, 48, 46, 49, 56, 46, 50, 16, + 119, 105, 116, 45, 98, 105, 110, 100, 103, 101, 110, 45, 114, 117, 115, 116, 6, 48, 46, 49, 53, + 46, 48, ]; #[inline(never)] diff --git a/core/guest/src/secrets.rs b/core/guest/src/secrets.rs index 676276a3..f72818d3 100644 --- a/core/guest/src/secrets.rs +++ b/core/guest/src/secrets.rs @@ -1,4 +1,4 @@ -// Generated by `wit-bindgen` 0.8.0. DO NOT EDIT! +// Generated by `wit-bindgen` 0.15.0. DO NOT EDIT! pub mod akkoro { pub mod secrets { @@ -8,7 +8,8 @@ pub mod akkoro { #[doc(hidden)] #[cfg(target_arch = "wasm32")] static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; - + /// TODO this should be a capability handle or `resource` + pub type Key = wit_bindgen::rt::string::String; #[derive(Clone)] pub struct Secret { pub id: wit_bindgen::rt::string::String, @@ -22,9 +23,8 @@ pub mod akkoro { .finish() } } - pub type Key<'a> = &'a str; #[repr(u8)] - #[derive(Clone, Copy, PartialEq, Eq)] + #[derive(Clone, Copy, Eq, PartialEq)] pub enum Error { Success, InvalidArgument, @@ -62,7 +62,24 @@ pub mod akkoro { } impl std::error::Error for Error {} - #[allow(clippy::all)] + + impl Error { + pub(crate) unsafe fn _lift(val: u8) -> Error { + if !cfg!(debug_assertions) { + return ::core::mem::transmute(val); + } + + match val { + 0 => Error::Success, + 1 => Error::InvalidArgument, + 2 => Error::Forbidden, + + _ => panic!("invalid enum discriminant"), + } + } + } + + #[allow(unused_unsafe, clippy::all)] /// Return the secret value associated with the handle pub fn get_secret_value(id: &str) -> Result { #[allow(unused_imports)] @@ -75,86 +92,63 @@ pub mod akkoro { let ptr0 = vec0.as_ptr() as i32; let len0 = vec0.len() as i32; let ptr1 = ret_area.as_mut_ptr() as i32; + #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "akkoro:secrets/secret-storage")] extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "get-secret-value")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "akkoro:secrets/secret-storage_get-secret-value" - )] + #[link_name = "get-secret-value"] fn wit_import(_: i32, _: i32, _: i32); } + + #[cfg(not(target_arch = "wasm32"))] + fn wit_import(_: i32, _: i32, _: i32) { + unreachable!() + } wit_import(ptr0, len0, ptr1); - match i32::from(*((ptr1 + 0) as *const u8)) { - 0 => Ok({ - let len2 = *((ptr1 + 8) as *const i32) as usize; + let l2 = i32::from(*((ptr1 + 0) as *const u8)); + match l2 { + 0 => { + let e = { + let l3 = *((ptr1 + 4) as *const i32); + let l4 = *((ptr1 + 8) as *const i32); + let len5 = l4 as usize; + let bytes5 = Vec::from_raw_parts(l3 as *mut _, len5, len5); + let l6 = i32::from(*((ptr1 + 12) as *const u8)); - Secret { - id: { - #[cfg(not(debug_assertions))] - { - String::from_utf8_unchecked(Vec::from_raw_parts( - *((ptr1 + 4) as *const i32) as *mut _, - len2, - len2, - )) - } - #[cfg(debug_assertions)] - { - String::from_utf8(Vec::from_raw_parts( - *((ptr1 + 4) as *const i32) as *mut _, - len2, - len2, - )) - .unwrap() - } - }, - value: match i32::from(*((ptr1 + 12) as *const u8)) { - 0 => None, - 1 => Some({ - let len3 = *((ptr1 + 20) as *const i32) as usize; + Secret { + id: wit_bindgen::rt::string_lift(bytes5), + value: match l6 { + 0 => None, + 1 => { + let e = { + let l7 = *((ptr1 + 16) as *const i32); + let l8 = *((ptr1 + 20) as *const i32); + let len9 = l8 as usize; - Vec::from_raw_parts( - *((ptr1 + 16) as *const i32) as *mut _, - len3, - len3, - ) - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - }, - } - }), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr1 + 4) as *const u8)) { - 0 => Error::Success, - 1 => Error::InvalidArgument, - 2 => Error::Forbidden, - _ => panic!("invalid enum discriminant"), + Vec::from_raw_parts(l7 as *mut _, len9, len9) + }; + Some(e) + } + _ => wit_bindgen::rt::invalid_enum_discriminant(), + }, } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, Error>(i32::from( - *((ptr1 + 4) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), + }; + Ok(e) + } + 1 => { + let e = { + let l10 = i32::from(*((ptr1 + 4) as *const u8)); + + Error::_lift(l10 as u8) + }; + Err(e) + } + _ => wit_bindgen::rt::invalid_enum_discriminant(), } } } - #[allow(clippy::all)] + #[allow(unused_unsafe, clippy::all)] /// Set the secret value associated with the handle - pub fn set_secret_value(id: &str, value: &[u8], key: Key<'_>) -> Result { + pub fn set_secret_value(id: &str, value: &[u8], key: &Key) -> Result { #[allow(unused_imports)] use wit_bindgen::rt::{alloc, string::String, vec::Vec}; unsafe { @@ -171,80 +165,57 @@ pub mod akkoro { let ptr2 = vec2.as_ptr() as i32; let len2 = vec2.len() as i32; let ptr3 = ret_area.as_mut_ptr() as i32; + #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "akkoro:secrets/secret-storage")] extern "C" { - #[cfg_attr(target_arch = "wasm32", link_name = "set-secret-value")] - #[cfg_attr( - not(target_arch = "wasm32"), - link_name = "akkoro:secrets/secret-storage_set-secret-value" - )] + #[link_name = "set-secret-value"] fn wit_import(_: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32); } + + #[cfg(not(target_arch = "wasm32"))] + fn wit_import(_: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32) { + unreachable!() + } wit_import(ptr0, len0, ptr1, len1, ptr2, len2, ptr3); - match i32::from(*((ptr3 + 0) as *const u8)) { - 0 => Ok({ - let len4 = *((ptr3 + 8) as *const i32) as usize; + let l4 = i32::from(*((ptr3 + 0) as *const u8)); + match l4 { + 0 => { + let e = { + let l5 = *((ptr3 + 4) as *const i32); + let l6 = *((ptr3 + 8) as *const i32); + let len7 = l6 as usize; + let bytes7 = Vec::from_raw_parts(l5 as *mut _, len7, len7); + let l8 = i32::from(*((ptr3 + 12) as *const u8)); - Secret { - id: { - #[cfg(not(debug_assertions))] - { - String::from_utf8_unchecked(Vec::from_raw_parts( - *((ptr3 + 4) as *const i32) as *mut _, - len4, - len4, - )) - } - #[cfg(debug_assertions)] - { - String::from_utf8(Vec::from_raw_parts( - *((ptr3 + 4) as *const i32) as *mut _, - len4, - len4, - )) - .unwrap() - } - }, - value: match i32::from(*((ptr3 + 12) as *const u8)) { - 0 => None, - 1 => Some({ - let len5 = *((ptr3 + 20) as *const i32) as usize; + Secret { + id: wit_bindgen::rt::string_lift(bytes7), + value: match l8 { + 0 => None, + 1 => { + let e = { + let l9 = *((ptr3 + 16) as *const i32); + let l10 = *((ptr3 + 20) as *const i32); + let len11 = l10 as usize; - Vec::from_raw_parts( - *((ptr3 + 16) as *const i32) as *mut _, - len5, - len5, - ) - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), - }, - } - }), - 1 => Err({ - #[cfg(debug_assertions)] - { - match i32::from(*((ptr3 + 4) as *const u8)) { - 0 => Error::Success, - 1 => Error::InvalidArgument, - 2 => Error::Forbidden, - _ => panic!("invalid enum discriminant"), + Vec::from_raw_parts(l9 as *mut _, len11, len11) + }; + Some(e) + } + _ => wit_bindgen::rt::invalid_enum_discriminant(), + }, } - } - #[cfg(not(debug_assertions))] - { - ::core::mem::transmute::<_, Error>(i32::from( - *((ptr3 + 4) as *const u8), - ) - as u8) - } - }), - #[cfg(not(debug_assertions))] - _ => ::core::hint::unreachable_unchecked(), - #[cfg(debug_assertions)] - _ => panic!("invalid enum discriminant"), + }; + Ok(e) + } + 1 => { + let e = { + let l12 = i32::from(*((ptr3 + 4) as *const u8)); + + Error::_lift(l12 as u8) + }; + Err(e) + } + _ => wit_bindgen::rt::invalid_enum_discriminant(), } } } @@ -255,33 +226,50 @@ pub mod akkoro { #[cfg(target_arch = "wasm32")] #[link_section = "component-type:secrets"] #[doc(hidden)] -pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 565] = [ - 3, 0, 7, 115, 101, 99, 114, 101, 116, 115, 0, 97, 115, 109, 13, 0, 1, 0, 7, 191, 3, 1, 65, 4, - 1, 66, 13, 1, 112, 125, 1, 107, 0, 1, 114, 2, 2, 105, 100, 115, 5, 118, 97, 108, 117, 101, 1, - 4, 0, 6, 115, 101, 99, 114, 101, 116, 3, 0, 2, 1, 115, 4, 0, 3, 107, 101, 121, 3, 0, 4, 1, 109, +pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 914] = [ + 3, 0, 7, 115, 101, 99, 114, 101, 116, 115, 0, 97, 115, 109, 13, 0, 1, 0, 7, 210, 1, 1, 65, 2, + 1, 66, 13, 1, 115, 4, 0, 3, 107, 101, 121, 3, 0, 0, 1, 112, 125, 1, 107, 2, 1, 114, 2, 2, 105, + 100, 115, 5, 118, 97, 108, 117, 101, 3, 4, 0, 6, 115, 101, 99, 114, 101, 116, 3, 0, 4, 1, 109, 3, 7, 115, 117, 99, 99, 101, 115, 115, 16, 105, 110, 118, 97, 108, 105, 100, 45, 97, 114, 103, 117, 109, 101, 110, 116, 9, 102, 111, 114, 98, 105, 100, 100, 101, 110, 4, 0, 5, 101, 114, 114, - 111, 114, 3, 0, 6, 1, 106, 1, 3, 1, 7, 1, 64, 1, 2, 105, 100, 115, 0, 8, 4, 0, 16, 103, 101, + 111, 114, 3, 0, 6, 1, 106, 1, 5, 1, 7, 1, 64, 1, 2, 105, 100, 115, 0, 8, 4, 0, 16, 103, 101, 116, 45, 115, 101, 99, 114, 101, 116, 45, 118, 97, 108, 117, 101, 1, 9, 1, 64, 3, 2, 105, 100, - 115, 5, 118, 97, 108, 117, 101, 0, 3, 107, 101, 121, 5, 0, 8, 4, 0, 16, 115, 101, 116, 45, 115, + 115, 5, 118, 97, 108, 117, 101, 2, 3, 107, 101, 121, 1, 0, 8, 4, 0, 16, 115, 101, 116, 45, 115, 101, 99, 114, 101, 116, 45, 118, 97, 108, 117, 101, 1, 10, 4, 1, 29, 97, 107, 107, 111, 114, 111, 58, 115, 101, 99, 114, 101, 116, 115, 47, 115, 101, 99, 114, 101, 116, 45, 115, 116, 111, - 114, 97, 103, 101, 5, 0, 1, 65, 2, 1, 66, 13, 1, 112, 125, 1, 107, 0, 1, 114, 2, 2, 105, 100, - 115, 5, 118, 97, 108, 117, 101, 1, 4, 0, 6, 115, 101, 99, 114, 101, 116, 3, 0, 2, 1, 115, 4, 0, - 3, 107, 101, 121, 3, 0, 4, 1, 109, 3, 7, 115, 117, 99, 99, 101, 115, 115, 16, 105, 110, 118, - 97, 108, 105, 100, 45, 97, 114, 103, 117, 109, 101, 110, 116, 9, 102, 111, 114, 98, 105, 100, - 100, 101, 110, 4, 0, 5, 101, 114, 114, 111, 114, 3, 0, 6, 1, 106, 1, 3, 1, 7, 1, 64, 1, 2, 105, - 100, 115, 0, 8, 4, 0, 16, 103, 101, 116, 45, 115, 101, 99, 114, 101, 116, 45, 118, 97, 108, - 117, 101, 1, 9, 1, 64, 3, 2, 105, 100, 115, 5, 118, 97, 108, 117, 101, 0, 3, 107, 101, 121, 5, - 0, 8, 4, 0, 16, 115, 101, 116, 45, 115, 101, 99, 114, 101, 116, 45, 118, 97, 108, 117, 101, 1, - 10, 3, 1, 29, 97, 107, 107, 111, 114, 111, 58, 115, 101, 99, 114, 101, 116, 115, 47, 115, 101, - 99, 114, 101, 116, 45, 115, 116, 111, 114, 97, 103, 101, 5, 0, 4, 1, 22, 97, 107, 107, 111, - 114, 111, 58, 115, 101, 99, 114, 101, 116, 115, 47, 115, 101, 99, 114, 101, 116, 115, 4, 1, 0, - 69, 9, 112, 114, 111, 100, 117, 99, 101, 114, 115, 1, 12, 112, 114, 111, 99, 101, 115, 115, - 101, 100, 45, 98, 121, 2, 13, 119, 105, 116, 45, 99, 111, 109, 112, 111, 110, 101, 110, 116, 6, - 48, 46, 49, 49, 46, 48, 16, 119, 105, 116, 45, 98, 105, 110, 100, 103, 101, 110, 45, 114, 117, - 115, 116, 5, 48, 46, 56, 46, 48, 11, 24, 1, 1, 18, 97, 107, 107, 111, 114, 111, 58, 115, 101, - 99, 114, 101, 116, 115, 47, 119, 105, 116, 3, 0, 0, + 114, 97, 103, 101, 5, 0, 11, 20, 1, 0, 14, 115, 101, 99, 114, 101, 116, 45, 115, 116, 111, 114, + 97, 103, 101, 3, 0, 0, 7, 240, 1, 1, 65, 2, 1, 65, 2, 1, 66, 13, 1, 115, 4, 0, 3, 107, 101, + 121, 3, 0, 0, 1, 112, 125, 1, 107, 2, 1, 114, 2, 2, 105, 100, 115, 5, 118, 97, 108, 117, 101, + 3, 4, 0, 6, 115, 101, 99, 114, 101, 116, 3, 0, 4, 1, 109, 3, 7, 115, 117, 99, 99, 101, 115, + 115, 16, 105, 110, 118, 97, 108, 105, 100, 45, 97, 114, 103, 117, 109, 101, 110, 116, 9, 102, + 111, 114, 98, 105, 100, 100, 101, 110, 4, 0, 5, 101, 114, 114, 111, 114, 3, 0, 6, 1, 106, 1, 5, + 1, 7, 1, 64, 1, 2, 105, 100, 115, 0, 8, 4, 0, 16, 103, 101, 116, 45, 115, 101, 99, 114, 101, + 116, 45, 118, 97, 108, 117, 101, 1, 9, 1, 64, 3, 2, 105, 100, 115, 5, 118, 97, 108, 117, 101, + 2, 3, 107, 101, 121, 1, 0, 8, 4, 0, 16, 115, 101, 116, 45, 115, 101, 99, 114, 101, 116, 45, + 118, 97, 108, 117, 101, 1, 10, 3, 1, 29, 97, 107, 107, 111, 114, 111, 58, 115, 101, 99, 114, + 101, 116, 115, 47, 115, 101, 99, 114, 101, 116, 45, 115, 116, 111, 114, 97, 103, 101, 5, 0, 4, + 1, 22, 97, 107, 107, 111, 114, 111, 58, 115, 101, 99, 114, 101, 116, 115, 47, 115, 101, 99, + 114, 101, 116, 115, 4, 0, 11, 13, 1, 0, 7, 115, 101, 99, 114, 101, 116, 115, 3, 2, 0, 0, 200, + 2, 12, 112, 97, 99, 107, 97, 103, 101, 45, 100, 111, 99, 115, 0, 123, 34, 105, 110, 116, 101, + 114, 102, 97, 99, 101, 115, 34, 58, 123, 34, 115, 101, 99, 114, 101, 116, 45, 115, 116, 111, + 114, 97, 103, 101, 34, 58, 123, 34, 100, 111, 99, 115, 34, 58, 34, 80, 114, 111, 118, 105, 100, + 101, 115, 32, 105, 110, 116, 101, 114, 102, 97, 99, 101, 32, 116, 111, 32, 97, 32, 115, 101, + 99, 114, 101, 116, 115, 32, 115, 116, 111, 114, 101, 34, 44, 34, 102, 117, 110, 99, 115, 34, + 58, 123, 34, 103, 101, 116, 45, 115, 101, 99, 114, 101, 116, 45, 118, 97, 108, 117, 101, 34, + 58, 34, 82, 101, 116, 117, 114, 110, 32, 116, 104, 101, 32, 115, 101, 99, 114, 101, 116, 32, + 118, 97, 108, 117, 101, 32, 97, 115, 115, 111, 99, 105, 97, 116, 101, 100, 32, 119, 105, 116, + 104, 32, 116, 104, 101, 32, 104, 97, 110, 100, 108, 101, 34, 44, 34, 115, 101, 116, 45, 115, + 101, 99, 114, 101, 116, 45, 118, 97, 108, 117, 101, 34, 58, 34, 83, 101, 116, 32, 116, 104, + 101, 32, 115, 101, 99, 114, 101, 116, 32, 118, 97, 108, 117, 101, 32, 97, 115, 115, 111, 99, + 105, 97, 116, 101, 100, 32, 119, 105, 116, 104, 32, 116, 104, 101, 32, 104, 97, 110, 100, 108, + 101, 34, 125, 44, 34, 116, 121, 112, 101, 115, 34, 58, 123, 34, 107, 101, 121, 34, 58, 123, 34, + 100, 111, 99, 115, 34, 58, 34, 84, 79, 68, 79, 32, 116, 104, 105, 115, 32, 115, 104, 111, 117, + 108, 100, 32, 98, 101, 32, 97, 32, 99, 97, 112, 97, 98, 105, 108, 105, 116, 121, 32, 104, 97, + 110, 100, 108, 101, 32, 111, 114, 32, 96, 114, 101, 115, 111, 117, 114, 99, 101, 96, 34, 125, + 125, 125, 125, 125, 0, 70, 9, 112, 114, 111, 100, 117, 99, 101, 114, 115, 1, 12, 112, 114, 111, + 99, 101, 115, 115, 101, 100, 45, 98, 121, 2, 13, 119, 105, 116, 45, 99, 111, 109, 112, 111, + 110, 101, 110, 116, 6, 48, 46, 49, 56, 46, 50, 16, 119, 105, 116, 45, 98, 105, 110, 100, 103, + 101, 110, 45, 114, 117, 115, 116, 6, 48, 46, 49, 53, 46, 48, ]; #[inline(never)] diff --git a/core/src/wasm/mod.rs b/core/src/wasm/mod.rs index 6de97f6c..86c976ad 100644 --- a/core/src/wasm/mod.rs +++ b/core/src/wasm/mod.rs @@ -9,13 +9,13 @@ use std::sync::{Arc, Mutex}; use anyhow::{anyhow, Context}; use wasmtime_wasi::sync::Dir; use wasmtime_wasi::preview2; -use wasmtime_wasi::preview2::{DirPerms, FilePerms, Table, WasiView}; +use wasmtime_wasi::preview2::{DirPerms, FilePerms, WasiView}; pub use crossbeam_channel::bounded as status_channel; use once_cell::sync::Lazy; use tracing::debug; use uuid::Uuid; use wasmtime::{component, AsContextMut, AsContext}; -use wasmtime::component::Component; +use wasmtime::component::{Component, ResourceTable}; use wasmtime::{Config, Engine, Store}; use wit_component::{ComponentEncoder, StringEncoding}; use wasm_encoder::{Encode, Section}; @@ -80,7 +80,7 @@ where Ok((engine, component)) } _ => { - return Err(anyhow!( + Err(anyhow!( "invalid module extension; must be .wasm or .wasm.bin" )) } @@ -125,13 +125,13 @@ where request_id: Option, input: &[u8], ) -> anyhow::Result<( - preview2::wasi::command::Command, + preview2::command::Command, Store>, )> { let threader = Arc::new(Mutex::new(Threader::new(registry_tx))); let mut linker: component::Linker> = component::Linker::new(&self.engine); - wasmtime_wasi::preview2::wasi::command::add_to_linker(&mut linker) + wasmtime_wasi::preview2::command::add_to_linker(&mut linker) .expect("could not link wasi runtime component"); asml_wit::Assemblylift::add_to_linker(&mut linker, |s| s) .expect("could not link assemblylift runtime component"); @@ -142,19 +142,19 @@ where secrets_wit::Secrets::add_to_linker(&mut linker, |s| s) .expect("could not link secrets runtime component"); - let mut builder = preview2::WasiCtxBuilder::new(); + let mut builder = &mut preview2::WasiCtxBuilder::new(); for e in environment_vars { - builder = builder.push_env(&*e.0, &*e.1); + builder = builder.env(&*e.0, &*e.1); } match runtime_environment.as_str() { - "ruby" => builder = builder.inherit_stdio().push_env("RUBY_PLATFORM", "wasm32-wasi").set_args(&["ruby", "/src/handler.rb"]), + "ruby" => builder = builder.inherit_stdio().env("RUBY_PLATFORM", "wasm32-wasi").args(&["ruby", "/src/handler.rb"]), _ => (), } for path in bind_paths { debug!("binding {} to {}", path.0, path.1); - builder = builder.push_preopened_dir( + builder = builder.preopened_dir( Dir::from_std_file( File::open(path.0).unwrap(), ), @@ -163,7 +163,7 @@ where path.1, ); } - builder = builder.push_preopened_dir( + builder = builder.preopened_dir( Dir::from_std_file( File::open("/tmp/asmltmp").unwrap(), ), @@ -174,8 +174,8 @@ where builder = builder.inherit_stdout(); builder = builder.inherit_stderr(); - let mut table = Table::new(); - let wasi = builder.build(&mut table).unwrap(); + let table = ResourceTable::new(); + let wasi = builder.build(); let state = AsmlComponentFunctionState { function_input: input.to_vec(), @@ -190,7 +190,7 @@ where }; let mut store = Store::new(&self.engine, state); - match wasmtime_wasi::preview2::wasi::command::Command::instantiate_async( + match wasmtime_wasi::preview2::command::Command::instantiate_async( &mut store, &self.component, &linker, @@ -204,18 +204,18 @@ where pub async fn run_component( &mut self, - wasi: wasmtime_wasi::preview2::wasi::command::Command, + wasi: wasmtime_wasi::preview2::command::Command, mut store: CTX, ) -> anyhow::Result<()> where CTX: AsContextMut, ::Data: std::marker::Send, { - wasi.call_run( - &mut store, - ) - .await? - .map_err(|()| anyhow::anyhow!("command returned with failing exit status")) + wasi + .wasi_cli_run() + .call_run(&mut store) + .await? + .map_err(|()| anyhow::anyhow!("command returned with failing exit status")) } } @@ -231,7 +231,7 @@ where request_id: Option, cache: Arc>, wasi: preview2::WasiCtx, - table: Table, + table: ResourceTable, _phantom: std::marker::PhantomData, } @@ -240,21 +240,21 @@ where R: RuntimeAbi + Send + 'static, S: Clone + Send + Sized + 'static, { - fn table(&self) -> &wasmtime_wasi::preview2::Table { - &self.table - } - - fn table_mut(&mut self) -> &mut wasmtime_wasi::preview2::Table { + fn table(&mut self) -> &mut ResourceTable { &mut self.table } - fn ctx(&self) -> &preview2::WasiCtx { - &self.wasi - } + // fn table_mut(&mut self) -> &mut wasmtime_wasi::preview2::Table { + // &mut self.table + // } - fn ctx_mut(&mut self) -> &mut preview2::WasiCtx { + fn ctx(&mut self) -> &mut preview2::WasiCtx { &mut self.wasi } + + // fn ctx_mut(&mut self) -> &mut preview2::WasiCtx { + // &mut self.wasi + // } } impl asml_io::Host for AsmlComponentFunctionState @@ -435,7 +435,7 @@ pub fn precompile(module_path: &Path, target: &str, mode: &str) -> anyhow::Resul let is_component = file_path.contains(".component."); println!("Precompiling WASM to {}...", file_path.clone()); - let wasm_bytes = match std::fs::read(module_path.clone()) { + let wasm_bytes = match std::fs::read(module_path) { Ok(bytes) => bytes, Err(err) => return Err(err.into()), }; @@ -488,7 +488,7 @@ fn new_engine(target: Option<&str>, cpu_compat_mode: Option<&str>) -> anyhow::Re } pub fn make_wasi_component(module: Vec, preview1: &[u8]) -> anyhow::Result> { - println!("Encoding WASM Module as Component..."); + println!("Encoding WASM Module as Component [{} bytes]...", module.len()); let mut encoder = ComponentEncoder::default().validate(true).module(&module)?; encoder = encoder.adapter("wasi_snapshot_preview1", preview1)?; diff --git a/core/wit/assemblylift/assemblylift.wit b/core/wit/assemblylift/assemblylift.wit index 0936bb97..ca0a0e18 100644 --- a/core/wit/assemblylift/assemblylift.wit +++ b/core/wit/assemblylift/assemblylift.wit @@ -1,7 +1,7 @@ -package akkoro:assemblylift +package akkoro:assemblylift; interface asml-io { - type ioid = u32 + type ioid = u32; enum io-error { coords-not-found, @@ -14,12 +14,12 @@ interface asml-io { invalid-ioid, } - invoke: func(path: string, input: string) -> result - poll: func(ioid: ioid) -> result, poll-error> + invoke: func(path: string, input: string) -> result; + poll: func(ioid: ioid) -> result, poll-error>; } interface asml-rt { - type bytes = list + type bytes = list; enum log-level { debug, @@ -29,13 +29,13 @@ interface asml-rt { error } - success: func(response: bytes) - failure: func(response: bytes) - log: func(level: log-level, context: string, message: string) - get-input: func() -> list + success: func(response: bytes); + failure: func(response: bytes); + log: func(level: log-level, context: string, message: string); + get-input: func() -> list; } world assemblylift { - import asml-io - import asml-rt + import asml-io; + import asml-rt; } diff --git a/core/wit/jwt/jwt.wit b/core/wit/jwt/jwt.wit index 3bd7c018..9d0d76c8 100644 --- a/core/wit/jwt/jwt.wit +++ b/core/wit/jwt/jwt.wit @@ -1,4 +1,4 @@ -package akkoro:jwt +package akkoro:jwt; interface decoder { enum jwt-error { @@ -15,9 +15,9 @@ interface decoder { valid: bool, } - decode-verify: func(token: string, jwks: string, params: validation-params) -> result + decode-verify: func(token: string, jwks: string, params: validation-params) -> result; } world jwt { - import decoder + import decoder; } diff --git a/core/wit/opa/opa.wit b/core/wit/opa/opa.wit index e4533fac..1e7869f0 100644 --- a/core/wit/opa/opa.wit +++ b/core/wit/opa/opa.wit @@ -1,4 +1,4 @@ -package akkoro:opa +package akkoro:opa; interface module { enum policy-error { @@ -11,10 +11,10 @@ interface module { entrypoints: list, } - new-policy: func(bytes: list) -> result - eval: func(id: string, data: string, input: string) -> string + new-policy: func(bytes: list) -> result; + eval: func(id: string, data: string, input: string) -> string; } world opa { - import module + import module; } diff --git a/core/wit/secrets/secrets.wit b/core/wit/secrets/secrets.wit index 0aeb43de..cc1c2b89 100644 --- a/core/wit/secrets/secrets.wit +++ b/core/wit/secrets/secrets.wit @@ -1,9 +1,9 @@ -package akkoro:secrets +package akkoro:secrets; /// Provides interface to a secrets store interface secret-storage { // TODO this should be a capability handle or `resource` - type key = string + type key = string; record secret { id: string, @@ -12,10 +12,10 @@ interface secret-storage { } /// Return the secret value associated with the handle - get-secret-value: func(id: string) -> result + get-secret-value: func(id: string) -> result; /// Set the secret value associated with the handle - set-secret-value: func(id: string, value: list, key: key) -> result + set-secret-value: func(id: string, value: list, key: key) -> result; enum error { success, @@ -25,5 +25,5 @@ interface secret-storage { } world secrets { - import secret-storage + import secret-storage; }