diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cf42d9e0..64e3fb2f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,8 +44,7 @@ jobs: rustup component add rustfmt clippy - name: Code format check - run: cargo fmt --check - + run: cargo fmt --check -- --config "unstable_features=true,imports_granularity=Crate,group_imports=StdExternalCrate" - name: Clippy run: cargo clippy --all --examples -- -D warnings diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..9b6d0d60 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,8 @@ +repos: + - repo: local + hooks: + - id: fmt + name: fmt + entry: cargo fmt -- --config "unstable_features=true,imports_granularity=Crate,group_imports=StdExternalCrate" + language: system + types: [rust] diff --git a/Cargo.lock b/Cargo.lock index c806aa68..62a11f8f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -39,9 +39,9 @@ dependencies = [ [[package]] name = "aes" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" dependencies = [ "cfg-if 1.0.0", "cipher 0.4.4", @@ -84,9 +84,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.7" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if 1.0.0", "getrandom 0.2.10", @@ -128,9 +128,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.75" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "array-init" @@ -151,13 +151,42 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" [[package]] -name = "async-attributes" -version = "1.1.2" +name = "asn1-rs" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ad1373757efa0f70ec53939aabc7152e1591cb485208052993070ac8d2429d" +dependencies = [ + "asn1-rs-derive", + "asn1-rs-impl", + "displaydoc", + "nom", + "num-traits", + "rusticata-macros", + "thiserror", + "time 0.3.36", +] + +[[package]] +name = "asn1-rs-derive" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3203e79f4dd9bdda415ed03cf14dae5a2bf775c683a00f94e9cd1faf0f596e5" +checksum = "7378575ff571966e99a744addeff0bff98b8ada0dedf1956d59e634db95eaac1" dependencies = [ + "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.76", + "synstructure", +] + +[[package]] +name = "asn1-rs-impl" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.76", ] [[package]] @@ -171,6 +200,18 @@ dependencies = [ "futures-core", ] +[[package]] +name = "async-channel" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" +dependencies = [ + "concurrent-queue", + "event-listener-strategy", + "futures-core", + "pin-project-lite 0.2.13", +] + [[package]] name = "async-dup" version = "1.2.2" @@ -183,30 +224,29 @@ dependencies = [ [[package]] name = "async-executor" -version = "1.5.1" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fa3dc5f2a8564f07759c008b9109dc0d39de92a88d5588b8a5036d286383afb" +checksum = "d7ebdfa2ebdab6b1760375fa7d6f382b9f486eac35fc994625a00e89280bdbb7" dependencies = [ - "async-lock", "async-task", "concurrent-queue", - "fastrand", - "futures-lite", + "fastrand 2.0.2", + "futures-lite 2.0.0", "slab", ] [[package]] name = "async-global-executor" -version = "2.3.1" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1b6f5d7df27bd294849f8eec66ecfc63d11814df7a4f5d74168a2394467b776" +checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" dependencies = [ - "async-channel", + "async-channel 2.3.1", "async-executor", - "async-io", - "async-lock", + "async-io 2.3.3", + "async-lock 3.4.0", "blocking", - "futures-lite", + "futures-lite 2.0.0", "once_cell", "tokio", ] @@ -217,7 +257,7 @@ version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8101020758a4fc3a7c326cb42aa99e9fa77cbfb76987c128ad956406fe1f70a7" dependencies = [ - "async-channel", + "async-channel 1.9.0", "async-dup", "async-std", "futures-core", @@ -233,20 +273,39 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" dependencies = [ - "async-lock", + "async-lock 2.8.0", "autocfg", "cfg-if 1.0.0", "concurrent-queue", - "futures-lite", + "futures-lite 1.13.0", "log", "parking", - "polling", + "polling 2.8.0", "rustix 0.37.25", "slab", "socket2 0.4.9", "waker-fn", ] +[[package]] +name = "async-io" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" +dependencies = [ + "async-lock 3.4.0", + "cfg-if 1.0.0", + "concurrent-queue", + "futures-io", + "futures-lite 2.0.0", + "parking", + "polling 3.7.2", + "rustix 0.38.32", + "slab", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "async-liveliness-monitor" version = "0.1.1" @@ -262,19 +321,30 @@ dependencies = [ "event-listener 2.5.3", ] +[[package]] +name = "async-lock" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" +dependencies = [ + "event-listener 5.3.1", + "event-listener-strategy", + "pin-project-lite 0.2.13", +] + [[package]] name = "async-process" version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a9d28b1d97e08915212e2e45310d47854eafa69600756fc735fb788f75199c9" dependencies = [ - "async-io", - "async-lock", + "async-io 1.13.0", + "async-lock 2.8.0", "autocfg", "blocking", "cfg-if 1.0.0", "event-listener 2.5.3", - "futures-lite", + "futures-lite 1.13.0", "rustix 0.37.25", "signal-hook", "windows-sys 0.48.0", @@ -307,7 +377,7 @@ version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53bba003996b8fd22245cd0c59b869ba764188ed435392cf2796d03b805ade10" dependencies = [ - "async-channel", + "async-channel 1.9.0", "async-std", "http-types", "log", @@ -321,17 +391,16 @@ version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" dependencies = [ - "async-attributes", - "async-channel", + "async-channel 1.9.0", "async-global-executor", - "async-io", - "async-lock", + "async-io 1.13.0", + "async-lock 2.8.0", "async-process", "crossbeam-utils", "futures-channel", "futures-core", "futures-io", - "futures-lite", + "futures-lite 1.13.0", "gloo-timers", "kv-log-macro", "log", @@ -351,13 +420,13 @@ checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" [[package]] name = "async-trait" -version = "0.1.73" +version = "0.1.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" +checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.76", ] [[package]] @@ -422,6 +491,12 @@ version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + [[package]] name = "base64ct" version = "1.6.0" @@ -454,9 +529,9 @@ dependencies = [ "proc-macro2", "quote", "regex", - "rustc-hash", + "rustc-hash 1.1.0", "shlex", - "syn 2.0.33", + "syn 2.0.76", "which", ] @@ -525,17 +600,15 @@ dependencies = [ [[package]] name = "blocking" -version = "1.3.1" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77231a1c8f801696fc0123ec6150ce92cffb8e164a02afb9c8ddee0e9b65ad65" +checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" dependencies = [ - "async-channel", - "async-lock", + "async-channel 2.3.1", "async-task", - "atomic-waker", - "fastrand", - "futures-lite", - "log", + "futures-io", + "futures-lite 2.0.0", + "piper", ] [[package]] @@ -558,9 +631,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.5.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" [[package]] name = "cache-padded" @@ -614,6 +687,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "chrono" version = "0.4.30" @@ -704,9 +783,9 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "2.2.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" dependencies = [ "crossbeam-utils", ] @@ -725,18 +804,18 @@ checksum = "fbdcdcb6d86f71c5e97409ad45898af11cbc995b4ee8112d59095a28d376c935" [[package]] name = "const_format" -version = "0.2.31" +version = "0.2.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c990efc7a285731f9a4378d81aff2f0e85a2c8781a05ef0f8baa8dac54d0ff48" +checksum = "e3a214c7af3d04997541b18d432afaff4c455e79e2029079647e72fc2bd27673" dependencies = [ "const_format_proc_macros", ] [[package]] name = "const_format_proc_macros" -version = "0.2.31" +version = "0.2.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e026b6ce194a874cb9cf32cd5772d1ef9767cc8fcb5765948d74f37a9d8b2bf6" +checksum = "c7f6ff08fd20f4f299298a28e2dfa8a8ba1036e6cd2460ac1de7b425d76f2500" dependencies = [ "proc-macro2", "quote", @@ -799,12 +878,9 @@ checksum = "dcb25d077389e53838a8158c8e99174c5a9d902dee4904320db714f3c653ffba" [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if 1.0.0", -] +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crypto-common" @@ -878,6 +954,20 @@ dependencies = [ "zeroize", ] +[[package]] +name = "der-parser" +version = "9.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cd0a5c643689626bec213c4d8bd4d96acc8ffdb4ad4bb6bc16abf27d5f4b553" +dependencies = [ + "asn1-rs", + "displaydoc", + "nom", + "num-bigint", + "num-traits", + "rusticata-macros", +] + [[package]] name = "deranged" version = "0.3.11" @@ -946,6 +1036,17 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" +[[package]] +name = "displaydoc" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.76", +] + [[package]] name = "dyn-clone" version = "1.0.13" @@ -954,9 +1055,9 @@ checksum = "bbfc4744c1b8f2a09adc0e55242f60b1af195d88596bd8700be74418c056c555" [[package]] name = "either" -version = "1.9.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "equivalent" @@ -991,23 +1092,34 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "event-listener" -version = "4.0.0" +version = "5.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "770d968249b5d99410d61f5bf89057f3199a077a04d087092f58e7d10692baae" +checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" dependencies = [ "concurrent-queue", "parking", "pin-project-lite 0.2.13", ] +[[package]] +name = "event-listener-strategy" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" +dependencies = [ + "event-listener 5.3.1", + "pin-project-lite 0.2.13", +] + [[package]] name = "fancy-regex" -version = "0.11.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b95f7c0680e4142284cf8b22c14a476e87d61b004a3a0861872b32ef7ead40a2" +checksum = "531e46835a22af56d1e3b66f04844bed63158bc094a628bec1d321d9b4c44bf2" dependencies = [ "bit-set", - "regex", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", ] [[package]] @@ -1019,6 +1131,12 @@ dependencies = [ "instant", ] +[[package]] +name = "fastrand" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" + [[package]] name = "femme" version = "2.2.1" @@ -1050,7 +1168,7 @@ dependencies = [ "futures-core", "futures-sink", "nanorand", - "spin 0.9.8", + "spin", ] [[package]] @@ -1061,18 +1179,18 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] [[package]] name = "fraction" -version = "0.13.1" +version = "0.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3027ae1df8d41b4bed2241c8fdad4acc1e7af60c8e17743534b545e77182d678" +checksum = "0f158e3ff0a1b334408dc9fb811cd99b446986f4d8b741bb08f9df1604085ae7" dependencies = [ "lazy_static", "num", @@ -1080,9 +1198,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -1095,9 +1213,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -1105,15 +1223,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -1122,9 +1240,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-lite" @@ -1132,7 +1250,22 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" dependencies = [ - "fastrand", + "fastrand 1.9.0", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite 0.2.13", + "waker-fn", +] + +[[package]] +name = "futures-lite" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c1155db57329dca6d018b61e76b1488ce9a2e5e44028cac420a5898f4fcef63" +dependencies = [ + "fastrand 2.0.2", "futures-core", "futures-io", "memchr", @@ -1143,32 +1276,32 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.76", ] [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-channel", "futures-core", @@ -1234,24 +1367,22 @@ checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" [[package]] name = "git-version" -version = "0.3.5" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6b0decc02f4636b9ccad390dcbe77b722a77efedfa393caf8379a51d5c61899" +checksum = "1ad568aa3db0fcbc81f2f116137f263d7304f512a1209b35b85150d3ef88ad19" dependencies = [ "git-version-macro", - "proc-macro-hack", ] [[package]] name = "git-version-macro" -version = "0.3.5" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe69f1cbdb6e28af2bac214e943b99ce8a0a06b447d15d3e61161b0423139f3f" +checksum = "53010ccb100b96a67bc32c0175f0ed1426b31b655d562898e57325f81c023ac0" dependencies = [ - "proc-macro-hack", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.76", ] [[package]] @@ -1273,25 +1404,22 @@ dependencies = [ ] [[package]] -name = "hashbrown" -version = "0.12.3" +name = "half" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", -] +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.0" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", "allocator-api2", @@ -1308,9 +1436,15 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.2" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +name = "hermit-abi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" [[package]] name = "hex" @@ -1359,11 +1493,11 @@ dependencies = [ [[package]] name = "home" -version = "0.5.5" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1396,11 +1530,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e9b187a72d63adbfba487f48095306ac823049cb504ee195541e91c7775f5ad" dependencies = [ "anyhow", - "async-channel", + "async-channel 1.9.0", "async-std", "base64 0.13.1", "cookie", - "futures-lite", + "futures-lite 1.13.0", "infer", "pin-project-lite 0.2.13", "rand 0.7.3", @@ -1448,9 +1582,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -1468,12 +1602,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" dependencies = [ "equivalent", - "hashbrown 0.14.0", + "hashbrown 0.14.5", ] [[package]] @@ -1506,7 +1640,7 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi 0.3.2", + "hermit-abi 0.3.9", "libc", "windows-sys 0.48.0", ] @@ -1529,6 +1663,21 @@ dependencies = [ "nom", ] +[[package]] +name = "iter-read" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c397ca3ea05ad509c4ec451fea28b4771236a376ca1c69fd5143aae0cf8f93c4" + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.9" @@ -1577,13 +1726,13 @@ dependencies = [ [[package]] name = "jsonschema" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a071f4f7efc9a9118dfb627a0a94ef247986e1ab8606a4c806ae2b3aa3b6978" +checksum = "f5f037c58cadb17e8591b620b523cc6a7ab2b91b6ce3121f8eb4171f8d80115c" dependencies = [ "ahash", "anyhow", - "base64 0.21.4", + "base64 0.22.1", "bytecount", "fancy-regex", "fraction", @@ -1614,11 +1763,11 @@ dependencies = [ [[package]] name = "keyed-set" -version = "0.4.5" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b79e110283e09081809ca488cf3a9709270c6d4d4c4a32674c39cc438366615a" +checksum = "0a3ec39d2dc17953a1540d63906a112088f79b2e46833b4ed65bc9de3904ae34" dependencies = [ - "hashbrown 0.13.2", + "hashbrown 0.14.5", ] [[package]] @@ -1632,11 +1781,11 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" dependencies = [ - "spin 0.5.2", + "spin", ] [[package]] @@ -1647,9 +1796,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.153" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] name = "libloading" @@ -1719,9 +1868,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.6.3" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "minimal-lexical" @@ -1740,13 +1889,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.11" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ + "hermit-abi 0.3.9", "libc", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1760,12 +1910,13 @@ dependencies = [ [[package]] name = "nix" -version = "0.27.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" dependencies = [ "bitflags 2.5.0", "cfg-if 1.0.0", + "cfg_aliases", "libc", ] @@ -1797,9 +1948,9 @@ dependencies = [ [[package]] name = "num" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b05180d69e3da0e530ba2a1dae5110317e49e3b7f3d41be227dc5f92e49ee7af" +checksum = "3135b08af27d103b0a51f2ae0f8632117b7b185ccf931445affa8df530576a41" dependencies = [ "num-bigint", "num-complex", @@ -1845,9 +1996,9 @@ checksum = "63335b2e2c34fae2fb0aa2cecfd9f0832a1e24b3b32ecec612c3426d46dc8aaa" [[package]] name = "num-complex" -version = "0.4.4" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ba157ca0885411de85d6ca030ba7e2a83a28636056c7c699b07c8b6f7383214" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" dependencies = [ "num-traits", ] @@ -1860,19 +2011,18 @@ checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" [[package]] name = "num-integer" -version = "0.1.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "autocfg", "num-traits", ] [[package]] name = "num-iter" -version = "0.1.43" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" dependencies = [ "autocfg", "num-integer", @@ -1893,9 +2043,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.16" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", "libm", @@ -1907,7 +2057,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.2", + "hermit-abi 0.3.9", "libc", ] @@ -1920,6 +2070,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "oid-registry" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c958dd45046245b9c3c2547369bb634eb461670b2e7e0de552905801a648d1d" +dependencies = [ + "asn1-rs", +] + [[package]] name = "once_cell" version = "1.19.0" @@ -1946,9 +2105,9 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "ordered-float" -version = "4.1.1" +version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "536900a8093134cf9ccf00a27deb3532421099e958d9dd431135d0c7543ca1e8" +checksum = "4a91171844676f8c7990ce64959210cd2eaef32c2612c50f9fae9f8aaa6065a6" dependencies = [ "num-traits", ] @@ -1996,9 +2155,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "peeking_take_while" @@ -2017,9 +2176,9 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" @@ -2052,7 +2211,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.76", ] [[package]] @@ -2068,12 +2227,54 @@ dependencies = [ [[package]] name = "petgraph" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.0.0", + "indexmap 2.4.0", +] + +[[package]] +name = "phf" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +dependencies = [ + "phf_macros", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +dependencies = [ + "phf_shared", + "rand 0.8.5", +] + +[[package]] +name = "phf_macros" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", + "syn 2.0.76", +] + +[[package]] +name = "phf_shared" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +dependencies = [ + "siphasher", ] [[package]] @@ -2093,7 +2294,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.76", ] [[package]] @@ -2114,6 +2315,17 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "piper" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" +dependencies = [ + "atomic-waker", + "fastrand 2.0.2", + "futures-io", +] + [[package]] name = "pkcs1" version = "0.7.5" @@ -2137,18 +2349,18 @@ dependencies = [ [[package]] name = "pnet_base" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe4cf6fb3ab38b68d01ab2aea03ed3d1132b4868fa4e06285f29f16da01c5f4c" +checksum = "ffc190d4067df16af3aba49b3b74c469e611cad6314676eaf1157f31aa0fb2f7" dependencies = [ "no-std-net", ] [[package]] name = "pnet_datalink" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad5854abf0067ebbd3967f7d45ebc8976ff577ff0c7bd101c4973ae3c70f98fe" +checksum = "e79e70ec0be163102a332e1d2d5586d362ad76b01cec86f830241f2b6452a7b7" dependencies = [ "ipnetwork", "libc", @@ -2159,9 +2371,9 @@ dependencies = [ [[package]] name = "pnet_sys" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "417c0becd1b573f6d544f73671070b039051e5ad819cc64aa96377b536128d00" +checksum = "7d4643d3d4db6b08741050c2f3afa9a892c4244c085a72fcda93c9c2c9a00f4b" dependencies = [ "libc", "winapi", @@ -2183,6 +2395,21 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "polling" +version = "3.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3ed00ed3fbf728b5816498ecd316d1716eecaced9c0c8d2c5a6740ca214985b" +dependencies = [ + "cfg-if 1.0.0", + "concurrent-queue", + "hermit-abi 0.4.0", + "pin-project-lite 0.2.13", + "rustix 0.38.32", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "polyval" version = "0.4.5" @@ -2208,12 +2435,12 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "prettyplease" -version = "0.2.15" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" +checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" dependencies = [ "proc-macro2", - "syn 2.0.33", + "syn 2.0.76", ] [[package]] @@ -2224,25 +2451,26 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.67" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[package]] name = "quinn" -version = "0.11.1" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904e3d3ba178131798c6d9375db2b13b34337d489b089fc5ba0825a2ff1bee73" +checksum = "b22d8e7369034b9a7132bc2008cac12f2013c8132b45e0554e6e20e2617f2156" dependencies = [ "bytes", "pin-project-lite 0.2.13", "quinn-proto", "quinn-udp", - "rustc-hash", + "rustc-hash 2.0.0", "rustls", + "socket2 0.5.7", "thiserror", "tokio", "tracing", @@ -2250,14 +2478,14 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e974563a4b1c2206bbc61191ca4da9c22e4308b4c455e8906751cc7828393f08" +checksum = "ddf517c03a109db8100448a4be38d498df8a210a99fe0e1b9eaf39e78c640efe" dependencies = [ "bytes", "rand 0.8.5", "ring", - "rustc-hash", + "rustc-hash 1.1.0", "rustls", "rustls-platform-verifier", "slab", @@ -2268,22 +2496,22 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.1" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4f0def2590301f4f667db5a77f9694fb004f82796dc1a8b1508fafa3d0e8b72" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" dependencies = [ "libc", "once_cell", - "socket2 0.5.6", + "socket2 0.5.7", "tracing", "windows-sys 0.52.0", ] [[package]] name = "quote" -version = "1.0.33" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -2390,14 +2618,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.5" +version = "1.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.3.8", - "regex-syntax 0.7.5", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", ] [[package]] @@ -2411,13 +2639,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.8" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.5", + "regex-syntax 0.8.4", ] [[package]] @@ -2428,9 +2656,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.5" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "ring" @@ -2441,7 +2669,7 @@ dependencies = [ "cc", "getrandom 0.2.10", "libc", - "spin 0.9.8", + "spin", "untrusted", "windows-sys 0.48.0", ] @@ -2508,6 +2736,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc-hash" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" + [[package]] name = "rustc_version" version = "0.2.3" @@ -2519,13 +2753,22 @@ dependencies = [ [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ "semver 1.0.18", ] +[[package]] +name = "rusticata-macros" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632" +dependencies = [ + "nom", +] + [[package]] name = "rustix" version = "0.37.25" @@ -2555,9 +2798,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.9" +version = "0.23.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a218f0f6d05669de4eabfb24f31ce802035c952429d037507b4a4a39f0e60c5b" +checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" dependencies = [ "log", "once_cell", @@ -2583,19 +2826,19 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.0.0" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35e4980fa29e4c4b212ffb3db068a564cbf560e51d3944b7c88bd8bf5bec64f4" +checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" dependencies = [ - "base64 0.21.4", + "base64 0.22.1", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" +checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" [[package]] name = "rustls-platform-verifier" @@ -2626,9 +2869,9 @@ checksum = "84e217e7fdc8466b5b35d30f8c0a30febd29173df4a3a0c2115d306b9c4117ad" [[package]] name = "rustls-webpki" -version = "0.102.4" +version = "0.102.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" +checksum = "84678086bd54edf2b415183ed7a94d0efb049f1b646a33e22a36f3794be6ae56" dependencies = [ "ring", "rustls-pki-types", @@ -2661,11 +2904,12 @@ dependencies = [ [[package]] name = "schemars" -version = "0.8.13" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "763f8cd0d4c71ed8389c90cb8100cba87e763bd01a8e614d4f0af97bcd50a161" +checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" dependencies = [ "dyn-clone", + "either", "schemars_derive", "serde", "serde_json", @@ -2673,14 +2917,14 @@ dependencies = [ [[package]] name = "schemars_derive" -version = "0.8.13" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0f696e21e10fa546b7ffb1c9672c6de8fbc7a81acf59524386d8639bf12737" +checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 1.0.109", + "syn 2.0.76", ] [[package]] @@ -2746,33 +2990,56 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.188" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" dependencies = [ "serde_derive", ] +[[package]] +name = "serde-pickle" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c762ad136a26407c6a80825813600ceeab5e613660d93d79a41f0ec877171e71" +dependencies = [ + "byteorder", + "iter-read", + "num-bigint", + "num-traits", + "serde", +] + +[[package]] +name = "serde_cbor" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" +dependencies = [ + "half", + "serde", +] + [[package]] name = "serde_derive" -version = "1.0.188" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.76", ] [[package]] name = "serde_derive_internals" -version = "0.26.0" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.76", ] [[package]] @@ -2786,11 +3053,12 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.107" +version = "1.0.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] @@ -2820,11 +3088,11 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.9.25" +version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a49e178e4452f45cb61d0cd8cebc1b0fafd3e41929e996cef79aa3aca91f574" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.4.0", "itoa", "ryu", "serde", @@ -2953,6 +3221,12 @@ dependencies = [ "event-listener 2.5.3", ] +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + [[package]] name = "slab" version = "0.4.9" @@ -2964,9 +3238,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.0" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" @@ -2980,20 +3254,14 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", "windows-sys 0.52.0", ] -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - [[package]] name = "spin" version = "0.9.8" @@ -3083,7 +3351,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af91f480ee899ab2d9f8435bfdfc14d08a5754bd9d3fef1f1a1c23336aad6c8b" dependencies = [ - "async-channel", + "async-channel 1.9.0", "cfg-if 1.0.0", "futures-core", "pin-project-lite 0.2.13", @@ -3182,15 +3450,26 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.33" +version = "2.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9caece70c63bfba29ec2fed841a09851b14a235c60010fa4de58089b6c025668" +checksum = "578e081a14e0cefc3279b0472138c513f37b41a08d5a3cca9b6e4e8ceb6cd525" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.76", +] + [[package]] name = "termcolor" version = "1.4.1" @@ -3223,7 +3502,7 @@ checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.76", ] [[package]] @@ -3281,6 +3560,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", + "itoa", "num-conv", "powerfmt", "serde", @@ -3353,30 +3633,29 @@ dependencies = [ [[package]] name = "tokio" -version = "1.36.0" +version = "1.39.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" +checksum = "9babc99b9923bfa4804bd74722ff02c0381021eafa4db9949217e3be8e84fff5" dependencies = [ "backtrace", "bytes", "libc", "mio", - "num_cpus", "pin-project-lite 0.2.13", - "socket2 0.5.6", + "socket2 0.5.7", "tokio-macros", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.76", ] [[package]] @@ -3392,9 +3671,9 @@ dependencies = [ [[package]] name = "tokio-tungstenite" -version = "0.21.0" +version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c83b561d025642014097b66e6c1bb422783339e0909e4429cde4749d1990bc38" +checksum = "c6989540ced10490aaf14e6bad2e3d33728a2813310a0c71d1574304c49631cd" dependencies = [ "futures-util", "log", @@ -3404,15 +3683,15 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", "futures-sink", "futures-util", - "hashbrown 0.14.0", + "hashbrown 0.14.5", "pin-project-lite 0.2.13", "tokio", ] @@ -3438,7 +3717,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.76", ] [[package]] @@ -3495,9 +3774,9 @@ dependencies = [ [[package]] name = "tungstenite" -version = "0.21.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ef1a641ea34f399a848dea702823bbecfb4c486f911735368f1f137cb8257e1" +checksum = "6e2e2ce1e47ed2994fd43b04c8f618008d4cabdd5ee34027cf14f9d918edd9c8" dependencies = [ "byteorder", "bytes", @@ -3508,7 +3787,6 @@ dependencies = [ "rand 0.8.5", "sha1 0.10.5", "thiserror", - "url", "utf-8", ] @@ -3536,23 +3814,23 @@ checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" [[package]] name = "uhlc" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99b6df3f3e948b40e20c38a6d1fd6d8f91b3573922fc164e068ad3331560487e" +checksum = "79ac3c37bd9506595768f0387bd39d644525728b4a1d783218acabfb56356db7" dependencies = [ "humantime", "lazy_static", "log", "rand 0.8.5", "serde", - "spin 0.9.8", + "spin", ] [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" @@ -3562,9 +3840,9 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] @@ -3587,9 +3865,9 @@ dependencies = [ [[package]] name = "unsafe-libyaml" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab4c90930b95a82d00dc9e9ac071b4991924390d46cbd0dfe566148667605e4b" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" [[package]] name = "untrusted" @@ -3597,6 +3875,12 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" +[[package]] +name = "unwrap-infallible" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" + [[package]] name = "unzip-n" version = "0.1.2" @@ -3610,9 +3894,9 @@ dependencies = [ [[package]] name = "url" -version = "2.4.1" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", @@ -3628,9 +3912,9 @@ checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" [[package]] name = "uuid" -version = "1.4.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" +checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" dependencies = [ "getrandom 0.2.10", ] @@ -3764,7 +4048,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.76", "wasm-bindgen-shared", ] @@ -3798,7 +4082,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.76", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3821,9 +4105,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.0" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de2cfda980f21be5a7ed2eadb3e6fe074d56022bea2cdeb1a62eb220fc04188" +checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" dependencies = [ "rustls-pki-types", ] @@ -4012,35 +4296,59 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +[[package]] +name = "x509-parser" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcbc162f30700d6f3f82a24bf7cc62ffe7caea42c0b2cba8bf7f3ae50cf51f69" +dependencies = [ + "asn1-rs", + "data-encoding", + "der-parser", + "lazy_static", + "nom", + "oid-registry", + "rusticata-macros", + "thiserror", + "time 0.3.36", +] + [[package]] name = "zenoh" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#926208cd2bd9a7ef59e6151ff17a99ce6b78edbd" dependencies = [ "ahash", "async-trait", - "base64 0.21.4", - "const_format", - "event-listener 4.0.0", + "base64 0.22.1", + "bytes", + "event-listener 5.3.1", "flume", "form_urlencoded", "futures", "git-version", + "itertools", "lazy_static", + "once_cell", "ordered-float", "paste", "petgraph", + "phf", "rand 0.8.5", "regex", - "rustc_version 0.4.0", + "rustc_version 0.4.1", "serde", + "serde-pickle", + "serde_cbor", "serde_json", - "socket2 0.5.6", + "serde_yaml", + "socket2 0.5.7", "stop-token", "tokio", "tokio-util", "tracing", "uhlc", + "unwrap-infallible", "uuid", "vec_map", "zenoh-buffers", @@ -4064,33 +4372,33 @@ dependencies = [ [[package]] name = "zenoh-bridge-dds" -version = "0.11.0-dev" +version = "1.0.0-dev" dependencies = [ "async-liveliness-monitor", - "async-std", "clap", + "futures", "lazy_static", "serde_json", + "tokio", "tracing", "zenoh", "zenoh-plugin-dds", "zenoh-plugin-rest", "zenoh-plugin-trait", - "zenoh-util", ] [[package]] name = "zenoh-buffers" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#926208cd2bd9a7ef59e6151ff17a99ce6b78edbd" dependencies = [ "zenoh-collections", ] [[package]] name = "zenoh-codec" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#926208cd2bd9a7ef59e6151ff17a99ce6b78edbd" dependencies = [ "serde", "tracing", @@ -4101,13 +4409,13 @@ dependencies = [ [[package]] name = "zenoh-collections" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#926208cd2bd9a7ef59e6151ff17a99ce6b78edbd" [[package]] name = "zenoh-config" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#926208cd2bd9a7ef59e6151ff17a99ce6b78edbd" dependencies = [ "flume", "json5", @@ -4117,8 +4425,10 @@ dependencies = [ "serde_json", "serde_yaml", "tracing", + "uhlc", "validated_struct", "zenoh-core", + "zenoh-macros", "zenoh-protocol", "zenoh-result", "zenoh-util", @@ -4126,8 +4436,8 @@ dependencies = [ [[package]] name = "zenoh-core" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#926208cd2bd9a7ef59e6151ff17a99ce6b78edbd" dependencies = [ "async-global-executor", "lazy_static", @@ -4138,10 +4448,10 @@ dependencies = [ [[package]] name = "zenoh-crypto" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#926208cd2bd9a7ef59e6151ff17a99ce6b78edbd" dependencies = [ - "aes 0.8.3", + "aes 0.8.4", "hmac 0.12.1", "rand 0.8.5", "rand_chacha 0.3.1", @@ -4151,31 +4461,29 @@ dependencies = [ [[package]] name = "zenoh-ext" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#926208cd2bd9a7ef59e6151ff17a99ce6b78edbd" dependencies = [ "bincode", "flume", "futures", + "phf", "serde", + "serde_cbor", + "serde_json", "tokio", "tracing", "zenoh", - "zenoh-core", "zenoh-macros", - "zenoh-result", - "zenoh-runtime", - "zenoh-sync", - "zenoh-task", "zenoh-util", ] [[package]] name = "zenoh-keyexpr" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#926208cd2bd9a7ef59e6151ff17a99ce6b78edbd" dependencies = [ - "hashbrown 0.14.0", + "hashbrown 0.14.5", "keyed-set", "rand 0.8.5", "schemars", @@ -4186,8 +4494,8 @@ dependencies = [ [[package]] name = "zenoh-link" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#926208cd2bd9a7ef59e6151ff17a99ce6b78edbd" dependencies = [ "async-trait", "zenoh-config", @@ -4204,8 +4512,8 @@ dependencies = [ [[package]] name = "zenoh-link-commons" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#926208cd2bd9a7ef59e6151ff17a99ce6b78edbd" dependencies = [ "async-trait", "flume", @@ -4216,6 +4524,7 @@ dependencies = [ "tokio", "tokio-util", "tracing", + "webpki-roots", "zenoh-buffers", "zenoh-codec", "zenoh-config", @@ -4228,11 +4537,11 @@ dependencies = [ [[package]] name = "zenoh-link-quic" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#926208cd2bd9a7ef59e6151ff17a99ce6b78edbd" dependencies = [ "async-trait", - "base64 0.21.4", + "base64 0.22.1", "futures", "quinn", "rustls", @@ -4245,6 +4554,8 @@ dependencies = [ "tokio-util", "tracing", "webpki-roots", + "x509-parser", + "zenoh-collections", "zenoh-config", "zenoh-core", "zenoh-link-commons", @@ -4257,10 +4568,11 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#926208cd2bd9a7ef59e6151ff17a99ce6b78edbd" dependencies = [ "async-trait", + "socket2 0.5.7", "tokio", "tokio-util", "tracing", @@ -4275,22 +4587,25 @@ dependencies = [ [[package]] name = "zenoh-link-tls" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#926208cd2bd9a7ef59e6151ff17a99ce6b78edbd" dependencies = [ "async-trait", - "base64 0.21.4", + "base64 0.22.1", "futures", "rustls", "rustls-pemfile", "rustls-pki-types", "rustls-webpki", "secrecy", + "socket2 0.5.7", "tokio", "tokio-rustls", "tokio-util", "tracing", "webpki-roots", + "x509-parser", + "zenoh-collections", "zenoh-config", "zenoh-core", "zenoh-link-commons", @@ -4303,11 +4618,11 @@ dependencies = [ [[package]] name = "zenoh-link-udp" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#926208cd2bd9a7ef59e6151ff17a99ce6b78edbd" dependencies = [ "async-trait", - "socket2 0.5.6", + "socket2 0.5.7", "tokio", "tokio-util", "tracing", @@ -4324,8 +4639,8 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#926208cd2bd9a7ef59e6151ff17a99ce6b78edbd" dependencies = [ "async-trait", "futures", @@ -4344,8 +4659,8 @@ dependencies = [ [[package]] name = "zenoh-link-ws" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#926208cd2bd9a7ef59e6151ff17a99ce6b78edbd" dependencies = [ "async-trait", "futures-util", @@ -4365,20 +4680,19 @@ dependencies = [ [[package]] name = "zenoh-macros" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#926208cd2bd9a7ef59e6151ff17a99ce6b78edbd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.76", "zenoh-keyexpr", ] [[package]] name = "zenoh-plugin-dds" -version = "0.11.0-dev" +version = "1.0.0-dev" dependencies = [ - "async-std", "async-trait", "bincode", "cdr", @@ -4390,26 +4704,23 @@ dependencies = [ "hex", "lazy_static", "regex", - "rustc_version 0.4.0", + "rustc_version 0.4.1", "serde", "serde_json", + "tokio", "tracing", "zenoh", - "zenoh-collections", - "zenoh-core", "zenoh-ext", "zenoh-plugin-trait", - "zenoh-util", ] [[package]] name = "zenoh-plugin-rest" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#926208cd2bd9a7ef59e6151ff17a99ce6b78edbd" dependencies = [ "anyhow", - "async-std", - "base64 0.21.4", + "base64 0.22.1", "const_format", "flume", "futures", @@ -4417,24 +4728,22 @@ dependencies = [ "http-types", "jsonschema", "lazy_static", - "rustc_version 0.4.0", + "rustc_version 0.4.1", "schemars", "serde", "serde_json", "tide", + "tokio", "tracing", "zenoh", "zenoh-plugin-trait", - "zenoh-result", - "zenoh-util", ] [[package]] name = "zenoh-plugin-trait" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#926208cd2bd9a7ef59e6151ff17a99ce6b78edbd" dependencies = [ - "const_format", "libloading", "serde", "serde_json", @@ -4447,30 +4756,31 @@ dependencies = [ [[package]] name = "zenoh-protocol" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#926208cd2bd9a7ef59e6151ff17a99ce6b78edbd" dependencies = [ "const_format", "rand 0.8.5", "serde", "uhlc", "zenoh-buffers", + "zenoh-collections", "zenoh-keyexpr", "zenoh-result", ] [[package]] name = "zenoh-result" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#926208cd2bd9a7ef59e6151ff17a99ce6b78edbd" dependencies = [ "anyhow", ] [[package]] name = "zenoh-runtime" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#926208cd2bd9a7ef59e6151ff17a99ce6b78edbd" dependencies = [ "futures", "lazy_static", @@ -4478,17 +4788,16 @@ dependencies = [ "ron", "serde", "tokio", - "zenoh-collections", "zenoh-macros", "zenoh-result", ] [[package]] name = "zenoh-sync" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#926208cd2bd9a7ef59e6151ff17a99ce6b78edbd" dependencies = [ - "event-listener 4.0.0", + "event-listener 5.3.1", "futures", "tokio", "zenoh-buffers", @@ -4499,8 +4808,8 @@ dependencies = [ [[package]] name = "zenoh-task" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#926208cd2bd9a7ef59e6151ff17a99ce6b78edbd" dependencies = [ "futures", "tokio", @@ -4512,11 +4821,13 @@ dependencies = [ [[package]] name = "zenoh-transport" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#926208cd2bd9a7ef59e6151ff17a99ce6b78edbd" dependencies = [ "async-trait", + "crossbeam-utils", "flume", + "lazy_static", "lz4_flex", "paste", "rand 0.8.5", @@ -4544,11 +4855,11 @@ dependencies = [ [[package]] name = "zenoh-util" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#926208cd2bd9a7ef59e6151ff17a99ce6b78edbd" dependencies = [ - "async-std", "async-trait", + "const_format", "flume", "home", "humantime", @@ -4556,6 +4867,8 @@ dependencies = [ "libc", "libloading", "pnet_datalink", + "serde", + "serde_json", "shellexpand", "tokio", "tracing", @@ -4582,7 +4895,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.76", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index d80a8304..50a3fc01 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,11 +26,10 @@ edition = "2021" homepage = "http://zenoh.io" license = "EPL-2.0 OR Apache-2.0" repository = "https://github.com/eclipse-zenoh/zenoh-plugin-dds" -version = "0.11.0-dev" +version = "1.0.0-dev" [workspace.dependencies] async-liveliness-monitor = "0.1.1" -async-std = "=1.12.0" async-trait = "0.1.66" bincode = "1.3.3" cdr = "0.2.4" @@ -45,21 +44,19 @@ lazy_static = "1.4.0" regex = "1.7.1" rustc_version = "0.4" serde = "1.0.154" -serde_json = "1.0.94" +serde_json = "1.0.114" +tokio = { version = "1.35.1", default-features = false } # Default features are disabled due to some crates' requirements tracing = "0.1" -zenoh = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", features = [ +zenoh = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0", features = [ "plugins", "unstable", ] } -zenoh-collections = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main" } -zenoh-core = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main" } -zenoh-ext = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", features = [ +zenoh-ext = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0", features = [ "unstable", ] } -zenoh-plugin-dds = { version = "0.11.0-dev", path = "zenoh-plugin-dds/", default-features = false } -zenoh-plugin-rest = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", default-features = false } -zenoh-plugin-trait = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", default-features = false } -zenoh-util = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", default-features = false } +zenoh-plugin-dds = { version = "1.0.0-dev", path = "zenoh-plugin-dds/", default-features = false } +zenoh-plugin-rest = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0", default-features = false } +zenoh-plugin-trait = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0", default-features = false } [profile.release] codegen-units = 1 diff --git a/DEFAULT_CONFIG.json5 b/DEFAULT_CONFIG.json5 index cdd9b2e6..864bad32 100644 --- a/DEFAULT_CONFIG.json5 +++ b/DEFAULT_CONFIG.json5 @@ -34,12 +34,6 @@ //// // shm_enabled: false, - //// - //// group_member_id: A custom identifier for the bridge, that will be used in group management - //// (if not specified, the zenoh UUID is used). - //// - // group_member_id: "robot-1", - //// //// allow: 1 or more regular expression matching the set of 'partition/topic-name' that must be routed via zenoh. //// By default, all partitions and topics are allowed. @@ -110,6 +104,24 @@ //// but the route will not be blocked forever). //// // queries_timeout: 5.0, + + //// + //// This plugin uses Tokio (https://tokio.rs/) for asynchronous programming. + //// When running as a plugin within a Zenoh router, the plugin creates its own Runtime managing 2 pools of threads: + //// - worker threads for non-blocking tasks. Those threads are spawn at Runtime creation. + //// - blocking threads for blocking tasks (e.g. I/O). Those threads are spawn when needed. + //// For more details see https://github.com/tokio-rs/tokio/discussions/3858#discussioncomment-869878 + //// When running as a standalone bridge the Zenoh Session's Runtime is used and can be configured via the + //// `ZENOH_RUNTIME` environment variable. See https://docs.rs/zenoh-runtime/latest/zenoh_runtime/enum.ZRuntime.html + //// + + //// work_thread_num: The number of worker thread in the asynchronous runtime will use. (default: 2) + //// Only for a plugin, no effect on a bridge. + // work_thread_num: 2, + + //// max_block_thread_num: The number of blocking thread in the asynchronous runtime will use. (default: 50) + //// Only for a plugin, no effect on a bridge. + // max_block_thread_num: 50, }, //// diff --git a/README.md b/README.md index f0cd448f..77da40f9 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ This software is built in 2 ways to choose from: - `zenoh-plugin-dds`: a Zenoh plugin - a dynamic library that can be loaded by a Zenoh router - `zenoh-bridge-dds`: a standalone executable -The features and configurations descibed in this document applies to both. +The features and configurations described in this document applies to both. Meaning the *"plugin"* and *"bridge"* words are interchangeables in the rest of this document. ## How to install it @@ -82,7 +82,7 @@ Then either: ## How to build it -> :warning: **WARNING** :warning: : Zenoh and its ecosystem are under active development. When you build from git, make sure you also build from git any other Zenoh repository you plan to use (e.g. binding, plugin, backend, etc.). It may happen that some changes in git are not compatible with the most recent packaged Zenoh release (e.g. deb, docker, pip). We put particular effort in mantaining compatibility between the various git repositories in the Zenoh project. +> :warning: **WARNING** :warning: : Zenoh and its ecosystem are under active development. When you build from git, make sure you also build from git any other Zenoh repository you plan to use (e.g. binding, plugin, backend, etc.). It may happen that some changes in git are not compatible with the most recent packaged Zenoh release (e.g. deb, docker, pip). We put particular effort in maintaining compatibility between the various git repositories in the Zenoh project. > :warning: **WARNING** :warning: : As Rust doesn't have a stable ABI, the plugins should be built with the exact same Rust version than `zenohd`, and using for `zenoh` dependency the same version (or commit number) than 'zenohd'. @@ -152,7 +152,7 @@ If you want to cross-compile the package on x86 device for any target, you can u rosdep install --from-paths . --ignore-src -r -y colcon build --packages-select zenoh_bridge_dds --cmake-args -DCMAKE_BUILD_TYPE=Release --cmake-args -DCROSS_ARCH= ``` -where `` is the target architecture (e.g. `aarch64-unknown-linux-gnu`). The architechture list can be found [here](https://doc.rust-lang.org/nightly/rustc/platform-support.html). +where `` is the target architecture (e.g. `aarch64-unknown-linux-gnu`). The architecture list can be found [here](https://doc.rust-lang.org/nightly/rustc/platform-support.html). The cross-compilation uses `zig` as a linker. You can install it with instructions in [here](https://ziglang.org/download/). Also, the `zigbuild` package is required to be installed on the target device. You can install it with instructions in [here](https://github.com/rust-cross/cargo-zigbuild#installation). @@ -172,7 +172,7 @@ It supports the same command line arguments than the `zenoh-bridge-dds` (see bel The use cases of this Zenoh plugin for DDS are various: - integration of a DDS System with a Zenoh System -- communication between DDS System and embeded devices thanks to [zenoh-pico](https://github.com/eclipse-zenoh/zenoh-pico) +- communication between DDS System and embedded devices thanks to [zenoh-pico](https://github.com/eclipse-zenoh/zenoh-pico) - bridging between different DDS Systems, across various transports, via a Zenoh infrastructure (i.e. some routers or directly in peer-to-peer between the bridges) - scaling a DDS system up to the Cloud with Zenoh routers - integration with any technology supported by other Zenoh Plugins (MQTT, ROS 2 ...) or Storages technology (InfluxDB, RocksDB) @@ -193,7 +193,6 @@ The `"dds"` part of this same configuration file can also be used in the configu - **`-e, --peer `** : A peer locator this router will try to connect to (typically another bridge or a zenoh router). Repeat this option to connect to several peers. Example of locator: `tcp/:7447`. - **`--no-multicast-scouting`** : disable the zenoh scouting protocol that allows automatic discovery of zenoh peers and routers. - **`-i, --id `** : The identifier (as an hexadecimal string - e.g.: 0A0B23...) that the zenoh bridge must use. **WARNING: this identifier must be unique in the system!** If not set, a random UUIDv4 will be used. - - **`--group-member-id `** : The bridges are supervising each other via zenoh liveliness tokens. This option allows to set a custom identifier for the bridge, that will be used the liveliness token key (if not specified, the zenoh UUID is used). - **`--rest-http-port `** : set the REST API http port (default: 8000) * DDS-related arguments: - **`-d, --domain `** : The DDS Domain ID. By default set to `0`, or to `"$ROS_DOMAIN_ID"` is this environment variable is defined. @@ -236,28 +235,28 @@ The `"dds"` part of this same configuration file can also be used in the configu The zenoh bridge for DDS exposes an administration space allowing to browse the DDS entities that have been discovered (with their QoS), and the routes that have been established between DDS and zenoh. This administration space is accessible via any zenoh API, including the REST API that you can activate at `zenoh-bridge-dds` startup using the `--rest-http-port` argument. -Starting from version `0.11.0-rc.2`, the `zenoh-bridge-dds` exposes this administration space with paths prefixed by `@dds/` (where `` is the unique identifier of the bridge instance). The informations are then organized with such paths: - - `@dds//version` : the bridge version - - `@dds//config` : the bridge configuration - - `@dds//participant//reader//` : a discovered DDS reader on `` - - `@dds//participant//writer//` : a discovered DDS reader on `` - - `@dds//route/from_dds/` : a route established from a DDS writer to a zenoh key named `` (see [mapping rules](#mapping-dds-topics-to-zenoh-resources)). - - `@dds//route/to_dds/` : a route established from a zenoh key named `` (see [mapping rules](#mapping-dds-topics-to-zenoh-resources)).. +Starting from version `0.11.0-rc.2`, the `zenoh-bridge-dds` exposes this administration space with paths prefixed by `@//dds` (where `` is the unique identifier of the bridge instance). The information is then organized with such paths: + - `@//dds/version` : the bridge version + - `@//dds/config` : the bridge configuration + - `@//dds/participant//reader//` : a discovered DDS reader on `` + - `@//dds/participant//writer//` : a discovered DDS reader on `` + - `@//dds/route/from_dds/` : a route established from a DDS writer to a zenoh key named `` (see [mapping rules](#mapping-dds-topics-to-zenoh-resources)). + - `@//dds/route/to_dds/` : a route established from a zenoh key named `` (see [mapping rules](#mapping-dds-topics-to-zenoh-resources)).. For previous versions, see the corresponding version of README.md: [0.10.1-rc](https://github.com/eclipse-zenoh/zenoh-plugin-dds/blob/0.10.1-rc/README.md#admin-space). Example of queries on administration space using the REST API with the `curl` command line tool (don't forget to activate the REST API with `--rest-http-port 8000` argument): - List all the DDS entities that have been discovered: ```bash - curl http://localhost:8000/@dds/*/participant/** + curl http://localhost:8000/@/*/dds/participant/** ``` - List all established routes: ```bash - curl http://localhost:8000/@dds/*/route/** + curl http://localhost:8000/@/*/dds/route/** ``` - List all discovered DDS entities and established route for topic `cmd_vel`: ```bash - curl http://localhost:8000/@dds/**/cmd_vel + curl http://localhost:8000/@/*/dds/**/cmd_vel ``` > _Pro tip: pipe the result into [**jq**](https://stedolan.github.io/jq/) command for JSON pretty print or transformation._ diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 743f7cd9..7897a24d 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.72.0" +channel = "1.75.0" diff --git a/zenoh-bridge-dds/Cargo.toml b/zenoh-bridge-dds/Cargo.toml index 047e4317..58528581 100644 --- a/zenoh-bridge-dds/Cargo.toml +++ b/zenoh-bridge-dds/Cargo.toml @@ -27,17 +27,17 @@ publish = false dds_shm = ["zenoh-plugin-dds/dds_shm"] [dependencies] -async-std = { workspace = true, features = ["unstable", "attributes"] } async-liveliness-monitor = { workspace = true } clap = { workspace = true } +futures = { workspace = true } lazy_static = { workspace = true } serde_json = { workspace = true } +tokio = { workspace = true } tracing = { workspace = true } zenoh = { workspace = true } zenoh-plugin-rest = { workspace = true } zenoh-plugin-trait = { workspace = true } zenoh-plugin-dds = { workspace = true } -zenoh-util = { workspace = true } [[bin]] name = "zenoh-bridge-dds" diff --git a/zenoh-bridge-dds/src/main.rs b/zenoh-bridge-dds/src/main.rs index bda07b3a..358f0c39 100644 --- a/zenoh-bridge-dds/src/main.rs +++ b/zenoh-bridge-dds/src/main.rs @@ -11,14 +11,19 @@ // Contributors: // ZettaScale Zenoh Team, // +use std::{ + str::FromStr, + time::{Duration, SystemTime}, +}; + use async_liveliness_monitor::LivelinessMonitor; use clap::{App, Arg}; -use std::str::FromStr; -use std::time::{Duration, SystemTime}; -use zenoh::config::{Config, ModeDependentValue}; -use zenoh::plugins::PluginsManager; -use zenoh::prelude::r#async::*; -use zenoh::runtime::RuntimeBuilder; +use zenoh::{ + config::{Config, ModeDependentValue}, + internal::{plugins::PluginsManager, runtime::RuntimeBuilder}, + prelude::*, + session::ZenohId, +}; use zenoh_plugin_dds::DDSPlugin; use zenoh_plugin_trait::Plugin; @@ -116,9 +121,6 @@ This option is not active by default, unless the "ROS_LOCALHOST_ONLY" environmen app = app .arg(Arg::from_usage( -r#"--group-member-id=[ID] 'A custom identifier for the bridge, that will be used in group management (if not specified, the zenoh UUID is used).'"# - )) - .arg(Arg::from_usage( r#"-a, --allow=[String]... 'A regular expression matching the set of 'partition/topic-name' that must be routed via zenoh. By default, all partitions and topics are allowed. If both '--allow' and '--deny' are set a partition and/or topic will be allowed if it matches only the 'allow' expression. Repeat this option to configure several topic expressions. These expressions are concatenated with '|'. @@ -183,13 +185,15 @@ r#"--watchdog=[PERIOD] 'Experimental!! Run a watchdog thread that monitors the config .connect .endpoints - .extend(endpoints.map(|p| p.parse().unwrap())) + .set(endpoints.map(|p| p.parse().unwrap()).collect()) + .unwrap(); } if let Some(endpoints) = args.values_of("listen") { config .listen .endpoints - .extend(endpoints.map(|p| p.parse().unwrap())) + .set(endpoints.map(|p| p.parse().unwrap()).collect()) + .unwrap(); } if args.is_present("no-multicast-scouting") { config.scouting.multicast.set_enabled(Some(false)).unwrap(); @@ -217,7 +221,6 @@ r#"--watchdog=[PERIOD] 'Experimental!! Run a watchdog thread that monitors the { insert_json5!(config, args, "plugins/dds/shm_enabled", if "dds-enable-shm"); } - insert_json5!(config, args, "plugins/dds/group_member_id", if "group-member-id", ); insert_json5!(config, args, "plugins/dds/allow", for "allow", .collect::>()); insert_json5!(config, args, "plugins/dds/deny", for "deny", .collect::>()); insert_json5!(config, args, "plugins/dds/max_frequencies", for "max-frequency", .collect::>()); @@ -239,9 +242,9 @@ r#"--watchdog=[PERIOD] 'Experimental!! Run a watchdog thread that monitors the (config, watchdog_period) } -#[async_std::main] +#[tokio::main] async fn main() { - zenoh_util::init_log_from_env_or("z=info"); + zenoh::init_log_from_env_or("z=info"); tracing::info!("zenoh-bridge-dds {}", DDSPlugin::PLUGIN_LONG_VERSION); let (config, watchdog_period) = parse_args(); @@ -280,7 +283,7 @@ async fn main() { std::process::exit(-1); } - async_std::future::pending::<()>().await; + futures::future::pending::<()>().await; } fn run_watchdog(period: f32) { @@ -298,8 +301,8 @@ fn run_watchdog(period: f32) { report_threshold_2.as_secs_f32() ); - // Start a Liveliness Monitor thread for async_std Runtime - let (_task, monitor) = LivelinessMonitor::start(async_std::task::spawn); + // Start a Liveliness Monitor thread for tokio Runtime + let (_task, monitor) = LivelinessMonitor::start(tokio::spawn); std::thread::spawn(move || { tracing::debug!( "Watchdog started with period {} sec", @@ -321,11 +324,20 @@ fn run_watchdog(period: f32) { let report = monitor.latest_report(); if report.elapsed() > report_threshold_1 { if report.elapsed() > sleep_time { - tracing::error!("Watchdog detecting async_std is stalled! No task scheduling since {} seconds", report.elapsed().as_secs_f32()); + tracing::error!( + "Watchdog detecting tokio is stalled! No task scheduling since {} seconds", + report.elapsed().as_secs_f32() + ); } else if report.elapsed() > report_threshold_2 { - tracing::warn!("Watchdog detecting async_std was not scheduling tasks during the last {} ms", report.elapsed().as_micros()); + tracing::warn!( + "Watchdog detecting tokio was not scheduling tasks during the last {} ms", + report.elapsed().as_micros() + ); } else { - tracing::info!("Watchdog detecting async_std was not scheduling tasks during the last {} ms", report.elapsed().as_micros()); + tracing::info!( + "Watchdog detecting tokio was not scheduling tasks during the last {} ms", + report.elapsed().as_micros() + ); } } } diff --git a/zenoh-plugin-dds/Cargo.toml b/zenoh-plugin-dds/Cargo.toml index 07ba8803..4d7f40ca 100644 --- a/zenoh-plugin-dds/Cargo.toml +++ b/zenoh-plugin-dds/Cargo.toml @@ -33,7 +33,6 @@ dds_shm = ["cyclors/iceoryx"] stats = ["zenoh/stats"] [dependencies] -async-std = { workspace = true, features = ["unstable", "attributes"] } async-trait = { workspace = true } bincode = { workspace = true } cdr = { workspace = true } @@ -47,13 +46,11 @@ lazy_static = { workspace = true } regex = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } +tokio = { workspace = true } tracing = { workspace = true } zenoh = { workspace = true } -zenoh-collections = { workspace = true } -zenoh-core = { workspace = true } zenoh-ext = { workspace = true } zenoh-plugin-trait = { workspace = true } -zenoh-util = { workspace = true } [build-dependencies] rustc_version = { workspace = true } @@ -64,4 +61,4 @@ maintainer = "zenoh-dev@eclipse.org" copyright = "2017, 2022 ZettaScale Technology Inc." section = "net" license-file = ["../LICENSE", "0"] -depends = "zenohd (=0.11.0-dev-1)" +depends = "zenohd (=1.0.0~dev-1)" diff --git a/zenoh-plugin-dds/src/config.rs b/zenoh-plugin-dds/src/config.rs index 5672172d..8e0fa485 100644 --- a/zenoh-plugin-dds/src/config.rs +++ b/zenoh-plugin-dds/src/config.rs @@ -11,19 +11,19 @@ // Contributors: // ZettaScale Zenoh Team, // +use std::{env, fmt, time::Duration}; + use regex::Regex; -use serde::de::Visitor; -use serde::{de, Deserialize, Deserializer}; -use std::env; -use std::fmt; -use std::time::Duration; -use zenoh::prelude::*; +use serde::{de, de::Visitor, Deserialize, Deserializer}; +use zenoh::key_expr::OwnedKeyExpr; pub const DEFAULT_DOMAIN: u32 = 0; pub const DEFAULT_FORWARD_DISCOVERY: bool = false; pub const DEFAULT_RELIABLE_ROUTES_BLOCKING: bool = true; pub const DEFAULT_QUERIES_TIMEOUT: f32 = 5.0; pub const DEFAULT_DDS_LOCALHOST_ONLY: bool = false; +pub const DEFAULT_WORK_THREAD_NUM: usize = 2; +pub const DEFAULT_MAX_BLOCK_THREAD_NUM: usize = 50; #[derive(Deserialize, Debug)] #[serde(deny_unknown_fields)] @@ -32,8 +32,6 @@ pub struct Config { pub scope: Option, #[serde(default = "default_domain")] pub domain: u32, - #[serde(default)] - pub group_member_id: Option, #[serde(default, deserialize_with = "deserialize_regex")] pub allow: Option, #[serde(default, deserialize_with = "deserialize_regex")] @@ -58,6 +56,10 @@ pub struct Config { deserialize_with = "deserialize_duration" )] pub queries_timeout: Duration, + #[serde(default = "default_work_thread_num")] + pub work_thread_num: usize, + #[serde(default = "default_max_block_thread_num")] + pub max_block_thread_num: usize, __required__: Option, #[serde(default, deserialize_with = "deserialize_path")] __path__: Option>, @@ -176,6 +178,14 @@ where Ok(Duration::from_secs_f32(seconds)) } +fn default_work_thread_num() -> usize { + DEFAULT_WORK_THREAD_NUM +} + +fn default_max_block_thread_num() -> usize { + DEFAULT_MAX_BLOCK_THREAD_NUM +} + fn default_forward_discovery() -> bool { DEFAULT_FORWARD_DISCOVERY } diff --git a/zenoh-plugin-dds/src/dds_mgt.rs b/zenoh-plugin-dds/src/dds_mgt.rs index 1680aa3a..32a2244c 100644 --- a/zenoh-plugin-dds/src/dds_mgt.rs +++ b/zenoh-plugin-dds/src/dds_mgt.rs @@ -11,25 +11,32 @@ // Contributors: // ZettaScale Zenoh Team, // -use async_std::task; -use cyclors::qos::{History, HistoryKind, Qos}; -use cyclors::*; +use std::{ + collections::HashMap, + ffi::{CStr, CString}, + fmt, + mem::MaybeUninit, + slice, + sync::Arc, + time::Duration, +}; + +use cyclors::{ + qos::{History, HistoryKind, Qos}, + *, +}; use flume::Sender; use serde::{Deserialize, Serialize, Serializer}; -use std::collections::HashMap; -use std::ffi::{CStr, CString}; -use std::fmt; -use std::mem::MaybeUninit; -use std::slice; -use std::sync::Arc; -use std::time::Duration; use tracing::{debug, error, warn}; +use zenoh::{ + bytes::ZBytes, + key_expr::{KeyExpr, OwnedKeyExpr}, + prelude::*, + qos::CongestionControl, + Session, +}; #[cfg(feature = "dds_shm")] -use zenoh::buffers::{ZBuf, ZSlice}; -use zenoh::prelude::*; -use zenoh::publication::CongestionControl; -use zenoh::Session; -use zenoh_core::SyncResolve; +use zenoh::{internal::buffers::ZBuf, internal::buffers::ZSlice}; const MAX_SAMPLES: usize = 32; @@ -264,7 +271,7 @@ impl fmt::Debug for DDSRawSample { } } -impl From for Value { +impl From for ZBytes { fn from(buf: DDSRawSample) -> Self { #[cfg(feature = "dds_shm")] { @@ -506,7 +513,7 @@ unsafe extern "C" fn data_forwarder_listener(dr: dds_entity_t, arg: *mut std::os .2 .put(&(*pa).1, raw_sample) .congestion_control((*pa).3) - .res_sync(); + .wait(); } ddsi_serdata_unref(zp); } @@ -567,7 +574,7 @@ pub(crate) fn create_forwarding_dds_reader( let qos_native = qos.to_qos_native(); let reader = dds_create_reader(dp, t, qos_native, std::ptr::null()); let z_key = z_key.into_owned(); - task::spawn(async move { + tokio::task::spawn(async move { // loop while reader's instance handle remain the same // (if reader was deleted, its dds_entity_t value might have been // reused by a new entity... don't trust it! Only trust instance handle) @@ -579,7 +586,7 @@ pub(crate) fn create_forwarding_dds_reader( break; } - async_std::task::sleep(period).await; + tokio::time::sleep(period).await; let mut zp: *mut ddsi_serdata = std::ptr::null_mut(); #[allow(clippy::uninit_assumed_init)] let mut si = MaybeUninit::<[dds_sample_info_t; 1]>::uninit(); @@ -603,7 +610,7 @@ pub(crate) fn create_forwarding_dds_reader( let _ = z .put(&z_key, raw_sample) .congestion_control(congestion_ctrl) - .res_sync(); + .wait(); } ddsi_serdata_unref(zp); } diff --git a/zenoh-plugin-dds/src/lib.rs b/zenoh-plugin-dds/src/lib.rs index 03829dd8..a811fb3b 100644 --- a/zenoh-plugin-dds/src/lib.rs +++ b/zenoh-plugin-dds/src/lib.rs @@ -11,41 +11,51 @@ // Contributors: // ZettaScale Zenoh Team, // +use std::{ + borrow::Cow, + collections::HashMap, + env, + future::Future, + mem::ManuallyDrop, + sync::{ + atomic::{AtomicBool, AtomicUsize, Ordering}, + Arc, + }, + time::Duration, +}; + use async_trait::async_trait; -use cyclors::qos::{ - DurabilityService, History, IgnoreLocal, IgnoreLocalKind, Qos, Reliability, ReliabilityKind, - DDS_100MS_DURATION, DDS_1S_DURATION, +use cyclors::{ + qos::{ + DurabilityService, History, IgnoreLocal, IgnoreLocalKind, Qos, Reliability, + ReliabilityKind, DDS_100MS_DURATION, DDS_1S_DURATION, + }, + *, }; -use cyclors::*; use flume::{unbounded, Receiver, Sender}; use futures::select; use route_dds_zenoh::RouteDDSZenoh; -use serde::ser::SerializeStruct; -use serde::{Serialize, Serializer}; +use serde::{ser::SerializeStruct, Serialize, Serializer}; use serde_json::Value; -use std::collections::HashMap; -use std::convert::TryInto; -use std::env; -use std::mem::ManuallyDrop; -use std::sync::atomic::AtomicBool; -use std::sync::Arc; -use std::time::Duration; +use tokio::task::JoinHandle; use tracing::{debug, error, info, trace, warn}; -use zenoh::liveliness::LivelinessToken; -use zenoh::plugins::{RunningPlugin, RunningPluginTrait, ZenohPlugin}; -use zenoh::prelude::r#async::AsyncResolve; -use zenoh::prelude::r#sync::SyncResolve; -use zenoh::prelude::*; -use zenoh::publication::CongestionControl; -use zenoh::query::{ConsolidationMode, QueryTarget}; -use zenoh::queryable::{Query, Queryable}; -use zenoh::runtime::Runtime; -use zenoh::Result as ZResult; -use zenoh::Session; -use zenoh_core::zerror; +use zenoh::{ + bytes::{Encoding, ZBytes}, + internal::{ + plugins::{RunningPlugin, RunningPluginTrait, ZenohPlugin}, + runtime::Runtime, + zerror, Timed, TimedEvent, Timer, + }, + key_expr::{keyexpr, KeyExpr, OwnedKeyExpr}, + liveliness::LivelinessToken, + prelude::*, + qos::CongestionControl, + query::{ConsolidationMode, Query, QueryTarget, Queryable, Selector}, + sample::{Locality, Sample, SampleKind}, + Result as ZResult, Session, +}; use zenoh_ext::{SessionExt, SubscriberBuilderExt}; use zenoh_plugin_trait::{plugin_long_version, plugin_version, Plugin, PluginControl}; -use zenoh_util::{Timed, TimedEvent, Timer}; pub mod config; mod dds_mgt; @@ -56,36 +66,64 @@ mod route_zenoh_dds; use config::Config; use dds_mgt::*; -use crate::qos_helpers::*; -use crate::ros_discovery::{ - NodeEntitiesInfo, ParticipantEntitiesInfo, RosDiscoveryInfoMgr, ROS_DISCOVERY_INFO_TOPIC_NAME, +use crate::{ + qos_helpers::*, + ros_discovery::{ + NodeEntitiesInfo, ParticipantEntitiesInfo, RosDiscoveryInfoMgr, + ROS_DISCOVERY_INFO_TOPIC_NAME, + }, + route_zenoh_dds::RouteZenohDDS, }; -use crate::route_zenoh_dds::RouteZenohDDS; -macro_rules! ke_for_sure { +macro_rules! zenoh_id { ($val:expr) => { - unsafe { keyexpr::from_str_unchecked($val) } + $val.key_expr().as_str().split('/').last().unwrap() }; } -macro_rules! member_id { - ($val:expr) => { - $val.key_expr.as_str().split('/').last().unwrap() - }; +lazy_static::lazy_static! { + static ref WORK_THREAD_NUM: AtomicUsize = AtomicUsize::new(config::DEFAULT_WORK_THREAD_NUM); + static ref MAX_BLOCK_THREAD_NUM: AtomicUsize = AtomicUsize::new(config::DEFAULT_MAX_BLOCK_THREAD_NUM); + // The global runtime is used in the dynamic plugins, which we can't get the current runtime + static ref TOKIO_RUNTIME: tokio::runtime::Runtime = tokio::runtime::Builder::new_multi_thread() + .worker_threads(WORK_THREAD_NUM.load(Ordering::SeqCst)) + .max_blocking_threads(MAX_BLOCK_THREAD_NUM.load(Ordering::SeqCst)) + .enable_all() + .build() + .expect("Unable to create runtime"); +} +#[inline(always)] +pub(crate) fn spawn_runtime(task: F) -> JoinHandle +where + F: Future + Send + 'static, + F::Output: Send + 'static, +{ + // Check whether able to get the current runtime + match tokio::runtime::Handle::try_current() { + Ok(rt) => { + // Able to get the current runtime (standalone binary), spawn on the current runtime + rt.spawn(task) + } + Err(_) => { + // Unable to get the current runtime (dynamic plugins), spawn on the global runtime + TOKIO_RUNTIME.spawn(task) + } + } } lazy_static::lazy_static!( static ref LOG_PAYLOAD: bool = std::env::var("Z_LOG_PAYLOAD").is_ok(); - static ref KE_PREFIX_ADMIN_SPACE: &'static keyexpr = ke_for_sure!("@dds"); - static ref KE_PREFIX_ROUTE_TO_DDS: &'static keyexpr = ke_for_sure!("route/to_dds"); - static ref KE_PREFIX_ROUTE_FROM_DDS: &'static keyexpr = ke_for_sure!("route/from_dds"); - static ref KE_PREFIX_PUB_CACHE: &'static keyexpr = ke_for_sure!("@dds_pub_cache"); - static ref KE_PREFIX_FWD_DISCO: &'static keyexpr = ke_for_sure!("@dds_fwd_disco"); - static ref KE_PREFIX_LIVELINESS_GROUP: &'static keyexpr = ke_for_sure!("zenoh-plugin-dds"); + static ref KE_PREFIX_ADMIN_SPACE: &'static keyexpr = unsafe { keyexpr::from_str_unchecked("@") }; + static ref KE_PREFIX_DDS: &'static keyexpr = unsafe { keyexpr::from_str_unchecked("dds") }; + static ref KE_PREFIX_ROUTE_TO_DDS: &'static keyexpr = unsafe { keyexpr::from_str_unchecked("route/to_dds") }; + static ref KE_PREFIX_ROUTE_FROM_DDS: &'static keyexpr = unsafe { keyexpr::from_str_unchecked("route/from_dds") }; + static ref KE_PREFIX_PUB_CACHE: &'static keyexpr = unsafe { keyexpr::from_str_unchecked("@dds_pub_cache") }; + static ref KE_PREFIX_FWD_DISCO: &'static keyexpr = unsafe { keyexpr::from_str_unchecked("@dds_fwd_disco") }; + static ref KE_PREFIX_LIVELINESS_GROUP: &'static keyexpr = unsafe { keyexpr::from_str_unchecked("zenoh-plugin-dds") }; - static ref KE_ANY_1_SEGMENT: &'static keyexpr = ke_for_sure!("*"); - static ref KE_ANY_N_SEGMENT: &'static keyexpr = ke_for_sure!("**"); + static ref KE_ANY_1_SEGMENT: &'static keyexpr = unsafe { keyexpr::from_str_unchecked("*") }; + static ref KE_ANY_N_SEGMENT: &'static keyexpr = unsafe { keyexpr::from_str_unchecked("**") }; static ref LOG_ROS2_DEPRECATION_WARNING_FLAG: AtomicBool = AtomicBool::new(false); ); @@ -133,7 +171,7 @@ impl Plugin for DDSPlugin { // Try to initiate login. // Required in case of dynamic lib, otherwise no logs. // But cannot be done twice in case of static link. - zenoh_util::try_init_log_from_env(); + zenoh::try_init_log_from_env(); let runtime_conf = runtime.config().lock(); let plugin_conf = runtime_conf @@ -141,7 +179,11 @@ impl Plugin for DDSPlugin { .ok_or_else(|| zerror!("Plugin `{}`: missing config", name))?; let config: Config = serde_json::from_value(plugin_conf.clone()) .map_err(|e| zerror!("Plugin `{}` configuration error: {}", name, e))?; - async_std::task::spawn(run(runtime.clone(), config)); + WORK_THREAD_NUM.store(config.work_thread_num, Ordering::SeqCst); + MAX_BLOCK_THREAD_NUM.store(config.max_block_thread_num, Ordering::SeqCst); + + spawn_runtime(run(runtime.clone(), config)); + Ok(Box::new(DDSPlugin)) } } @@ -151,15 +193,14 @@ pub async fn run(runtime: Runtime, config: Config) { // Try to initiate login. // Required in case of dynamic lib, otherwise no logs. // But cannot be done twice in case of static link. - zenoh_util::try_init_log_from_env(); + zenoh::try_init_log_from_env(); debug!("DDS plugin {}", DDSPlugin::PLUGIN_LONG_VERSION); debug!("DDS plugin {:?}", config); // open zenoh-net Session - let zsession = match zenoh::init(runtime) + let zsession = match zenoh::session::init(runtime) .aggregated_subscribers(config.generalise_subs.clone()) .aggregated_publishers(config.generalise_pubs.clone()) - .res_async() .await { Ok(session) => Arc::new(session), @@ -169,15 +210,9 @@ pub async fn run(runtime: Runtime, config: Config) { } }; - // create group member using the group_member_id if configured, or the Session ID otherwise - let member_id = match config.group_member_id { - Some(ref id) => id.clone(), - None => zsession.zid().into_keyexpr(), - }; let member = match zsession .liveliness() - .declare_token(*KE_PREFIX_LIVELINESS_GROUP / &member_id) - .res_async() + .declare_token(*KE_PREFIX_LIVELINESS_GROUP / &zsession.zid().into_keyexpr()) .await { Ok(member) => member, @@ -227,9 +262,8 @@ pub async fn run(runtime: Runtime, config: Config) { ); let dp = unsafe { dds_create_participant(config.domain, std::ptr::null(), std::ptr::null()) }; debug!( - "DDS plugin {} with member_id={} and using DDS Participant {}", + "DDS plugin {} using DDS Participant {}", zsession.zid(), - member_id, get_guid(&dp).unwrap() ); @@ -237,7 +271,6 @@ pub async fn run(runtime: Runtime, config: Config) { config, zsession: &zsession, _member: member, - member_id, dp, discovered_participants: HashMap::::new(), discovered_writers: HashMap::::new(), @@ -268,7 +301,6 @@ pub(crate) struct DdsPluginRuntime<'a> { // and be able to store the publishers/subscribers it creates in this same struct. zsession: &'a Arc, _member: LivelinessToken<'a>, - member_id: OwnedKeyExpr, dp: dds_entity_t, // maps of all discovered DDS entities (indexed by DDS key) discovered_participants: HashMap, @@ -383,7 +415,7 @@ impl<'a> DdsPluginRuntime<'a> { } fn remove_dds_participant(&mut self, dds_key: &str) -> Option<(OwnedKeyExpr, DdsParticipant)> { - // remove fron participants map + // remove from participants map if let Some(e) = self.discovered_participants.remove(dds_key) { // remove from admin_space let admin_keyexpr = DdsPluginRuntime::get_participant_admin_keyexpr(&e); @@ -667,12 +699,19 @@ impl<'a> DdsPluginRuntime<'a> { // send replies for (ke, v) in kvs.drain(..) { let admin_keyexpr = admin_keyexpr_prefix / &ke; - if let Err(e) = query - .reply(Ok(Sample::new(admin_keyexpr, v))) - .res_async() - .await - { - warn!("Error replying to admin query {:?}: {}", query, e); + match ZBytes::try_from(v) { + Ok(payload) => { + if let Err(e) = query + .reply(admin_keyexpr, payload) + .encoding(Encoding::APPLICATION_JSON) + .await + { + warn!("Error replying to admin query {:?}: {}", query, e); + } + } + Err(e) => { + warn!("Error transforming JSON to admin query {:?}: {}", query, e); + } } } } @@ -684,7 +723,6 @@ impl<'a> DdsPluginRuntime<'a> { .declare_subscriber(*KE_PREFIX_LIVELINESS_GROUP / *KE_ANY_N_SEGMENT) .querying() .with(flume::unbounded()) - .res_async() .await .expect("Failed to create Liveliness Subscriber"); @@ -693,13 +731,13 @@ impl<'a> DdsPluginRuntime<'a> { run_discovery(self.dp, tx); // declare admin space queryable - let admin_keyexpr_prefix = *KE_PREFIX_ADMIN_SPACE / &self.zsession.zid().into_keyexpr(); + let admin_keyexpr_prefix = + *KE_PREFIX_ADMIN_SPACE / &self.zsession.zid().into_keyexpr() / *KE_PREFIX_DDS; let admin_keyexpr_expr = (&admin_keyexpr_prefix) / *KE_ANY_N_SEGMENT; debug!("Declare admin space on {}", admin_keyexpr_expr); let admin_queryable = self .zsession .declare_queryable(admin_keyexpr_expr) - .res_async() .await .expect("Failed to create AdminSpace queryable"); @@ -804,7 +842,7 @@ impl<'a> DdsPluginRuntime<'a> { } => { if let Some((_, e)) = self.remove_dds_writer(&key) { debug!("Undiscovered DDS Writer {} on topic {}", key, e.topic_name); - // remove it from all the active routes refering it (deleting the route if no longer used) + // remove it from all the active routes referring it (deleting the route if no longer used) let admin_space = &mut self.admin_space; self.routes_from_dds.retain(|zkey, route| { route.remove_local_routed_writer(&key); @@ -866,7 +904,7 @@ impl<'a> DdsPluginRuntime<'a> { } => { if let Some((_, e)) = self.remove_dds_reader(&key) { debug!("Undiscovered DDS Reader {} on topic {}", key, e.topic_name); - // remove it from all the active routes refering it (deleting the route if no longer used) + // remove it from all the active routes referring it (deleting the route if no longer used) let admin_space = &mut self.admin_space; self.routes_to_dds.retain(|zkey, route| { route.remove_local_routed_reader(&key); @@ -907,17 +945,17 @@ impl<'a> DdsPluginRuntime<'a> { }, group_event = group_subscriber.recv_async() => { - match group_event.as_ref().map(|s|s.kind) { + match group_event.as_ref().map(|s|s.kind()) { Ok(SampleKind::Put) => { - let mid = member_id!(group_event.as_ref().unwrap()); - debug!("New zenoh_dds_plugin detected: {}", mid); - if let Ok(member_id) = keyexpr::new(mid) { + let zid = zenoh_id!(group_event.as_ref().unwrap()); + debug!("New zenoh_dds_plugin detected: {}", zid); + if let Ok(zenoh_id) = keyexpr::new(zid) { // make all QueryingSubscriber to query this new member for (zkey, route) in &mut self.routes_to_dds { - route.query_historical_publications(|| (*KE_PREFIX_PUB_CACHE / member_id / zkey).into(), self.config.queries_timeout).await; + route.query_historical_publications(|| (*KE_PREFIX_ADMIN_SPACE / zenoh_id / *KE_PREFIX_PUB_CACHE / zkey).into(), self.config.queries_timeout).await; } } else { - error!("Can't convert member id '{}' into a KeyExpr", mid); + error!("Can't convert zenoh id '{}' into a KeyExpr", zid); } } Ok(_) => {} // ignore other GroupEvents @@ -945,45 +983,49 @@ impl<'a> DdsPluginRuntime<'a> { ) { debug!(r#"Run in "forward discovery" mode"#); - // The data space where all discovery info are fowarded: - // - writers discovery on //[]/writer/ - // - readers discovery on //[]/reader/ - // - ros_discovery_info on //[]/ros_disco/ - // The PublicationCache is declared on //[]/** - // The QuerySubscriber is declared on /*/[]/** + // The data space where all discovery info are forwarded: + // - writers discovery on ///[]/writer/ + // - readers discovery on ///[]/reader/ + // - ros_discovery_info on ///[]/ros_disco/ + // The PublicationCache is declared on ///[]/** + // The QuerySubscriber is declared on /*//[]/** let uuid: OwnedKeyExpr = self.zsession.zid().into(); let fwd_key_prefix = if let Some(scope) = &self.config.scope { - *KE_PREFIX_FWD_DISCO / &uuid / scope + *KE_PREFIX_ADMIN_SPACE / &uuid / *KE_PREFIX_FWD_DISCO / scope } else { - *KE_PREFIX_FWD_DISCO / &uuid + *KE_PREFIX_ADMIN_SPACE / &uuid / *KE_PREFIX_FWD_DISCO }; - let fwd_writers_key_prefix = &fwd_key_prefix / ke_for_sure!("writer"); - let fwd_readers_key_prefix = &fwd_key_prefix / ke_for_sure!("reader"); - let fwd_ros_discovery_key = &fwd_key_prefix / ke_for_sure!("ros_disco"); + let fwd_writers_key_prefix = + &fwd_key_prefix / unsafe { keyexpr::from_str_unchecked("writer") }; + let fwd_readers_key_prefix = + &fwd_key_prefix / unsafe { keyexpr::from_str_unchecked("reader") }; + let fwd_ros_discovery_key = + &fwd_key_prefix / unsafe { keyexpr::from_str_unchecked("ros_disco") }; let fwd_declare_publication_cache_key = &fwd_key_prefix / *KE_ANY_N_SEGMENT; let fwd_discovery_subscription_key = if let Some(scope) = &self.config.scope { - *KE_PREFIX_FWD_DISCO / *KE_ANY_1_SEGMENT / scope / *KE_ANY_N_SEGMENT + *KE_PREFIX_ADMIN_SPACE + / *KE_ANY_1_SEGMENT + / *KE_PREFIX_FWD_DISCO + / scope + / *KE_ANY_N_SEGMENT } else { - *KE_PREFIX_FWD_DISCO / *KE_ANY_1_SEGMENT / *KE_ANY_N_SEGMENT + *KE_PREFIX_ADMIN_SPACE / *KE_ANY_1_SEGMENT / *KE_PREFIX_FWD_DISCO / *KE_ANY_N_SEGMENT }; // Register prefixes for optimization let fwd_writers_key_prefix_key = self .zsession .declare_keyexpr(fwd_writers_key_prefix) - .res_async() .await .expect("Failed to declare key expression for Fwd Discovery of writers"); let fwd_readers_key_prefix_key = self .zsession .declare_keyexpr(fwd_readers_key_prefix) - .res_async() .await .expect("Failed to declare key expression for Fwd Discovery of readers"); let fwd_ros_discovery_key_declared = self .zsession .declare_keyexpr(&fwd_ros_discovery_key) - .res_async() .await .expect("Failed to declare key expression for Fwd Discovery of ros_discovery"); @@ -992,7 +1034,6 @@ impl<'a> DdsPluginRuntime<'a> { .zsession .declare_publication_cache(fwd_declare_publication_cache_key) .queryable_allowed_origin(Locality::Remote) // Note: don't reply to queries from local QueryingSubscribers - .res_async() .await .expect("Failed to declare PublicationCache for Fwd Discovery"); @@ -1003,7 +1044,6 @@ impl<'a> DdsPluginRuntime<'a> { .querying() .allowed_origin(Locality::Remote) // Note: ignore my own publications .query_timeout(self.config.queries_timeout) - .res_async() .await .expect("Failed to declare QueryingSubscriber for Fwd Discovery"); @@ -1040,7 +1080,7 @@ impl<'a> DdsPluginRuntime<'a> { Ok(s) => s, Err(e) => { error!("INTERNAL ERROR: failed to serialize discovery message for {:?}: {}", entity, e); continue; } }; - if let Err(e) = self.zsession.put(&fwd_ke, ser_msg).congestion_control(CongestionControl::Block).res_async().await { + if let Err(e) = self.zsession.put(&fwd_ke, ser_msg).congestion_control(CongestionControl::Block).await { error!("INTERNAL ERROR: failed to publish discovery message on {}: {}", fwd_ke, e); } @@ -1055,7 +1095,7 @@ impl<'a> DdsPluginRuntime<'a> { if let Some((admin_keyexpr, _)) = self.remove_dds_writer(&key) { let fwd_ke = &fwd_writers_key_prefix_key / &admin_keyexpr; // publish its deletion from admin space - if let Err(e) = self.zsession.delete(&fwd_ke).congestion_control(CongestionControl::Block).res_async().await { + if let Err(e) = self.zsession.delete(&fwd_ke).congestion_control(CongestionControl::Block).await { error!("INTERNAL ERROR: failed to publish undiscovery message on {:?}: {}", fwd_ke, e); } } @@ -1100,7 +1140,7 @@ impl<'a> DdsPluginRuntime<'a> { Ok(s) => s, Err(e) => { error!("INTERNAL ERROR: failed to serialize discovery message for {:?}: {}", entity, e); continue; } }; - if let Err(e) = self.zsession.put(&fwd_ke, ser_msg).congestion_control(CongestionControl::Block).res_async().await { + if let Err(e) = self.zsession.put(&fwd_ke, ser_msg).congestion_control(CongestionControl::Block).await { error!("INTERNAL ERROR: failed to publish discovery message on {}: {}", fwd_ke, e); } @@ -1115,11 +1155,11 @@ impl<'a> DdsPluginRuntime<'a> { if let Some((admin_keyexpr, _)) = self.remove_dds_reader(&key) { let fwd_ke = &fwd_readers_key_prefix_key / &admin_keyexpr; // publish its deletion from admin space - if let Err(e) = self.zsession.delete(&fwd_ke).congestion_control(CongestionControl::Block).res_async().await { + if let Err(e) = self.zsession.delete(&fwd_ke).congestion_control(CongestionControl::Block).await { error!("INTERNAL ERROR: failed to publish undiscovery message on {:?}: {}", fwd_ke, e); } } - // #102: also remove the Reader from all the active routes refering it, + // #102: also remove the Reader from all the active routes referring it, // deleting the route if it has no longer local Reader nor remote Writer. let admin_space = &mut self.admin_space; self.routes_to_dds.retain(|zkey, route| { @@ -1161,7 +1201,7 @@ impl<'a> DdsPluginRuntime<'a> { sample = fwd_disco_sub.recv_async() => { let sample = sample.expect("Fwd Discovery subscriber was closed!"); - let fwd_ke = &sample.key_expr; + let fwd_ke = &sample.key_expr(); debug!("Received forwarded discovery message on {}", fwd_ke); // parse fwd_ke and extract the remote uuid, the discovery kind (reader|writer|ros_disco) and the remaining of the keyexpr @@ -1170,10 +1210,10 @@ impl<'a> DdsPluginRuntime<'a> { // it's a writer discovery message "writer" => { // reconstruct full admin keyexpr for this entity (i.e. with it's remote plugin's uuid) - let full_admin_keyexpr = *KE_PREFIX_ADMIN_SPACE / remote_uuid / remaining_ke; - if sample.kind != SampleKind::Delete { + let full_admin_keyexpr = *KE_PREFIX_ADMIN_SPACE / remote_uuid / *KE_PREFIX_DDS / remaining_ke; + if sample.kind() != SampleKind::Delete { // deserialize payload - let (entity, scope) = match bincode::deserialize::<(DdsEntity, Option)>(&sample.payload.contiguous()) { + let (entity, scope) = match bincode::deserialize::<(DdsEntity, Option)>(&sample.payload().into::>()) { Ok(x) => x, Err(e) => { warn!("Failed to deserialize discovery msg for {}: {}", full_admin_keyexpr, e); @@ -1219,7 +1259,7 @@ impl<'a> DdsPluginRuntime<'a> { } } } else { - // writer was deleted; remove it from all the active routes refering it (deleting the route if no longer used) + // writer was deleted; remove it from all the active routes referring it (deleting the route if no longer used) let admin_space = &mut self.admin_space; self.routes_to_dds.retain(|zkey, route| { route.remove_remote_routed_writer(&full_admin_keyexpr); @@ -1250,10 +1290,10 @@ impl<'a> DdsPluginRuntime<'a> { // it's a reader discovery message "reader" => { // reconstruct full admin keyexpr for this entity (i.e. with it's remote plugin's uuid) - let full_admin_keyexpr = *KE_PREFIX_ADMIN_SPACE / remote_uuid / remaining_ke; - if sample.kind != SampleKind::Delete { + let full_admin_keyexpr = *KE_PREFIX_ADMIN_SPACE / remote_uuid / *KE_PREFIX_DDS / remaining_ke; + if sample.kind() != SampleKind::Delete { // deserialize payload - let (entity, scope) = match bincode::deserialize::<(DdsEntity, Option)>(&sample.payload.contiguous()) { + let (entity, scope) = match bincode::deserialize::<(DdsEntity, Option)>(&sample.payload().into::>()) { Ok(x) => x, Err(e) => { warn!("Failed to deserialize discovery msg for {}: {}", full_admin_keyexpr, e); @@ -1305,7 +1345,7 @@ impl<'a> DdsPluginRuntime<'a> { } } } else { - // reader was deleted; remove it from all the active routes refering it (deleting the route if no longer used) + // reader was deleted; remove it from all the active routes referring it (deleting the route if no longer used) let admin_space = &mut self.admin_space; self.routes_from_dds.retain(|zkey, route| { route.remove_remote_routed_reader(&full_admin_keyexpr); @@ -1328,7 +1368,7 @@ impl<'a> DdsPluginRuntime<'a> { // it's a ros_discovery_info message "ros_disco" => { match cdr::deserialize_from::<_, ParticipantEntitiesInfo, _>( - &*sample.payload.contiguous(), + sample.payload().reader(), cdr::size::Infinite, ) { Ok(mut info) => { @@ -1349,48 +1389,52 @@ impl<'a> DdsPluginRuntime<'a> { } x => { - error!("Unexpected forwarded discovery message received on invalid key {} (unkown kind: {}) ", fwd_ke, x); + error!("Unexpected forwarded discovery message received on invalid key {} (unknown kind: {}) ", fwd_ke, x); } } } }, group_event = group_subscriber.recv_async() => { - match group_event.as_ref().map(|s|s.kind) { + match group_event.as_ref().map(|s|s.kind()) { Ok(SampleKind::Put) => { - let mid = member_id!(group_event.as_ref().unwrap()); - debug!("New zenoh_dds_plugin detected: {}", mid); - // query for past publications of discocvery messages from this new member - let key = if let Some(scope) = &self.config.scope { - *KE_PREFIX_FWD_DISCO / ke_for_sure!(mid) / scope / *KE_ANY_N_SEGMENT + let zid = zenoh_id!(group_event.as_ref().unwrap()); + debug!("New zenoh_dds_plugin detected: {}", zid); + + if let Ok(zenoh_id) = keyexpr::new(zid) { + // query for past publications of discocvery messages from this new member + let key = if let Some(scope) = &self.config.scope { + *KE_PREFIX_ADMIN_SPACE / zenoh_id / *KE_PREFIX_FWD_DISCO / scope / *KE_ANY_N_SEGMENT + } else { + *KE_PREFIX_ADMIN_SPACE / zenoh_id / *KE_PREFIX_FWD_DISCO / *KE_ANY_N_SEGMENT + }; + debug!("Query past discovery messages from {} on {}", zid, key); + if let Err(e) = fwd_disco_sub.fetch( |cb| { + self.zsession.get(Selector::from(&key)) + .callback(cb) + .target(QueryTarget::All) + .consolidation(ConsolidationMode::None) + .timeout(self.config.queries_timeout) + .wait() + }).await + { + warn!("Query on {} for discovery messages failed: {}", key, e); + } + // make all QueryingSubscriber to query this new member + for (zkey, route) in &mut self.routes_to_dds { + route.query_historical_publications(|| (*KE_PREFIX_ADMIN_SPACE / zenoh_id / *KE_PREFIX_PUB_CACHE / zkey).into(), self.config.queries_timeout).await; + } } else { - *KE_PREFIX_FWD_DISCO / ke_for_sure!(mid) / *KE_ANY_N_SEGMENT - }; - debug!("Query past discovery messages from {} on {}", mid, key); - if let Err(e) = fwd_disco_sub.fetch( |cb| { - use zenoh_core::SyncResolve; - self.zsession.get(Selector::from(&key)) - .callback(cb) - .target(QueryTarget::All) - .consolidation(ConsolidationMode::None) - .timeout(self.config.queries_timeout) - .res_sync() - }).res_async().await - { - warn!("Query on {} for discovery messages failed: {}", key, e); - } - // make all QueryingSubscriber to query this new member - for (zkey, route) in &mut self.routes_to_dds { - route.query_historical_publications(|| (*KE_PREFIX_PUB_CACHE / ke_for_sure!(mid) / zkey).into(), self.config.queries_timeout).await; + error!("Can't convert zenoh id '{}' into a KeyExpr", zid); } } Ok(SampleKind::Delete) => { - let mid = member_id!(group_event.as_ref().unwrap()); - debug!("Remote zenoh_dds_plugin left: {}", mid); - // remove all the references to the plugin's enities, removing no longer used routes + let zid = zenoh_id!(group_event.as_ref().unwrap()); + debug!("Remote zenoh_dds_plugin left: {}", zid); + // remove all the references to the plugin's entities, removing no longer used routes // and updating/re-publishing ParticipantEntitiesInfo let admin_space = &mut self.admin_space; - let admin_subke = format!("@dds/{mid}/"); + let admin_subke = format!("@/{zid}/dds/"); let mut participant_info_changed = false; self.routes_to_dds.retain(|zkey, route| { route.remove_remote_routed_writers_containing(&admin_subke); @@ -1433,7 +1477,7 @@ impl<'a> DdsPluginRuntime<'a> { } }); if participant_info_changed { - debug!("Publishing up-to-date ros_discovery_info after leaving of plugin {}", mid); + debug!("Publishing up-to-date ros_discovery_info after leaving of plugin {}", zid); participant_info.cleanup(); if let Err(e) = ros_disco_mgr.write(&participant_info) { error!("Error forwarding ros_discovery_info: {}", e); @@ -1457,8 +1501,8 @@ impl<'a> DdsPluginRuntime<'a> { for (gid, buf) in infos { trace!("Received ros_discovery_info from DDS for {}, forward via zenoh: {}", gid, buf.hex_encode()); // forward the payload on zenoh - let ke = &fwd_ros_discovery_key_declared / ke_for_sure!(&gid); - if let Err(e) = self.zsession.put(ke, buf).res_sync() { + let ke = &fwd_ros_discovery_key_declared / unsafe { keyexpr::from_str_unchecked(&gid) }; + if let Err(e) = self.zsession.put(ke, buf).wait() { error!("Forward ROS discovery info failed: {}", e); } } @@ -1468,15 +1512,15 @@ impl<'a> DdsPluginRuntime<'a> { } fn parse_fwd_discovery_keyexpr(fwd_ke: &keyexpr) -> Option<(&keyexpr, &str, &keyexpr)> { - // parse fwd_ke which have format: "KE_PREFIX_FWD_DISCO/[/scope/possibly/multiple]//" - if !fwd_ke.starts_with(KE_PREFIX_FWD_DISCO.as_str()) { + // parse fwd_ke which have format: "KE_PREFIX_ADMIN_SPACE//KE_PREFIX_FWD_DISCO[/scope/possibly/multiple]//" + if !fwd_ke.starts_with(KE_PREFIX_ADMIN_SPACE.as_str()) { // publication on a key expression matching the fwd_ke: ignore it return None; } - let mut remaining = &fwd_ke[KE_PREFIX_FWD_DISCO.len() + 1..]; + let mut remaining = &fwd_ke[KE_PREFIX_ADMIN_SPACE.len() + 1..]; let uuid = if let Some(i) = remaining.find('/') { - let uuid = ke_for_sure!(&remaining[..i]); - remaining = &remaining[i..]; + let uuid = unsafe { keyexpr::from_str_unchecked(&remaining[..i]) }; + remaining = &remaining[i + 1..]; uuid } else { error!( @@ -1485,6 +1529,10 @@ impl<'a> DdsPluginRuntime<'a> { ); return None; }; + if !remaining.starts_with(KE_PREFIX_FWD_DISCO.as_str()) { + // publication on a key expression matching the fwd_ke: ignore it + return None; + } let kind = if let Some(i) = remaining.find("/reader/") { remaining = &remaining[i + 8..]; "reader" @@ -1498,7 +1546,9 @@ impl<'a> DdsPluginRuntime<'a> { error!("Unexpected forwarded discovery message received on invalid key: {} (no expected kind '/reader/', '/writer/' or '/ros_disco/')", fwd_ke); return None; }; - Some((uuid, kind, ke_for_sure!(remaining))) + Some((uuid, kind, unsafe { + keyexpr::from_str_unchecked(remaining) + })) } fn remap_entities_info(&self, entities_info: &mut HashMap) { diff --git a/zenoh-plugin-dds/src/ros_discovery.rs b/zenoh-plugin-dds/src/ros_discovery.rs index 4993601e..51c36bcf 100644 --- a/zenoh-plugin-dds/src/ros_discovery.rs +++ b/zenoh-plugin-dds/src/ros_discovery.rs @@ -11,22 +11,23 @@ // Contributors: // ZettaScale Zenoh Team, // -use crate::dds_mgt::{delete_dds_entity, DDSRawSample}; -use cdr::{CdrLe, Infinite}; -use cyclors::qos::{ - Durability, History, IgnoreLocal, IgnoreLocalKind, Qos, Reliability, DDS_INFINITE_TIME, -}; -use cyclors::*; -use serde::ser::SerializeSeq; -use serde::{Deserialize, Deserializer, Serialize, Serializer}; -use std::convert::TryInto; use std::{ collections::HashMap, + convert::TryInto, ffi::{CStr, CString}, mem::MaybeUninit, }; + +use cdr::{CdrLe, Infinite}; +use cyclors::{ + qos::{Durability, History, IgnoreLocal, IgnoreLocalKind, Qos, Reliability, DDS_INFINITE_TIME}, + *, +}; +use serde::{ser::SerializeSeq, Deserialize, Deserializer, Serialize, Serializer}; use tracing::warn; +use crate::dds_mgt::{delete_dds_entity, DDSRawSample}; + pub(crate) const ROS_DISCOVERY_INFO_TOPIC_NAME: &str = "ros_discovery_info"; const ROS_DISCOVERY_INFO_TOPIC_TYPE: &str = "rmw_dds_common::msg::dds_::ParticipantEntitiesInfo_"; diff --git a/zenoh-plugin-dds/src/route_dds_zenoh.rs b/zenoh-plugin-dds/src/route_dds_zenoh.rs index b547af0d..1f63f9e7 100644 --- a/zenoh-plugin-dds/src/route_dds_zenoh.rs +++ b/zenoh-plugin-dds/src/route_dds_zenoh.rs @@ -12,12 +12,20 @@ // ZettaScale Zenoh Team, // -use cyclors::qos::{HistoryKind, Qos}; -use cyclors::{dds_entity_t, DDS_LENGTH_UNLIMITED}; -use serde::Serialize; use std::{collections::HashSet, fmt}; -use zenoh::prelude::r#async::AsyncResolve; -use zenoh::prelude::*; + +use cyclors::{ + dds_entity_t, + qos::{HistoryKind, Qos}, + DDS_LENGTH_UNLIMITED, +}; +use serde::Serialize; +use zenoh::{ + key_expr::{keyexpr, KeyExpr, OwnedKeyExpr}, + prelude::*, + qos::CongestionControl, + sample::Locality, +}; use zenoh_ext::{PublicationCache, SessionExt}; use crate::{dds_mgt::*, qos_helpers::*, DdsPluginRuntime, KE_PREFIX_PUB_CACHE}; @@ -100,7 +108,6 @@ impl RouteDDSZenoh<'_> { let declared_ke = plugin .zsession .declare_keyexpr(ke.clone()) - .res() .await .map_err(|e| { format!("Route Zenoh->DDS ({topic_name} -> {ke}): failed to declare KeyExpr: {e}") @@ -142,21 +149,15 @@ impl RouteDDSZenoh<'_> { .zsession .declare_publication_cache(&declared_ke) .history(history) - .queryable_prefix(*KE_PREFIX_PUB_CACHE / &plugin.member_id) + .queryable_prefix(*KE_PREFIX_PUB_CACHE / &plugin.zsession.zid().into_keyexpr()) .queryable_allowed_origin(Locality::Remote) // Note: don't reply to queries from local QueryingSubscribers - .res() .await .map_err(|e| { format!("Failed create PublicationCache for key {ke} (rid={declared_ke}): {e}") })?; ZPublisher::PublicationCache(pub_cache) } else { - if let Err(e) = plugin - .zsession - .declare_publisher(declared_ke.clone()) - .res() - .await - { + if let Err(e) = plugin.zsession.declare_publisher(declared_ke.clone()).await { tracing::warn!( "Failed to declare publisher for key {} (rid={}): {}", ke, diff --git a/zenoh-plugin-dds/src/route_zenoh_dds.rs b/zenoh-plugin-dds/src/route_zenoh_dds.rs index 83272f34..f48b82c3 100644 --- a/zenoh-plugin-dds/src/route_zenoh_dds.rs +++ b/zenoh-plugin-dds/src/route_zenoh_dds.rs @@ -12,23 +12,35 @@ // ZettaScale Zenoh Team, // +use std::{ + collections::HashSet, + ffi::CStr, + fmt, + sync::{ + atomic::{AtomicI32, Ordering}, + Arc, + }, + time::Duration, +}; + use cyclors::{ dds_entity_t, dds_get_entity_sertype, dds_strretcode, dds_writecdr, ddsi_serdata_from_ser_iov, ddsi_serdata_kind_SDK_DATA, ddsi_sertype, ddsrt_iovec_t, }; use serde::{Serialize, Serializer}; -use std::collections::HashSet; -use std::sync::atomic::Ordering; -use std::sync::Arc; -use std::{ffi::CStr, fmt, sync::atomic::AtomicI32, time::Duration}; -use zenoh::prelude::*; -use zenoh::query::ReplyKeyExpr; -use zenoh::{prelude::r#async::AsyncResolve, subscriber::Subscriber}; +use zenoh::{ + key_expr::{keyexpr, KeyExpr, OwnedKeyExpr}, + prelude::*, + pubsub::Subscriber, + query::{ConsolidationMode, QueryTarget, ReplyKeyExpr, Selector}, + sample::{Locality, Sample}, + Session, +}; use zenoh_ext::{FetchingSubscriber, SubscriberBuilderExt}; -use crate::DdsPluginRuntime; use crate::{ - dds_mgt::*, qos::Qos, vec_into_raw_parts, KE_ANY_1_SEGMENT, KE_PREFIX_PUB_CACHE, LOG_PAYLOAD, + dds_mgt::*, qos::Qos, vec_into_raw_parts, DdsPluginRuntime, KE_ANY_1_SEGMENT, + KE_PREFIX_PUB_CACHE, LOG_PAYLOAD, }; type AtomicDDSEntity = AtomicI32; @@ -135,15 +147,15 @@ impl RouteZenohDDS<'_> { // before the discovery message provoking the creation of the Data Writer tracing::debug!( "Route Zenoh->DDS ({} -> {}): data arrived but no DDS Writer yet to route it... wait 3s for discovery forwarding msg", - s.key_expr, + s.key_expr(), &ton ); let arc_dw2 = arc_dw.clone(); let ton2 = ton.clone(); - let ke = s.key_expr.clone(); - async_std::task::spawn(async move { + let ke = s.key_expr().clone(); + tokio::task::spawn(async move { for _ in 1..30 { - async_std::task::sleep(Duration::from_millis(100)).await; + tokio::time::sleep(Duration::from_millis(100)).await; let dw = arc_dw2.load(Ordering::Relaxed); if dw != DDS_ENTITY_NULL { do_route_data(s, &ton2, dw); @@ -181,7 +193,6 @@ impl RouteZenohDDS<'_> { .query_timeout(plugin.config.queries_timeout) .query_selector(query_selector) .query_accept_replies(ReplyKeyExpr::Any) - .res() .await .map_err(|e| { format!( @@ -196,7 +207,6 @@ impl RouteZenohDDS<'_> { .callback(subscriber_callback) .allowed_origin(Locality::Remote) // Allow only remote publications to avoid loops .reliable() - .res() .await .map_err(|e| { format!( @@ -290,7 +300,6 @@ impl RouteZenohDDS<'_> { let session = &self.zenoh_session; let s = s.clone(); move |cb| { - use zenoh_core::SyncResolve; session .get(&s) .target(QueryTarget::All) @@ -298,10 +307,9 @@ impl RouteZenohDDS<'_> { .accept_replies(ReplyKeyExpr::Any) .timeout(query_timeout) .callback(cb) - .res_sync() + .wait() } }) - .res() .await { tracing::warn!( @@ -358,20 +366,20 @@ fn do_route_data(s: Sample, topic_name: &str, data_writer: dds_entity_t) { if *LOG_PAYLOAD { tracing::trace!( "Route Zenoh->DDS ({} -> {}): routing data - payload: {:?}", - s.key_expr, + s.key_expr(), &topic_name, - s.value.payload + s.payload() ); } else { tracing::trace!( "Route Zenoh->DDS ({} -> {}): routing data", - s.key_expr, + s.key_expr(), &topic_name ); } unsafe { - let bs = s.value.payload.contiguous().into_owned(); + let bs = s.payload().into(); // As per the Vec documentation (see https://doc.rust-lang.org/std/vec/struct.Vec.html#method.into_raw_parts) // the only way to correctly releasing it is to create a vec using from_raw_parts // and then have its destructor do the cleanup. @@ -401,7 +409,7 @@ fn do_route_data(s: Sample, topic_name: &str, data_writer: dds_entity_t) { if ret < 0 { tracing::warn!( "Route Zenoh->DDS ({} -> {}): can't route data; sertype lookup failed ({})", - s.key_expr, + s.key_expr(), topic_name, CStr::from_ptr(dds_strretcode(ret)) .to_str()