From 13d5ca65d6b781d26e9e55a4f9ccc7f5efd8750a Mon Sep 17 00:00:00 2001 From: Christien Rioux Date: Wed, 14 May 2025 18:21:56 -0400 Subject: [PATCH] Upgrade to Rust 1.86.0 --- Cargo.lock | 511 ++++++++++-------- Cargo.toml | 2 +- Earthfile | 2 +- .../src/network_manager/native/igd_manager.rs | 6 +- .../src/rpc_processor/fanout/fanout_call.rs | 2 +- veilid-core/src/veilid_config.rs | 2 +- veilid-tools/src/ipc/ipc_tokio/windows.rs | 410 +++++++------- .../src/network_interfaces/windows.rs | 4 +- 8 files changed, 502 insertions(+), 437 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3f288edb..86cb834a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,22 +1,16 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" -version = "0.21.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - [[package]] name = "adler2" version = "2.0.0" @@ -47,15 +41,15 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.11" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" dependencies = [ "cfg-if 1.0.0", - "getrandom 0.2.16", + "getrandom 0.3.3", "once_cell", "version_check", - "zerocopy 0.7.35", + "zerocopy", ] [[package]] @@ -136,10 +130,10 @@ dependencies = [ [[package]] name = "ansi-parser" version = "0.9.1" -source = "git+https://gitlab.com/davidbittner/ansi-parser.git#a431fb31f8b7f5680525987c1d67d4863ac02660" +source = "git+https://gitlab.com/davidbittner/ansi-parser.git#6b973008e08069d95316790ab73a5847e600c702" dependencies = [ "heapless 0.8.0", - "nom", + "nom 8.0.0", ] [[package]] @@ -288,14 +282,15 @@ dependencies = [ [[package]] name = "async-executor" -version = "1.13.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ca9a001c1e8ba5149f91a74362376cc6bc5b919d92d988668657bd570bdcec" +checksum = "bb812ffb58524bdd10860d7d974e2f01cc0950c2438a74ee5ec2e2280c6c4ffa" dependencies = [ "async-task", "concurrent-queue", "fastrand 2.3.0", "futures-lite 2.6.0", + "pin-project-lite", "slab", ] @@ -673,17 +668,17 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.71" +version = "0.3.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" dependencies = [ "addr2line", - "cc", "cfg-if 1.0.0", "libc", - "miniz_oxide 0.7.4", + "miniz_oxide", "object", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] @@ -887,9 +882,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.20" +version = "1.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04da6a0d40b948dfc4fa8f5bbf402b0fc1a64a28dbf7d12ffd683550f2c1b63a" +checksum = "32db95edf998450acc7881c932f94cd9b05c87b4b2599e8bab064753da4acfd1" dependencies = [ "shlex", ] @@ -906,7 +901,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" dependencies = [ - "nom", + "nom 7.1.3", ] [[package]] @@ -953,9 +948,9 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.40" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" +checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" dependencies = [ "android-tzdata", "iana-time-zone", @@ -1014,9 +1009,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.37" +version = "4.5.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eccb054f56cbd38340b380d4a8e69ef1f02f1af43db2f0cc817a4774d80ae071" +checksum = "ed93b9805f8ba930df42c2590f05453d5ec36cbb85d018868a5b24d31f6ac000" dependencies = [ "clap_builder", "clap_derive", @@ -1024,9 +1019,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.37" +version = "4.5.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd9466fac8543255d3b1fcad4762c5e116ffe808c8a3043d4263cd4fd4862a2" +checksum = "379026ff283facf611b0ea629334361c4211d1b12ee01024eec1591133b04120" dependencies = [ "anstream", "anstyle", @@ -1079,9 +1074,9 @@ checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" [[package]] name = "color-eyre" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55146f5e46f237f7423d74111267d4597b59b0dad0ffaf7303bce9945d843ad5" +checksum = "e6e1761c0e16f8883bbbb8ce5990867f4f06bf11a0253da6495a04ce4b6ef0ec" dependencies = [ "backtrace", "eyre", @@ -1124,7 +1119,7 @@ checksum = "23738e11972c7643e4ec947840fc463b6a571afcd3e735bdfce7d03c7a784aca" dependencies = [ "async-trait", "lazy_static", - "nom", + "nom 7.1.3", "pathdiff", "serde", "yaml-rust", @@ -1136,10 +1131,22 @@ version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68578f196d2a33ff61b27fae256c3164f65e36382648e30666dde05b8cc9dfdf" dependencies = [ - "nom", + "nom 7.1.3", "pathdiff", "serde", - "yaml-rust2", + "yaml-rust2 0.8.1", +] + +[[package]] +name = "config" +version = "0.15.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595aae20e65c3be792d05818e8c63025294ac3cb7e200f11459063a352a6ef80" +dependencies = [ + "pathdiff", + "serde", + "winnow 0.7.10", + "yaml-rust2 0.10.1", ] [[package]] @@ -1308,7 +1315,7 @@ dependencies = [ "futures-core", "mio 1.0.3", "parking_lot 0.12.3", - "rustix 1.0.5", + "rustix 1.0.7", "signal-hook", "signal-hook-mio", "winapi", @@ -1356,11 +1363,11 @@ dependencies = [ [[package]] name = "ctrlc" -version = "3.4.6" +version = "3.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "697b5419f348fd5ae2478e8018cb016c00a5881c7f46c717de98ffd135a5651c" +checksum = "46f93780a459b7d656ef7f071fe699c4d3d2cb201c4b24d085b6ddc505276e73" dependencies = [ - "nix 0.29.0", + "nix 0.30.1", "windows-sys 0.59.0", ] @@ -1426,7 +1433,7 @@ dependencies = [ "serde_yaml", "time", "tokio", - "toml 0.8.21", + "toml 0.8.22", "unicode-segmentation", "unicode-width 0.1.14", "xi-unicode", @@ -1714,7 +1721,7 @@ dependencies = [ "ed25519", "rand_core", "serde", - "sha2 0.10.8", + "sha2 0.10.9", "signature", "subtle", "zeroize", @@ -1808,9 +1815,9 @@ dependencies = [ [[package]] name = "enumset" -version = "1.1.5" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07a4b049558765cef5f0c1a273c3fc57084d768b44d2f98127aef4cceb17293" +checksum = "11a6b7c3d347de0a9f7bfd2f853be43fe32fa6fac30c70f6d6d67a1e936b87ee" dependencies = [ "enumset_derive", "serde", @@ -1818,9 +1825,9 @@ dependencies = [ [[package]] name = "enumset_derive" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59c3b24c345d8c314966bdc1832f6c2635bfcce8e7cf363bd115987bba2ee242" +checksum = "6da3ea9e1d1a3b1593e15781f930120e72aa7501610b2f82e5b6739c72e8eac5" dependencies = [ "darling 0.20.11", "proc-macro2", @@ -1869,9 +1876,9 @@ dependencies = [ [[package]] name = "error-code" -version = "3.3.1" +version = "3.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5d9305ccc6942a704f4335694ecd3de2ea531b114ac2d51f5f843750787a92f" +checksum = "dea2df4cf52843e0452895c455a1a2cfbb842a1e7329671acf418fdc53ed4c59" [[package]] name = "event-listener" @@ -1974,7 +1981,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ced92e76e966ca2fd84c8f7aa01a4aea65b0eb6648d72f7c8f3e2764a67fece" dependencies = [ "crc32fast", - "miniz_oxide 0.8.8", + "miniz_oxide", ] [[package]] @@ -2019,6 +2026,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + [[package]] name = "foreign-types" version = "0.3.2" @@ -2233,9 +2246,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" dependencies = [ "cfg-if 1.0.0", "libc", @@ -2245,9 +2258,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "glob" @@ -2393,9 +2406,12 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.2" +version = "0.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +checksum = "84b26c544d002229e640969970a2e74021aadf6e2f96372b9c58eff97de08eb3" +dependencies = [ + "foldhash", +] [[package]] name = "hashlink" @@ -2406,6 +2422,15 @@ dependencies = [ "hashbrown 0.14.5", ] +[[package]] +name = "hashlink" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1" +dependencies = [ + "hashbrown 0.15.3", +] + [[package]] name = "hdrhistogram" version = "7.5.4" @@ -2415,7 +2440,7 @@ dependencies = [ "base64 0.21.7", "byteorder", "flate2", - "nom", + "nom 7.1.3", "num-traits", ] @@ -2698,21 +2723,22 @@ dependencies = [ [[package]] name = "icu_collections" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" dependencies = [ "displaydoc", + "potential_utf", "yoke", "zerofrom", "zerovec", ] [[package]] -name = "icu_locid" -version = "1.5.0" +name = "icu_locale_core" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" dependencies = [ "displaydoc", "litemap", @@ -2721,31 +2747,11 @@ dependencies = [ "zerovec", ] -[[package]] -name = "icu_locid_transform" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_locid_transform_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_locid_transform_data" -version = "1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7515e6d781098bf9f7205ab3fc7e9709d34554ae0b21ddbcb5febfa4bc7df11d" - [[package]] name = "icu_normalizer" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" dependencies = [ "displaydoc", "icu_collections", @@ -2753,67 +2759,54 @@ dependencies = [ "icu_properties", "icu_provider", "smallvec", - "utf16_iter", - "utf8_iter", - "write16", "zerovec", ] [[package]] name = "icu_normalizer_data" -version = "1.5.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5e8338228bdc8ab83303f16b797e177953730f601a96c25d10cb3ab0daa0cb7" +checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" [[package]] name = "icu_properties" -version = "1.5.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +checksum = "2549ca8c7241c82f59c80ba2a6f415d931c5b58d24fb8412caa1a1f02c49139a" dependencies = [ "displaydoc", "icu_collections", - "icu_locid_transform", + "icu_locale_core", "icu_properties_data", "icu_provider", - "tinystr", + "potential_utf", + "zerotrie", "zerovec", ] [[package]] name = "icu_properties_data" -version = "1.5.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85fb8799753b75aee8d2a21d7c14d9f38921b54b3dbda10f5a3c7a7b82dba5e2" +checksum = "8197e866e47b68f8f7d95249e172903bec06004b18b2937f1095d40a0c57de04" [[package]] name = "icu_provider" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" dependencies = [ "displaydoc", - "icu_locid", - "icu_provider_macros", + "icu_locale_core", "stable_deref_trait", "tinystr", "writeable", "yoke", "zerofrom", + "zerotrie", "zerovec", ] -[[package]] -name = "icu_provider_macros" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.101", -] - [[package]] name = "ident_case" version = "1.0.1" @@ -2833,9 +2826,9 @@ dependencies = [ [[package]] name = "idna_adapter" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" dependencies = [ "icu_normalizer", "icu_properties", @@ -2904,7 +2897,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" dependencies = [ "equivalent", - "hashbrown 0.15.2", + "hashbrown 0.15.3", "serde", ] @@ -3150,12 +3143,12 @@ dependencies = [ [[package]] name = "libloading" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" +checksum = "6a793df0d7afeac54f95b471d3af7f0d4fb975699f972341a4b76988d49cdf0c" dependencies = [ "cfg-if 1.0.0", - "windows-targets 0.52.6", + "windows-targets 0.53.0", ] [[package]] @@ -3166,7 +3159,7 @@ checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ "bitflags 2.9.0", "libc", - "redox_syscall 0.5.11", + "redox_syscall 0.5.12", ] [[package]] @@ -3218,9 +3211,9 @@ checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" [[package]] name = "litemap" -version = "0.7.5" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" +checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" [[package]] name = "litrs" @@ -3341,15 +3334,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" -[[package]] -name = "miniz_oxide" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" -dependencies = [ - "adler", -] - [[package]] name = "miniz_oxide" version = "0.8.8" @@ -3599,6 +3583,18 @@ dependencies = [ "libc", ] +[[package]] +name = "nix" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6" +dependencies = [ + "bitflags 2.9.0", + "cfg-if 1.0.0", + "cfg_aliases", + "libc", +] + [[package]] name = "nom" version = "7.1.3" @@ -3609,6 +3605,15 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "nom" +version = "8.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df9761775871bdef83bee530e60050f7e54b1105350d6884eb0fb4f46c2f9405" +dependencies = [ + "memchr", +] + [[package]] name = "ntapi" version = "0.4.1" @@ -3812,9 +3817,9 @@ dependencies = [ [[package]] name = "object" -version = "0.32.2" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "memchr", ] @@ -3865,9 +3870,9 @@ checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" [[package]] name = "openssl-sys" -version = "0.9.107" +version = "0.9.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8288979acd84749c744a9014b4382d42b8f7b2592847b5afb2ed29e5d16ede07" +checksum = "e145e1651e858e820e4860f7b9c5e169bc1d8ce1c86043be79fa7b7634821847" dependencies = [ "cc", "libc", @@ -4095,9 +4100,9 @@ dependencies = [ [[package]] name = "owo-colors" -version = "3.5.0" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" +checksum = "1036865bb9422d3300cf723f657c2851d0e9ab12567854b1f4eba3d77decf564" [[package]] name = "paranoid-android" @@ -4162,7 +4167,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if 1.0.0", "libc", - "redox_syscall 0.5.11", + "redox_syscall 0.5.12", "smallvec", "windows-targets 0.52.6", ] @@ -4361,6 +4366,15 @@ dependencies = [ "serde", ] +[[package]] +name = "potential_utf" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585" +dependencies = [ + "zerovec", +] + [[package]] name = "powerfmt" version = "0.2.0" @@ -4373,7 +4387,7 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" dependencies = [ - "zerocopy 0.8.25", + "zerocopy", ] [[package]] @@ -4570,9 +4584,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.11" +version = "0.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2f103c6d277498fbceb16e84d317e2a400f160f46904d5f5410848c829511a3" +checksum = "928fca9cf2aa042393a8325b9ead81d2f0df4cb12e1e24cef072922ccd99c5af" dependencies = [ "bitflags 2.9.0", ] @@ -4674,12 +4688,9 @@ dependencies = [ [[package]] name = "resolv-conf" -version = "0.7.1" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48375394603e3dd4b2d64371f7148fd8c7baa2680e28741f2cb8d23b59e3d4c4" -dependencies = [ - "hostname 0.4.1", -] +checksum = "95325155c684b1c89f7765e30bc1c42e4a6da51ca513615660cb8a62ef9a88e3" [[package]] name = "ring" @@ -4744,7 +4755,7 @@ dependencies = [ "bitflags 2.9.0", "fallible-iterator", "fallible-streaming-iterator", - "hashlink", + "hashlink 0.8.4", "libsqlite3-sys", "smallvec", ] @@ -4799,9 +4810,9 @@ dependencies = [ [[package]] name = "rustix" -version = "1.0.5" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d97817398dd4bb2e6da002002db259209759911da105da92bec29ccb12cf58bf" +checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" dependencies = [ "bitflags 2.9.0", "errno", @@ -5267,9 +5278,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.8" +version = "0.10.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" dependencies = [ "cfg-if 1.0.0", "cpufeatures", @@ -5299,9 +5310,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" +checksum = "d881a16cf4426aa584979d30bd82cb33429027e42122b169753d6ef1085ed6e2" dependencies = [ "libc", "signal-hook-registry", @@ -5502,9 +5513,9 @@ checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" [[package]] name = "synstructure" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", @@ -5548,14 +5559,14 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.19.1" +version = "3.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7437ac7763b9b123ccf33c338a5cc1bac6f69b45a136c19bdd8a65e3916435bf" +checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" dependencies = [ "fastrand 2.3.0", - "getrandom 0.3.2", + "getrandom 0.3.3", "once_cell", - "rustix 1.0.5", + "rustix 1.0.7", "windows-sys 0.59.0", ] @@ -5574,7 +5585,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45c6481c4829e4cc63825e62c49186a34538b7b2750b73b266581ffb612fb5ed" dependencies = [ - "rustix 1.0.5", + "rustix 1.0.7", "windows-sys 0.59.0", ] @@ -5692,9 +5703,9 @@ dependencies = [ [[package]] name = "tinystr" -version = "0.7.6" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" dependencies = [ "displaydoc", "zerovec", @@ -5717,9 +5728,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.44.2" +version = "1.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6b88822cbe49de4185e3a4cbf8321dd487cf5fe0c5c65695fef6346371e9c48" +checksum = "2513ca694ef9ede0fb23fe71a4ee4107cb102b9dc1930f6d0fd77aae068ae165" dependencies = [ "backtrace", "bytes 1.10.1", @@ -5801,14 +5812,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.21" +version = "0.8.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900f6c86a685850b1bc9f6223b20125115ee3f31e01207d81655bbcc0aea9231" +checksum = "05ae329d1f08c4d17a59bed7ff5b5a769d062e64a62d34a3261b219e62cd5aae" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.25", + "toml_edit 0.22.26", ] [[package]] @@ -5833,23 +5844,23 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.25" +version = "0.22.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10558ed0bd2a1562e630926a2d1f0b98c827da99fabd3fe20920a59642504485" +checksum = "310068873db2c5b3e7659d2cc35d21855dbafa50d1ce336397c666e3cb08137e" dependencies = [ "indexmap 2.9.0", "serde", "serde_spanned", "toml_datetime", "toml_write", - "winnow 0.7.7", + "winnow 0.7.10", ] [[package]] name = "toml_write" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28391a4201ba7eb1984cfeb6862c0b3ea2cfe23332298967c749dddc0d6cd976" +checksum = "bfb942dfe1d8e29a7ee7fcbde5bd2b9a25fb89aa70caea2eba3bee836ff41076" [[package]] name = "tonic" @@ -6300,12 +6311,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "utf16_iter" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" - [[package]] name = "utf8_iter" version = "1.0.4" @@ -6390,8 +6395,8 @@ dependencies = [ "async-tungstenite 0.23.0", "cfg-if 1.0.0", "chrono", - "clap 4.5.37", - "config 0.13.4", + "clap 4.5.38", + "config 0.15.11", "console", "crossbeam-channel", "cursive", @@ -6408,7 +6413,7 @@ dependencies = [ "log", "lru", "owning_ref", - "parking_lot 0.11.2", + "parking_lot 0.12.3", "rustyline-async", "serde", "serde_derive", @@ -6492,7 +6497,7 @@ dependencies = [ "serde_json", "serde_with", "serial_test 2.0.0", - "sha2 0.10.8", + "sha2 0.10.9", "shell-words", "simplelog", "static_assertions", @@ -6595,7 +6600,7 @@ dependencies = [ "backtrace", "cfg-if 1.0.0", "chrono", - "clap 4.5.37", + "clap 4.5.38", "color-eyre", "config 0.14.1", "console-subscriber", @@ -6604,7 +6609,7 @@ dependencies = [ "directories", "flume", "futures-util", - "hostname 0.3.1", + "hostname 0.4.1", "json", "lazy_static", "nix 0.29.0", @@ -6653,7 +6658,7 @@ dependencies = [ "backtrace", "cfg-if 1.0.0", "chrono", - "clap 4.5.37", + "clap 4.5.38", "console_error_panic_hook", "ctrlc", "eyre", @@ -6738,7 +6743,7 @@ dependencies = [ "js-sys", "lazy_static", "parking_lot 0.12.3", - "send_wrapper 0.4.0", + "send_wrapper 0.6.0", "serde", "serde-wasm-bindgen", "serde_bytes", @@ -7213,13 +7218,29 @@ dependencies = [ "windows_aarch64_gnullvm 0.52.6", "windows_aarch64_msvc 0.52.6", "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", + "windows_i686_gnullvm 0.52.6", "windows_i686_msvc 0.52.6", "windows_x86_64_gnu 0.52.6", "windows_x86_64_gnullvm 0.52.6", "windows_x86_64_msvc 0.52.6", ] +[[package]] +name = "windows-targets" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.42.2" @@ -7238,6 +7259,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + [[package]] name = "windows_aarch64_msvc" version = "0.42.2" @@ -7256,6 +7283,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + [[package]] name = "windows_i686_gnu" version = "0.42.2" @@ -7274,12 +7307,24 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + [[package]] name = "windows_i686_msvc" version = "0.42.2" @@ -7298,6 +7343,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + [[package]] name = "windows_x86_64_gnu" version = "0.42.2" @@ -7316,6 +7367,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" @@ -7334,6 +7391,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + [[package]] name = "windows_x86_64_msvc" version = "0.42.2" @@ -7352,6 +7415,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + [[package]] name = "winnow" version = "0.5.40" @@ -7363,9 +7432,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.7.7" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cb8234a863ea0e8cd7284fcdd4f145233eb00fee02bbdd9861aec44e6477bc5" +checksum = "c06928c8748d81b05c9be96aad92e1b6ff01833332f281e8cfca3be4b35fc9ec" dependencies = [ "memchr", ] @@ -7389,17 +7458,11 @@ dependencies = [ "bitflags 2.9.0", ] -[[package]] -name = "write16" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" - [[package]] name = "writeable" -version = "0.5.5" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" +checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" [[package]] name = "ws_stream_tungstenite" @@ -7506,14 +7569,25 @@ checksum = "8902160c4e6f2fb145dbe9d6760a75e3c9522d8bf796ed7047c85919ac7115f8" dependencies = [ "arraydeque", "encoding_rs", - "hashlink", + "hashlink 0.8.4", +] + +[[package]] +name = "yaml-rust2" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "818913695e83ece1f8d2a1c52d54484b7b46d0f9c06beeb2649b9da50d9b512d" +dependencies = [ + "arraydeque", + "encoding_rs", + "hashlink 0.10.0", ] [[package]] name = "yoke" -version = "0.7.5" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" dependencies = [ "serde", "stable_deref_trait", @@ -7523,9 +7597,9 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.7.5" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" dependencies = [ "proc-macro2", "quote", @@ -7568,33 +7642,13 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "zerocopy" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" -dependencies = [ - "zerocopy-derive 0.7.35", -] - [[package]] name = "zerocopy" version = "0.8.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1702d9583232ddb9174e01bb7c15a2ab8fb1bc6f227aa1233858c351a3ba0cb" dependencies = [ - "zerocopy-derive 0.8.25", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.101", + "zerocopy-derive", ] [[package]] @@ -7650,10 +7704,21 @@ dependencies = [ ] [[package]] -name = "zerovec" -version = "0.10.4" +name = "zerotrie" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a05eb080e015ba39cc9e23bbe5e7fb04d5fb040350f99f34e338d5fdd294428" dependencies = [ "yoke", "zerofrom", @@ -7662,9 +7727,9 @@ dependencies = [ [[package]] name = "zerovec-derive" -version = "0.10.3" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index d342aeb2..eef0202c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ repository = "https://gitlab.com/veilid/veilid" authors = ["Veilid Team "] license = "MPL-2.0" edition = "2021" -rust-version = "1.81.0" +rust-version = "1.86.0" [patch.crates-io] cursive = { git = "https://gitlab.com/veilid/cursive.git" } diff --git a/Earthfile b/Earthfile index 1f2394f6..63b36f61 100644 --- a/Earthfile +++ b/Earthfile @@ -18,7 +18,7 @@ ENV ZIG_VERSION=0.13.0 ENV CMAKE_VERSION_MINOR=3.30 ENV CMAKE_VERSION_PATCH=3.30.1 ENV WASM_BINDGEN_CLI_VERSION=0.2.100 -ENV RUST_VERSION=1.81.0 +ENV RUST_VERSION=1.86.0 ENV RUSTUP_HOME=/usr/local/rustup ENV RUSTUP_DIST_SERVER=https://static.rust-lang.org ENV CARGO_HOME=/usr/local/cargo diff --git a/veilid-core/src/network_manager/native/igd_manager.rs b/veilid-core/src/network_manager/native/igd_manager.rs index cb63d363..559370e4 100644 --- a/veilid-core/src/network_manager/native/igd_manager.rs +++ b/veilid-core/src/network_manager/native/igd_manager.rs @@ -198,7 +198,7 @@ impl IGDManager { // Map any port let desc = this.get_description(protocol_type, local_port); - let mapped_port = match gw.add_any_port(convert_protocol_type(protocol_type), SocketAddr::new(local_ip, local_port), (UPNP_MAPPING_LIFETIME_MS + 999) / 1000, &desc) { + let mapped_port = match gw.add_any_port(convert_protocol_type(protocol_type), SocketAddr::new(local_ip, local_port), UPNP_MAPPING_LIFETIME_MS.div_ceil(1000), &desc) { Ok(mapped_port) => mapped_port, Err(e) => { // Failed to map external port @@ -295,7 +295,7 @@ impl IGDManager { match gw.add_any_port( convert_protocol_type(k.protocol_type), SocketAddr::new(local_ip, k.local_port), - (UPNP_MAPPING_LIFETIME_MS + 999) / 1000, + UPNP_MAPPING_LIFETIME_MS.div_ceil(1000), &desc, ) { Ok(mapped_port) => { @@ -343,7 +343,7 @@ impl IGDManager { convert_protocol_type(k.protocol_type), v.mapped_port, SocketAddr::new(local_ip, k.local_port), - (UPNP_MAPPING_LIFETIME_MS + 999) / 1000, + UPNP_MAPPING_LIFETIME_MS.div_ceil(1000), &desc, ) { Ok(()) => { diff --git a/veilid-core/src/rpc_processor/fanout/fanout_call.rs b/veilid-core/src/rpc_processor/fanout/fanout_call.rs index ba878d21..f497cd3e 100644 --- a/veilid-core/src/rpc_processor/fanout/fanout_call.rs +++ b/veilid-core/src/rpc_processor/fanout/fanout_call.rs @@ -138,7 +138,7 @@ pub fn capability_fanout_node_info_filter(caps: Vec) -> FanoutNodeIn /// * 'node_count' - the number of nodes to keep in the closest_nodes set /// * 'fanout' - the number of concurrent calls being processed at the same time /// * 'consensus_count' - the number of nodes in the processed queue that need to be in the -/// 'Accepted' state before we terminate the fanout early. +/// 'Accepted' state before we terminate the fanout early. /// /// The algorithm returns early if 'check_done' returns some value, or if an error is found during the process. /// If the algorithm times out, a Timeout result is returned, however operations will still have been performed and a diff --git a/veilid-core/src/veilid_config.rs b/veilid-core/src/veilid_config.rs index 6de4844f..52169625 100644 --- a/veilid-core/src/veilid_config.rs +++ b/veilid-core/src/veilid_config.rs @@ -830,7 +830,7 @@ impl VeilidConfig { /// specified to override this location /// /// * `program_name` - Pick a program name and do not change it from release to release, - /// see `VeilidConfig::program_name` for details. + /// see `VeilidConfig::program_name` for details. /// * `organization_name` - Similar to program_name, but for the organization publishing this app /// * `qualifier` - Suffix for the application bundle name /// * `storage_directory` - Override for the path where veilid-core stores its content diff --git a/veilid-tools/src/ipc/ipc_tokio/windows.rs b/veilid-tools/src/ipc/ipc_tokio/windows.rs index 1afc175c..edda462e 100644 --- a/veilid-tools/src/ipc/ipc_tokio/windows.rs +++ b/veilid-tools/src/ipc/ipc_tokio/windows.rs @@ -1,205 +1,205 @@ -use crate::*; -use futures_util::stream::FuturesUnordered; -use futures_util::AsyncRead as FuturesAsyncRead; -use futures_util::AsyncWrite as FuturesAsyncWrite; -use futures_util::Stream; -use std::path::PathBuf; -use std::{io, path::Path}; -use tokio::io::{AsyncRead, AsyncWrite, ReadBuf}; -use tokio::net::windows::named_pipe::{ - ClientOptions, NamedPipeClient, NamedPipeServer, ServerOptions, -}; -///////////////////////////////////////////////////////////// - -enum IpcStreamInternal { - Client(NamedPipeClient), - Server(NamedPipeServer), -} - -pub struct IpcStream { - internal: IpcStreamInternal, -} - -impl IpcStream { - #[expect(clippy::unused_async)] - pub async fn connect>(path: P) -> io::Result { - Ok(IpcStream { - internal: IpcStreamInternal::Client( - ClientOptions::new().open(path.as_ref().to_path_buf().as_os_str())?, - ), - }) - } -} - -impl FuturesAsyncRead for IpcStream { - fn poll_read( - mut self: std::pin::Pin<&mut Self>, - cx: &mut std::task::Context<'_>, - buf: &mut [u8], - ) -> std::task::Poll> { - match &mut self.internal { - IpcStreamInternal::Client(client) => { - let mut rb = ReadBuf::new(buf); - match ::poll_read( - std::pin::Pin::new(client), - cx, - &mut rb, - ) { - std::task::Poll::Ready(r) => { - std::task::Poll::Ready(r.map(|_| rb.filled().len())) - } - std::task::Poll::Pending => std::task::Poll::Pending, - } - } - IpcStreamInternal::Server(server) => { - let mut rb = ReadBuf::new(buf); - match ::poll_read( - std::pin::Pin::new(server), - cx, - &mut rb, - ) { - std::task::Poll::Ready(r) => { - std::task::Poll::Ready(r.map(|_| rb.filled().len())) - } - std::task::Poll::Pending => std::task::Poll::Pending, - } - } - } - } -} - -impl FuturesAsyncWrite for IpcStream { - fn poll_write( - mut self: std::pin::Pin<&mut Self>, - cx: &mut std::task::Context<'_>, - buf: &[u8], - ) -> std::task::Poll> { - match &mut self.internal { - IpcStreamInternal::Client(client) => { - ::poll_write(std::pin::Pin::new(client), cx, buf) - } - IpcStreamInternal::Server(server) => { - ::poll_write(std::pin::Pin::new(server), cx, buf) - } - } - } - - fn poll_flush( - mut self: std::pin::Pin<&mut Self>, - cx: &mut std::task::Context<'_>, - ) -> std::task::Poll> { - match &mut self.internal { - IpcStreamInternal::Client(client) => { - ::poll_flush(std::pin::Pin::new(client), cx) - } - IpcStreamInternal::Server(server) => { - ::poll_flush(std::pin::Pin::new(server), cx) - } - } - } - - fn poll_close( - mut self: std::pin::Pin<&mut Self>, - cx: &mut std::task::Context<'_>, - ) -> std::task::Poll> { - match &mut self.internal { - IpcStreamInternal::Client(client) => { - ::poll_shutdown(std::pin::Pin::new(client), cx) - } - IpcStreamInternal::Server(server) => { - ::poll_shutdown(std::pin::Pin::new(server), cx) - } - } - } -} - -///////////////////////////////////////////////////////////// - -pub struct IpcIncoming<'a> { - listener: IpcListener, - unord: FuturesUnordered>>, - phantom: std::marker::PhantomData<&'a ()>, -} - -impl Stream for IpcIncoming<'_> { - type Item = io::Result; - - fn poll_next<'a>( - mut self: std::pin::Pin<&'a mut Self>, - cx: &mut std::task::Context<'_>, - ) -> std::task::Poll> { - if self.unord.is_empty() { - self.unord.push(Box::pin(self.listener.accept())); - } - match Pin::new(&mut self.unord).poll_next(cx) { - task::Poll::Ready(ro) => { - self.unord.push(Box::pin(self.listener.accept())); - std::task::Poll::Ready(ro) - } - task::Poll::Pending => std::task::Poll::Pending, - } - } -} - -///////////////////////////////////////////////////////////// - -pub struct IpcListener { - path: Option, - internal: Option>>, -} - -impl IpcListener { - /// Creates a new `IpcListener` bound to the specified path. - #[expect(clippy::unused_async)] - pub async fn bind>(path: P) -> io::Result { - let path = path.as_ref().to_path_buf(); - let server = ServerOptions::new() - .first_pipe_instance(true) - .create(&path)?; - Ok(Self { - path: Some(path), - internal: Some(Mutex::new(Some(server))), - }) - } - - /// Accepts a new incoming connection to this listener. - #[must_use] - pub fn accept(&self) -> PinBoxFutureStatic> { - if self.path.is_none() { - return Box::pin(std::future::ready(Err(io::Error::from( - io::ErrorKind::NotConnected, - )))); - } - let internal = self.internal.as_ref().unwrap(); - let mut opt_server = internal.lock(); - let server = opt_server.take().unwrap(); - let path = self.path.clone().unwrap(); - *opt_server = match ServerOptions::new().create(path) { - Ok(v) => Some(v), - Err(e) => return Box::pin(std::future::ready(Err(e))), - }; - - Box::pin(async move { - server.connect().await?; - - Ok(IpcStream { - internal: IpcStreamInternal::Server(server), - }) - }) - } - - /// Returns a stream of incoming connections. - pub fn incoming(&mut self) -> io::Result> { - if self.path.is_none() { - return Err(io::Error::from(io::ErrorKind::NotConnected)); - } - Ok(IpcIncoming { - listener: IpcListener { - path: self.path.take(), - internal: self.internal.take(), - }, - unord: FuturesUnordered::new(), - phantom: std::marker::PhantomData, - }) - } -} +use crate::*; +use futures_util::stream::FuturesUnordered; +use futures_util::AsyncRead as FuturesAsyncRead; +use futures_util::AsyncWrite as FuturesAsyncWrite; +use futures_util::Stream; +use std::path::PathBuf; +use std::{io, path::Path}; +use tokio::io::{AsyncRead, AsyncWrite, ReadBuf}; +use tokio::net::windows::named_pipe::{ + ClientOptions, NamedPipeClient, NamedPipeServer, ServerOptions, +}; +///////////////////////////////////////////////////////////// + +enum IpcStreamInternal { + Client(NamedPipeClient), + Server(NamedPipeServer), +} + +pub struct IpcStream { + internal: IpcStreamInternal, +} + +impl IpcStream { + #[expect(clippy::unused_async)] + pub async fn connect>(path: P) -> io::Result { + Ok(IpcStream { + internal: IpcStreamInternal::Client( + ClientOptions::new().open(path.as_ref().to_path_buf().as_os_str())?, + ), + }) + } +} + +impl FuturesAsyncRead for IpcStream { + fn poll_read( + mut self: std::pin::Pin<&mut Self>, + cx: &mut std::task::Context<'_>, + buf: &mut [u8], + ) -> std::task::Poll> { + match &mut self.internal { + IpcStreamInternal::Client(client) => { + let mut rb = ReadBuf::new(buf); + match ::poll_read( + std::pin::Pin::new(client), + cx, + &mut rb, + ) { + std::task::Poll::Ready(r) => { + std::task::Poll::Ready(r.map(|_| rb.filled().len())) + } + std::task::Poll::Pending => std::task::Poll::Pending, + } + } + IpcStreamInternal::Server(server) => { + let mut rb = ReadBuf::new(buf); + match ::poll_read( + std::pin::Pin::new(server), + cx, + &mut rb, + ) { + std::task::Poll::Ready(r) => { + std::task::Poll::Ready(r.map(|_| rb.filled().len())) + } + std::task::Poll::Pending => std::task::Poll::Pending, + } + } + } + } +} + +impl FuturesAsyncWrite for IpcStream { + fn poll_write( + mut self: std::pin::Pin<&mut Self>, + cx: &mut std::task::Context<'_>, + buf: &[u8], + ) -> std::task::Poll> { + match &mut self.internal { + IpcStreamInternal::Client(client) => { + ::poll_write(std::pin::Pin::new(client), cx, buf) + } + IpcStreamInternal::Server(server) => { + ::poll_write(std::pin::Pin::new(server), cx, buf) + } + } + } + + fn poll_flush( + mut self: std::pin::Pin<&mut Self>, + cx: &mut std::task::Context<'_>, + ) -> std::task::Poll> { + match &mut self.internal { + IpcStreamInternal::Client(client) => { + ::poll_flush(std::pin::Pin::new(client), cx) + } + IpcStreamInternal::Server(server) => { + ::poll_flush(std::pin::Pin::new(server), cx) + } + } + } + + fn poll_close( + mut self: std::pin::Pin<&mut Self>, + cx: &mut std::task::Context<'_>, + ) -> std::task::Poll> { + match &mut self.internal { + IpcStreamInternal::Client(client) => { + ::poll_shutdown(std::pin::Pin::new(client), cx) + } + IpcStreamInternal::Server(server) => { + ::poll_shutdown(std::pin::Pin::new(server), cx) + } + } + } +} + +///////////////////////////////////////////////////////////// + +pub struct IpcIncoming<'a> { + listener: IpcListener, + unord: FuturesUnordered>>, + phantom: std::marker::PhantomData<&'a ()>, +} + +impl Stream for IpcIncoming<'_> { + type Item = io::Result; + + fn poll_next( + mut self: std::pin::Pin<&mut Self>, + cx: &mut std::task::Context<'_>, + ) -> std::task::Poll> { + if self.unord.is_empty() { + self.unord.push(Box::pin(self.listener.accept())); + } + match Pin::new(&mut self.unord).poll_next(cx) { + task::Poll::Ready(ro) => { + self.unord.push(Box::pin(self.listener.accept())); + std::task::Poll::Ready(ro) + } + task::Poll::Pending => std::task::Poll::Pending, + } + } +} + +///////////////////////////////////////////////////////////// + +pub struct IpcListener { + path: Option, + internal: Option>>, +} + +impl IpcListener { + /// Creates a new `IpcListener` bound to the specified path. + #[expect(clippy::unused_async)] + pub async fn bind>(path: P) -> io::Result { + let path = path.as_ref().to_path_buf(); + let server = ServerOptions::new() + .first_pipe_instance(true) + .create(&path)?; + Ok(Self { + path: Some(path), + internal: Some(Mutex::new(Some(server))), + }) + } + + /// Accepts a new incoming connection to this listener. + #[must_use] + pub fn accept(&self) -> PinBoxFutureStatic> { + if self.path.is_none() { + return Box::pin(std::future::ready(Err(io::Error::from( + io::ErrorKind::NotConnected, + )))); + } + let internal = self.internal.as_ref().unwrap(); + let mut opt_server = internal.lock(); + let server = opt_server.take().unwrap(); + let path = self.path.clone().unwrap(); + *opt_server = match ServerOptions::new().create(path) { + Ok(v) => Some(v), + Err(e) => return Box::pin(std::future::ready(Err(e))), + }; + + Box::pin(async move { + server.connect().await?; + + Ok(IpcStream { + internal: IpcStreamInternal::Server(server), + }) + }) + } + + /// Returns a stream of incoming connections. + pub fn incoming(&mut self) -> io::Result> { + if self.path.is_none() { + return Err(io::Error::from(io::ErrorKind::NotConnected)); + } + Ok(IpcIncoming { + listener: IpcListener { + path: self.path.take(), + internal: self.internal.take(), + }, + unord: FuturesUnordered::new(), + phantom: std::marker::PhantomData, + }) + } +} diff --git a/veilid-tools/src/network_interfaces/windows.rs b/veilid-tools/src/network_interfaces/windows.rs index 35503753..4366b810 100644 --- a/veilid-tools/src/network_interfaces/windows.rs +++ b/veilid-tools/src/network_interfaces/windows.rs @@ -87,7 +87,7 @@ impl PlatformSupportWindows { for (n, netmask_elt) in netmask .iter_mut() .enumerate() - .take((prefix.PrefixLength as usize + 7) / 8) + .take((prefix.PrefixLength as usize).div_ceil(8)) { let x_byte = ipv4_addr.octets()[n]; let y_byte = a.octets()[n]; @@ -140,7 +140,7 @@ impl PlatformSupportWindows { for (n, netmask_elt) in netmask .iter_mut() .enumerate() - .take((prefix.PrefixLength as usize + 15) / 16) + .take((prefix.PrefixLength as usize).div_ceil(16)) { let x_word = ipv6_addr.segments()[n]; let y_word = a.segments()[n];