diff --git a/Cargo.lock b/Cargo.lock index 8f75d3d4..4248b85b 100644 --- a/Cargo.lock +++ b/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,9 +30,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.7" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", "once_cell", @@ -42,9 +42,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.0.5" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c378d78423fdad8089616f827526ee33c19f2fddbd5de1629152c9593ba4783" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] @@ -57,9 +57,9 @@ checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" [[package]] name = "anstream" -version = "0.6.12" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b09b5178381e0874812a9b157f7fe84982617e48f71f4e3235482775e5b540" +checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" dependencies = [ "anstyle", "anstyle-parse", @@ -77,20 +77,20 @@ 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]] @@ -105,9 +105,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.75" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" [[package]] name = "array-init" @@ -126,32 +126,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.3.0", + "event-listener-strategy 0.5.1", + "futures-core", + "pin-project-lite", +] + [[package]] name = "async-executor" -version = "1.5.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fa3dc5f2a8564f07759c008b9109dc0d39de92a88d5588b8a5036d286383afb" +checksum = "5f98c37cf288e302c16ef6c8472aad1e034c6c84ce5ea7b8101c98eb4a802fee" dependencies = [ - "async-lock", + "async-lock 3.3.0", "async-task", "concurrent-queue", - "fastrand", - "futures-lite", + "fastrand 2.0.2", + "futures-lite 2.3.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.2", + "async-lock 3.3.0", "blocking", - "futures-lite", + "futures-lite 2.3.0", "once_cell", "tokio", ] @@ -162,20 +175,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.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcccb0f599cfa2f8ace422d3555572f47424da5648a4382a9dd0310ff8210884" +dependencies = [ + "async-lock 3.3.0", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite 2.3.0", + "parking", + "polling 3.6.0", + "rustix 0.38.32", + "slab", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "async-lock" version = "2.8.0" @@ -185,21 +217,49 @@ 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.32", + "windows-sys 0.48.0", +] + +[[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.2", + "async-lock 2.8.0", + "atomic-waker", + "cfg-if", + "futures-core", + "futures-io", + "rustix 0.38.32", + "signal-hook-registry", + "slab", "windows-sys 0.48.0", ] @@ -209,16 +269,16 @@ version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" dependencies = [ - "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", @@ -232,38 +292,38 @@ 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.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" +checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.58", ] [[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 = "autocfg" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" dependencies = [ "addr2line", "cc", @@ -276,9 +336,15 @@ dependencies = [ [[package]] name = "base64" -version = "0.21.4" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" +checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" [[package]] name = "base64ct" @@ -294,9 +360,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "block-buffer" @@ -309,36 +375,37 @@ 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.2", + "futures-io", + "futures-lite 2.3.0", + "piper", + "tracing", ] [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" [[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" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] name = "cache-padded" @@ -348,12 +415,9 @@ checksum = "981520c98f422fcc584dc1a95c334e6953900b9106bc47a9839b81790009eb21" [[package]] name = "cc" -version = "1.0.83" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "libc", -] +checksum = "1fd97381a8cc6493395a5afc4c691c1084b3768db713b73aa215217aa245d153" [[package]] name = "cfg-if" @@ -379,33 +443,33 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[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", @@ -414,9 +478,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", @@ -424,27 +488,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" @@ -458,15 +519,15 @@ 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" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", "pem-rfc7468", @@ -508,9 +569,9 @@ dependencies = [ [[package]] name = "dyn-clone" -version = "1.0.13" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbfc4744c1b8f2a09adc0e55242f60b1af195d88596bd8700be74418c056c555" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "env_filter" @@ -524,22 +585,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.10.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" -dependencies = [ - "humantime", - "is-terminal", - "log", - "regex", - "termcolor", -] - -[[package]] -name = "env_logger" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c012a26a7f605efc424dd53697843a72be7dc86ad2d01f7814337794a12231d" +checksum = "38b35839ba51819680ba087cd351788c9a3c476841207e0b8cee0b04722343b9" dependencies = [ "anstream", "anstyle", @@ -556,42 +604,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 = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "event-listener" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +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.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "770d968249b5d99410d61f5bf89057f3199a077a04d087092f58e7d10692baae" +checksum = "6d9944b8ca13534cdfb2800775f8dd4902ff3fc75a50101466decadfdf322a24" 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.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "332f51cb23d20b0de8458b86580878211da09bcd4503cb579c225b3d124cabb3" +dependencies = [ + "event-listener 5.3.0", + "pin-project-lite", +] + [[package]] name = "fastrand" version = "1.9.0" @@ -601,6 +680,12 @@ dependencies = [ "instant", ] +[[package]] +name = "fastrand" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" + [[package]] name = "fixedbitset" version = "0.4.2" @@ -627,18 +712,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", @@ -651,9 +736,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", @@ -661,15 +746,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", @@ -678,9 +763,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" @@ -688,7 +773,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", @@ -697,34 +782,47 @@ dependencies = [ "waker-fn", ] +[[package]] +name = "futures-lite" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" +dependencies = [ + "fastrand 2.0.2", + "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.58", ] [[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", @@ -750,9 +848,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "a06fddc2749e0528d2813f95e050e87e52c8cbbae56223b9babf73b3e53b0cc6" dependencies = [ "cfg-if", "js-sys", @@ -763,30 +861,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.58", ] [[package]] @@ -801,6 +897,12 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "half" +version = "1.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b43ede17f21864e81be2fa654110bf1e793774238d86ef8555c37e6519c0403" + [[package]] name = "hashbrown" version = "0.13.2" @@ -812,19 +914,25 @@ 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", ] +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + [[package]] name = "hermit-abi" -version = "0.3.2" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hmac" @@ -837,18 +945,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 = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b32afd38673a8016f7c9ae69e5af41a58f81b1d31689040f2f1959594ce194ea" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ "bytes", "fnv", @@ -869,9 +977,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", @@ -879,19 +987,19 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.0" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.0", + "hashbrown 0.14.3", ] [[package]] name = "indoc" -version = "1.0.9" +version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa799dd5ed20a7e349f3b4639aa80d74549c81716d9ec4f994c9b5815598306" +checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" [[package]] name = "inout" @@ -932,27 +1040,22 @@ dependencies = [ ] [[package]] -name = "is-terminal" -version = "0.4.9" +name = "iter-read" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" -dependencies = [ - "hermit-abi", - "rustix 0.38.13", - "windows-sys 0.48.0", -] +checksum = "c397ca3ea05ad509c4ec451fea28b4771236a376ca1c69fd5143aae0cf8f93c4" [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -970,9 +1073,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", ] @@ -1012,19 +1115,29 @@ checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libloading" -version = "0.8.0" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d580318f95776505201b28cf98eb1fa5e4be3b689633ba6a3e6cd880ff22d8cb" +checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" dependencies = [ "cfg-if", - "windows-sys 0.48.0", + "windows-targets 0.52.4", ] [[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.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.5.0", + "libc", +] [[package]] name = "linux-raw-sys" @@ -1034,15 +1147,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", @@ -1050,42 +1163,42 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" dependencies = [ "value-bag", ] [[package]] name = "lz4_flex" -version = "0.11.1" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ea9b256699eda7b0387ffbc776dd625e28bde3918446381781245b7a50349d8" +checksum = "75761162ae2b0e580d7e7c390558127e5f01b4194debd6221fd8c207fc80e3f5" dependencies = [ "twox-hash", ] [[package]] name = "memchr" -version = "2.6.3" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "memoffset" -version = "0.8.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" dependencies = [ "autocfg", ] [[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", ] @@ -1116,7 +1229,7 @@ version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.5.0", "cfg-if", "libc", ] @@ -1127,6 +1240,17 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43794a0ace135be66a25d3ae77d41b91615fb68ae937f904090203e81f755b65" +[[package]] +name = "num-bigint" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + [[package]] name = "num-bigint-dig" version = "0.8.4" @@ -1146,19 +1270,18 @@ dependencies = [ [[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", @@ -1167,9 +1290,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", @@ -1187,18 +1310,18 @@ dependencies = [ [[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" @@ -1214,18 +1337,18 @@ 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", ] [[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" @@ -1239,13 +1362,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", "smallvec", "windows-targets 0.48.5", ] @@ -1267,15 +1390,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.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a4d085fd991ac8d5b05a147b437791b4260b76326baf0fc60cf7c9c27ecd33" +checksum = "311fb059dee1a7b802f036316d790138c613a4e8b180c822e3925a662e9f0c95" dependencies = [ "memchr", "thiserror", @@ -1284,9 +1407,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.3" +version = "2.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bee7be22ce7918f641a33f08e3f43388c7656772244e2bbb2477f44cc9021a" +checksum = "f73541b156d32197eecda1a4014d7f868fd2bcb3c550d5386087cfba442bf69c" dependencies = [ "pest", "pest_generator", @@ -1294,22 +1417,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.3" +version = "2.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1511785c5e98d79a05e8a6bc34b4ac2168a0e3e92161862030ad84daa223141" +checksum = "c35eeed0a3fab112f75165fdc026b3913f4183133f19b49be773ac9ea966e8bd" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.58", ] [[package]] name = "pest_meta" -version = "2.7.3" +version = "2.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42f0394d3123e33353ca5e1e89092e533d2cc490389f2bd6131c43c634ebc5f" +checksum = "2adbf29bb9776f28caece835398781ab24435585fe0d4dc1374a61db5accedca" dependencies = [ "once_cell", "pest", @@ -1326,11 +1449,53 @@ dependencies = [ "indexmap", ] +[[package]] +name = "phf" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +dependencies = [ + "phf_macros", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +dependencies = [ + "phf_shared", + "rand", +] + +[[package]] +name = "phf_macros" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", + "syn 2.0.58", +] + +[[package]] +name = "phf_shared" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +dependencies = [ + "siphasher", +] + [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -1338,6 +1503,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.2", + "futures-io", +] + [[package]] name = "pkcs1" version = "0.7.5" @@ -1408,37 +1584,53 @@ dependencies = [ ] [[package]] -name = "ppv-lite86" -version = "0.2.17" +name = "polling" +version = "3.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "e0c976a60b2d7e99d6f229e414670a9b85d13ac305cc6d1e9c134de58c5aaaf6" +dependencies = [ + "cfg-if", + "concurrent-queue", + "hermit-abi", + "pin-project-lite", + "rustix 0.38.32", + "tracing", + "windows-sys 0.52.0", +] [[package]] -name = "proc-macro-hack" -version = "0.5.20+deprecated" +name = "portable-atomic" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" +checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" + +[[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.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" +checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" dependencies = [ "unicode-ident", ] [[package]] name = "pyo3" -version = "0.18.3" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b1ac5b3731ba34fdaa9785f8d74d17448cd18f30cf19e0c7e7b1fdb5272109" +checksum = "a7a8b1990bd018761768d5e608a13df8bd1ac5f678456e0f301bb93e5f3ea16b" dependencies = [ "cfg-if", "indoc", "libc", "memoffset", "parking_lot", + "portable-atomic", "pyo3-build-config", "pyo3-ffi", "pyo3-macros", @@ -1447,9 +1639,9 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.18.3" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cb946f5ac61bb61a5014924910d936ebd2b23b705f7a4a3c40b05c720b079a3" +checksum = "650dca34d463b6cdbdb02b1d71bfd6eb6b6816afc708faebb3bac1380ff4aef7" dependencies = [ "once_cell", "target-lexicon", @@ -1457,9 +1649,9 @@ dependencies = [ [[package]] name = "pyo3-ffi" -version = "0.18.3" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd4d7c5337821916ea2a1d21d1092e8443cf34879e53a0ac653fbb98f44ff65c" +checksum = "09a7da8fc04a8a2084909b59f29e1b8474decac98b951d77b80b26dc45f046ad" dependencies = [ "libc", "pyo3-build-config", @@ -1467,25 +1659,27 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.18.3" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9d39c55dab3fc5a4b25bbd1ac10a2da452c4aca13bb450f22818a002e29648d" +checksum = "4b8a199fce11ebb28e3569387228836ea98110e43a804a530a9fd83ade36d513" dependencies = [ "proc-macro2", "pyo3-macros-backend", "quote", - "syn 1.0.109", + "syn 2.0.58", ] [[package]] name = "pyo3-macros-backend" -version = "0.18.3" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97daff08a4c48320587b5224cc98d609e3c27b6d437315bd40b605c98eeb5918" +checksum = "93fbbfd7eb553d10036513cb122b888dcd362a945a00b06c165f2ab480d4cc3b" dependencies = [ + "heck", "proc-macro2", + "pyo3-build-config", "quote", - "syn 1.0.109", + "syn 2.0.58", ] [[package]] @@ -1499,7 +1693,7 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustc-hash", - "rustls 0.21.7", + "rustls 0.21.10", "thiserror", "tokio", "tracing", @@ -1507,15 +1701,15 @@ 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", "ring 0.16.20", "rustc-hash", - "rustls 0.21.7", + "rustls 0.21.10", "rustls-native-certs 0.6.3", "slab", "thiserror", @@ -1538,9 +1732,9 @@ dependencies = [ [[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", ] @@ -1577,38 +1771,29 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -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.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" dependencies = [ "getrandom", - "redox_syscall 0.2.16", + "libredox", "thiserror", ] [[package]] name = "regex" -version = "1.9.5" +version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", @@ -1618,9 +1803,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.8" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", @@ -1629,9 +1814,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.7.5" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "ring" @@ -1650,16 +1835,17 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.6" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "684d5e6e18f669ccebf64a92236bb7db9a34f07be010e3627368182027180866" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", + "cfg-if", "getrandom", "libc", "spin 0.9.8", "untrusted 0.9.0", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1674,16 +1860,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", @@ -1717,9 +1901,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", @@ -1731,37 +1915,37 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.13" +version = "0.38.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7db8590df6dfcd144d22afd1b83b36c21a18d7cbc1dc4bb5295a8712e9eb662" +checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.5.0", "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.8", + "rustls-webpki 0.101.7", "sct", ] [[package]] name = "rustls" -version = "0.22.2" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e87c9956bd9807afa1f77e0f7594af32566e830e088a5576d27c5b6f30f49d41" +checksum = "99008d7ad0bbbea527ec27bddbc0e432c5b87d8175178cee68d2eec9c4a1813c" dependencies = [ "log", - "ring 0.17.6", + "ring 0.17.8", "rustls-pki-types", "rustls-webpki 0.102.2", "subtle", @@ -1775,7 +1959,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", ] @@ -1787,7 +1971,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.2", "rustls-pki-types", "schannel", "security-framework", @@ -1795,37 +1979,37 @@ 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", + "base64 0.21.7", ] [[package]] name = "rustls-pemfile" -version = "2.0.0" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35e4980fa29e4c4b212ffb3db068a564cbf560e51d3944b7c88bd8bf5bec64f4" +checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" dependencies = [ - "base64", + "base64 0.22.0", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.3.1" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ede67b28608b4c60685c7d54122d4400d90f62b40caee7700e700380a390fa8" +checksum = "ecd36cc4259e3e4514335c4a138c6b43171a8d61d8f5c9348f9fc7529416f247" [[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.8", + "untrusted 0.9.0", ] [[package]] @@ -1834,31 +2018,31 @@ version = "0.102.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" dependencies = [ - "ring 0.17.6", + "ring 0.17.8", "rustls-pki-types", "untrusted 0.9.0", ] [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[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", @@ -1868,9 +2052,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", @@ -1886,12 +2070,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.8", + "untrusted 0.9.0", ] [[package]] @@ -1906,9 +2090,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.9.2" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +checksum = "770452e37cad93e0a50d5abc3990d2bc351c36d0328f86cefec2f2fb206eaef6" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -1919,9 +2103,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.9.1" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +checksum = "41f3cc463c0ef97e11c3461a9d3787412d30e8e7eb907c79180c4a57bf7c04ef" dependencies = [ "core-foundation-sys", "libc", @@ -1929,28 +2113,51 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.18" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" +checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" [[package]] name = "serde" -version = "1.0.188" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" dependencies = [ "serde_derive", ] +[[package]] +name = "serde-pickle" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c762ad136a26407c6a80825813600ceeab5e613660d93d79a41f0ec877171e71" +dependencies = [ + "byteorder", + "iter-read", + "num-bigint", + "num-traits", + "serde", +] + +[[package]] +name = "serde_cbor" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" +dependencies = [ + "half", + "serde", +] + [[package]] name = "serde_derive" -version = "1.0.188" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.58", ] [[package]] @@ -1966,9 +2173,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.107" +version = "1.0.115" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd" dependencies = [ "itoa", "ryu", @@ -1977,9 +2184,9 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.9.25" +version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a49e178e4452f45cb61d0cd8cebc1b0fafd3e41929e996cef79aa3aca91f574" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ "indexmap", "itoa", @@ -1990,9 +2197,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", @@ -2001,9 +2208,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", @@ -2029,16 +2236,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" @@ -2050,14 +2247,20 @@ 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", ] +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + [[package]] name = "slab" version = "0.4.9" @@ -2069,15 +2272,15 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.0" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -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", @@ -2110,9 +2313,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", @@ -2130,7 +2333,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", @@ -2155,9 +2358,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.33" +version = "2.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9caece70c63bfba29ec2fed841a09851b14a235c60010fa4de58089b6c025668" +checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687" dependencies = [ "proc-macro2", "quote", @@ -2170,33 +2373,24 @@ version = "0.12.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" -[[package]] -name = "termcolor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" -dependencies = [ - "winapi-util", -] - [[package]] name = "thiserror" -version = "1.0.48" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" +checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.48" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" +checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.58", ] [[package]] @@ -2225,9 +2419,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.36.0" +version = "1.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" dependencies = [ "backtrace", "bytes", @@ -2248,7 +2442,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.58", ] [[package]] @@ -2257,7 +2451,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.7", + "rustls 0.21.10", "tokio", ] @@ -2267,7 +2461,7 @@ version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" dependencies = [ - "rustls 0.22.2", + "rustls 0.22.3", "rustls-pki-types", "tokio", ] @@ -2294,18 +2488,17 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "hashbrown 0.14.0", + "hashbrown 0.14.3", "pin-project-lite", "tokio", ] [[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", @@ -2314,20 +2507,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.58", ] [[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", ] @@ -2363,9 +2556,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" @@ -2375,9 +2568,9 @@ checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" [[package]] name = "uhlc" -version = "0.6.3" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1eadef1fa26cbbae1276c46781e8f4d888bdda434779c18ae6c2a0e69991885" +checksum = "99b6df3f3e948b40e20c38a6d1fd6d8f91b3573922fc164e068ad3331560487e" dependencies = [ "humantime", "lazy_static", @@ -2389,9 +2582,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" @@ -2401,9 +2594,9 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] @@ -2416,15 +2609,15 @@ checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "unindent" -version = "0.1.11" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1766d682d402817b5ac4490b3c3002d91dfa0d22812f341609f97b08757359c" +checksum = "c7de7d73e1754487cb58364ee906a499937a0dfabd86bcb980fa99ec8c8fa2ce" [[package]] name = "unsafe-libyaml" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab4c90930b95a82d00dc9e9ac071b4991924390d46cbd0dfe566148667605e4b" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" [[package]] name = "untrusted" @@ -2451,9 +2644,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", @@ -2474,9 +2667,9 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "1.4.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" dependencies = [ "getrandom", ] @@ -2507,9 +2700,9 @@ dependencies = [ [[package]] name = "value-bag" -version = "1.4.1" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d92ccd67fb88503048c01b59152a04effd0782d035a83a6d256ce6085f08f4a3" +checksum = "74797339c3b98616c009c7c3eb53a0ce41e85c8ec66bd3db96ed132d20cfdee8" [[package]] name = "vec_map" @@ -2525,9 +2718,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 = "wasi" @@ -2537,9 +2730,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2547,24 +2740,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.58", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.37" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ "cfg-if", "js-sys", @@ -2574,9 +2767,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2584,28 +2777,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.58", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", @@ -2613,9 +2806,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", ] @@ -2636,15 +2829,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -2666,7 +2850,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.4", ] [[package]] @@ -2686,17 +2870,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.4", + "windows_aarch64_msvc 0.52.4", + "windows_i686_gnu 0.52.4", + "windows_i686_msvc 0.52.4", + "windows_x86_64_gnu 0.52.4", + "windows_x86_64_gnullvm 0.52.4", + "windows_x86_64_msvc 0.52.4", ] [[package]] @@ -2707,9 +2891,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" [[package]] name = "windows_aarch64_msvc" @@ -2719,9 +2903,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" [[package]] name = "windows_i686_gnu" @@ -2731,9 +2915,9 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" [[package]] name = "windows_i686_msvc" @@ -2743,9 +2927,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" [[package]] name = "windows_x86_64_gnu" @@ -2755,9 +2939,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" [[package]] name = "windows_x86_64_gnullvm" @@ -2767,9 +2951,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" [[package]] name = "windows_x86_64_msvc" @@ -2779,20 +2963,20 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a2645588ed739a2fbfdc6dc00d5f24442017613" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=protocol_changes#b330289a865b1e23cdabdca3948b7bc5fcaed647" dependencies = [ "async-trait", - "base64", + "base64 0.21.7", "const_format", - "env_logger 0.11.2", - "event-listener 4.0.0", + "env_logger", + "event-listener 4.0.3", "flume", "form_urlencoded", "futures", @@ -2802,11 +2986,15 @@ dependencies = [ "ordered-float", "paste", "petgraph", + "phf", "rand", "regex", "rustc_version", "serde", + "serde-pickle", + "serde_cbor", "serde_json", + "serde_yaml", "socket2 0.5.6", "stop-token", "tokio", @@ -2835,7 +3023,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a2645588ed739a2fbfdc6dc00d5f24442017613" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=protocol_changes#b330289a865b1e23cdabdca3948b7bc5fcaed647" dependencies = [ "zenoh-collections", ] @@ -2843,7 +3031,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a2645588ed739a2fbfdc6dc00d5f24442017613" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=protocol_changes#b330289a865b1e23cdabdca3948b7bc5fcaed647" dependencies = [ "log", "serde", @@ -2855,12 +3043,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a2645588ed739a2fbfdc6dc00d5f24442017613" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=protocol_changes#b330289a865b1e23cdabdca3948b7bc5fcaed647" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a2645588ed739a2fbfdc6dc00d5f24442017613" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=protocol_changes#b330289a865b1e23cdabdca3948b7bc5fcaed647" dependencies = [ "flume", "json5", @@ -2880,7 +3068,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a2645588ed739a2fbfdc6dc00d5f24442017613" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=protocol_changes#b330289a865b1e23cdabdca3948b7bc5fcaed647" dependencies = [ "async-global-executor", "lazy_static", @@ -2892,7 +3080,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a2645588ed739a2fbfdc6dc00d5f24442017613" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=protocol_changes#b330289a865b1e23cdabdca3948b7bc5fcaed647" dependencies = [ "aes", "hmac", @@ -2905,9 +3093,9 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a2645588ed739a2fbfdc6dc00d5f24442017613" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=protocol_changes#b330289a865b1e23cdabdca3948b7bc5fcaed647" dependencies = [ - "hashbrown 0.14.0", + "hashbrown 0.14.3", "keyed-set", "rand", "schemars", @@ -2919,7 +3107,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a2645588ed739a2fbfdc6dc00d5f24442017613" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=protocol_changes#b330289a865b1e23cdabdca3948b7bc5fcaed647" dependencies = [ "async-trait", "zenoh-config", @@ -2937,13 +3125,13 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a2645588ed739a2fbfdc6dc00d5f24442017613" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=protocol_changes#b330289a865b1e23cdabdca3948b7bc5fcaed647" dependencies = [ "async-trait", "flume", "futures", "log", - "rustls 0.22.2", + "rustls 0.22.3", "rustls-webpki 0.102.2", "serde", "tokio", @@ -2960,16 +3148,16 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a2645588ed739a2fbfdc6dc00d5f24442017613" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=protocol_changes#b330289a865b1e23cdabdca3948b7bc5fcaed647" dependencies = [ "async-trait", - "base64", + "base64 0.21.7", "futures", "log", "quinn", - "rustls 0.21.7", + "rustls 0.21.10", "rustls-native-certs 0.7.0", - "rustls-pemfile 2.0.0", + "rustls-pemfile 2.1.2", "rustls-webpki 0.102.2", "secrecy", "tokio", @@ -2988,7 +3176,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a2645588ed739a2fbfdc6dc00d5f24442017613" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=protocol_changes#b330289a865b1e23cdabdca3948b7bc5fcaed647" dependencies = [ "async-trait", "log", @@ -3006,14 +3194,14 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a2645588ed739a2fbfdc6dc00d5f24442017613" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=protocol_changes#b330289a865b1e23cdabdca3948b7bc5fcaed647" dependencies = [ "async-trait", - "base64", + "base64 0.21.7", "futures", "log", - "rustls 0.22.2", - "rustls-pemfile 2.0.0", + "rustls 0.22.3", + "rustls-pemfile 2.1.2", "rustls-pki-types", "rustls-webpki 0.102.2", "secrecy", @@ -3034,7 +3222,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a2645588ed739a2fbfdc6dc00d5f24442017613" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=protocol_changes#b330289a865b1e23cdabdca3948b7bc5fcaed647" dependencies = [ "async-trait", "log", @@ -3055,7 +3243,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a2645588ed739a2fbfdc6dc00d5f24442017613" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=protocol_changes#b330289a865b1e23cdabdca3948b7bc5fcaed647" dependencies = [ "async-trait", "futures", @@ -3075,7 +3263,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a2645588ed739a2fbfdc6dc00d5f24442017613" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=protocol_changes#b330289a865b1e23cdabdca3948b7bc5fcaed647" dependencies = [ "async-trait", "futures-util", @@ -3096,18 +3284,18 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a2645588ed739a2fbfdc6dc00d5f24442017613" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=protocol_changes#b330289a865b1e23cdabdca3948b7bc5fcaed647" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.58", "zenoh-keyexpr", ] [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a2645588ed739a2fbfdc6dc00d5f24442017613" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=protocol_changes#b330289a865b1e23cdabdca3948b7bc5fcaed647" dependencies = [ "const_format", "libloading", @@ -3123,7 +3311,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a2645588ed739a2fbfdc6dc00d5f24442017613" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=protocol_changes#b330289a865b1e23cdabdca3948b7bc5fcaed647" dependencies = [ "const_format", "rand", @@ -3138,7 +3326,7 @@ dependencies = [ name = "zenoh-python" version = "0.11.0-dev" dependencies = [ - "env_logger 0.10.2", + "env_logger", "flume", "json5", "pyo3", @@ -3152,7 +3340,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a2645588ed739a2fbfdc6dc00d5f24442017613" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=protocol_changes#b330289a865b1e23cdabdca3948b7bc5fcaed647" dependencies = [ "anyhow", ] @@ -3160,7 +3348,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a2645588ed739a2fbfdc6dc00d5f24442017613" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=protocol_changes#b330289a865b1e23cdabdca3948b7bc5fcaed647" dependencies = [ "lazy_static", "tokio", @@ -3171,9 +3359,9 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a2645588ed739a2fbfdc6dc00d5f24442017613" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=protocol_changes#b330289a865b1e23cdabdca3948b7bc5fcaed647" dependencies = [ - "event-listener 4.0.0", + "event-listener 4.0.3", "futures", "tokio", "zenoh-buffers", @@ -3185,7 +3373,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a2645588ed739a2fbfdc6dc00d5f24442017613" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=protocol_changes#b330289a865b1e23cdabdca3948b7bc5fcaed647" dependencies = [ "async-trait", "flume", @@ -3216,7 +3404,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3a2645588ed739a2fbfdc6dc00d5f24442017613" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=protocol_changes#b330289a865b1e23cdabdca3948b7bc5fcaed647" dependencies = [ "async-std", "async-trait", @@ -3252,11 +3440,11 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.58", ] [[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/Cargo.toml b/Cargo.toml index 642d65fe..c524fbcf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,19 +34,18 @@ name = "zenoh" crate-type = ["cdylib"] [features] -complete_n = ["zenoh/complete_n"] default = ["zenoh/default"] [badges] maintenance = { status = "actively-developed" } [dependencies] -env_logger = "0.10.0" +env_logger = "0.11.3" flume = "0.11.0" json5 = "0.4.1" -pyo3 = { version = "0.18.1", features = ["extension-module", "abi3-py37"] } -uhlc = "0.6.0" +pyo3 = { version = "0.21.1", features = ["extension-module", "abi3-py37"] } +uhlc = "0.7.0" validated_struct = "2.1.0" -zenoh = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", features = ["unstable"], default-features = false } -zenoh-buffers = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main" } -zenoh-core = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main" } +zenoh = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "protocol_changes", features = ["unstable"], default-features = false } +zenoh-buffers = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "protocol_changes" } +zenoh-core = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "protocol_changes" } diff --git a/docs/index.rst b/docs/index.rst index 9072d771..b115941c 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -139,11 +139,6 @@ Subscriber .. autoclass:: zenoh.Subscriber :members: -PullSubscriber --------------- -.. autoclass:: zenoh.PullSubscriber - :members: - Reliability ----------- .. autoclass:: zenoh.Reliability diff --git a/examples/README.md b/examples/README.md index 690824b9..638c1c3e 100644 --- a/examples/README.md +++ b/examples/README.md @@ -6,153 +6,158 @@ python3 ``` - Each example accepts the `-h` or `--help` option that provides a description of its arguments and their default values. +Each example accepts the `-h` or `--help` option that provides a description of its arguments and their default values. - If you run the tests against the zenoh router running in a Docker container, you need to add the - `-e tcp/localhost:7447` option to your examples. That's because Docker doesn't support UDP multicast - transport, and therefore the zenoh scouting and discrovery mechanism cannot work with. +If you run the tests against the zenoh router running in a Docker container, you need to add the +`-e tcp/localhost:7447` option to your examples. That's because Docker doesn't support UDP multicast +transport, and therefore the zenoh scouting and discrovery mechanism cannot work with. ## Examples description ### z_scout - Scouts for zenoh peers and routers available on the network. +Scouts for zenoh peers and routers available on the network. + +Typical usage: - Typical usage: ```bash python3 z_scout.py ``` ### z_info - Gets information about the Zenoh session. +Gets information about the Zenoh session. + +Typical usage: - Typical usage: ```bash python3 z_info.py ``` - ### z_put - Puts a path/value into Zenoh. - The path/value will be received by all matching subscribers, for instance the [z_sub](#z_sub) - and [z_storage](#z_storage) examples. +Puts a path/value into Zenoh. +The path/value will be received by all matching subscribers, for instance the [z_sub](#z_sub) +and [z_storage](#z_storage) examples. + +Typical usage: - Typical usage: ```bash python3 z_put.py ``` - or + +or + ```bash python3 z_put.py -k demo/example/test -v 'Hello World' ``` ### z_pub - Declares a resource with a path and a publisher on this resource. Then puts a value using the numerical resource id. - The path/value will be received by all matching subscribers, for instance the [z_sub](#z_sub) - and [z_storage](#z_storage) examples. +Declares a resource with a path and a publisher on this resource. Then puts a value using the numerical resource id. +The path/value will be received by all matching subscribers, for instance the [z_sub](#z_sub) +and [z_storage](#z_storage) examples. + +Typical usage: - Typical usage: ```bash python3 z_pub.py ``` - or + +or + ```bash python3 z_pub.py -k demo/example/test -v 'Hello World' ``` ### z_sub - Creates a subscriber with a key expression. - The subscriber will be notified of each put made on any key expression matching - the subscriber's key expression, and will print this notification. +Creates a subscriber with a key expression. +The subscriber will be notified of each put made on any key expression matching +the subscriber's key expression, and will print this notification. + +Typical usage: - Typical usage: ```bash python3 z_sub.py ``` - or - ```bash - python3 z_sub.py -k 'demo/**' - ``` - -### z_pull - Creates a pull subscriber with a selector. - The pull subscriber will receive each put made on any key expression matching - the subscriber's key expression and will pull on demand and print the received - key/value. +or - Typical usage: ```bash - python3 z_pull.py - ``` - or - ```bash - python3 z_pull.py -k 'demo/**' + python3 z_sub.py -k 'demo/**' ``` ### z_get - Sends a query message for a selector. - The queryables with a matching path or selector (for instance [z_queryable](#z_queryable) and [z_storage](#z_storage)) - will receive this query and reply with paths/values that will be received by the query callback. +Sends a query message for a selector. +The queryables with a matching path or selector (for instance [z_queryable](#z_queryable) and [z_storage](#z_storage)) +will receive this query and reply with paths/values that will be received by the query callback. + +Typical usage: - Typical usage: ```bash python3 z_get.py ``` - or + +or + ```bash python3 z_get.py -s 'demo/**' ``` ### z_queryable - Creates a queryable function with a key expression. - This queryable function will be triggered by each call to a get operation on zenoh - with a selector that matches the key expression, and will return a value to the querier. +Creates a queryable function with a key expression. +This queryable function will be triggered by each call to a get operation on zenoh +with a selector that matches the key expression, and will return a value to the querier. + +Typical usage: - Typical usage: ```bash python3 z_queryable.py ``` - or + +or + ```bash python3 z_queryable.py -k demo/example/queryable -v 'This is the result' ``` ### z_storage - Trivial implementation of a storage in memory. - This examples creates a subscriber and a queryable on the same key expression. - The subscriber callback will store the received key/values in an hashmap. - The queryable callback will answer to queries with the key/values stored in the hashmap - and that match the queried selector. +Trivial implementation of a storage in memory. +This examples creates a subscriber and a queryable on the same key expression. +The subscriber callback will store the received key/values in an hashmap. +The queryable callback will answer to queries with the key/values stored in the hashmap +and that match the queried selector. + +Typical usage: - Typical usage: ```bash python3 z_storage.py ``` - or + +or + ```bash python3 z_storage.py -k 'demo/**' ``` ### z_pub_thr & z_sub_thr - Pub/Sub throughput test. - This example allows to perform throughput measurements between a pubisher performing - put operations and a subscriber receiving notifications of those puts. +Pub/Sub throughput test. +This example allows to perform throughput measurements between a pubisher performing +put operations and a subscriber receiving notifications of those puts. + +Typical Subscriber usage: - Typical Subscriber usage: ```bash python3 z_sub_thr.py ``` - Typical Publisher usage: +Typical Publisher usage: + ```bash python3 z_pub_thr.py 1024 ``` diff --git a/examples/z_get.py b/examples/z_get.py index 5faa5361..bdcde0f8 100644 --- a/examples/z_get.py +++ b/examples/z_get.py @@ -17,7 +17,7 @@ import argparse import json import zenoh -from zenoh import config, QueryTarget +from zenoh import config, QueryTarget, into_payload # --- Command line argument parsing --- --- --- --- --- --- parser = argparse.ArgumentParser( @@ -79,7 +79,7 @@ def main(): session = zenoh.open(conf) print("Sending Query '{}'...".format(selector)) - replies = session.get(selector, zenoh.Queue(), target=target, value=args.value, consolidation=zenoh.QueryConsolidation.NONE()) + replies = session.get(selector, zenoh.Queue(), target=target, payload=into_payload(args.value), consolidation=zenoh.QueryConsolidation.NONE()) for reply in replies.receiver: try: print(">> Received ('{}': '{}')" diff --git a/examples/z_pub_thr.py b/examples/z_pub_thr.py index dc67e725..2b0b9e61 100644 --- a/examples/z_pub_thr.py +++ b/examples/z_pub_thr.py @@ -17,7 +17,7 @@ import argparse import json import zenoh -from zenoh import config, CongestionControl, Value +from zenoh import config, CongestionControl # --- Command line argument parsing --- --- --- --- --- --- parser = argparse.ArgumentParser( @@ -63,7 +63,6 @@ def main(): data = bytearray() for i in range(0, size): data.append(i % 10) - data = Value(bytes(data)) congestion_control = CongestionControl.BLOCK() session = zenoh.open(conf) @@ -71,6 +70,6 @@ def main(): print("Press CTRL-C to quit...") while True: - pub.put(data) + pub.put(bytes(data)) main() diff --git a/examples/z_pull.py b/examples/z_pull.py deleted file mode 100644 index 6ce80657..00000000 --- a/examples/z_pull.py +++ /dev/null @@ -1,88 +0,0 @@ -# -# Copyright (c) 2022 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, -# - -import itertools -import sys -import time -from datetime import datetime -import argparse -import json -import zenoh -from zenoh import Reliability - -# --- Command line argument parsing --- --- --- --- --- --- -parser = argparse.ArgumentParser( - prog='z_pull', - description='zenoh pull example') -parser.add_argument('--mode', '-m', dest='mode', - choices=['peer', 'client'], - type=str, - help='The zenoh session mode.') -parser.add_argument('--connect', '-e', dest='connect', - metavar='ENDPOINT', - action='append', - type=str, - help='Endpoints to connect to.') -parser.add_argument('--listen', '-l', dest='listen', - metavar='ENDPOINT', - action='append', - type=str, - help='Endpoints to listen on.') -parser.add_argument('--key', '-k', dest='key', - default='demo/example/**', - type=str, - help='The key expression matching resources to pull.') -parser.add_argument('--config', '-c', dest='config', - metavar='FILE', - type=str, - help='A configuration file.') - -args = parser.parse_args() -conf = zenoh.Config.from_file( - args.config) if args.config is not None else zenoh.Config() -if args.mode is not None: - conf.insert_json5(zenoh.config.MODE_KEY, json.dumps(args.mode)) -if args.connect is not None: - conf.insert_json5(zenoh.config.CONNECT_KEY, json.dumps(args.connect)) -if args.listen is not None: - conf.insert_json5(zenoh.config.LISTEN_KEY, json.dumps(args.listen)) -key = args.key - -# Zenoh code --- --- --- --- --- --- --- --- --- --- --- - - -def listen(sample): - print(f">> [Subscriber] Received {sample.kind} ('{sample.key_expr}': '{sample.payload.decode('utf-8')}')") - - -def main(): - # initiate logging - zenoh.init_logger() - - print("Opening session...") - session = zenoh.open(conf) - - print("Declaring Subscriber on '{}'...".format(key)) - sub = session.declare_pull_subscriber(key, listen, reliability=Reliability.RELIABLE()) - - print("Press CTRL-C to quit...") - for idx in itertools.count(): - time.sleep(1) - print(f"[{idx:4d}] Pulling...") - sub.pull() - - sub.undeclare() - session.close() - -main() diff --git a/examples/z_put.py b/examples/z_put.py index 2f04ab02..07255546 100644 --- a/examples/z_put.py +++ b/examples/z_put.py @@ -17,7 +17,7 @@ import argparse import json import zenoh -from zenoh import config, Value +from zenoh import config # --- Command line argument parsing --- --- --- --- --- --- parser = argparse.ArgumentParser( diff --git a/examples/z_queryable.py b/examples/z_queryable.py index 4223afba..0ec9fe6d 100644 --- a/examples/z_queryable.py +++ b/examples/z_queryable.py @@ -17,7 +17,7 @@ import argparse import json import zenoh -from zenoh import config, Sample, Value +from zenoh import config, Sample # --- Command line argument parsing --- --- --- --- --- --- parser = argparse.ArgumentParser( diff --git a/src/closures.rs b/src/closures.rs index 5fac615a..3da7e6e6 100644 --- a/src/closures.rs +++ b/src/closures.rs @@ -20,7 +20,7 @@ use pyo3::{ prelude::*, types::{PyList, PyTuple}, }; -use zenoh::prelude::IntoCallbackReceiverPair; +use zenoh::handlers::IntoHandler; trait CallbackUnwrap { type Output; @@ -29,16 +29,15 @@ trait CallbackUnwrap { impl CallbackUnwrap for PyResult { type Output = T; fn cb_unwrap(self) -> Self::Output { - match self { - Ok(o) => o, - Err(e) => Python::with_gil(|py| { - if let Some(trace) = e.traceback(py).and_then(|trace| trace.format().ok()) { + self.unwrap_or_else(|e| { + Python::with_gil(|py| { + if let Some(trace) = e.traceback_bound(py).and_then(|trace| trace.format().ok()) { panic!("Exception thrown in callback: {}.\n{}", e, trace) } else { panic!("Exception thrown in callback: {}.", e,) } - }), - } + }) + }) } } @@ -47,9 +46,9 @@ pub(crate) struct PyClosure { pub(crate) drop: Option>, _marker: std::marker::PhantomData, } -impl TryFrom<&PyAny> for PyClosure { +impl TryFrom<&Bound<'_, PyAny>> for PyClosure { type Error = PyErr; - fn try_from(value: &PyAny) -> Result { + fn try_from(value: &Bound) -> Result { Python::with_gil(|py| { let pycall = match value.getattr("call") { Ok(value) => value.into_py(py), @@ -85,15 +84,16 @@ impl Drop for PyClosure { } } } -impl IntoCallbackReceiverPair<'static, T> for PyClosure<(I,)> + +impl IntoHandler<'static, T> for PyClosure<(I,)> where T: Into, I: Send + Sync + 'static, (I,): IntoPy>, { - type Receiver = (); + type Handler = (); - fn into_cb_receiver_pair(self) -> (zenoh::handlers::Callback<'static, T>, Self::Receiver) { + fn into_handler(self) -> (zenoh::handlers::Callback<'static, T>, Self::Handler) { ( Arc::new(move |reply| { self.call((reply.into(),)).cb_unwrap(); @@ -169,7 +169,7 @@ impl _Queue { Err(flume::RecvTimeoutError::Disconnected) => break, Err(flume::RecvTimeoutError::Timeout) => { let list: Py = - Python::with_gil(|py| PyList::new(py, vec).into_py(py)); + Python::with_gil(|py| PyList::new_bound(py, vec).into()); return Err(pyo3::exceptions::PyTimeoutError::new_err((list,))); } } @@ -177,7 +177,7 @@ impl _Queue { vec } }; - Ok(Python::with_gil(|py| PyList::new(py, vec).into_py(py))) + Ok(Python::with_gil(|py| PyList::new_bound(py, vec).into())) }) } pub fn is_closed(&self) -> bool { diff --git a/src/config.rs b/src/config.rs index 9fb6ab0f..e0bb5ba2 100644 --- a/src/config.rs +++ b/src/config.rs @@ -63,7 +63,7 @@ impl _Config { pub fn from_json5(expr: &str) -> PyResult { match Config::from_deserializer(&mut json5::Deserializer::from_str(expr).to_pyres()?) { Ok(k) => Ok(Self(PyConfig::Config(Box::new(k)))), - Err(Ok(_)) => Err(zenoh_core::zerror!( + Err(Ok(_)) => Err(zerror!( "{} did parse into a config, but invalid values were found", expr, ) diff --git a/src/enums.rs b/src/enums.rs index d6da1bb6..92c4d4aa 100644 --- a/src/enums.rs +++ b/src/enums.rs @@ -13,14 +13,14 @@ // use crate::ToPyErr; use pyo3::prelude::*; -use zenoh::prelude::{Encoding, KnownEncoding, Priority, SampleKind}; +use zenoh::prelude::{Encoding, Priority, SampleKind}; use zenoh::publication::CongestionControl; use zenoh::query::{ConsolidationMode, QueryTarget}; use zenoh::subscriber::Reliability; #[pyclass(subclass)] #[repr(transparent)] -#[derive(Clone, Debug, PartialEq, Eq)] +#[derive(Clone, Debug, PartialEq, Eq, Default)] pub struct _Encoding(pub(crate) Encoding); #[pymethods] impl _Encoding { @@ -36,48 +36,121 @@ impl _Encoding { } } #[classattr] - pub const EMPTY: Self = Self(Encoding::Exact(KnownEncoding::Empty)); + pub const ZENOH_BYTES: Self = Self(Encoding::ZENOH_BYTES); + #[classattr] + pub const ZENOH_INT: Self = Self(Encoding::ZENOH_INT); + #[classattr] + pub const ZENOH_UINT: Self = Self(Encoding::ZENOH_UINT); + #[classattr] + pub const ZENOH_FLOAT: Self = Self(Encoding::ZENOH_FLOAT); + #[classattr] + pub const ZENOH_BOOL: Self = Self(Encoding::ZENOH_BOOL); + #[classattr] + pub const ZENOH_STRING: Self = Self(Encoding::ZENOH_STRING); + #[classattr] + pub const ZENOH_ERROR: Self = Self(Encoding::ZENOH_ERROR); + #[classattr] + pub const APPLICATION_OCTET_STREAM: Self = Self(Encoding::APPLICATION_OCTET_STREAM); + #[classattr] + pub const TEXT_PLAIN: Self = Self(Encoding::TEXT_PLAIN); + #[classattr] + pub const APPLICATION_JSON: Self = Self(Encoding::APPLICATION_JSON); + #[classattr] + pub const TEXT_JSON: Self = Self(Encoding::TEXT_JSON); + #[classattr] + pub const APPLICATION_CDR: Self = Self(Encoding::APPLICATION_CDR); + #[classattr] + pub const APPLICATION_CBOR: Self = Self(Encoding::APPLICATION_CBOR); + #[classattr] + pub const APPLICATION_YAML: Self = Self(Encoding::APPLICATION_YAML); + #[classattr] + pub const TEXT_YAML: Self = Self(Encoding::TEXT_YAML); + #[classattr] + pub const TEXT_JSON5: Self = Self(Encoding::TEXT_JSON5); + pub const APPLICATION_PYTHON_SERIALIZED_OBJECT: Self = + Self(Encoding::APPLICATION_PYTHON_SERIALIZED_OBJECT); + #[classattr] + pub const APPLICATION_PROTOBUF: Self = Self(Encoding::APPLICATION_PROTOBUF); + #[classattr] + pub const APPLICATION_JAVA_SERIALIZED_OBJECT: Self = + Self(Encoding::APPLICATION_JAVA_SERIALIZED_OBJECT); + #[classattr] + pub const APPLICATION_OPENMETRICS_TEXT: Self = Self(Encoding::APPLICATION_OPENMETRICS_TEXT); + #[classattr] + pub const IMAGE_PNG: Self = Self(Encoding::IMAGE_PNG); #[classattr] - pub const APP_OCTET_STREAM: Self = Self(Encoding::Exact(KnownEncoding::AppOctetStream)); + pub const IMAGE_JPEG: Self = Self(Encoding::IMAGE_JPEG); #[classattr] - pub const APP_CUSTOM: Self = Self(Encoding::Exact(KnownEncoding::AppCustom)); + pub const IMAGE_GIF: Self = Self(Encoding::IMAGE_GIF); #[classattr] - pub const TEXT_PLAIN: Self = Self(Encoding::Exact(KnownEncoding::TextPlain)); + pub const IMAGE_BMP: Self = Self(Encoding::IMAGE_BMP); #[classattr] - pub const APP_PROPERTIES: Self = Self(Encoding::Exact(KnownEncoding::AppProperties)); + pub const IMAGE_WEBP: Self = Self(Encoding::IMAGE_WEBP); #[classattr] - pub const APP_JSON: Self = Self(Encoding::Exact(KnownEncoding::AppJson)); + pub const APPLICATION_XML: Self = Self(Encoding::APPLICATION_XML); #[classattr] - pub const APP_SQL: Self = Self(Encoding::Exact(KnownEncoding::AppSql)); + pub const APPLICATION_X_WWW_FORM_URLENCODED: Self = + Self(Encoding::APPLICATION_X_WWW_FORM_URLENCODED); #[classattr] - pub const APP_INTEGER: Self = Self(Encoding::Exact(KnownEncoding::AppInteger)); + pub const TEXT_HTML: Self = Self(Encoding::TEXT_HTML); #[classattr] - pub const APP_FLOAT: Self = Self(Encoding::Exact(KnownEncoding::AppFloat)); + pub const TEXT_XML: Self = Self(Encoding::TEXT_XML); #[classattr] - pub const APP_XML: Self = Self(Encoding::Exact(KnownEncoding::AppXml)); + pub const TEXT_CSS: Self = Self(Encoding::TEXT_CSS); #[classattr] - pub const APP_XHTML_XML: Self = Self(Encoding::Exact(KnownEncoding::AppXhtmlXml)); + pub const TEXT_JAVASCRIPT: Self = Self(Encoding::TEXT_JAVASCRIPT); #[classattr] - pub const APP_X_WWW_FORM_URLENCODED: Self = - Self(Encoding::Exact(KnownEncoding::AppXWwwFormUrlencoded)); + pub const TEXT_MARKDOWN: Self = Self(Encoding::TEXT_MARKDOWN); #[classattr] - pub const TEXT_JSON: Self = Self(Encoding::Exact(KnownEncoding::TextJson)); + pub const TEXT_CSV: Self = Self(Encoding::TEXT_CSV); #[classattr] - pub const TEXT_HTML: Self = Self(Encoding::Exact(KnownEncoding::TextHtml)); + pub const APPLICATION_SQL: Self = Self(Encoding::APPLICATION_SQL); #[classattr] - pub const TEXT_XML: Self = Self(Encoding::Exact(KnownEncoding::TextXml)); + pub const APPLICATION_COAP_PAYLOAD: Self = Self(Encoding::APPLICATION_COAP_PAYLOAD); #[classattr] - pub const TEXT_CSS: Self = Self(Encoding::Exact(KnownEncoding::TextCss)); + pub const APPLICATION_JSON_PATCH_JSON: Self = Self(Encoding::APPLICATION_JSON_PATCH_JSON); #[classattr] - pub const TEXT_CSV: Self = Self(Encoding::Exact(KnownEncoding::TextCsv)); + pub const APPLICATION_JSON_SEQ: Self = Self(Encoding::APPLICATION_JSON_SEQ); #[classattr] - pub const TEXT_JAVASCRIPT: Self = Self(Encoding::Exact(KnownEncoding::TextJavascript)); + pub const APPLICATION_JSONPATH: Self = Self(Encoding::APPLICATION_JSONPATH); #[classattr] - pub const IMAGE_JPEG: Self = Self(Encoding::Exact(KnownEncoding::ImageJpeg)); + pub const APPLICATION_JWT: Self = Self(Encoding::APPLICATION_JWT); #[classattr] - pub const IMAGE_PNG: Self = Self(Encoding::Exact(KnownEncoding::ImagePng)); + pub const APPLICATION_MP4: Self = Self(Encoding::APPLICATION_MP4); #[classattr] - pub const IMAGE_GIF: Self = Self(Encoding::Exact(KnownEncoding::ImageGif)); + pub const APPLICATION_SOAP_XML: Self = Self(Encoding::APPLICATION_SOAP_XML); + #[classattr] + pub const APPLICATION_YANG: Self = Self(Encoding::APPLICATION_YANG); + #[classattr] + pub const AUDIO_AAC: Self = Self(Encoding::AUDIO_AAC); + #[classattr] + pub const AUDIO_FLAC: Self = Self(Encoding::AUDIO_FLAC); + #[classattr] + pub const AUDIO_MP4: Self = Self(Encoding::AUDIO_MP4); + #[classattr] + pub const AUDIO_OGG: Self = Self(Encoding::AUDIO_OGG); + #[classattr] + pub const AUDIO_VORBIS: Self = Self(Encoding::AUDIO_VORBIS); + #[classattr] + pub const VIDEO_H261: Self = Self(Encoding::VIDEO_H261); + #[classattr] + pub const VIDEO_H263: Self = Self(Encoding::VIDEO_H263); + #[classattr] + pub const VIDEO_H264: Self = Self(Encoding::VIDEO_H264); + #[classattr] + pub const VIDEO_H265: Self = Self(Encoding::VIDEO_H265); + #[classattr] + pub const VIDEO_H266: Self = Self(Encoding::VIDEO_H266); + #[classattr] + pub const VIDEO_MP4: Self = Self(Encoding::VIDEO_MP4); + #[classattr] + pub const VIDEO_OGG: Self = Self(Encoding::VIDEO_OGG); + #[classattr] + pub const VIDEO_RAW: Self = Self(Encoding::VIDEO_RAW); + #[classattr] + pub const VIDEO_VP8: Self = Self(Encoding::VIDEO_VP8); + #[classattr] + pub const VIDEO_VP9: Self = Self(Encoding::VIDEO_VP9); #[staticmethod] pub fn from_str(s: String) -> Self { Self(s.into()) @@ -85,20 +158,8 @@ impl _Encoding { pub fn __str__(&self) -> String { self.0.to_string() } - pub fn append(&mut self, suffix: String) -> PyResult<()> { - unsafe { - let tmp = std::ptr::read(&self.0); - match tmp.with_suffix(suffix) { - Ok(tmp) => { - std::ptr::write(&mut self.0, tmp); - Ok(()) - } - Err(e) => Err(e.to_pyerr()), - } - } - } - pub fn equals(&self, other: &Self) -> bool { - self == other + pub fn with_schema(&self, suffix: String) -> Self { + Self(self.0.clone().with_schema(suffix)) } } @@ -147,14 +208,14 @@ impl _Priority { } } } -impl std::cmp::PartialOrd for _Priority { +impl PartialOrd for _Priority { fn partial_cmp(&self, other: &Self) -> Option { (self.0 as u8).partial_cmp(&(other.0 as u8)) } } #[pyclass(subclass)] -#[derive(Clone, PartialEq, Eq)] +#[derive(Clone, PartialEq, Eq, Default)] pub struct _SampleKind(pub(crate) SampleKind); #[pymethods] impl _SampleKind { diff --git a/src/lib.rs b/src/lib.rs index fb4cc3ff..ef42ad00 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -51,17 +51,9 @@ impl From for ExtractError { pub(crate) trait PyExtract { fn extract_item<'a, V: FromPyObject<'a>>(&'a self, key: K) -> Result; } -impl PyExtract for PyAny { +impl PyExtract for Bound<'_, PyDict> { fn extract_item<'a, V: FromPyObject<'a>>(&'a self, key: K) -> Result { - match self.get_item(key) { - Ok(item) => Ok(item.extract::()?), - Err(e) => Err(ExtractError::Unavailable(Some(e))), - } - } -} -impl PyExtract for PyDict { - fn extract_item<'a, V: FromPyObject<'a>>(&'a self, key: K) -> Result { - match self.get_item(key) { + match self.get_item(key)? { Some(item) => Ok(item.extract::()?), None => Err(ExtractError::Unavailable(None)), } @@ -69,7 +61,7 @@ impl PyExtract for PyDict { } #[pymodule] -fn zenoh(_py: Python, m: &PyModule) -> PyResult<()> { +fn zenoh(_py: Python, m: &Bound) -> PyResult<()> { m.add_class::()?; m.add_class::()?; m.add_class::()?; @@ -77,7 +69,6 @@ fn zenoh(_py: Python, m: &PyModule) -> PyResult<()> { m.add_class::()?; m.add_class::()?; m.add_class::()?; - m.add_class::()?; m.add_class::()?; m.add_class::()?; m.add_class::()?; @@ -114,8 +105,6 @@ fn init_logger() { let _ = env_logger::try_init(); } -pub(crate) use value::PyAnyToValue; - // Test should be runned with `cargo test --no-default-features` #[test] #[cfg(not(feature = "default"))] diff --git a/src/queryable.rs b/src/queryable.rs index 37920687..fa2278cf 100644 --- a/src/queryable.rs +++ b/src/queryable.rs @@ -14,12 +14,17 @@ use std::{collections::HashMap, sync::Arc}; use pyo3::prelude::*; +use pyo3::types::PyBytes; +use zenoh::prelude::ValueBuilderTrait; +use zenoh::value::Value; use zenoh::{ prelude::sync::SyncResolve, queryable::{Query, Queryable}, selector::Parameters, }; +use crate::enums::_Encoding; +use crate::value::Payload; use crate::{ keyexpr::{_KeyExpr, _Selector}, value::{_Sample, _Value}, @@ -73,15 +78,14 @@ impl _Query { } pub fn reply(&self, sample: _Sample) -> PyResult<()> { self.0 - .reply(Ok(sample.into())) + .reply_sample(sample.into()) .res_sync() .map_err(|e| e.to_pyerr()) } - pub fn reply_err(&self, value: _Value) -> PyResult<()> { - self.0 - .reply(Err(value.into())) - .res_sync() - .map_err(|e| e.to_pyerr()) + pub fn reply_err(&self, payload: Py, encoding: Option<_Encoding>) -> PyResult<()> { + let value = Value::new(Payload::Python(payload).into_zbuf()) + .encoding(encoding.unwrap_or_default().0); + self.0.reply_err(value).res_sync().map_err(|e| e.to_pyerr()) } pub fn __str__(&self) -> String { self.0.to_string() diff --git a/src/session.rs b/src/session.rs index 9425cbb0..372fc36c 100644 --- a/src/session.rs +++ b/src/session.rs @@ -17,25 +17,28 @@ use std::convert::TryInto; use std::sync::Arc; +use pyo3::types::PyBytes; use pyo3::{prelude::*, types::PyDict}; +use zenoh::prelude::{QoSBuilderTrait, ValueBuilderTrait}; use zenoh::{ config::{WhatAmI, WhatAmIMatcher}, prelude::{sync::SyncResolve, SessionDeclarations}, publication::Publisher, scouting::Scout, - subscriber::{PullSubscriber, Subscriber}, + subscriber::Subscriber, Session, }; +use zenoh_buffers::ZBuf; use crate::closures::PyClosure; use crate::config::{PyConfig, _Config}; use crate::enums::{ - _CongestionControl, _Priority, _QueryConsolidation, _QueryTarget, _Reliability, _SampleKind, + _CongestionControl, _Encoding, _Priority, _QueryConsolidation, _QueryTarget, _Reliability, }; use crate::keyexpr::{_KeyExpr, _Selector}; use crate::queryable::{_Query, _Queryable}; -use crate::value::{_Hello, _Reply, _Sample, _Value, _ZenohId}; -use crate::{PyAnyToValue, PyExtract, ToPyErr}; +use crate::value::{Payload, _Hello, _Reply, _Sample, _ZenohId}; +use crate::{PyExtract, ToPyErr}; #[pyclass(subclass)] #[derive(Clone)] @@ -44,7 +47,7 @@ pub struct _Session(pub(crate) Arc); #[pymethods] impl _Session { #[new] - pub fn new(mut config: Option<&mut crate::config::_Config>) -> PyResult { + pub fn new(mut config: Option<&mut _Config>) -> PyResult { let c = match &mut config { Some(c) => c.0.take().unwrap_or_default(), None => Default::default(), @@ -59,23 +62,20 @@ impl _Session { _Config(PyConfig::Notifier(self.0.config().clone())) } - #[pyo3(signature = (key_expr, value, **kwargs))] + #[pyo3(signature = (key_expr, payload, encoding = None, **kwargs))] pub fn put( &self, - key_expr: &crate::keyexpr::_KeyExpr, - value: &PyAny, - kwargs: Option<&PyDict>, + key_expr: &_KeyExpr, + payload: &Bound, + encoding: Option<_Encoding>, + kwargs: Option<&Bound>, ) -> PyResult<()> { let s = &self.0; let k = &key_expr.0; - let v = value.to_value()?; - let mut builder = s.put(k, v); + let mut builder = s + .put(k, ZBuf::from(payload.as_bytes().to_owned())) + .encoding(encoding.unwrap_or_default().0); if let Some(kwargs) = kwargs { - match kwargs.extract_item::<_SampleKind>("kind") { - Ok(kind) => builder = builder.kind(kind.0), - Err(crate::ExtractError::Other(e)) => return Err(e), - _ => {} - } match kwargs.extract_item::<_CongestionControl>("congestion_control") { Ok(congestion_control) => { builder = builder.congestion_control(congestion_control.0) @@ -93,20 +93,11 @@ impl _Session { } #[pyo3(signature = (key_expr, **kwargs))] - pub fn delete( - &self, - key_expr: &crate::keyexpr::_KeyExpr, - kwargs: Option<&PyDict>, - ) -> PyResult<()> { + pub fn delete(&self, key_expr: &_KeyExpr, kwargs: Option<&Bound>) -> PyResult<()> { let s = &self.0; let k = &key_expr.0; let mut builder = s.delete(k); if let Some(kwargs) = kwargs { - match kwargs.extract_item::<_SampleKind>("kind") { - Ok(kind) => builder = builder.kind(kind.0), - Err(crate::ExtractError::Other(e)) => return Err(e), - _ => {} - } match kwargs.extract_item::<_CongestionControl>("congestion_control") { Ok(congestion_control) => { builder = builder.congestion_control(congestion_control.0) @@ -127,8 +118,8 @@ impl _Session { pub fn get( &self, selector: &_Selector, - callback: &PyAny, - kwargs: Option<&PyDict>, + callback: &Bound, + kwargs: Option<&Bound>, ) -> PyResult<()> { let callback: PyClosure<(_Reply,)> = <_ as TryInto<_>>::try_into(callback)?; let mut builder = self.0.get(&selector.0).with(callback); @@ -143,8 +134,13 @@ impl _Session { Err(crate::ExtractError::Other(e)) => return Err(e), _ => {} } - match kwargs.extract_item::<_Value>("value") { - Ok(value) => builder = builder.with_value(value), + match kwargs.extract_item::>("payload") { + Ok(value) => builder = builder.payload(Payload::Python(value).into_zbuf()), + Err(crate::ExtractError::Other(e)) => return Err(e), + _ => {} + } + match kwargs.extract_item::<_Encoding>("encoding") { + Ok(value) => builder = builder.encoding(value.0), Err(crate::ExtractError::Other(e)) => return Err(e), _ => {} } @@ -163,8 +159,8 @@ impl _Session { pub fn declare_queryable( &self, key_expr: _KeyExpr, - callback: &PyAny, - kwargs: Option<&PyDict>, + callback: &Bound, + kwargs: Option<&Bound>, ) -> PyResult<_Queryable> { let callback: PyClosure<(_Query,)> = <_ as TryInto<_>>::try_into(callback)?; let mut builder = self.0.declare_queryable(key_expr.0).with(callback); @@ -185,7 +181,7 @@ impl _Session { pub fn declare_publisher( &self, key_expr: _KeyExpr, - kwargs: Option<&PyDict>, + kwargs: Option<&Bound>, ) -> PyResult<_Publisher> { let mut builder = self.0.declare_publisher(key_expr.0); if let Some(kwargs) = kwargs { @@ -210,8 +206,8 @@ impl _Session { pub fn declare_subscriber( &self, key_expr: &_KeyExpr, - callback: &PyAny, - kwargs: Option<&PyDict>, + callback: &Bound, + kwargs: Option<&Bound>, ) -> PyResult<_Subscriber> { let callback: PyClosure<(_Sample,)> = <_ as TryInto<_>>::try_into(callback)?; let mut builder = self.0.declare_subscriber(&key_expr.0).with(callback); @@ -226,30 +222,6 @@ impl _Session { Ok(_Subscriber(subscriber)) } - #[pyo3(signature = (key_expr, callback, **kwargs))] - pub fn declare_pull_subscriber( - &self, - key_expr: &_KeyExpr, - callback: &PyAny, - kwargs: Option<&PyDict>, - ) -> PyResult<_PullSubscriber> { - let callback: PyClosure<(_Sample,)> = <_ as TryInto<_>>::try_into(callback)?; - let mut builder = self - .0 - .declare_subscriber(&key_expr.0) - .pull_mode() - .with(callback); - if let Some(kwargs) = kwargs { - match kwargs.extract_item::<_Reliability>("reliability") { - Ok(reliabilty) => builder = builder.reliability(reliabilty.0), - Err(crate::ExtractError::Other(e)) => return Err(e), - _ => {} - } - } - let subscriber = builder.res().map_err(|e| e.to_pyerr())?; - Ok(_PullSubscriber(subscriber)) - } - pub fn zid(&self) -> _ZenohId { _ZenohId(self.0.zid()) } @@ -279,8 +251,12 @@ impl _Publisher { pub fn key_expr(&self) -> _KeyExpr { _KeyExpr(self.0.key_expr().clone()) } - pub fn put(&self, value: _Value) -> PyResult<()> { - self.0.put(value).res_sync().map_err(|e| e.to_pyerr()) + pub fn put(&self, payload: Py, encoding: Option<_Encoding>) -> PyResult<()> { + self.0 + .put(Payload::Python(payload).into_zbuf()) + .encoding(encoding.unwrap_or_default().0) + .res_sync() + .map_err(|e| e.to_pyerr()) } pub fn delete(&self) -> PyResult<()> { self.0.delete().res_sync().map_err(|e| e.to_pyerr()) @@ -290,20 +266,15 @@ impl _Publisher { #[pyclass(subclass)] pub struct _Subscriber(Subscriber<'static, ()>); -#[pyclass(subclass)] -pub struct _PullSubscriber(PullSubscriber<'static, ()>); -#[pymethods] -impl _PullSubscriber { - fn pull(&self) -> PyResult<()> { - self.0.pull().res_sync().map_err(|e| e.to_pyerr()) - } -} - #[pyclass(subclass)] pub struct _Scout(Scout<()>); #[pyfunction] -pub fn scout(callback: &PyAny, config: Option<&_Config>, what: Option<&str>) -> PyResult<_Scout> { +pub fn scout( + callback: &Bound, + config: Option<&_Config>, + what: Option<&str>, +) -> PyResult<_Scout> { let callback: PyClosure<(_Hello,)> = <_ as TryInto<_>>::try_into(callback)?; let what: WhatAmIMatcher = match what { None => WhatAmI::Client | WhatAmI::Peer | WhatAmI::Router, diff --git a/src/value.rs b/src/value.rs index 33157866..831760b9 100644 --- a/src/value.rs +++ b/src/value.rs @@ -12,6 +12,9 @@ use pyo3::{prelude::*, types::PyBytes}; use uhlc::Timestamp; +use zenoh::prelude::{TimestampBuilderTrait, ValueBuilderTrait}; +use zenoh::sample::builder::SampleBuilder; +use zenoh::sample::SampleKind; use zenoh::{ prelude::{Encoding, KeyExpr, Sample, Value, ZenohId}, query::Reply, @@ -47,7 +50,7 @@ impl Payload { let len = buf.len(); Python::with_gil(|py| { Py::from( - PyBytes::new_with(py, len, |mut bytes| { + PyBytes::new_bound_with(py, len, |mut bytes| { for slice in buf.slices() { let len = slice.len(); bytes[..len].copy_from_slice(slice); @@ -108,7 +111,7 @@ impl _Value { pub fn new(payload: Py, encoding: Option<_Encoding>) -> Self { Self { payload: payload.into(), - encoding: encoding.map(|e| e.0).unwrap_or(Encoding::EMPTY), + encoding: encoding.map(|e| e.0).unwrap_or_default(), } } #[getter] @@ -138,7 +141,7 @@ impl _Value { impl From for _Value { fn from(value: Value) -> Self { _Value { - payload: value.payload.into(), + payload: Payload::Zenoh(value.payload.into()), encoding: value.encoding, } } @@ -149,17 +152,6 @@ impl From<_Value> for Value { } } -pub(crate) trait PyAnyToValue { - fn to_value(self) -> PyResult; -} -impl PyAnyToValue for &PyAny { - fn to_value(self) -> PyResult { - let encoding: _Encoding = self.getattr("encoding")?.extract()?; - let payload: &PyBytes = self.getattr("payload")?.extract()?; - Ok(Value::new(ZBuf::from(payload.as_bytes().to_owned())).encoding(encoding.0)) - } -} - #[pyclass(subclass)] #[derive(Clone, Debug, Default)] pub struct _QoS(pub(crate) QoS); @@ -192,27 +184,21 @@ impl _QoS { #[derive(Clone, Debug)] pub struct _Sample { key_expr: KeyExpr<'static>, - value: _Value, + payload: Payload, + encoding: Encoding, kind: _SampleKind, timestamp: Option<_Timestamp>, qos: _QoS, } impl From for _Sample { fn from(sample: Sample) -> Self { - let Sample { - key_expr, - value, - kind, - timestamp, - qos, - .. - } = sample; _Sample { - key_expr, - value: value.into(), - kind: _SampleKind(kind), - timestamp: timestamp.map(_Timestamp), - qos: _QoS(qos), + key_expr: sample.key_expr().clone(), + payload: Payload::Zenoh(sample.payload().into()), + encoding: sample.encoding().clone(), + kind: _SampleKind(sample.kind()), + timestamp: sample.timestamp().cloned().map(_Timestamp), + qos: _QoS(*sample.qos()), } } } @@ -277,26 +263,22 @@ impl _Sample { this } #[getter] - pub fn value(&self) -> _Value { - self.value.clone() - } - #[getter] pub fn key_expr(&self) -> _KeyExpr { _KeyExpr(self.key_expr.clone()) } #[getter] pub fn payload(&mut self) -> Py { - if let Payload::Python(buf) = &self.value.payload { + if let Payload::Python(buf) = &self.payload { return buf.clone(); } - let payload = unsafe { std::ptr::read(&self.value.payload) }; + let payload = unsafe { std::ptr::read(&self.payload) }; let buf = payload.into_pybytes(); - unsafe { std::ptr::write(&mut self.value.payload, Payload::Python(buf.clone())) }; + unsafe { std::ptr::write(&mut self.payload, Payload::Python(buf.clone())) }; buf } #[getter] pub fn encoding(&self) -> _Encoding { - _Encoding(self.value.encoding.clone()) + _Encoding(self.encoding.clone()) } #[getter] pub fn qos(&self) -> _QoS { @@ -313,16 +295,18 @@ impl _Sample { #[staticmethod] pub fn new( key_expr: _KeyExpr, - value: _Value, - qos: _QoS, - kind: _SampleKind, + payload: Py, + encoding: Option<_Encoding>, + qos: Option<_QoS>, + kind: Option<_SampleKind>, timestamp: Option<_Timestamp>, ) -> Self { _Sample { key_expr: key_expr.0, - value, - qos, - kind, + payload: payload.into(), + encoding: encoding.unwrap_or_default().0, + qos: qos.unwrap_or_default(), + kind: kind.unwrap_or_default(), timestamp, } } @@ -335,16 +319,23 @@ impl From<_Sample> for Sample { fn from(sample: _Sample) -> Self { let _Sample { key_expr, - value, + payload, + encoding, kind, timestamp, qos, } = sample; - let mut sample = Sample::new(key_expr, value); - sample.kind = kind.0; - sample.timestamp = timestamp.map(|t| t.0); - sample.qos = qos.0; - sample + match kind.0 { + SampleKind::Put => SampleBuilder::put(key_expr, payload.into_zbuf()) + .encoding(encoding) + .timestamp(timestamp.map(|t| t.0)) + .qos(qos.0) + .into(), + SampleKind::Delete => SampleBuilder::delete(key_expr) + .timestamp(timestamp.map(|t| t.0)) + .qos(qos.0) + .into(), + } } } diff --git a/tests/examples_check.py b/tests/examples_check.py index 6c2d3e93..8a43edbf 100644 --- a/tests/examples_check.py +++ b/tests/examples_check.py @@ -81,7 +81,6 @@ def time(self): storage = Pyrun("z_storage.py") sub = Pyrun("z_sub.py") -pull = Pyrun("z_pull.py") time.sleep(1) put = Pyrun("z_put.py") if put.status(): @@ -91,21 +90,6 @@ def time(self): pub = Pyrun("z_pub.py", ["--iter=2"]) time.sleep(4) -pull.interrupt() -if pub.status(): - pub.dbg() - errors.append(pub.status()) -if pull.status(KILL): - pull.dbg() - errors.append(pull.status(KILL)) -subout = "".join(pull.stdout) -if not ("Received PUT ('demo/example/zenoh-python-put': 'Put from Python!')" in subout): - errors.append("z_pull didn't catch put") -if not ("Received PUT ('demo/example/zenoh-python-pub': '[ 1] Pub from Python!')" in subout): - errors.append("z_pull didn't catch second z_pub") -if any(("z_pull" in error) for error in errors): - pull.dbg() - queryable = Pyrun("z_queryable.py", ["-k=demo/example/zenoh-python-queryable"]) time.sleep(1) get = Pyrun("z_get.py", ["-s=demo/example/zenoh-python-queryable"]) diff --git a/zenoh/__init__.py b/zenoh/__init__.py index d84f07d3..a66ffcff 100644 --- a/zenoh/__init__.py +++ b/zenoh/__init__.py @@ -14,9 +14,9 @@ from .zenoh import init_logger, scout as _scout from .keyexpr import IntoKeyExpr, IntoSelector, KeyExpr, Selector from .config import Config -from .session import Session, Publisher, Subscriber, PullSubscriber, Info +from .session import Session, Publisher, Subscriber, Info from .enums import CongestionControl, Encoding, Priority, QueryConsolidation, QueryTarget, Reliability, SampleKind -from .value import Hello, Value, IntoValue, IValue, Sample, IntoSample, ZenohId, Timestamp, Reply +from .value import into_payload, from_payload, Hello, Sample, ZenohId, Timestamp, Reply from .closures import Closure, IClosure, IntoClosure, Handler, IHandler, IntoHandler, ListCollector, Queue from .queryable import Queryable, Query from typing import Any diff --git a/zenoh/enums.py b/zenoh/enums.py index 1d9281cb..e1520fc7 100644 --- a/zenoh/enums.py +++ b/zenoh/enums.py @@ -105,47 +105,89 @@ def __new__(cls, inner: _Encoding): @staticmethod def from_str(s: str) -> 'Encoding': return super(Encoding, Encoding).from_str(s) - def append(self, s: str): - super().append(s) + def with_schema(self, s: str): + super().with_schema(s) @staticmethod - def EMPTY() -> 'Encoding': - return Encoding(_Encoding.EMPTY ) + def ZENOH_BYTES() -> 'Encoding': + return Encoding(_Encoding.ZENOH_BYTES) @staticmethod - def APP_OCTET_STREAM() -> 'Encoding': - return Encoding(_Encoding.APP_OCTET_STREAM) + def ZENOH_INT() -> 'Encoding': + return Encoding(_Encoding.ZENOH_INT) @staticmethod - def APP_CUSTOM() -> 'Encoding': - return Encoding(_Encoding.APP_CUSTOM) + def ZENOH_UINT() -> 'Encoding': + return Encoding(_Encoding.ZENOH_UINT) + @staticmethod + def ZENOH_FLOAT() -> 'Encoding': + return Encoding(_Encoding.ZENOH_FLOAT) + @staticmethod + def ZENOH_BOOL() -> 'Encoding': + return Encoding(_Encoding.ZENOH_BOOL) + @staticmethod + def ZENOH_STRING() -> 'Encoding': + return Encoding(_Encoding.ZENOH_STRING) + @staticmethod + def ZENOH_ERROR() -> 'Encoding': + return Encoding(_Encoding.ZENOH_ERROR) + @staticmethod + def APPLICATION_OCTET_STREAM() -> 'Encoding': + return Encoding(_Encoding.APPLICATION_OCTET_STREAM) @staticmethod def TEXT_PLAIN() -> 'Encoding': return Encoding(_Encoding.TEXT_PLAIN) @staticmethod - def APP_PROPERTIES() -> 'Encoding': - return Encoding(_Encoding.APP_PROPERTIES) + def APPLICATION_JSON() -> 'Encoding': + return Encoding(_Encoding.APPLICATION_JSON) + @staticmethod + def TEXT_JSON() -> 'Encoding': + return Encoding(_Encoding.TEXT_JSON) + @staticmethod + def APPLICATION_CDR() -> 'Encoding': + return Encoding(_Encoding.APPLICATION_CDR) @staticmethod - def APP_JSON() -> 'Encoding': - return Encoding(_Encoding.APP_JSON) + def APPLICATION_CBOR() -> 'Encoding': + return Encoding(_Encoding.APPLICATION_CBOR) @staticmethod - def APP_SQL() -> 'Encoding': - return Encoding(_Encoding.APP_SQL) + def APPLICATION_YAML() -> 'Encoding': + return Encoding(_Encoding.APPLICATION_YAML) @staticmethod - def APP_INTEGER() -> 'Encoding': - return Encoding(_Encoding.APP_INTEGER) + def TEXT_YAML() -> 'Encoding': + return Encoding(_Encoding.TEXT_YAML) @staticmethod - def APP_FLOAT() -> 'Encoding': - return Encoding(_Encoding.APP_FLOAT) + def TEXT_JSON5() -> 'Encoding': + return Encoding(_Encoding.TEXT_JSON5) @staticmethod - def APP_XML() -> 'Encoding': - return Encoding(_Encoding.APP_XML) + def APPLICATION_PYTHON_SERIALIZED_OBJECT() -> 'Encoding': + return Encoding(_Encoding.APPLICATION_PYTHON_SERIALIZED_OBJECT) @staticmethod - def APP_XHTML_XML() -> 'Encoding': - return Encoding(_Encoding.APP_XHTML_XML) + def APPLICATION_PROTOBUF() -> 'Encoding': + return Encoding(_Encoding.APPLICATION_PROTOBUF) @staticmethod - def APP_X_WWW_FORM_URLENCODED() -> 'Encoding': - return Encoding(_Encoding.APP_X_WWW_FORM_URLENCODED) + def APPLICATION_JAVA_SERIALIZED_OBJECT() -> 'Encoding': + return Encoding(_Encoding.APPLICATION_JAVA_SERIALIZED_OBJECT) @staticmethod - def TEXT_JSON() -> 'Encoding': - return Encoding(_Encoding.TEXT_JSON) + def APPLICATION_OPENMETRICS_TEXT() -> 'Encoding': + return Encoding(_Encoding.APPLICATION_OPENMETRICS_TEXT) + @staticmethod + def IMAGE_PNG() -> 'Encoding': + return Encoding(_Encoding.IMAGE_PNG) + @staticmethod + def IMAGE_JPEG() -> 'Encoding': + return Encoding(_Encoding.IMAGE_JPEG) + @staticmethod + def IMAGE_GIF() -> 'Encoding': + return Encoding(_Encoding.IMAGE_GIF) + @staticmethod + def IMAGE_BMP() -> 'Encoding': + return Encoding(_Encoding.IMAGE_BMP) + @staticmethod + def IMAGE_WEBP() -> 'Encoding': + return Encoding(_Encoding.IMAGE_WEBP) + @staticmethod + def APPLICATION_XML() -> 'Encoding': + return Encoding(_Encoding.APPLICATION_XML) + @staticmethod + def APPLICATION_X_WWW_FORM_URLENCODED() -> 'Encoding': + return Encoding(_Encoding.APPLICATION_X_WWW_FORM_URLENCODED) @staticmethod def TEXT_HTML() -> 'Encoding': return Encoding(_Encoding.TEXT_HTML) @@ -156,20 +198,86 @@ def TEXT_XML() -> 'Encoding': def TEXT_CSS() -> 'Encoding': return Encoding(_Encoding.TEXT_CSS) @staticmethod + def TEXT_JAVASCRIPT() -> 'Encoding': + return Encoding(_Encoding.TEXT_JAVASCRIPT) + @staticmethod + def TEXT_MARKDOWN() -> 'Encoding': + return Encoding(_Encoding.TEXT_MARKDOWN) + @staticmethod def TEXT_CSV() -> 'Encoding': return Encoding(_Encoding.TEXT_CSV) @staticmethod - def TEXT_JAVASCRIPT() -> 'Encoding': - return Encoding(_Encoding.TEXT_JAVASCRIPT) + def APPLICATION_SQL() -> 'Encoding': + return Encoding(_Encoding.APPLICATION_SQL) @staticmethod - def IMAGE_JPEG() -> 'Encoding': - return Encoding(_Encoding.IMAGE_JPEG) + def APPLICATION_COAP_PAYLOAD() -> 'Encoding': + return Encoding(_Encoding.APPLICATION_COAP_PAYLOAD) @staticmethod - def IMAGE_PNG() -> 'Encoding': - return Encoding(_Encoding.IMAGE_PNG) + def APPLICATION_JSON_PATCH_JSON() -> 'Encoding': + return Encoding(_Encoding.APPLICATION_JSON_PATCH_JSON) @staticmethod - def IMAGE_GIF() -> 'Encoding': - return Encoding(_Encoding.IMAGE_GIF) + def APPLICATION_JSON_SEQ() -> 'Encoding': + return Encoding(_Encoding.APPLICATION_JSON_SEQ) + @staticmethod + def APPLICATION_JSONPATH() -> 'Encoding': + return Encoding(_Encoding.APPLICATION_JSONPATH) + @staticmethod + def APPLICATION_JWT() -> 'Encoding': + return Encoding(_Encoding.APPLICATION_JWT) + @staticmethod + def APPLICATION_MP4() -> 'Encoding': + return Encoding(_Encoding.APPLICATION_MP4) + @staticmethod + def APPLICATION_SOAP_XML() -> 'Encoding': + return Encoding(_Encoding.APPLICATION_SOAP_XML) + @staticmethod + def APPLICATION_YANG() -> 'Encoding': + return Encoding(_Encoding.APPLICATION_YANG) + @staticmethod + def AUDIO_AAC() -> 'Encoding': + return Encoding(_Encoding.AUDIO_AAC) + @staticmethod + def AUDIO_FLAC() -> 'Encoding': + return Encoding(_Encoding.AUDIO_FLAC) + @staticmethod + def AUDIO_MP4() -> 'Encoding': + return Encoding(_Encoding.AUDIO_MP4) + @staticmethod + def AUDIO_OGG() -> 'Encoding': + return Encoding(_Encoding.AUDIO_OGG) + @staticmethod + def AUDIO_VORBIS() -> 'Encoding': + return Encoding(_Encoding.AUDIO_VORBIS) + @staticmethod + def VIDEO_H261() -> 'Encoding': + return Encoding(_Encoding.VIDEO_H261) + @staticmethod + def VIDEO_H263() -> 'Encoding': + return Encoding(_Encoding.VIDEO_H263) + @staticmethod + def VIDEO_H264() -> 'Encoding': + return Encoding(_Encoding.VIDEO_H264) + @staticmethod + def VIDEO_H265() -> 'Encoding': + return Encoding(_Encoding.VIDEO_H265) + @staticmethod + def VIDEO_H266() -> 'Encoding': + return Encoding(_Encoding.VIDEO_H266) + @staticmethod + def VIDEO_MP4() -> 'Encoding': + return Encoding(_Encoding.VIDEO_MP4) + @staticmethod + def VIDEO_OGG() -> 'Encoding': + return Encoding(_Encoding.VIDEO_OGG) + @staticmethod + def VIDEO_RAW() -> 'Encoding': + return Encoding(_Encoding.VIDEO_RAW) + @staticmethod + def VIDEO_VP8() -> 'Encoding': + return Encoding(_Encoding.VIDEO_VP8) + @staticmethod + def VIDEO_VP9() -> 'Encoding': + return Encoding(_Encoding.VIDEO_VP9) def __eq__(self, other) -> bool: return super().__eq__(other) def __ne__(self, other) -> bool: diff --git a/zenoh/queryable.py b/zenoh/queryable.py index bfe161f6..a9c14148 100644 --- a/zenoh/queryable.py +++ b/zenoh/queryable.py @@ -15,7 +15,8 @@ from .zenoh import _Query, _Queryable from .keyexpr import KeyExpr, Selector -from .value import Sample, Value, IntoValue, IntoSample +from .value import Sample, Value, IntoPayload, into_payload +from .enums import Encoding class Queryable: """ @@ -74,10 +75,10 @@ def reply(self, sample: Sample): You may send any amount of replies to a single query, including 0. """ super().reply(sample) - def reply_err(self, value: IntoValue): + def reply_err(self, payload: IntoPayload, encoding: Encoding = None): """ Allows you to reply to a query with an error. You may send any amount of replies to a single query, including 0. Sending error responses does not exclude sending other responses. """ - super().reply_err(Value(value)) + super().reply_err(into_payload(payload), encoding) diff --git a/zenoh/session.py b/zenoh/session.py index 02f62849..4223424b 100644 --- a/zenoh/session.py +++ b/zenoh/session.py @@ -11,15 +11,15 @@ # Contributors: # ZettaScale Zenoh Team, # -from typing import Union, Any, List +from typing import Union, Any, List, overload -from .zenoh import _Session, _Config, _Publisher, _Subscriber, _PullSubscriber +from .zenoh import _Session, _Config, _Publisher, _Subscriber from .keyexpr import KeyExpr, IntoKeyExpr, Selector, IntoSelector from .config import Config from .closures import IntoHandler, Handler, Receiver from .enums import * -from .value import IntoValue, Value, Sample, Reply, ZenohId +from .value import into_payload, IntoPayload, Sample, Reply, ZenohId from .queryable import Queryable, Query @@ -29,9 +29,9 @@ class Publisher: def __init__(self, p: _Publisher): self._inner_ = p - def put(self, value: IntoValue, encoding: Encoding = None): + def put(self, payload: IntoPayload, encoding: Encoding = None): "An optimised version of ``session.put(self.key_expr, value, encoding=encoding)``" - self._inner_.put(Value(value, encoding)) + self._inner_.put(into_payload(payload), encoding) def delete(self): "An optimised version of ``session.delete(self.key_expr)``" @@ -66,34 +66,6 @@ def undeclare(self): self._subscriber_ = None -class PullSubscriber: - """ - A handle to a pull subscription. - - Its main purpose is to keep the subscription active as long as it exists. - - When constructed through ``Session.declare_pull_subscriber(session, keyexpr, handler)``, it exposes ``handler``'s receiver - through ``self.receiver``. - - Calling ``self.pull()`` will prompt the Zenoh network to send a new sample when available. - """ - - def __init__(self, s: _PullSubscriber, receiver=None): - self._subscriber_ = s - self.receiver = receiver - - def pull(self): - """ - Prompts the Zenoh network to send a new sample if available. - Note that this sample will not be returned by this function, but provided to the handler's callback. - """ - self._subscriber_.pull() - - def undeclare(self): - "Undeclares the subscription" - self._subscriber_ = None - - class Session(_Session): """ A Zenoh Session, the core interraction point with a Zenoh network. @@ -108,9 +80,8 @@ def __new__(cls, config: Union[Config, Any] = None): else: return super().__new__(cls, Config.from_obj(config)) - def put(self, keyexpr: IntoKeyExpr, value: IntoValue, encoding=None, - priority: Priority = None, congestion_control: CongestionControl = None, - sample_kind: SampleKind = None): + def put(self, keyexpr: IntoKeyExpr, payload: IntoPayload, encoding: Encoding = None, + priority: Priority = None, congestion_control: CongestionControl = None): """ Sends a value over Zenoh. @@ -118,10 +89,10 @@ def put(self, keyexpr: IntoKeyExpr, value: IntoValue, encoding=None, Storages will store the value if ``keyexpr`` is non-wild, or update the values for all known keys that are included in ``keyexpr`` if it is wild. :param keyexpr: The key expression to publish - :param value: The value to send + :param payload: The payload to send + :param encoding: The encoding of the payload to send :param priority: The priority to use when routing the published data :param congestion_control: The congestion control to use when routing the published data - :param sample_kind: The kind of sample to send :Examples: @@ -129,16 +100,13 @@ def put(self, keyexpr: IntoKeyExpr, value: IntoValue, encoding=None, >>> s = zenoh.open({}) >>> s.put('key/expression', 'value') """ - value = Value(value, encoding) keyexpr = KeyExpr(keyexpr) kwargs = dict() if priority is not None: kwargs['priority'] = priority if congestion_control is not None: kwargs['congestion_control'] = congestion_control - if sample_kind is not None: - kwargs['sample_kind'] = sample_kind - return super().put(keyexpr, value, **kwargs) + return super().put(keyexpr, into_payload(payload), encoding=encoding, **kwargs) def config(self) -> Config: """Returns a configuration object that can be used to alter the session's configuration at runtime. @@ -174,7 +142,7 @@ def delete(self, keyexpr: IntoKeyExpr, kwargs['congestion_control'] = congestion_control return super().delete(keyexpr, **kwargs) - def get(self, selector: IntoSelector, handler: IntoHandler[Reply, Any, Receiver], consolidation: QueryConsolidation = None, target: QueryTarget = None, value: IntoValue = None) -> Receiver: + def get(self, selector: IntoSelector, handler: IntoHandler[Reply, Any, Receiver], consolidation: QueryConsolidation = None, target: QueryTarget = None, payload: IntoPayload = None, encoding: Encoding = None) -> Receiver: """ Emits a query, which queryables with intersecting selectors will be able to reply to. @@ -186,7 +154,8 @@ def get(self, selector: IntoSelector, handler: IntoHandler[Reply, Any, Receiver] :param handler: :param consolidation: The consolidation to apply to replies :param target: The queryables that should be target to this query - :param value: An optional value to attach to this query + :param payload: An optional payload to attach to this query + :param encoding: The encoding of the optional payload :return: The receiver of the handler :rtype: Receiver @@ -223,8 +192,10 @@ def get(self, selector: IntoSelector, handler: IntoHandler[Reply, Any, Receiver] kwargs["consolidation"] = consolidation if target is not None: kwargs["target"] = target - if value is not None: - kwargs["value"] = Value(value) + if payload is not None: + kwargs["payload"] = payload + if encoding is not None: + kwargs["encoding"] = encoding super().get(Selector(selector), handler.closure, **kwargs) return handler.receiver @@ -342,35 +313,6 @@ def declare_subscriber(self, keyexpr: IntoKeyExpr, handler: IntoHandler[Sample, s = super().declare_subscriber(KeyExpr(keyexpr), handler.closure, **kwargs) return Subscriber(s, handler.receiver) - def declare_pull_subscriber(self, keyexpr: IntoKeyExpr, handler: IntoHandler[Sample, Any, Any], reliability: Reliability = None) -> PullSubscriber: - """ - Declares a pull-mode subscriber, which will receive a single published sample with a key expression intersecting ``keyexpr`` any time its ``pull`` method is called. - - These samples are passed to the `handler`'s closure as instances of the `Sample` class. - The `handler` can typically be a queue or a callback. - The `handler`'s receiver is returned as the `receiver` field of the returned `PullSubscriber`. - - :param keyexpr: The key expression to subscribe to - :param handler: - :param reliability: the reliability to use when routing the subscribed samples - :rtype: PullSubscriber - - :Examples: - - >>> import zenoh - >>> s = zenoh.open({}) - >>> sub = s.declare_pull_subscriber('key/expression', lambda sample: - ... print(f"Received '{sample.key_expr}': '{sample.payload.decode('utf-8')}'")) - ... - >>> sub.pull() - """ - handler = Handler(handler, lambda x: Sample._upgrade_(x)) - kwargs = dict() - if reliability is not None: - kwargs['reliability'] = reliability - s = super().declare_pull_subscriber(KeyExpr(keyexpr), handler.closure, **kwargs) - return PullSubscriber(s, handler.receiver) - def close(self): """Attempts to close the Session. diff --git a/zenoh/value.py b/zenoh/value.py index 22ca40f2..be526e04 100644 --- a/zenoh/value.py +++ b/zenoh/value.py @@ -12,60 +12,58 @@ # ZettaScale Zenoh Team, # import abc -from typing import Union, Tuple, Optional, List +from typing import Union, Tuple, Optional, List, Type, TypeVar import json +import struct from .enums import Encoding, SampleKind, Priority, CongestionControl from .zenoh import _Value, _Encoding, _Sample, _SampleKind, _Reply, _ZenohId, _Timestamp, _Hello, _QoS from .keyexpr import KeyExpr, IntoKeyExpr -class IValue: - "The IValue interface exposes how to recover a value's payload in a binary-serialized format, as well as that format's encoding." - @property - @abc.abstractmethod - def payload(self) -> bytes: - "The value itself, as an array of bytes" - ... - - @property - @abc.abstractmethod - def encoding(self) -> Encoding: - "The value's encoding" - ... +IntoPayload = Union[bytes, str, int, float, bool, list, dict] + +def into_payload(obj: Optional[IntoPayload]) -> Optional[bytes]: + if obj is None: + return obj + if isinstance(obj, bytes): + return obj + if isinstance(obj, str): + return obj.encode() + if isinstance(obj, int): + return struct.pack(' T: + if tp == bytes: + return payload + if tp == str: + return payload.decode() + if tp == int: + if len(payload) > 8: + raise ValueError("invalid int payload") + return struct.unpack(' 8: + raise ValueError("invalid float payload") + return struct.unpack(' 'Value': - "Automatically encodes the value based on its type" - if isinstance(value, IValue): - return Value.new(value.payload, value.encoding) - if isinstance(value, bytes): - return Value.new(value, Encoding.APP_OCTET_STREAM()) - if isinstance(value, str): - return Value.new(value.encode(), Encoding.TEXT_PLAIN()) - if isinstance(value, int): - return Value.new(f"{value}".encode(), Encoding.APP_INTEGER()) - if isinstance(value, float): - return Value.new(f"{value}".encode(), Encoding.APP_FLOAT()) - return Value.new(json.dumps(value).encode(), Encoding.APP_JSON()) - + def __new__(cls, payload: IntoPayload, encoding: Encoding=None): + return Value.new(into_payload(payload), encoding) + @staticmethod def new(payload: bytes, encoding: Encoding = None) -> 'Value': return Value._upgrade_(_Value.new(payload, encoding)) @@ -156,24 +154,19 @@ def _upgrade_(inner: _QoS) -> 'QoS': QoS.DEFAULT = QoS() -IntoSample = Union[_Sample, Tuple[IntoKeyExpr, IntoValue, SampleKind], Tuple[KeyExpr, IntoValue]] class Sample(_Sample): """ A KeyExpr-Value pair, annotated with the kind (PUT or DELETE) of publication used to emit it and a timestamp. """ - def __new__(cls, key: IntoKeyExpr, value: IntoValue, kind: SampleKind = None, qos:QoS = None, timestamp: Timestamp = None): + def __new__(cls, key: IntoKeyExpr, payload: IntoPayload, *, encoding: Encoding = None, kind: SampleKind = None, qos:QoS = None, timestamp: Timestamp = None): kind = _SampleKind.PUT if kind is None else kind qos = QoS.DEFAULT if qos is None else qos - return Sample._upgrade_(super().new(KeyExpr(key), Value(value), qos, kind, timestamp)) + return Sample._upgrade_(super().new(KeyExpr(key), into_payload(payload), encoding, qos, kind, timestamp)) @property def key_expr(self) -> KeyExpr: "The sample's key expression" return KeyExpr(super().key_expr) @property - def value(self) -> Value: - "The sample's value" - return Value._upgrade_(super().value) - @property def payload(self) -> bytes: "A shortcut to ``self.value.payload``" return super().payload