diff --git a/.gitignore b/.gitignore index 061c588e..4330fe8b 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,13 @@ # MacOS Related .DS_Store + +.gradle +build/ +examples/build +gradle.properties +gradle/ +gradlew +gradlew.bat +local.properties +zenoh-kotlin/build diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 743f7cd9..624eb0ea 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.72.0" +channel = "1.76.0" diff --git a/zenoh-jni/Cargo.lock b/zenoh-jni/Cargo.lock index cbcfb9af..28f0a4fe 100644 --- a/zenoh-jni/Cargo.lock +++ b/zenoh-jni/Cargo.lock @@ -19,9 +19,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[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", "cipher", @@ -30,20 +30,21 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "42cd52102d3df161c77a887b608d7a4897d7cc112886a9537b738a887a03aaff" dependencies = [ "cfg-if", "once_cell", "version_check", + "zerocopy", ] [[package]] name = "aho-corasick" -version = "1.0.5" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c378d78423fdad8089616f827526ee33c19f2fddbd5de1629152c9593ba4783" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] @@ -74,9 +75,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.4" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" +checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" dependencies = [ "anstyle", "anstyle-parse", @@ -88,26 +89,26 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.3" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b84bf0a05bbb2a83e5eb6fa36bb6e87baa08193c35ff52bbf6b38d8af2890e46" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" [[package]] name = "anstyle-parse" -version = "0.2.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -122,9 +123,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.75" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" [[package]] name = "array-init" @@ -153,32 +154,45 @@ dependencies = [ "futures-core", ] +[[package]] +name = "async-channel" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28243a43d821d11341ab73c80bed182dc015c514b951616cf79bd4af39af0c3" +dependencies = [ + "concurrent-queue", + "event-listener 5.0.0", + "event-listener-strategy 0.5.0", + "futures-core", + "pin-project-lite", +] + [[package]] name = "async-executor" -version = "1.5.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fa3dc5f2a8564f07759c008b9109dc0d39de92a88d5588b8a5036d286383afb" +checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c" dependencies = [ - "async-lock", + "async-lock 3.3.0", "async-task", "concurrent-queue", - "fastrand", - "futures-lite", + "fastrand 2.0.1", + "futures-lite 2.2.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.2.0", "async-executor", - "async-io", - "async-lock", + "async-io 2.3.1", + "async-lock 3.3.0", "blocking", - "futures-lite", + "futures-lite 2.2.0", "once_cell", "tokio", ] @@ -189,20 +203,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", "concurrent-queue", - "futures-lite", + "futures-lite 1.13.0", "log", "parking", - "polling", - "rustix 0.37.25", + "polling 2.8.0", + "rustix 0.37.27", "slab", - "socket2 0.4.9", + "socket2 0.4.10", "waker-fn", ] +[[package]] +name = "async-io" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f97ab0c5b00a7cdbe5a371b9a782ee7be1316095885c8a4ea1daf490eb0ef65" +dependencies = [ + "async-lock 3.3.0", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite 2.2.0", + "parking", + "polling 3.4.0", + "rustix 0.38.31", + "slab", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "async-lock" version = "2.8.0" @@ -212,34 +245,62 @@ dependencies = [ "event-listener 2.5.3", ] +[[package]] +name = "async-lock" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" +dependencies = [ + "event-listener 4.0.3", + "event-listener-strategy 0.4.0", + "pin-project-lite", +] + [[package]] name = "async-process" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a9d28b1d97e08915212e2e45310d47854eafa69600756fc735fb788f75199c9" +checksum = "ea6438ba0a08d81529c69b36700fa2f95837bfe3e776ab39cde9c14d9149da88" dependencies = [ - "async-io", - "async-lock", - "autocfg", + "async-io 1.13.0", + "async-lock 2.8.0", + "async-signal", "blocking", "cfg-if", - "event-listener 2.5.3", - "futures-lite", - "rustix 0.37.25", - "signal-hook", + "event-listener 3.1.0", + "futures-lite 1.13.0", + "rustix 0.38.31", "windows-sys 0.48.0", ] [[package]] name = "async-rustls" -version = "0.4.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29479d362e242e320fa8f5c831940a5b83c1679af014068196cd20d4bf497b6b" +checksum = "ecfa55659849ace733f86ccd219da40abd8bc14124e40b312433e85a5a266e77" dependencies = [ "futures-io", "rustls", ] +[[package]] +name = "async-signal" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5" +dependencies = [ + "async-io 2.3.1", + "async-lock 2.8.0", + "atomic-waker", + "cfg-if", + "futures-core", + "futures-io", + "rustix 0.38.31", + "signal-hook-registry", + "slab", + "windows-sys 0.48.0", +] + [[package]] name = "async-std" version = "1.12.0" @@ -247,16 +308,16 @@ 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", @@ -270,26 +331,26 @@ dependencies = [ [[package]] name = "async-task" -version = "4.4.0" +version = "4.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" +checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799" [[package]] name = "async-trait" -version = "0.1.73" +version = "0.1.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" +checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.49", ] [[package]] name = "atomic-waker" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "atty" @@ -325,9 +386,9 @@ dependencies = [ [[package]] name = "base64" -version = "0.21.4" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64ct" @@ -352,9 +413,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.0" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" [[package]] name = "block-buffer" @@ -367,30 +428,31 @@ dependencies = [ [[package]] name = "blocking" -version = "1.3.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77231a1c8f801696fc0123ec6150ce92cffb8e164a02afb9c8ddee0e9b65ad65" +checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" dependencies = [ - "async-channel", - "async-lock", + "async-channel 2.2.0", + "async-lock 3.3.0", "async-task", - "atomic-waker", - "fastrand", - "futures-lite", - "log", + "fastrand 2.0.1", + "futures-io", + "futures-lite 2.2.0", + "piper", + "tracing", ] [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "d32a994c2b3ca201d9b263612a374263f05e7adde37c4707f693dcd375076d1f" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" @@ -445,16 +507,16 @@ dependencies = [ "bitflags 1.3.2", "clap_lex 0.2.4", "indexmap 1.9.3", - "strsim", + "strsim 0.10.0", "termcolor", "textwrap", ] [[package]] name = "clap" -version = "4.4.11" +version = "4.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfaff671f6b22ca62406885ece523383b9b64022e341e53e009a62ebc47a45f2" +checksum = "c918d541ef2913577a0f9566e9ce27cb35b6df072075769e0b26cb5a554520da" dependencies = [ "clap_builder", "clap_derive", @@ -462,26 +524,26 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.11" +version = "4.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a216b506622bb1d316cd51328dce24e07bdff4a6128a47c7e7fad11878d5adbb" +checksum = "9f3e7391dad68afb0c2ede1bf619f579a3dc9c2ec67f089baa397123a2f3d1eb" dependencies = [ "anstream", "anstyle", - "clap_lex 0.6.0", - "strsim", + "clap_lex 0.7.0", + "strsim 0.11.0", ] [[package]] name = "clap_derive" -version = "4.4.7" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" +checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.49", ] [[package]] @@ -495,9 +557,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "colorchoice" @@ -517,33 +579,33 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" +checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" dependencies = [ "crossbeam-utils", ] [[package]] name = "const-oid" -version = "0.9.5" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[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", @@ -552,9 +614,9 @@ dependencies = [ [[package]] name = "core-foundation" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -562,27 +624,24 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cpufeatures" -version = "0.2.9" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "crypto-common" @@ -596,9 +655,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" +checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" [[package]] name = "der" @@ -613,9 +672,12 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.8" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] [[package]] name = "digest" @@ -652,15 +714,15 @@ dependencies = [ [[package]] name = "dyn-clone" -version = "1.0.13" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbfc4744c1b8f2a09adc0e55242f60b1af195d88596bd8700be74418c056c555" +checksum = "545b22097d44f8a9581187cdf93de7a71e4722bf51200cfaba810865b49a495d" [[package]] name = "env_logger" -version = "0.10.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" +checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" dependencies = [ "humantime", "is-terminal", @@ -677,42 +739,73 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.3" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ - "errno-dragonfly", "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] -name = "errno-dragonfly" -version = "0.1.2" +name = "event-listener" +version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "event-listener" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d93877bcde0eb80ca09131a08d23f0a5c18a620b01db137dba666d18cd9b30c2" dependencies = [ - "cc", - "libc", + "concurrent-queue", + "parking", + "pin-project-lite", ] [[package]] name = "event-listener" -version = "2.5.3" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" +checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] [[package]] name = "event-listener" -version = "4.0.0" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "770d968249b5d99410d61f5bf89057f3199a077a04d087092f58e7d10692baae" +checksum = "b72557800024fabbaa2449dd4bf24e37b93702d457a4d4f2b0dd1f0f039f20c1" dependencies = [ "concurrent-queue", "parking", "pin-project-lite", ] +[[package]] +name = "event-listener-strategy" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" +dependencies = [ + "event-listener 4.0.3", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "feedafcaa9b749175d5ac357452a9d41ea2911da598fde46ce1fe02c37751291" +dependencies = [ + "event-listener 5.0.0", + "pin-project-lite", +] + [[package]] name = "fastrand" version = "1.9.0" @@ -722,6 +815,12 @@ dependencies = [ "instant", ] +[[package]] +name = "fastrand" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" + [[package]] name = "fixedbitset" version = "0.4.2" @@ -761,18 +860,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 = "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", @@ -785,9 +884,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", @@ -795,15 +894,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", @@ -812,9 +911,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" @@ -822,7 +921,7 @@ 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", @@ -831,34 +930,47 @@ dependencies = [ "waker-fn", ] +[[package]] +name = "futures-lite" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba" +dependencies = [ + "fastrand 2.0.1", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] + [[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.49", ] [[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", @@ -884,9 +996,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", "js-sys", @@ -897,30 +1009,28 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[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.49", ] [[package]] @@ -958,9 +1068,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.0" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", "allocator-api2", @@ -983,9 +1093,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.2" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "bd5256b483761cd23699d0da46cc6fd2ee3be420bbe6d020ae4a091e70b7e9fd" [[package]] name = "hex" @@ -1004,18 +1114,18 @@ 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]] name = "http" -version = "0.2.9" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" dependencies = [ "bytes", "fnv", @@ -1036,9 +1146,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[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", @@ -1056,12 +1166,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.0" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" dependencies = [ "equivalent", - "hashbrown 0.14.0", + "hashbrown 0.14.3", ] [[package]] @@ -1088,7 +1198,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.6", "libc", "windows-sys 0.48.0", ] @@ -1104,20 +1214,20 @@ dependencies = [ [[package]] name = "is-terminal" -version = "0.4.9" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ - "hermit-abi 0.3.2", - "rustix 0.38.13", - "windows-sys 0.48.0", + "hermit-abi 0.3.6", + "libc", + "windows-sys 0.52.0", ] [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "jni" @@ -1143,9 +1253,9 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" dependencies = [ "wasm-bindgen", ] @@ -1163,9 +1273,9 @@ dependencies = [ [[package]] name = "keccak" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" dependencies = [ "cpufeatures", ] @@ -1199,15 +1309,15 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.148" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libloading" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d580318f95776505201b28cf98eb1fa5e4be3b689633ba6a3e6cd880ff22d8cb" +checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" dependencies = [ "cfg-if", "windows-sys 0.48.0", @@ -1215,9 +1325,20 @@ dependencies = [ [[package]] name = "libm" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" + +[[package]] +name = "libredox" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +dependencies = [ + "bitflags 2.4.2", + "libc", + "redox_syscall 0.4.1", +] [[package]] name = "linux-raw-sys" @@ -1227,15 +1348,15 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.7" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "lock_api" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ "autocfg", "scopeguard", @@ -1252,33 +1373,33 @@ dependencies = [ [[package]] name = "lz4_flex" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ea9b256699eda7b0387ffbc776dd625e28bde3918446381781245b7a50349d8" +checksum = "912b45c753ff5f7f5208307e8ace7d2a2e30d024e26d3509f3dce546c044ce15" dependencies = [ "twox-hash", ] [[package]] name = "memchr" -version = "2.6.3" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.8" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", "wasi", @@ -1300,7 +1421,7 @@ version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.2", "cfg-if", "libc", ] @@ -1328,21 +1449,26 @@ dependencies = [ "zeroize", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +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.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" +checksum = "d869c01cc0c455284163fd0092f1f93835385ccab5a98a0dcc497b2f8bf055a9" dependencies = [ "autocfg", "num-integer", @@ -1351,9 +1477,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", "libm", @@ -1365,24 +1491,24 @@ 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.6", "libc", ] [[package]] name = "object" -version = "0.32.1" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "openssl-probe" @@ -1398,9 +1524,9 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "ordered-float" -version = "4.1.1" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "536900a8093134cf9ccf00a27deb3532421099e958d9dd431135d0c7543ca1e8" +checksum = "a76df7075c7d4d01fdcb46c912dd17fba5b60c78ea480b475f2b6ab6f666584e" dependencies = [ "num-traits", ] @@ -1413,9 +1539,9 @@ checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" [[package]] name = "parking" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] name = "parking_lot" @@ -1429,13 +1555,13 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.8" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.3.5", + "redox_syscall 0.4.1", "smallvec", "windows-targets 0.48.5", ] @@ -1457,15 +1583,15 @@ 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" -version = "2.7.3" +version = "2.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a4d085fd991ac8d5b05a147b437791b4260b76326baf0fc60cf7c9c27ecd33" +checksum = "219c0dcc30b6a27553f9cc242972b67f75b60eb0db71f0b5462f38b058c41546" dependencies = [ "memchr", "thiserror", @@ -1474,9 +1600,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.3" +version = "2.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bee7be22ce7918f641a33f08e3f43388c7656772244e2bbb2477f44cc9021a" +checksum = "22e1288dbd7786462961e69bfd4df7848c1e37e8b74303dbdab82c3a9cdd2809" dependencies = [ "pest", "pest_generator", @@ -1484,22 +1610,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.3" +version = "2.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1511785c5e98d79a05e8a6bc34b4ac2168a0e3e92161862030ad84daa223141" +checksum = "1381c29a877c6d34b8c176e734f35d7f7f5b3adaefe940cb4d1bb7af94678e2e" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.49", ] [[package]] name = "pest_meta" -version = "2.7.3" +version = "2.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42f0394d3123e33353ca5e1e89092e533d2cc490389f2bd6131c43c634ebc5f" +checksum = "d0934d6907f148c22a3acbda520c7eed243ad7487a30f51f6ce52b58b7077a8a" dependencies = [ "once_cell", "pest", @@ -1513,27 +1639,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 2.0.0", + "indexmap 2.2.3", ] [[package]] name = "pin-project" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +checksum = "0302c4a0442c456bd56f841aee5c3bfd17967563f6fadc9ceb9f9c23cf3807e0" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.49", ] [[package]] @@ -1548,6 +1674,17 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "piper" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" +dependencies = [ + "atomic-waker", + "fastrand 2.0.1", + "futures-io", +] + [[package]] name = "pkcs1" version = "0.7.5" @@ -1614,7 +1751,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.33", + "syn 2.0.49", ] [[package]] @@ -1677,22 +1814,36 @@ dependencies = [ ] [[package]] -name = "ppv-lite86" -version = "0.2.17" +name = "polling" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "30054e72317ab98eddd8561db0f6524df3367636884b7b21b703e4b280a84a14" +dependencies = [ + "cfg-if", + "concurrent-queue", + "pin-project-lite", + "rustix 0.38.31", + "tracing", + "windows-sys 0.52.0", +] [[package]] -name = "proc-macro-hack" -version = "0.5.20+deprecated" +name = "powerfmt" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.67" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] @@ -1716,9 +1867,9 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.10.4" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13f81c9a9d574310b8351f8666f5a93ac3b0069c45c28ad52c10291389a7cf9" +checksum = "141bf7dfde2fbc246bfd3fe12f2455aa24b0fbd9af535d8c86c7bd1381ff2b1a" dependencies = [ "bytes", "rand", @@ -1740,16 +1891,16 @@ checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" dependencies = [ "bytes", "libc", - "socket2 0.5.4", + "socket2 0.5.5", "tracing", "windows-sys 0.48.0", ] [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -1786,38 +1937,38 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.16" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" dependencies = [ "bitflags 1.3.2", ] [[package]] name = "redox_syscall" -version = "0.3.5" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ "bitflags 1.3.2", ] [[package]] name = "redox_users" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" dependencies = [ "getrandom", - "redox_syscall 0.2.16", + "libredox", "thiserror", ] [[package]] name = "regex" -version = "1.9.5" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", @@ -1827,9 +1978,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.8" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" dependencies = [ "aho-corasick", "memchr", @@ -1838,9 +1989,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.7.5" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "ring" @@ -1859,9 +2010,9 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.6" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "684d5e6e18f669ccebf64a92236bb7db9a34f07be010e3627368182027180866" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" dependencies = [ "cc", "getrandom", @@ -1883,16 +2034,14 @@ dependencies = [ [[package]] name = "rsa" -version = "0.9.2" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ab43bb47d23c1a631b4b680199a45255dce26fa9ab2fa902581f624ff13e6a8" +checksum = "5d0e5124fcb30e76a7e79bfee683a2746db83784b86289f6251b54b7950a0dfc" dependencies = [ - "byteorder", "const-oid", "digest", "num-bigint-dig", "num-integer", - "num-iter", "num-traits", "pkcs1", "pkcs8", @@ -1926,9 +2075,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.25" +version = "0.37.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4eb579851244c2c03e7c24f501c3432bed80b8f720af1d6e5b0e0f01555a035" +checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" dependencies = [ "bitflags 1.3.2", "errno", @@ -1940,26 +2089,26 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.13" +version = "0.38.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7db8590df6dfcd144d22afd1b83b36c21a18d7cbc1dc4bb5295a8712e9eb662" +checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.2", "errno", "libc", - "linux-raw-sys 0.4.7", - "windows-sys 0.48.0", + "linux-raw-sys 0.4.13", + "windows-sys 0.52.0", ] [[package]] name = "rustls" -version = "0.21.7" +version = "0.21.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" dependencies = [ "log", - "ring 0.16.20", - "rustls-webpki 0.101.5", + "ring 0.17.7", + "rustls-webpki 0.101.7", "sct", ] @@ -1970,7 +2119,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", - "rustls-pemfile 1.0.3", + "rustls-pemfile 1.0.4", "schannel", "security-framework", ] @@ -1982,7 +2131,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792" dependencies = [ "openssl-probe", - "rustls-pemfile 2.0.0", + "rustls-pemfile 2.1.0", "rustls-pki-types", "schannel", "security-framework", @@ -1990,18 +2139,18 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ "base64", ] [[package]] name = "rustls-pemfile" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35e4980fa29e4c4b212ffb3db068a564cbf560e51d3944b7c88bd8bf5bec64f4" +checksum = "3c333bb734fcdedcea57de1602543590f545f127dc8b533324318fd492c5c70b" dependencies = [ "base64", "rustls-pki-types", @@ -2009,36 +2158,36 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.0.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb0a1f9b9efec70d32e6d6aa3e58ebd88c3754ec98dfe9145c63cf54cc829b83" +checksum = "048a63e5b3ac996d78d402940b5fa47973d2d080c6c6fffa1d0f19c4445310b7" [[package]] name = "rustls-webpki" -version = "0.101.5" +version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45a27e3b59326c16e23d30aeb7a36a24cc0d29e71d68ff611cdfb4a01d013bed" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", + "ring 0.17.7", + "untrusted 0.9.0", ] [[package]] name = "rustls-webpki" -version = "0.102.0" +version = "0.102.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de2635c8bc2b88d367767c5de8ea1d8db9af3f6219eba28442242d9ab81d1b89" +checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" dependencies = [ - "ring 0.17.6", + "ring 0.17.7", "rustls-pki-types", "untrusted 0.9.0", ] [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "same-file" @@ -2051,18 +2200,18 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "schemars" -version = "0.8.13" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "763f8cd0d4c71ed8389c90cb8100cba87e763bd01a8e614d4f0af97bcd50a161" +checksum = "45a28f4c49489add4ce10783f7911893516f15afe45d015608d41faca6bc4d29" dependencies = [ "dyn-clone", "schemars_derive", @@ -2072,9 +2221,9 @@ dependencies = [ [[package]] name = "schemars_derive" -version = "0.8.13" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0f696e21e10fa546b7ffb1c9672c6de8fbc7a81acf59524386d8639bf12737" +checksum = "c767fd6fa65d9ccf9cf026122c1b555f2ef9a4f0cea69da4d7dbc3e258d30967" dependencies = [ "proc-macro2", "quote", @@ -2090,12 +2239,12 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sct" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", + "ring 0.17.7", + "untrusted 0.9.0", ] [[package]] @@ -2133,28 +2282,28 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.18" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" +checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" [[package]] name = "serde" -version = "1.0.188" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.188" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.49", ] [[package]] @@ -2170,9 +2319,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.107" +version = "1.0.113" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" dependencies = [ "itoa", "ryu", @@ -2181,11 +2330,11 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.9.25" +version = "0.9.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a49e178e4452f45cb61d0cd8cebc1b0fafd3e41929e996cef79aa3aca91f574" +checksum = "adf8a49373e98a4c5f0ceb5d05aa7c648d75f63774981ed95b7c7443bbd50c6e" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.2.3", "itoa", "ryu", "serde", @@ -2194,9 +2343,9 @@ dependencies = [ [[package]] name = "sha1" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", "cpufeatures", @@ -2205,9 +2354,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.7" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", @@ -2233,16 +2382,6 @@ dependencies = [ "dirs", ] -[[package]] -name = "signal-hook" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" -dependencies = [ - "libc", - "signal-hook-registry", -] - [[package]] name = "signal-hook-registry" version = "1.4.1" @@ -2254,9 +2393,9 @@ dependencies = [ [[package]] name = "signature" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest", "rand_core", @@ -2273,15 +2412,15 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "socket2" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ "libc", "winapi", @@ -2289,9 +2428,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" dependencies = [ "libc", "windows-sys 0.48.0", @@ -2314,9 +2453,9 @@ dependencies = [ [[package]] name = "spki" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", "der", @@ -2334,7 +2473,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", "futures-core", "pin-project-lite", @@ -2346,6 +2485,12 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +[[package]] +name = "strsim" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" + [[package]] name = "subtle" version = "2.5.0" @@ -2365,9 +2510,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.33" +version = "2.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9caece70c63bfba29ec2fed841a09851b14a235c60010fa4de58089b6c025668" +checksum = "915aea9e586f80826ee59f8453c1101f9d1c4b3964cd2460185ee8e299ada496" dependencies = [ "proc-macro2", "quote", @@ -2376,9 +2521,9 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.2.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ "winapi-util", ] @@ -2391,32 +2536,34 @@ checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" [[package]] name = "thiserror" -version = "1.0.48" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" +checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.48" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" +checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.49", ] [[package]] name = "time" -version = "0.3.28" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f6bb557fd245c28e6411aa56b6403c689ad95061f50e4be16c274e70a17e48" +checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" dependencies = [ "deranged", "itoa", + "num-conv", + "powerfmt", "serde", "time-core", "time-macros", @@ -2424,16 +2571,17 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.14" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a942f44339478ef67935ab2bbaec2fb0322496cf3cbe84b261e06ac3814c572" +checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" dependencies = [ + "num-conv", "time-core", ] @@ -2463,9 +2611,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.32.0" +version = "1.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" +checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" dependencies = [ "backtrace", "bytes", @@ -2473,27 +2621,27 @@ dependencies = [ "mio", "num_cpus", "pin-project-lite", - "socket2 0.5.4", + "socket2 0.5.5", "tokio-macros", "windows-sys 0.48.0", ] [[package]] name = "tokio-macros" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.49", ] [[package]] name = "tokio-tungstenite" -version = "0.20.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b2dbec703c26b00d74844519606ef15d09a7d6857860f84ad223dec002ddea2" +checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" dependencies = [ "futures-util", "log", @@ -2503,11 +2651,10 @@ dependencies = [ [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "log", "pin-project-lite", "tracing-attributes", @@ -2516,20 +2663,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.49", ] [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", ] @@ -2565,9 +2712,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ucd-trie" @@ -2591,9 +2738,9 @@ dependencies = [ [[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" @@ -2618,9 +2765,9 @@ checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "unsafe-libyaml" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28467d3e1d3c6586d8f25fa243f544f5800fec42d97032474e17222c2b75cfa" +checksum = "ab4c90930b95a82d00dc9e9ac071b4991924390d46cbd0dfe566148667605e4b" [[package]] name = "untrusted" @@ -2647,9 +2794,9 @@ dependencies = [ [[package]] name = "url" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna", @@ -2670,9 +2817,9 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "1.4.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" +checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" dependencies = [ "getrandom", ] @@ -2703,9 +2850,9 @@ dependencies = [ [[package]] name = "value-bag" -version = "1.4.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d92ccd67fb88503048c01b59152a04effd0782d035a83a6d256ce6085f08f4a3" +checksum = "126e423afe2dd9ac52142e7e9d5ce4135d7e13776c529d27fd6bc49f19e3280b" [[package]] name = "vec_map" @@ -2721,9 +2868,9 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "waker-fn" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" +checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" [[package]] name = "walkdir" @@ -2743,9 +2890,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2753,24 +2900,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.49", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.37" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" dependencies = [ "cfg-if", "js-sys", @@ -2780,9 +2927,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2790,28 +2937,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.49", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" dependencies = [ "js-sys", "wasm-bindgen", @@ -2819,9 +2966,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de2cfda980f21be5a7ed2eadb3e6fe074d56022bea2cdeb1a62eb220fc04188" +checksum = "b3de34ae270483955a94f4b21bdaaeb83d508bb84a01435f393818edb0012009" dependencies = [ "rustls-pki-types", ] @@ -2844,9 +2991,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] @@ -3058,7 +3205,7 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2ad877ca1cb3eec4af450007e6b5b9706c5b8a32" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f09fcc2c0423f4eb367db0f864031036f447a3e5" dependencies = [ "async-global-executor", "async-std", @@ -3066,7 +3213,7 @@ dependencies = [ "base64", "const_format", "env_logger", - "event-listener 4.0.0", + "event-listener 4.0.3", "flume 0.11.0", "form_urlencoded", "futures", @@ -3082,7 +3229,7 @@ dependencies = [ "rustc_version", "serde", "serde_json", - "socket2 0.5.4", + "socket2 0.5.5", "stop-token", "uhlc", "uuid", @@ -3093,6 +3240,7 @@ dependencies = [ "zenoh-config", "zenoh-core", "zenoh-crypto", + "zenoh-keyexpr", "zenoh-link", "zenoh-macros", "zenoh-plugin-trait", @@ -3106,7 +3254,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2ad877ca1cb3eec4af450007e6b5b9706c5b8a32" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f09fcc2c0423f4eb367db0f864031036f447a3e5" dependencies = [ "zenoh-collections", ] @@ -3114,7 +3262,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2ad877ca1cb3eec4af450007e6b5b9706c5b8a32" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f09fcc2c0423f4eb367db0f864031036f447a3e5" dependencies = [ "log", "serde", @@ -3126,12 +3274,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2ad877ca1cb3eec4af450007e6b5b9706c5b8a32" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f09fcc2c0423f4eb367db0f864031036f447a3e5" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2ad877ca1cb3eec4af450007e6b5b9706c5b8a32" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f09fcc2c0423f4eb367db0f864031036f447a3e5" dependencies = [ "flume 0.11.0", "json5", @@ -3150,7 +3298,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2ad877ca1cb3eec4af450007e6b5b9706c5b8a32" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f09fcc2c0423f4eb367db0f864031036f447a3e5" dependencies = [ "async-std", "lazy_static", @@ -3160,7 +3308,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2ad877ca1cb3eec4af450007e6b5b9706c5b8a32" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f09fcc2c0423f4eb367db0f864031036f447a3e5" dependencies = [ "aes", "hmac", @@ -3173,7 +3321,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2ad877ca1cb3eec4af450007e6b5b9706c5b8a32" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f09fcc2c0423f4eb367db0f864031036f447a3e5" dependencies = [ "async-std", "bincode", @@ -3193,9 +3341,9 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2ad877ca1cb3eec4af450007e6b5b9706c5b8a32" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f09fcc2c0423f4eb367db0f864031036f447a3e5" dependencies = [ - "hashbrown 0.14.0", + "hashbrown 0.14.3", "keyed-set", "rand", "schemars", @@ -3207,7 +3355,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2ad877ca1cb3eec4af450007e6b5b9706c5b8a32" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f09fcc2c0423f4eb367db0f864031036f447a3e5" dependencies = [ "async-std", "async-trait", @@ -3226,7 +3374,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2ad877ca1cb3eec4af450007e6b5b9706c5b8a32" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f09fcc2c0423f4eb367db0f864031036f447a3e5" dependencies = [ "async-std", "async-trait", @@ -3243,7 +3391,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2ad877ca1cb3eec4af450007e6b5b9706c5b8a32" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f09fcc2c0423f4eb367db0f864031036f447a3e5" dependencies = [ "async-rustls", "async-std", @@ -3254,8 +3402,8 @@ dependencies = [ "quinn", "rustls", "rustls-native-certs 0.7.0", - "rustls-pemfile 2.0.0", - "rustls-webpki 0.102.0", + "rustls-pemfile 2.1.0", + "rustls-webpki 0.102.2", "secrecy", "zenoh-config", "zenoh-core", @@ -3269,7 +3417,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2ad877ca1cb3eec4af450007e6b5b9706c5b8a32" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f09fcc2c0423f4eb367db0f864031036f447a3e5" dependencies = [ "async-std", "async-trait", @@ -3285,7 +3433,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2ad877ca1cb3eec4af450007e6b5b9706c5b8a32" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f09fcc2c0423f4eb367db0f864031036f447a3e5" dependencies = [ "async-rustls", "async-std", @@ -3294,8 +3442,8 @@ dependencies = [ "futures", "log", "rustls", - "rustls-pemfile 2.0.0", - "rustls-webpki 0.102.0", + "rustls-pemfile 2.1.0", + "rustls-webpki 0.102.2", "secrecy", "webpki-roots", "zenoh-config", @@ -3310,12 +3458,12 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2ad877ca1cb3eec4af450007e6b5b9706c5b8a32" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f09fcc2c0423f4eb367db0f864031036f447a3e5" dependencies = [ "async-std", "async-trait", "log", - "socket2 0.5.4", + "socket2 0.5.5", "zenoh-buffers", "zenoh-collections", "zenoh-core", @@ -3329,7 +3477,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2ad877ca1cb3eec4af450007e6b5b9706c5b8a32" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f09fcc2c0423f4eb367db0f864031036f447a3e5" dependencies = [ "async-std", "async-trait", @@ -3347,7 +3495,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2ad877ca1cb3eec4af450007e6b5b9706c5b8a32" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f09fcc2c0423f4eb367db0f864031036f447a3e5" dependencies = [ "async-std", "async-trait", @@ -3367,12 +3515,12 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2ad877ca1cb3eec4af450007e6b5b9706c5b8a32" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f09fcc2c0423f4eb367db0f864031036f447a3e5" dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.33", + "syn 2.0.49", "unzip-n", "zenoh-keyexpr", ] @@ -3380,11 +3528,14 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2ad877ca1cb3eec4af450007e6b5b9706c5b8a32" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f09fcc2c0423f4eb367db0f864031036f447a3e5" dependencies = [ + "const_format", "libloading", "log", + "serde", "serde_json", + "zenoh-keyexpr", "zenoh-macros", "zenoh-result", "zenoh-util", @@ -3393,7 +3544,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2ad877ca1cb3eec4af450007e6b5b9706c5b8a32" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f09fcc2c0423f4eb367db0f864031036f447a3e5" dependencies = [ "const_format", "hex", @@ -3409,7 +3560,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2ad877ca1cb3eec4af450007e6b5b9706c5b8a32" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f09fcc2c0423f4eb367db0f864031036f447a3e5" dependencies = [ "anyhow", ] @@ -3417,10 +3568,10 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2ad877ca1cb3eec4af450007e6b5b9706c5b8a32" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f09fcc2c0423f4eb367db0f864031036f447a3e5" dependencies = [ "async-std", - "event-listener 4.0.0", + "event-listener 4.0.3", "flume 0.11.0", "futures", "tokio", @@ -3432,7 +3583,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2ad877ca1cb3eec4af450007e6b5b9706c5b8a32" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f09fcc2c0423f4eb367db0f864031036f447a3e5" dependencies = [ "async-executor", "async-global-executor", @@ -3463,11 +3614,11 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2ad877ca1cb3eec4af450007e6b5b9706c5b8a32" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f09fcc2c0423f4eb367db0f864031036f447a3e5" dependencies = [ "async-std", "async-trait", - "clap 4.4.11", + "clap 4.5.1", "const_format", "flume 0.11.0", "futures", @@ -3505,8 +3656,28 @@ dependencies = [ "zenoh-ext", ] +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.49", +] + [[package]] name = "zeroize" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" diff --git a/zenoh-jni/src/publisher.rs b/zenoh-jni/src/publisher.rs index 227929b2..525be99e 100644 --- a/zenoh-jni/src/publisher.rs +++ b/zenoh-jni/src/publisher.rs @@ -28,6 +28,7 @@ use zenoh::{ use crate::{ errors::{Error, Result}, sample::decode_sample_kind, + utils::{decode_byte_array, vec_to_attachment}, }; use crate::{ put::{decode_congestion_control, decode_priority}, @@ -44,6 +45,7 @@ use zenoh::SessionDeclarations; /// - `_class`: The JNI class. /// - `payload`: The payload to be published, represented as a Java byte array (`JByteArray`). /// - `encoding`: The encoding type of the payload. +/// - `encoded_attachment`: Optional encoded attachment. May be null. /// - `ptr`: The raw pointer to the Zenoh publisher ([Publisher]). /// /// Safety: @@ -60,10 +62,17 @@ pub unsafe extern "C" fn Java_io_zenoh_jni_JNIPublisher_putViaJNI( _class: JClass, payload: JByteArray, encoding: jint, + encoded_attachment: JByteArray, ptr: *const Publisher<'static>, ) { let publisher = Arc::from_raw(ptr); - match perform_put(&env, payload, encoding, publisher.clone()) { + match perform_put( + &env, + payload, + encoding, + encoded_attachment, + publisher.clone(), + ) { Ok(_) => {} Err(err) => { _ = err.throw_on_jvm(&mut env).map_err(|err| { @@ -150,6 +159,7 @@ pub(crate) unsafe fn declare_publisher( /// - `env`: The JNI environment. /// - `payload`: The payload as a `JByteArray`. /// - `encoding`: The encoding of the payload. +/// - `encoded_attachment`: Optional encoded attachment. May be null. /// - `publisher`: The Zenoh publisher. /// /// Returns: @@ -159,11 +169,16 @@ fn perform_put( env: &JNIEnv, payload: JByteArray, encoding: jint, + encoded_attachment: JByteArray, publisher: Arc, ) -> Result<()> { let value = decode_value(env, payload, encoding)?; - publisher - .put(value) + let mut publication = publisher.put(value); + if !encoded_attachment.is_null() { + let aux = decode_byte_array(env, encoded_attachment)?; + publication = publication.with_attachment(vec_to_attachment(aux)) + }; + publication .res_sync() .map_err(|err| Error::Session(err.to_string())) } @@ -258,6 +273,7 @@ pub unsafe extern "C" fn Java_io_zenoh_jni_JNIPublisher_setPriorityViaJNI( /// - `payload`: The payload as a `JByteArray`. /// - `encoding`: The [zenoh::Encoding] of the payload. /// - `sample_kind`: The [zenoh::SampleKind] to use. +/// - `encoded_attachment`: Optional encoded attachment. May be null. /// - `publisher`: The Zenoh [Publisher]. /// /// Returns: @@ -268,12 +284,17 @@ fn perform_write( payload: JByteArray, encoding: jint, sample_kind: jint, + encoded_attachment: JByteArray, publisher: Arc, ) -> Result<()> { let value = decode_value(env, payload, encoding)?; let sample_kind = decode_sample_kind(sample_kind)?; - publisher - .write(sample_kind, value) + let mut publication = publisher.write(sample_kind, value); + if !encoded_attachment.is_null() { + let aux = decode_byte_array(env, encoded_attachment)?; + publication = publication.with_attachment(vec_to_attachment(aux)) + }; + publication .res() .map_err(|err| Error::Session(format!("{}", err))) } @@ -288,6 +309,7 @@ fn perform_write( /// - `payload`: The payload to be published, represented as a [Java byte array](JByteArray). /// - `encoding`: The [`encoding`](zenoh::Encoding) of the payload. /// - `sample_kind`: The [`kind`](zenoh::SampleKind) to use. +/// - `encoded_attachment`: Optional encoded attachment. May be null. /// - `ptr`: The raw pointer to the Zenoh publisher ([Publisher]). /// /// Safety: @@ -305,10 +327,18 @@ pub unsafe extern "C" fn Java_io_zenoh_jni_JNIPublisher_writeViaJNI( payload: JByteArray, encoding: jint, sample_kind: jint, + encoded_attachment: JByteArray, ptr: *const Publisher<'static>, ) { let publisher = Arc::from_raw(ptr); - match perform_write(&env, payload, encoding, sample_kind, publisher.clone()) { + match perform_write( + &env, + payload, + encoding, + sample_kind, + encoded_attachment, + publisher.clone(), + ) { Ok(_) => {} Err(err) => { _ = err.throw_on_jvm(&mut env).map_err(|err| { @@ -325,14 +355,24 @@ pub unsafe extern "C" fn Java_io_zenoh_jni_JNIPublisher_writeViaJNI( /// Performs a DELETE operation via JNI using the specified Zenoh publisher. /// /// Parameters: +/// - `env`: The JNI environment. +/// - `encoded_attachment`: Optional encoded attachment. May be null. /// - `publisher`: The Zenoh [Publisher]. /// /// Returns: /// - A [Result] indicating the success or failure of the operation. /// -fn perform_delete(publisher: Arc) -> Result<()> { - publisher - .delete() +fn perform_delete( + env: &JNIEnv, + encoded_attachment: JByteArray, + publisher: Arc, +) -> Result<()> { + let mut delete = publisher.delete(); + if !encoded_attachment.is_null() { + let aux = decode_byte_array(env, encoded_attachment)?; + delete = delete.with_attachment(vec_to_attachment(aux)) + }; + delete .res() .map_err(|err| Error::Session(format!("{}", err))) } @@ -344,6 +384,7 @@ fn perform_delete(publisher: Arc) -> Result<()> { /// Parameters: /// - `env`: The JNI environment. /// - `_class`: The JNI class. +/// - `encoded_attachment`: Optional encoded attachment. May be null. /// - `ptr`: The raw pointer to the [Zenoh publisher](Publisher). /// /// Safety: @@ -358,10 +399,11 @@ fn perform_delete(publisher: Arc) -> Result<()> { pub unsafe extern "C" fn Java_io_zenoh_jni_JNIPublisher_deleteViaJNI( mut env: JNIEnv, _class: JClass, + encoded_attachment: JByteArray, ptr: *const Publisher<'static>, ) { let publisher = Arc::from_raw(ptr); - match perform_delete(publisher.clone()) { + match perform_delete(&env, encoded_attachment, publisher.clone()) { Ok(_) => {} Err(err) => { _ = err.throw_on_jvm(&mut env).map_err(|err| { diff --git a/zenoh-jni/src/put.rs b/zenoh-jni/src/put.rs index a370b2da..0e2cf410 100644 --- a/zenoh-jni/src/put.rs +++ b/zenoh-jni/src/put.rs @@ -14,6 +14,7 @@ use crate::errors::{Error, Result}; use crate::sample::decode_sample_kind; +use crate::utils::{decode_byte_array, vec_to_attachment}; use crate::value::decode_value; use jni::objects::JByteArray; @@ -34,6 +35,7 @@ use zenoh::prelude::r#sync::*; /// - `congestion_control`: The [CongestionControl] mechanism specified. /// - `priority`: The [Priority] mechanism specified. /// - `sample_kind`: The [SampleKind] of the put operation. +/// - `attachment`: An optional attachment, encoded into a byte array. May be null. /// /// Returns: /// - A `Result` indicating the result of the `get` operation, with an [Error] in case of failure. @@ -48,6 +50,7 @@ pub(crate) fn on_put( congestion_control: jint, priority: jint, sample_kind: jint, + attachment: JByteArray, ) -> Result<()> { let value = decode_value(env, payload, encoding)?; let sample_kind = decode_sample_kind(sample_kind)?; @@ -71,13 +74,19 @@ pub(crate) fn on_put( }; let key_expr_clone = key_expr.deref().clone(); - match session + + let mut put_builder = session .put(key_expr_clone, value.to_owned()) .kind(sample_kind) .congestion_control(congestion_control) - .priority(priority) - .res() - { + .priority(priority); + + if !attachment.is_null() { + let attachment = decode_byte_array(env, attachment)?; + put_builder = put_builder.with_attachment(vec_to_attachment(attachment)) + } + + match put_builder.res() { Ok(_) => { log::trace!("Put on '{key_expr}' with value '{value}' and encoding '{}'. Kind: '{sample_kind}', Congestion control: '{congestion_control:?}', Priority: '{priority:?}'", value.encoding); Ok(()) diff --git a/zenoh-jni/src/query.rs b/zenoh-jni/src/query.rs index af3a88bc..333b6cfc 100644 --- a/zenoh-jni/src/query.rs +++ b/zenoh-jni/src/query.rs @@ -23,15 +23,19 @@ use zenoh::{ prelude::{sync::SyncResolve, KeyExpr, SplitBuffer}, query::{ConsolidationMode, QueryTarget}, queryable::Query, - sample::Sample, + sample::{Attachment, Sample}, value::Value, }; -use crate::sample::decode_sample; use crate::{ errors::{Error, Result}, + utils::attachment_to_vec, value::decode_value, }; +use crate::{ + sample::decode_sample, + utils::{decode_byte_array, vec_to_attachment}, +}; /// Replies with success to a Zenoh query via JNI. /// @@ -47,6 +51,7 @@ use crate::{ /// - `sample_kind`: The kind of sample. /// - `timestamp_enabled`: A boolean indicating whether the timestamp is enabled. /// - `timestamp_ntp_64`: The NTP64 timestamp value. +/// - `attachment`: Optional user attachment encoded as a byte array. May be null. /// /// Safety: /// - This function is marked as unsafe due to raw pointer manipulation and JNI interaction. @@ -66,6 +71,7 @@ pub(crate) unsafe extern "C" fn Java_io_zenoh_jni_JNIQuery_replySuccessViaJNI( sample_kind: jint, timestamp_enabled: jboolean, timestamp_ntp_64: jlong, + attachment: JByteArray, ) { let key_expr = Arc::from_raw(key_expr_ptr); let key_expr_clone = key_expr.deref().clone(); @@ -87,9 +93,22 @@ pub(crate) unsafe extern "C" fn Java_io_zenoh_jni_JNIQuery_replySuccessViaJNI( return; } }; + let attachment: Option = if !attachment.is_null() { + match decode_byte_array(&env, attachment) { + Ok(attachment_bytes) => Some(vec_to_attachment(attachment_bytes)), + Err(err) => { + _ = err.throw_on_jvm(&mut env).map_err(|err| { + log::error!("Unable to throw exception on query reply failure. {}", err) + }); + return; + } + } + } else { + None + }; let query = Arc::from_raw(query_ptr); - query_reply(&query, Ok(sample), env); + query_reply(env, &query, Ok(sample), attachment); mem::forget(query) } @@ -109,6 +128,7 @@ pub(crate) unsafe extern "C" fn Java_io_zenoh_jni_JNIQuery_replySuccessViaJNI( /// - `key_expr`: The key expression associated with the query result. /// - `payload`: The payload as a `JByteArray`. /// - `encoding`: The encoding of the payload as a jint. +/// - `attachment`: The user attachment bytes. /// /// Safety: /// - This function is marked as unsafe due to raw pointer manipulation and JNI interaction. @@ -124,6 +144,7 @@ pub(crate) unsafe extern "C" fn Java_io_zenoh_jni_JNIQuery_replyErrorViaJNI( ptr: *const zenoh::queryable::Query, payload: JByteArray, encoding: jint, + attachment: JByteArray, ) { let errorValue = match decode_value(&env, payload, encoding) { Ok(value) => value, @@ -134,9 +155,22 @@ pub(crate) unsafe extern "C" fn Java_io_zenoh_jni_JNIQuery_replyErrorViaJNI( return; } }; + let attachment: Option = if !attachment.is_null() { + match decode_byte_array(&env, attachment) { + Ok(attachment_bytes) => Some(vec_to_attachment(attachment_bytes)), + Err(err) => { + _ = err.throw_on_jvm(&mut env).map_err(|err| { + log::error!("Unable to throw exception on query reply failure. {}", err) + }); + return; + } + } + } else { + None + }; let query = Arc::from_raw(ptr); - query_reply(&query, Err(errorValue), env); + query_reply(env, &query, Err(errorValue), attachment); mem::forget(query) } @@ -209,6 +243,17 @@ pub(crate) fn on_query( None => (false, JPrimitiveArray::default(), 0), }; + let attachment_bytes = match query.attachment().map_or_else( + || env.byte_array_from_slice(&[]), + |attachment| env.byte_array_from_slice(attachment_to_vec(attachment.clone()).as_slice()), + ) { + Ok(byte_array) => Ok(byte_array), + Err(err) => Err(Error::Jni(format!( + "Error processing attachment of reply: {}.", + err + ))), + }?; + let key_expr = query.key_expr().clone(); let key_expr_ptr = Arc::into_raw(Arc::new(key_expr)); let query_ptr = Arc::into_raw(Arc::new(query)); @@ -217,13 +262,14 @@ pub(crate) fn on_query( .call_method( callback_global_ref, "run", - "(JLjava/lang/String;Z[BIJ)V", + "(JLjava/lang/String;Z[BI[BJ)V", &[ JValue::from(key_expr_ptr as jlong), JValue::from(&selector_params_jstr), JValue::from(with_value), JValue::from(&payload), JValue::from(encoding), + JValue::from(&attachment_bytes), JValue::from(query_ptr as jlong), ], ) @@ -251,12 +297,29 @@ pub(crate) fn on_query( } /// Helper function to perform a reply to a query. -fn query_reply(query: &Arc, reply: core::result::Result, mut env: JNIEnv) { - match query - .reply(reply) - .res() - .map_err(|err| Error::Session(err.to_string())) - { +fn query_reply( + mut env: JNIEnv, + query: &Arc, + reply: core::result::Result, + attachment: Option, +) { + let result = if let Some(attachment) = attachment { + query + .reply(reply) + .with_attachment(attachment) + .unwrap_or_else(|(builder, _)| { + log::warn!("Unable to append attachment to query reply"); + builder + }) + .res() + .map_err(|err| Error::Session(err.to_string())) + } else { + query + .reply(reply) + .res() + .map_err(|err| Error::Session(err.to_string())) + }; + match result { Ok(_) => {} Err(err) => { _ = err.throw_on_jvm(&mut env).map_err(|err| { diff --git a/zenoh-jni/src/reply.rs b/zenoh-jni/src/reply.rs index 753dd178..f3660a03 100644 --- a/zenoh-jni/src/reply.rs +++ b/zenoh-jni/src/reply.rs @@ -26,8 +26,8 @@ use zenoh::{ value::Value, }; -use crate::errors::Error; use crate::errors::Result; +use crate::{errors::Error, utils::attachment_to_vec}; pub(crate) fn on_reply( mut env: JNIEnv, @@ -58,11 +58,23 @@ fn on_reply_success( || (0, false), |timestamp| (timestamp.get_time().as_u64(), true), ); + + let attachment_bytes = match sample.attachment.map_or_else( + || env.byte_array_from_slice(&[]), + |attachment| env.byte_array_from_slice(attachment_to_vec(attachment).as_slice()), + ) { + Ok(byte_array) => Ok(byte_array), + Err(err) => Err(Error::Jni(format!( + "Error processing attachment of reply: {}.", + err + ))), + }?; + let key_expr_ptr = Arc::into_raw(Arc::new(sample.key_expr)); let result = match env.call_method( callback_global_ref, "run", - "(Ljava/lang/String;ZJ[BIIJZ)V", + "(Ljava/lang/String;ZJ[BIIJZ[B)V", &[ JValue::from(&zenoh_id), JValue::from(true), @@ -72,6 +84,7 @@ fn on_reply_success( JValue::from(kind), JValue::from(timestamp as i64), JValue::from(is_valid), + JValue::from(&attachment_bytes), ], ) { Ok(_) => Ok(()), diff --git a/zenoh-jni/src/session.rs b/zenoh-jni/src/session.rs index 02d498e1..cb4803e6 100644 --- a/zenoh-jni/src/session.rs +++ b/zenoh-jni/src/session.rs @@ -19,7 +19,10 @@ use crate::query::{decode_consolidation, decode_query_target}; use crate::queryable::declare_queryable; use crate::reply::on_reply; use crate::subscriber::declare_subscriber; -use crate::utils::{decode_string, get_callback_global_ref, get_java_vm, load_on_close}; +use crate::utils::{ + decode_byte_array, decode_string, get_callback_global_ref, get_java_vm, load_on_close, + vec_to_attachment, +}; use crate::value::decode_value; use jni::objects::{JByteArray, JClass, JObject, JString}; @@ -262,6 +265,7 @@ pub unsafe extern "C" fn Java_io_zenoh_jni_JNISession_declarePublisherViaJNI( /// - `congestion_control`: The [CongestionControl] mechanism specified. /// - `priority`: The [Priority] mechanism specified. /// - `sample_kind`: The [SampleKind] of the put operation. +/// - `attachment`: Optional attachment encoded into a byte array. May be null. /// /// Safety: /// - The function is marked as unsafe due to raw pointer manipulation and JNI interaction. @@ -283,6 +287,7 @@ pub unsafe extern "C" fn Java_io_zenoh_jni_JNISession_putViaJNI( congestion_control: jint, priority: jint, sample_kind: jint, + attachment: JByteArray, ) { let session = Arc::from_raw(session_ptr); let key_expr = Arc::from_raw(key_expr_ptr); @@ -295,6 +300,7 @@ pub unsafe extern "C" fn Java_io_zenoh_jni_JNISession_putViaJNI( congestion_control, priority, sample_kind, + attachment, ) { Ok(_) => {} Err(err) => { @@ -520,6 +526,7 @@ pub unsafe extern "C" fn Java_io_zenoh_jni_JNISession_undeclareKeyExprViaJNI( /// - `timeout_ms`: The timeout in milliseconds. /// - `target`: The [QueryTarget] as the ordinal of the enum. /// - `consolidation`: The [ConsolidationMode] as the ordinal of the enum. +/// - `attachment`: An optional attachment encoded into a byte array. /// /// Safety: /// - The function is marked as unsafe due to raw pointer manipulation and JNI interaction. @@ -544,6 +551,7 @@ pub unsafe extern "C" fn Java_io_zenoh_jni_JNISession_getViaJNI( timeout_ms: jlong, target: jint, consolidation: jint, + attachment: JByteArray, ) { let session = Arc::from_raw(session_ptr); let key_expr = Arc::from_raw(key_expr); @@ -558,6 +566,7 @@ pub unsafe extern "C" fn Java_io_zenoh_jni_JNISession_getViaJNI( target, consolidation, None, + attachment, ) { Ok(_) => {} Err(err) => { @@ -590,6 +599,7 @@ pub unsafe extern "C" fn Java_io_zenoh_jni_JNISession_getViaJNI( /// - `consolidation`: The [ConsolidationMode] as the ordinal of the enum. /// - `payload`: The payload of the [Value] /// - `encoding`: The [Encoding] as the ordinal of the enum. +/// - `attachment`: An optional attachment encoded into a byte array. /// /// Safety: /// - The function is marked as unsafe due to raw pointer manipulation and JNI interaction. @@ -616,6 +626,7 @@ pub unsafe extern "C" fn Java_io_zenoh_jni_JNISession_getWithValueViaJNI( consolidation: jint, payload: JByteArray, encoding: jint, + attachment: JByteArray, ) { let session = Arc::from_raw(session_ptr); let key_expr = Arc::from_raw(key_expr_ptr); @@ -630,6 +641,7 @@ pub unsafe extern "C" fn Java_io_zenoh_jni_JNISession_getWithValueViaJNI( target, consolidation, Some((payload, encoding)), + attachment, ) { Ok(_) => {} Err(err) => { @@ -659,6 +671,7 @@ pub unsafe extern "C" fn Java_io_zenoh_jni_JNISession_getWithValueViaJNI( /// - `consolidation`: The [ConsolidationMode] as the ordinal of the enum. /// - `value_params`: Parameters of the value (payload as [JByteArray] and encoding as [jint]) to /// be set in case the get is performed "with value". +/// - `encoded_attachment`: An optional attachment encoded into a byte array. /// /// Returns: /// - A `Result` indicating the result of the `get` operation. @@ -675,6 +688,7 @@ fn on_get_query( target: jint, consolidation: jint, value_params: Option<(JByteArray, jint)>, + encoded_attachment: JByteArray, ) -> Result<()> { let java_vm = Arc::new(get_java_vm(env)?); let callback_global_ref = get_callback_global_ref(env, callback)?; @@ -715,6 +729,12 @@ fn on_get_query( binding = Some(value) } + if !encoded_attachment.is_null() { + let aux = decode_byte_array(env, encoded_attachment)?; + let attachment = vec_to_attachment(aux); + get_builder = get_builder.with_attachment(attachment); + } + get_builder .res() .map(|_| { diff --git a/zenoh-jni/src/subscriber.rs b/zenoh-jni/src/subscriber.rs index a1309add..ae99f351 100644 --- a/zenoh-jni/src/subscriber.rs +++ b/zenoh-jni/src/subscriber.rs @@ -22,8 +22,11 @@ use jni::{ use zenoh::prelude::r#sync::*; use zenoh::subscriber::Subscriber; -use crate::errors::{Error, Result}; use crate::utils::{get_callback_global_ref, get_java_vm, load_on_close}; +use crate::{ + errors::{Error, Result}, + utils::attachment_to_vec, +}; /// Frees the memory associated with a Zenoh subscriber raw pointer via JNI. /// @@ -113,11 +116,25 @@ pub(crate) unsafe fn declare_subscriber( |timestamp| (timestamp.get_time().as_u64(), true), ); + let attachment_bytes = match sample.attachment.map_or_else( + || env.byte_array_from_slice(&[]), + |attachment| env.byte_array_from_slice(attachment_to_vec(attachment).as_slice()), + ) { + Ok(byte_array) => byte_array, + Err(err) => { + log::error!( + "On subscriber callback error. Error processing attachment: {}.", + err.to_string() + ); + return; + } + }; + let key_expr_ptr = Arc::into_raw(Arc::new(sample.key_expr)); match env.call_method( &callback_global_ref, "run", - "(J[BIIJZ)V", + "(J[BIIJZ[B)V", &[ JValue::from(key_expr_ptr as jlong), JValue::from(&byte_array), @@ -125,6 +142,7 @@ pub(crate) unsafe fn declare_subscriber( JValue::from(kind), JValue::from(timestamp as i64), JValue::from(is_valid), + JValue::from(&attachment_bytes), ], ) { Ok(_) => {} diff --git a/zenoh-jni/src/utils.rs b/zenoh-jni/src/utils.rs index 03e886cd..71eebaf1 100644 --- a/zenoh-jni/src/utils.rs +++ b/zenoh-jni/src/utils.rs @@ -15,9 +15,10 @@ use std::sync::Arc; use jni::{ - objects::{JObject, JString}, + objects::{JByteArray, JObject, JString}, JNIEnv, JavaVM, }; +use zenoh::sample::{Attachment, AttachmentBuilder}; use crate::errors::{Error, Result}; @@ -49,6 +50,19 @@ pub(crate) fn get_callback_global_ref( }) } +/// Helper function to convert a JByteArray into a Vec. +pub(crate) fn decode_byte_array(env: &JNIEnv<'_>, payload: JByteArray) -> Result> { + let payload_len = env + .get_array_length(&payload) + .map(|length| length as usize) + .map_err(|err| Error::Jni(err.to_string()))?; + let mut buff = vec![0; payload_len]; + env.get_byte_array_region(payload, 0, &mut buff[..]) + .map_err(|err| Error::Jni(err.to_string()))?; + let buff: Vec = unsafe { std::mem::transmute::, Vec>(buff) }; + Ok(buff) +} + /// A type that calls a function when dropped pub(crate) struct CallOnDrop(core::mem::MaybeUninit); impl CallOnDrop { @@ -98,3 +112,62 @@ pub(crate) fn load_on_close( } }) } + +/// This function is used in conjunction with the Kotlin function +/// `decodeAttachment(attachmentBytes: ByteArray): Attachment` which takes a byte array with the +/// format , repeating this +/// pattern for as many pairs there are in the attachment. +/// +/// The kotlin function expects both key size and value size to be i32 integers expressed with +/// little endian format. +/// +pub(crate) fn attachment_to_vec(attachment: Attachment) -> Vec { + let mut buffer: Vec = Vec::new(); + for (key, value) in attachment.iter() { + buffer.extend((key.len() as i32).to_le_bytes()); + buffer.extend(&key[..]); + buffer.extend((value.len() as i32).to_le_bytes()); + buffer.extend(&value[..]); + } + buffer +} + +/// This function is used in conjunction with the Kotlin function +/// `encodeAttachment(attachment: Attachment): ByteArray` which converts the attachment into a +/// ByteArray with the format , repeating this +/// pattern for as many pairs there are in the attachment. +/// +/// Both key size and value size are i32 integers with little endian format. +/// +pub(crate) fn vec_to_attachment(bytes: Vec) -> Attachment { + let mut builder = AttachmentBuilder::new(); + let mut idx = 0; + let i32_size = std::mem::size_of::(); + let mut slice_size; + + while idx < bytes.len() { + slice_size = i32::from_le_bytes( + bytes[idx..idx + i32_size] + .try_into() + .expect("Error decoding i32 while processing attachment."), //This error should never happen. + ); + idx += i32_size; + + let key = &bytes[idx..idx + slice_size as usize]; + idx += slice_size as usize; + + slice_size = i32::from_le_bytes( + bytes[idx..idx + i32_size] + .try_into() + .expect("Error decoding i32 while processing attachment."), //This error should never happen. + ); + idx += i32_size; + + let value = &bytes[idx..idx + slice_size as usize]; + idx += slice_size as usize; + + builder.insert(key, value); + } + + builder.build() +} diff --git a/zenoh-jni/src/value.rs b/zenoh-jni/src/value.rs index 3611c45b..d4fa030e 100644 --- a/zenoh-jni/src/value.rs +++ b/zenoh-jni/src/value.rs @@ -12,7 +12,7 @@ // ZettaScale Zenoh Team, // -use crate::errors::{Error, Result}; +use crate::{errors::Result, utils::decode_byte_array}; use jni::{objects::JByteArray, JNIEnv}; use zenoh::{ buffers::{writer::Writer, ZBuf}, @@ -28,16 +28,7 @@ pub(crate) fn build_value(payload: &[u8], encoding: KnownEncoding) -> Value { } pub(crate) fn decode_value(env: &JNIEnv<'_>, payload: JByteArray, encoding: i32) -> Result { - let payload_len = env - .get_array_length(&payload) - .map(|length| length as usize) - .map_err(|err| Error::Jni(err.to_string()))?; - - let mut buff = vec![0; payload_len]; - env.get_byte_array_region(payload, 0, &mut buff[..]) - .map_err(|err| Error::Jni(err.to_string()))?; - - let buff: Vec = buff.iter().map(|&x| x as u8).collect(); + let buff = decode_byte_array(env, payload)?; let encoding = match KnownEncoding::try_from(encoding as u8) { Ok(encoding) => encoding, Err(_) => { diff --git a/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/Session.kt b/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/Session.kt index c8c73ffa..de0bfd06 100644 --- a/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/Session.kt +++ b/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/Session.kt @@ -24,6 +24,7 @@ import io.zenoh.publication.Put import io.zenoh.query.* import io.zenoh.queryable.Query import io.zenoh.queryable.Queryable +import io.zenoh.sample.Attachment import io.zenoh.sample.Sample import io.zenoh.selector.Selector import io.zenoh.subscriber.Reliability @@ -420,10 +421,11 @@ class Session private constructor(private val config: Config) : AutoCloseable { timeout: Duration, target: QueryTarget, consolidation: ConsolidationMode, - value: Value? + value: Value?, + attachment: Attachment?, ): Result { return jniSession?.run { - performGet(selector, callback, onClose, receiver, timeout, target, consolidation, value) + performGet(selector, callback, onClose, receiver, timeout, target, consolidation, value, attachment) } ?: Result.failure(sessionClosedException) } diff --git a/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/jni/JNIPublisher.kt b/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/jni/JNIPublisher.kt index 6e23031b..9182952b 100644 --- a/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/jni/JNIPublisher.kt +++ b/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/jni/JNIPublisher.kt @@ -18,30 +18,50 @@ import io.zenoh.* import io.zenoh.prelude.SampleKind import io.zenoh.publication.CongestionControl import io.zenoh.publication.Priority +import io.zenoh.sample.Attachment import io.zenoh.value.Value /** - * Adapter class to handle the interactions with Zenoh through JNI for a [Publisher]. + * Adapter class to handle the interactions with Zenoh through JNI for a [io.zenoh.publication.Publisher]. * * @property ptr: raw pointer to the underlying native Publisher. */ internal class JNIPublisher(private val ptr: Long) { /** - * Put value through the publisher. + * Put operation. * * @param value The [Value] to be put. + * @param attachment Optional [Attachment]. */ - fun put(value: Value): Result = runCatching { - putViaJNI(value.payload, value.encoding.knownEncoding.ordinal, ptr) + fun put(value: Value, attachment: Attachment?): Result = runCatching { + putViaJNI(value.payload, value.encoding.knownEncoding.ordinal, attachment?.let { encodeAttachment(it) }, ptr) } - fun write(kind: SampleKind, value: Value): Result = runCatching { - writeViaJNI(value.payload, value.encoding.knownEncoding.ordinal, kind.ordinal, ptr) + /** + * Write operation. + * + * @param kind The [SampleKind]. + * @param value The [Value] to be written. + * @param attachment Optional [Attachment]. + */ + fun write(kind: SampleKind, value: Value, attachment: Attachment?): Result = runCatching { + writeViaJNI( + value.payload, + value.encoding.knownEncoding.ordinal, + kind.ordinal, + attachment?.let { encodeAttachment(it) }, + ptr + ) } - fun delete(): Result = runCatching { - deleteViaJNI(ptr) + /** + * Delete operation. + * + * @param attachment Optional [Attachment]. + */ + fun delete(attachment: Attachment?): Result = runCatching { + deleteViaJNI(attachment?.let { encodeAttachment(it) }, ptr) } /** @@ -100,13 +120,17 @@ internal class JNIPublisher(private val ptr: Long) { /** Puts through the native Publisher. */ @Throws(Exception::class) - private external fun putViaJNI(valuePayload: ByteArray, valueEncoding: Int, ptr: Long) + private external fun putViaJNI( + valuePayload: ByteArray, valueEncoding: Int, encodedAttachment: ByteArray?, ptr: Long + ) @Throws(Exception::class) - private external fun writeViaJNI(payload: ByteArray, encoding: Int, sampleKind: Int, ptr: Long) + private external fun writeViaJNI( + payload: ByteArray, encoding: Int, sampleKind: Int, encodedAttachment: ByteArray?, ptr: Long + ) @Throws(Exception::class) - private external fun deleteViaJNI(ptr: Long) + private external fun deleteViaJNI(encodedAttachment: ByteArray?, ptr: Long) /** Frees the underlying native Publisher. */ private external fun freePtrViaJNI(ptr: Long) diff --git a/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/jni/JNIQuery.kt b/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/jni/JNIQuery.kt index 4f1440d5..9ce20202 100644 --- a/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/jni/JNIQuery.kt +++ b/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/jni/JNIQuery.kt @@ -36,6 +36,7 @@ internal class JNIQuery(private val ptr: Long) { sample.kind.ordinal, timestampEnabled, if (timestampEnabled) sample.timestamp!!.ntpValue() else 0, + sample.attachment?.let { encodeAttachment(it) }, ) } @@ -55,7 +56,8 @@ internal class JNIQuery(private val ptr: Long) { valueEncoding: Int, sampleKind: Int, timestampEnabled: Boolean, - timestampNtp64: Long + timestampNtp64: Long, + attachment: ByteArray?, ) @Throws(Exception::class) diff --git a/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/jni/JNISession.kt b/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/jni/JNISession.kt index 0b199f16..96a81f16 100644 --- a/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/jni/JNISession.kt +++ b/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/jni/JNISession.kt @@ -29,6 +29,7 @@ import io.zenoh.publication.Put import io.zenoh.query.* import io.zenoh.queryable.Query import io.zenoh.queryable.Queryable +import io.zenoh.sample.Attachment import io.zenoh.sample.Sample import io.zenoh.selector.Selector import io.zenoh.subscriber.Reliability @@ -75,13 +76,15 @@ internal class JNISession { keyExpr: KeyExpr, callback: Callback, onClose: () -> Unit, receiver: R?, reliability: Reliability ): Result> = runCatching { val subCallback = - JNISubscriberCallback { keyExprPtr, payload, encoding, kind, timestampNTP64, timestampIsValid -> + JNISubscriberCallback { keyExprPtr, payload, encoding, kind, timestampNTP64, timestampIsValid, attachmentBytes -> val timestamp = if (timestampIsValid) TimeStamp(timestampNTP64) else null + val attachment = attachmentBytes.takeIf { it.isNotEmpty() }?.let { decodeAttachment(it) } val sample = Sample( KeyExpr(JNIKeyExpr(keyExprPtr)), Value(payload, Encoding(KnownEncoding.fromInt(encoding))), SampleKind.fromInt(kind), - timestamp + timestamp, + attachment ) callback.run(sample) } @@ -95,12 +98,13 @@ internal class JNISession { keyExpr: KeyExpr, callback: Callback, onClose: () -> Unit, receiver: R?, complete: Boolean ): Result> = runCatching { val queryCallback = - JNIQueryableCallback { keyExprPtr: Long, selectorParams: String, withValue: Boolean, payload: ByteArray?, encoding: Int, queryPtr: Long -> + JNIQueryableCallback { keyExprPtr: Long, selectorParams: String, withValue: Boolean, payload: ByteArray?, encoding: Int, attachmentBytes: ByteArray, queryPtr: Long -> val jniQuery = JNIQuery(queryPtr) val keyExpression = KeyExpr(JNIKeyExpr(keyExprPtr)) val selector = Selector(keyExpression, selectorParams) val value: Value? = if (withValue) Value(payload!!, Encoding(KnownEncoding.fromInt(encoding))) else null - val query = Query(keyExpression, selector, value, jniQuery) + val decodedAttachment = attachmentBytes.takeIf { it.isNotEmpty() }?.let { decodeAttachment(it) } + val query = Query(keyExpression, selector, value, decodedAttachment, jniQuery) callback.run(query) } val queryableRawPtr = @@ -116,17 +120,20 @@ internal class JNISession { timeout: Duration, target: QueryTarget, consolidation: ConsolidationMode, - value: Value? + value: Value?, + attachment: Attachment? ): Result = runCatching { val getCallback = - JNIGetCallback { replierId: String, success: Boolean, keyExprPtr: Long, payload: ByteArray, encoding: Int, kind: Int, timestampNTP64: Long, timestampIsValid: Boolean -> + JNIGetCallback { replierId: String, success: Boolean, keyExprPtr: Long, payload: ByteArray, encoding: Int, kind: Int, timestampNTP64: Long, timestampIsValid: Boolean, attachmentBytes: ByteArray -> if (success) { val timestamp = if (timestampIsValid) TimeStamp(timestampNTP64) else null + val decodedAttachment = attachmentBytes.takeIf { it.isNotEmpty() }?.let { decodeAttachment(it) } val sample = Sample( KeyExpr(JNIKeyExpr(keyExprPtr)), Value(payload, Encoding(KnownEncoding.fromInt(encoding))), SampleKind.fromInt(kind), - timestamp + timestamp, + decodedAttachment ) val reply = Reply.Success(replierId, sample) callback.run(reply) @@ -146,6 +153,7 @@ internal class JNISession { timeout.toMillis(), target.ordinal, consolidation.ordinal, + attachment?.let { encodeAttachment(it) } ) } else { getWithValueViaJNI( @@ -159,6 +167,7 @@ internal class JNISession { consolidation.ordinal, value.payload, value.encoding.knownEncoding.ordinal, + attachment?.let { encodeAttachment(it) } ) } receiver @@ -186,9 +195,9 @@ internal class JNISession { put.congestionControl.ordinal, put.priority.value, put.kind.ordinal, + put.attachment?.let { encodeAttachment(it) } ) } - @Throws(Exception::class) private external fun openSessionViaJNI(configFilePath: String): Long @@ -237,6 +246,7 @@ internal class JNISession { timeoutMs: Long, target: Int, consolidation: Int, + attachmentBytes: ByteArray?, ) @Throws(Exception::class) @@ -250,7 +260,8 @@ internal class JNISession { target: Int, consolidation: Int, payload: ByteArray, - encoding: Int + encoding: Int, + attachmentBytes: ByteArray? ) @Throws(Exception::class) @@ -262,5 +273,6 @@ internal class JNISession { congestionControl: Int, priority: Int, kind: Int, + attachmentBytes: ByteArray? ) } diff --git a/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/jni/JNIUtils.kt b/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/jni/JNIUtils.kt new file mode 100644 index 00000000..9c9bb5ae --- /dev/null +++ b/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/jni/JNIUtils.kt @@ -0,0 +1,74 @@ +// +// Copyright (c) 2023 ZettaScale Technology +// +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License 2.0 which is available at +// http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 +// which is available at https://www.apache.org/licenses/LICENSE-2.0. +// +// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 +// +// Contributors: +// ZettaScale Zenoh Team, +// + +package io.zenoh.jni + +import io.zenoh.sample.Attachment + +/** + * Encode attachment as a byte array. + */ +internal fun encodeAttachment(attachment: Attachment): ByteArray { + return attachment.values.map { + val key = it.first + val keyLength = key.size.toByteArray() + val value = it.second + val valueLength = value.size.toByteArray() + keyLength + key + valueLength + value + }.reduce { acc, bytes -> acc + bytes } +} + +/** + * Decode an attachment as a byte array, recreating the original [Attachment]. + */ +internal fun decodeAttachment(attachmentBytes: ByteArray): Attachment { + var idx = 0 + var sliceSize: Int + val pairs: MutableList> = mutableListOf() + while (idx < attachmentBytes.size) { + sliceSize = attachmentBytes.sliceArray(IntRange(idx, idx + Int.SIZE_BYTES - 1)).toInt() + idx += Int.SIZE_BYTES + + val key = attachmentBytes.sliceArray(IntRange(idx, idx + sliceSize - 1)) + idx += sliceSize + + sliceSize = attachmentBytes.sliceArray(IntRange(idx, idx + Int.SIZE_BYTES - 1)).toInt() + idx += Int.SIZE_BYTES + + val value = attachmentBytes.sliceArray(IntRange(idx, idx + sliceSize - 1)) + idx += sliceSize + + pairs.add(key to value) + } + return Attachment(pairs) +} + +/** + * Converts an integer into a byte array with little endian format. + */ +fun Int.toByteArray(): ByteArray { + val result = ByteArray(UInt.SIZE_BYTES) + (0 until UInt.SIZE_BYTES).forEach { + result[it] = this.shr(Byte.SIZE_BITS * it).toByte() + } + return result +} + +/** + * To int. The byte array is expected to be in Little Endian format. + * + * @return The integer value. + */ +fun ByteArray.toInt(): Int = + (((this[3].toUInt() and 0xFFu) shl 24) or ((this[2].toUInt() and 0xFFu) shl 16) or ((this[1].toUInt() and 0xFFu) shl 8) or (this[0].toUInt() and 0xFFu)).toInt() diff --git a/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/jni/callbacks/JNIGetCallback.kt b/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/jni/callbacks/JNIGetCallback.kt index 5adb1653..621eaf98 100644 --- a/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/jni/callbacks/JNIGetCallback.kt +++ b/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/jni/callbacks/JNIGetCallback.kt @@ -24,6 +24,7 @@ internal fun interface JNIGetCallback { encoding: Int, kind: Int, timestampNTP64: Long, - timestampIsValid: Boolean + timestampIsValid: Boolean, + attachment: ByteArray, ) } diff --git a/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/jni/callbacks/JNIQueryableCallback.kt b/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/jni/callbacks/JNIQueryableCallback.kt index 402d1cf4..813965aa 100644 --- a/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/jni/callbacks/JNIQueryableCallback.kt +++ b/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/jni/callbacks/JNIQueryableCallback.kt @@ -20,5 +20,6 @@ internal fun interface JNIQueryableCallback { withValue: Boolean, payload: ByteArray?, encoding: Int, + attachmentBytes: ByteArray, queryPtr: Long) } diff --git a/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/jni/callbacks/JNISubscriberCallback.kt b/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/jni/callbacks/JNISubscriberCallback.kt index fc0a4ca5..750888eb 100644 --- a/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/jni/callbacks/JNISubscriberCallback.kt +++ b/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/jni/callbacks/JNISubscriberCallback.kt @@ -21,6 +21,7 @@ internal fun interface JNISubscriberCallback { encoding: Int, kind: Int, timestampNTP64: Long, - timestampIsValid: Boolean + timestampIsValid: Boolean, + attachment: ByteArray, ) } diff --git a/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/publication/Delete.kt b/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/publication/Delete.kt index db907389..22e34e33 100644 --- a/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/publication/Delete.kt +++ b/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/publication/Delete.kt @@ -45,8 +45,8 @@ class Delete private constructor( value: Value, congestionControl: CongestionControl, priority: Priority, - kind: SampleKind -) : Put(keyExpr, value, congestionControl, priority, kind) { + kind: SampleKind, +) : Put(keyExpr, value, congestionControl, priority, kind, null) { companion object { /** diff --git a/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/publication/Publisher.kt b/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/publication/Publisher.kt index 3ca5dd0d..50a9da2a 100644 --- a/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/publication/Publisher.kt +++ b/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/publication/Publisher.kt @@ -19,6 +19,7 @@ import io.zenoh.exceptions.SessionException import io.zenoh.jni.JNIPublisher import io.zenoh.keyexpr.KeyExpr import io.zenoh.prelude.SampleKind +import io.zenoh.sample.Attachment import io.zenoh.value.Value /** @@ -74,14 +75,10 @@ class Publisher internal constructor( } /** Performs a PUT operation on the specified [keyExpr] with the specified [value]. */ - fun put(value: Value): Resolvable = Resolvable { - return@Resolvable jniPublisher?.put(value) ?: InvalidPublisherResult - } + fun put(value: Value) = Put(jniPublisher, value) /** Performs a PUT operation on the specified [keyExpr] with the specified string [value]. */ - fun put(value: String): Resolvable = Resolvable { - return@Resolvable jniPublisher?.put(Value(value)) ?: InvalidPublisherResult - } + fun put(value: String) = Put(jniPublisher, Value(value)) /** * Performs a WRITE operation on the specified [keyExpr] @@ -90,18 +87,14 @@ class Publisher internal constructor( * @param value The [Value] to send. * @return A [Resolvable] operation. */ - fun write(kind: SampleKind, value: Value): Resolvable = Resolvable { - return@Resolvable jniPublisher?.write(kind, value) ?: InvalidPublisherResult - } + fun write(kind: SampleKind, value: Value) = Write(jniPublisher, value, kind) /** * Performs a DELETE operation on the specified [keyExpr] * * @return A [Resolvable] operation. */ - fun delete(): Resolvable = Resolvable { - return@Resolvable jniPublisher?.delete() ?: InvalidPublisherResult - } + fun delete() = Delete(jniPublisher) /** Get congestion control policy. */ fun getCongestionControl(): CongestionControl { @@ -116,7 +109,7 @@ class Publisher internal constructor( * @param congestionControl: The [CongestionControl] policy. */ fun setCongestionControl(congestionControl: CongestionControl) { - jniPublisher?.setCongestionControl(congestionControl)?.onSuccess { this.congestionControl = congestionControl } + jniPublisher?.setCongestionControl(congestionControl)?.onSuccess { this.congestionControl = congestionControl } } /** Get priority policy. */ @@ -132,7 +125,7 @@ class Publisher internal constructor( * @param priority: The [Priority] policy. */ fun setPriority(priority: Priority) { - jniPublisher?.setPriority(priority)?.onSuccess { this.priority = priority } + jniPublisher?.setPriority(priority)?.onSuccess { this.priority = priority } } override fun isValid(): Boolean { @@ -148,11 +141,49 @@ class Publisher internal constructor( jniPublisher = null } - @Suppress("removal") protected fun finalize() { jniPublisher?.close() } + class Put internal constructor( + private var jniPublisher: JNIPublisher?, + val value: Value, + var attachment: Attachment? = null + ) : Resolvable { + + fun withAttachment(attachment: Attachment) = apply { this.attachment = attachment } + + override fun res(): Result = run { + jniPublisher?.put(value, attachment) ?: InvalidPublisherResult + } + } + + class Write internal constructor( + private var jniPublisher: JNIPublisher?, + val value: Value, + val sampleKind: SampleKind, + var attachment: Attachment? = null + ) : Resolvable { + + fun withAttachment(attachment: Attachment) = apply { this.attachment = attachment } + + override fun res(): Result = run { + jniPublisher?.write(sampleKind, value, attachment) ?: InvalidPublisherResult + } + } + + class Delete internal constructor( + private var jniPublisher: JNIPublisher?, + var attachment: Attachment? = null + ) : Resolvable { + + fun withAttachment(attachment: Attachment) = apply { this.attachment = attachment } + + override fun res(): Result = run { + jniPublisher?.delete(attachment) ?: InvalidPublisherResult + } + } + /** * Publisher Builder. * diff --git a/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/publication/Put.kt b/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/publication/Put.kt index af2fac17..f0a62c22 100644 --- a/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/publication/Put.kt +++ b/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/publication/Put.kt @@ -19,6 +19,7 @@ import io.zenoh.Session import io.zenoh.keyexpr.KeyExpr import io.zenoh.prelude.Encoding import io.zenoh.prelude.SampleKind +import io.zenoh.sample.Attachment import io.zenoh.value.Value /** @@ -47,13 +48,15 @@ import io.zenoh.value.Value * @property congestionControl The [CongestionControl] to be applied when routing the data. * @property priority The [Priority] of zenoh messages. * @property kind The [SampleKind] of the sample (put or delete). + * @property attachment An optional user [Attachment]. */ open class Put protected constructor( val keyExpr: KeyExpr, val value: Value, val congestionControl: CongestionControl, val priority: Priority, - val kind: SampleKind + val kind: SampleKind, + val attachment: Attachment? ) { companion object { @@ -81,6 +84,7 @@ open class Put protected constructor( * defaults to [CongestionControl.DROP] * @property priority The [Priority] of zenoh messages, defaults to [Priority.DATA]. * @property kind The [SampleKind] of the sample (put or delete), defaults to [SampleKind.PUT]. + * @property attachment Optional user [Attachment]. * @constructor Create a [Put] builder. */ class Builder internal constructor( @@ -89,7 +93,8 @@ open class Put protected constructor( private var value: Value, private var congestionControl: CongestionControl = CongestionControl.DROP, private var priority: Priority = Priority.DATA, - private var kind: SampleKind = SampleKind.PUT + private var kind: SampleKind = SampleKind.PUT, + private var attachment: Attachment? = null ): Resolvable { /** Change the [Encoding] of the written data. */ @@ -107,9 +112,12 @@ open class Put protected constructor( /** Change the [SampleKind] of the sample. If set to [SampleKind.DELETE], performs a delete operation. */ fun kind(kind: SampleKind) = apply { this.kind = kind } + /** Set an attachment to the put operation. */ + fun withAttachment(attachment: Attachment) = apply { this.attachment = attachment } + /** Resolves the put operation, returning a [Result]. */ override fun res(): Result = runCatching { - val put = Put(keyExpr, value, congestionControl, priority, kind) + val put = Put(keyExpr, value, congestionControl, priority, kind, attachment) session.run { resolvePut(keyExpr, put) } } } diff --git a/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/query/Get.kt b/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/query/Get.kt index 092a53ca..b0316ac7 100644 --- a/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/query/Get.kt +++ b/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/query/Get.kt @@ -18,6 +18,7 @@ import io.zenoh.handlers.Callback import io.zenoh.Session import io.zenoh.handlers.ChannelHandler import io.zenoh.handlers.Handler +import io.zenoh.sample.Attachment import io.zenoh.selector.Selector import io.zenoh.value.Value import kotlinx.coroutines.channels.Channel @@ -85,6 +86,7 @@ class Get private constructor() { private var target: QueryTarget = QueryTarget.BEST_MATCHING private var consolidation: ConsolidationMode = ConsolidationMode.NONE private var value: Value? = null + private var attachment: Attachment? = null private var onClose: (() -> Unit)? = null private constructor(other: Builder<*>, handler: Handler?) : this(other.session, other.selector) { @@ -102,6 +104,7 @@ class Get private constructor() { this.target = other.target this.consolidation = other.consolidation this.value = other.value + this.attachment = other.attachment this.onClose = other.onClose } @@ -138,6 +141,12 @@ class Get private constructor() { return this } + /** Specify an [Attachment]. */ + fun withAttachment(attachment: Attachment): Builder { + this.attachment = attachment + return this + } + /** * Specify an action to be invoked when the Get operation is over. * @@ -178,7 +187,8 @@ class Get private constructor() { timeout, target, consolidation, - value + value, + attachment ) } } diff --git a/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/query/Reply.kt b/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/query/Reply.kt index 49dc3996..b13e9bfb 100644 --- a/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/query/Reply.kt +++ b/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/query/Reply.kt @@ -20,6 +20,7 @@ import io.zenoh.sample.Sample import io.zenoh.prelude.SampleKind import io.zenoh.value.Value import io.zenoh.keyexpr.KeyExpr +import io.zenoh.sample.Attachment import io.zenoh.queryable.Query import org.apache.commons.net.ntp.TimeStamp @@ -108,6 +109,7 @@ abstract class Reply private constructor(val replierId: String) : ZenohType { private var kind = SampleKind.PUT private var timeStamp: TimeStamp? = null + private var attachment: Attachment? = null /** * Sets the [SampleKind] of the replied [Sample]. @@ -119,11 +121,16 @@ abstract class Reply private constructor(val replierId: String) : ZenohType { */ fun withTimeStamp(timeStamp: TimeStamp) = apply { this.timeStamp = timeStamp } + /** + * Appends an [Attachment] to the reply. + */ + fun withAttachment(attachment: Attachment) = apply { this.attachment = attachment } + /** * Constructs the reply sample with the provided parameters and triggers the reply to the query. */ override fun res(): Result { - val sample = Sample(keyExpr, value, kind, timeStamp) + val sample = Sample(keyExpr, value, kind, timeStamp, attachment) return query.reply(Success("", sample)).res() } } diff --git a/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/queryable/Query.kt b/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/queryable/Query.kt index 313606f8..54570d6a 100644 --- a/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/queryable/Query.kt +++ b/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/queryable/Query.kt @@ -22,6 +22,7 @@ import io.zenoh.exceptions.SessionException import io.zenoh.jni.JNIQuery import io.zenoh.keyexpr.KeyExpr import io.zenoh.query.Reply +import io.zenoh.sample.Attachment /** * Represents a Zenoh Query in Kotlin. @@ -31,6 +32,7 @@ import io.zenoh.query.Reply * @property keyExpr The key expression to which the query is associated. * @property selector The selector * @property value Optional value in case the received query was declared using "with query". + * @property attachment Optional attachment. * @property jniQuery Delegate object in charge of communicating with the underlying native code. * @constructor Instances of Query objects are only meant to be created through the JNI upon receiving * a query request. Therefore, the constructor is private. @@ -39,6 +41,7 @@ class Query internal constructor( val keyExpr: KeyExpr, val selector: Selector, val value: Value?, + val attachment: Attachment?, private var jniQuery: JNIQuery? ) : AutoCloseable, ZenohType { diff --git a/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/sample/Attachment.kt b/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/sample/Attachment.kt new file mode 100644 index 00000000..1da85f82 --- /dev/null +++ b/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/sample/Attachment.kt @@ -0,0 +1,60 @@ +// +// Copyright (c) 2023 ZettaScale Technology +// +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License 2.0 which is available at +// http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 +// which is available at https://www.apache.org/licenses/LICENSE-2.0. +// +// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 +// +// Contributors: +// ZettaScale Zenoh Team, +// + +package io.zenoh.sample + +/** + * Attachment + * + * An attachment consists of a list of non-unique ordered key value pairs, where keys are UTF-8 Strings and the values are bytes. + * Inserting at the same key multiple times leads to both values being transmitted for that key. + * + * Attachments can be added to a message sent through Zenoh while performing puts, queries and replies. + * + * Using attachments will result in performance loss. + * + * @property values + * @constructor Create empty Attachment + */ +class Attachment internal constructor(val values: List>) { + + class Builder { + + private val values: MutableList> = mutableListOf() + + fun add(key: ByteArray, value: ByteArray) = apply { + values.add(key to value) + } + + fun add(key: String, value: ByteArray) = apply { + values.add(key.toByteArray() to value) + } + + fun add(key: String, value: String) = apply { + values.add(key.toByteArray() to value.toByteArray()) + } + + fun addAll(elements: Collection>) { + values.addAll(elements) + } + + fun addAll(elements: Iterable>) { + values.addAll(elements) + } + + fun res(): Attachment { + return Attachment(values) + } + } +} diff --git a/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/sample/Sample.kt b/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/sample/Sample.kt index e84cd96d..5762d4cd 100644 --- a/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/sample/Sample.kt +++ b/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/sample/Sample.kt @@ -30,12 +30,14 @@ import org.apache.commons.net.ntp.TimeStamp * @property value The [Value] of the sample. * @property kind The [SampleKind] of the sample. * @property timestamp Optional [TimeStamp]. + * @property attachment Optional [Attachment]. */ class Sample( val keyExpr: KeyExpr, val value: Value, val kind: SampleKind, - val timestamp: TimeStamp? + val timestamp: TimeStamp?, + val attachment: Attachment? = null ): ZenohType { override fun toString(): String { return if (kind == SampleKind.DELETE) "$kind($keyExpr)" else "$kind($keyExpr: $value)" diff --git a/zenoh-kotlin/src/commonTest/kotlin/io/zenoh/PutTest.kt b/zenoh-kotlin/src/commonTest/kotlin/io/zenoh/PutTest.kt index d7dd7134..a0b5dc6f 100644 --- a/zenoh-kotlin/src/commonTest/kotlin/io/zenoh/PutTest.kt +++ b/zenoh-kotlin/src/commonTest/kotlin/io/zenoh/PutTest.kt @@ -31,7 +31,7 @@ class PutTest { } @Test - fun subscriber_receivesPutValue() { + fun putTest() { val session = Session.open().getOrThrow() var receivedSample: Sample? = null val keyExpr = TEST_KEY_EXP.intoKeyExpr().getOrThrow() diff --git a/zenoh-kotlin/src/commonTest/kotlin/io/zenoh/UserAttachmentTest.kt b/zenoh-kotlin/src/commonTest/kotlin/io/zenoh/UserAttachmentTest.kt new file mode 100644 index 00000000..8aee8dae --- /dev/null +++ b/zenoh-kotlin/src/commonTest/kotlin/io/zenoh/UserAttachmentTest.kt @@ -0,0 +1,247 @@ +// +// Copyright (c) 2023 ZettaScale Technology +// +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License 2.0 which is available at +// http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 +// which is available at https://www.apache.org/licenses/LICENSE-2.0. +// +// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 +// +// Contributors: +// ZettaScale Zenoh Team, +// + +package io.zenoh + +import io.zenoh.jni.decodeAttachment +import io.zenoh.jni.encodeAttachment +import io.zenoh.jni.toByteArray +import io.zenoh.jni.toInt +import io.zenoh.keyexpr.intoKeyExpr +import io.zenoh.prelude.Encoding +import io.zenoh.prelude.KnownEncoding +import io.zenoh.prelude.SampleKind +import io.zenoh.query.Reply +import io.zenoh.sample.Attachment +import io.zenoh.sample.Sample +import io.zenoh.value.Value +import java.time.Duration +import kotlin.test.* + +class UserAttachmentTest { + + companion object { + val value = Value("test", Encoding(KnownEncoding.TEXT_PLAIN)) + val keyExpr = "example/testing/attachment".intoKeyExpr().getOrThrow() + val attachmentPairs = arrayListOf( + "key1" to "value1", "key2" to "value2", "key3" to "value3", "repeatedKey" to "value1", "repeatedKey" to "value2" + ) + val attachment = + Attachment(attachmentPairs.map { it.first.encodeToByteArray() to it.second.encodeToByteArray() }) + } + + private fun assertAttachmentOk(attachment: Attachment?) { + assertNotNull(attachment) + val receivedPairs = attachment.values + assertEquals(attachmentPairs.size, receivedPairs.size) + for ((index, receivedPair) in receivedPairs.withIndex()) { + assertEquals(attachmentPairs[index].first, receivedPair.first.decodeToString()) + assertEquals(attachmentPairs[index].second, receivedPair.second.decodeToString()) + } + } + + @Test + fun putWithAttachmentTest() { + var receivedSample: Sample? = null + val session = Session.open().getOrThrow() + + session.declareSubscriber(keyExpr).with { sample -> receivedSample = sample }.res() + session.put(keyExpr, value).withAttachment(attachment).res() + session.close() + + assertNotNull(receivedSample) + assertEquals(value, receivedSample!!.value) + assertAttachmentOk(receivedSample!!.attachment) + } + + @Test + fun publisherPutWithAttachmentTest() { + val session = Session.open().getOrThrow() + + var receivedSample: Sample? = null + val publisher = session.declarePublisher(keyExpr).res().getOrThrow() + session.declareSubscriber(keyExpr).with { sample -> + receivedSample = sample + }.res() + + publisher.put("test").withAttachment(attachment).res() + session.close() + + assertAttachmentOk(receivedSample!!.attachment!!) + } + + @Test + fun publisherPutWithoutAttachmentTest() { + val session = Session.open().getOrThrow() + + var receivedSample: Sample? = null + val publisher = session.declarePublisher(keyExpr).res().getOrThrow() + session.declareSubscriber(keyExpr).with { sample -> + receivedSample = sample + }.res() + publisher.put("test").res() + session.close() + + assertNotNull(receivedSample) + assertNull(receivedSample!!.attachment) + } + + @Test + fun publisherWriteWithAttachmentTest() { + val session = Session.open().getOrThrow() + + var receivedSample: Sample? = null + val publisher = session.declarePublisher(keyExpr).res().getOrThrow() + session.declareSubscriber(keyExpr).with { sample -> + receivedSample = sample + }.res() + + publisher.write(SampleKind.PUT, Value("test")).withAttachment(attachment).res() + session.close() + + assertAttachmentOk(receivedSample!!.attachment!!) + } + + @Test + fun publisherWriteWithoutAttachmentTest() { + val session = Session.open().getOrThrow() + + var receivedSample: Sample? = null + val publisher = session.declarePublisher(keyExpr).res().getOrThrow() + session.declareSubscriber(keyExpr).with { sample -> + receivedSample = sample + }.res() + + publisher.write(SampleKind.PUT, Value("test")).res() + session.close() + + assertNotNull(receivedSample) + assertNull(receivedSample!!.attachment) + } + + @Test + fun publisherDeleteWithAttachmentTest() { + val session = Session.open().getOrThrow() + + var receivedSample: Sample? = null + val publisher = session.declarePublisher(keyExpr).res().getOrThrow() + session.declareSubscriber(keyExpr).with { sample -> + receivedSample = sample + }.res() + + publisher.delete().withAttachment(attachment).res() + session.close() + + assertAttachmentOk(receivedSample!!.attachment!!) + } + + @Test + fun publisherDeleteWithoutAttachmentTest() { + val session = Session.open().getOrThrow() + + var receivedSample: Sample? = null + val publisher = session.declarePublisher(keyExpr).res().getOrThrow() + session.declareSubscriber(keyExpr).with { sample -> + receivedSample = sample + }.res() + + publisher.delete().res() + session.close() + + assertNotNull(receivedSample) + assertNull(receivedSample!!.attachment) + } + + @Test + fun queryWithAttachmentTest() { + val session = Session.open().getOrThrow() + + var receivedAttachment: Attachment? = null + + val queryable = session.declareQueryable(keyExpr).with { query -> + receivedAttachment = query.attachment + query.reply(keyExpr).success("test").res() + }.res().getOrThrow() + + session.get(keyExpr).with {}.withAttachment(attachment).timeout(Duration.ofMillis(1000)).res() + Thread.sleep(1000) + + queryable.close() + session.close() + assertAttachmentOk(receivedAttachment) + } + + @Test + fun queryReplyWithAttachmentTest() { + val session = Session.open().getOrThrow() + + var receivedAttachment: Attachment? = null + + val queryable = session.declareQueryable(keyExpr).with { query -> + query.reply(keyExpr).success("test").withAttachment(attachment).res() + }.res().getOrThrow() + + session.get(keyExpr).with { reply -> + (reply as Reply.Success) + receivedAttachment = reply.sample.attachment + }.timeout(Duration.ofMillis(1000)).res() + + Thread.sleep(1000) + + queryable.close() + session.close() + assertAttachmentOk(receivedAttachment) + } + + @Test + fun queryReplyWithoutAttachmentTest() { + var reply: Reply? = null + val session = Session.open().getOrThrow() + val queryable = session.declareQueryable(keyExpr).with { query -> + query.reply(keyExpr).success("test").res() + }.res().getOrThrow() + + session.get(keyExpr).with { + reply = it + }.timeout(Duration.ofMillis(1000)).res() + + Thread.sleep(1000) + + queryable.close() + session.close() + + assertNotNull(reply) + assertTrue(reply is Reply.Success) + assertNull((reply as Reply.Success).sample.attachment) + } + + @Test + fun encodeAndDecodeNumbersTest() { + val numbers: List = arrayListOf(0, 1, -1, 12345, -12345, 123567, 123456789, -123456789) + + for (number in numbers) { + val bytes = number.toByteArray() + val decodedNumber: Int = bytes.toInt() + assertEquals(number, decodedNumber) + } + } + + @Test + fun encodeAndDecodeAttachmentTest() { + val encodedAttachment = encodeAttachment(attachment) + val decodedAttachment = decodeAttachment(encodedAttachment) + + assertAttachmentOk(decodedAttachment) + } +}