diff --git a/Cargo.lock b/Cargo.lock index 81cbe4e7..4b4c3b77 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -99,7 +99,7 @@ dependencies = [ "nom", "num-traits", "rusticata-macros", - "thiserror 2.0.17", + "thiserror 2.0.18", "time", ] @@ -217,9 +217,9 @@ checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3" [[package]] name = "cc" -version = "1.2.52" +version = "1.2.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd4932aefd12402b36c60956a4fe0035421f544799057659ff86f923657aada3" +checksum = "755d2fce177175ffca841e9a06afdb2c4ab0f593d53b4dee48147dfaade85932" dependencies = [ "find-msvc-tools", "shlex", @@ -591,9 +591,9 @@ checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "find-msvc-tools" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f449e6c6c08c865631d4890cfacf252b3d396c9bcc83adb6623cdb02a8336c41" +checksum = "8591b0bcc8a98a64310a2fae1bb3e9b8564dd10e381e6e28010fde8e8e8568db" [[package]] name = "fixedbitset" @@ -1157,9 +1157,9 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "js-sys" -version = "0.3.84" +version = "0.3.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "992dc2f5318945507d390b324ab307c7e7ef69da0002cd14f178a5f37e289dc5" +checksum = "8c942ebf8e95485ca0d52d97da7c5a2c387d0e7f0ba4c35e93bfcaee045955b3" dependencies = [ "once_cell", "wasm-bindgen", @@ -1472,9 +1472,9 @@ checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "openssl-probe" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f50d9b3dabb09ecd771ad0aa242ca6894994c130308ca3d7684634df8037391" +checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" [[package]] name = "option-ext" @@ -1564,7 +1564,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6" dependencies = [ "memchr", - "thiserror 2.0.17", + "thiserror 2.0.18", "ucd-trie", ] @@ -1754,9 +1754,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.105" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "535d180e0ecab6268a3e718bb9fd44db66bbbc256257165fc699dadf70d16fe7" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" dependencies = [ "unicode-ident", ] @@ -1860,7 +1860,7 @@ dependencies = [ "rustc-hash", "rustls", "socket2 0.6.1", - "thiserror 2.0.17", + "thiserror 2.0.18", "tokio", "tracing", "web-time", @@ -1883,7 +1883,7 @@ dependencies = [ "rustls-pki-types", "rustls-platform-verifier", "slab", - "thiserror 2.0.17", + "thiserror 2.0.18", "tinyvec", "tracing", "web-time", @@ -2003,7 +2003,7 @@ checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac" dependencies = [ "getrandom 0.2.17", "libredox", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -2163,9 +2163,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.13.2" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21e6f2ab2928ca4291b86736a8bd920a277a399bba1589409d72154ff87c1282" +checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd" dependencies = [ "web-time", "zeroize", @@ -2200,9 +2200,9 @@ checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" [[package]] name = "rustls-webpki" -version = "0.103.8" +version = "0.103.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ffdfa2f5286e2247234e03f680868ac2815974dc39e00ea15adc445d0aafe52" +checksum = "d7df23109aa6c1567d1c575b9952556388da57401e4ace1d15f79eedad0d8f53" dependencies = [ "ring", "rustls-pki-types", @@ -2376,6 +2376,15 @@ dependencies = [ "zmij", ] +[[package]] +name = "serde_spanned" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2789234a13a53fc4be1b51ea1bab45a3c338bdb884862a257d10e5a74ae009e6" +dependencies = [ + "serde_core", +] + [[package]] name = "serde_with" version = "3.14.1" @@ -2705,11 +2714,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.17" +version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" dependencies = [ - "thiserror-impl 2.0.17", + "thiserror-impl 2.0.18", ] [[package]] @@ -2725,9 +2734,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.17" +version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" dependencies = [ "proc-macro2", "quote", @@ -2821,7 +2830,7 @@ checksum = "ab41256c16d6fc2b3021545f20bf77a73200b18bd54040ac656dddfca6205bfa" dependencies = [ "futures-util", "pin-project-lite", - "thiserror 2.0.17", + "thiserror 2.0.18", "tokio", "tokio-rustls", ] @@ -2899,6 +2908,21 @@ dependencies = [ "tokio", ] +[[package]] +name = "toml" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae2a4cf385da23d1d53bc15cdfa5c2109e93d8d362393c801e87da2f72f0e201" +dependencies = [ + "indexmap 2.11.4", + "serde_core", + "serde_spanned", + "toml_datetime", + "toml_parser", + "toml_writer", + "winnow", +] + [[package]] name = "toml_datetime" version = "0.7.1" @@ -2929,6 +2953,12 @@ dependencies = [ "winnow", ] +[[package]] +name = "toml_writer" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc842091f2def52017664b53082ecbbeb5c7731092bad69d2c63050401dfd64" + [[package]] name = "tracing" version = "0.1.44" @@ -3206,18 +3236,18 @@ checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasip2" -version = "1.0.1+wasi-0.2.4" +version = "1.0.2+wasi-0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" +checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" dependencies = [ "wit-bindgen", ] [[package]] name = "wasm-bindgen" -version = "0.2.107" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1310980282a2842658e512a8bd683c962bbf9395e0544fa7bc0509343b8f7d10" +checksum = "64024a30ec1e37399cf85a7ffefebdb72205ca1c972291c51512360d90bd8566" dependencies = [ "cfg-if", "once_cell", @@ -3228,9 +3258,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.107" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d83321b348310f762bebefa30cd9504f673f3b554a53755eaa93af8272d28f7b" +checksum = "008b239d9c740232e71bd39e8ef6429d27097518b6b30bdf9086833bd5b6d608" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3238,9 +3268,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.107" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6971fd7d06a3063afaaf6b843a2b2b16c3d84b42f4e2ec4e0c8deafbcb179708" +checksum = "5256bae2d58f54820e6490f9839c49780dff84c65aeab9e772f15d5f0e913a55" dependencies = [ "bumpalo", "proc-macro2", @@ -3251,9 +3281,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.107" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54d2e1dc11b30bef0c334a34e7c7a1ed57cff1b602ad7eb6e5595e2e1e60bd62" +checksum = "1f01b580c9ac74c8d8f0c0e4afb04eeef2acf145458e52c03845ee9cd23e3d12" dependencies = [ "unicode-ident", ] @@ -3661,9 +3691,9 @@ dependencies = [ [[package]] name = "wit-bindgen" -version = "0.46.0" +version = "0.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" +checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" [[package]] name = "write16" @@ -3690,7 +3720,7 @@ dependencies = [ "nom", "oid-registry", "rusticata-macros", - "thiserror 2.0.17", + "thiserror 2.0.18", "time", ] @@ -3721,7 +3751,7 @@ dependencies = [ [[package]] name = "zenoh" version = "1.7.2" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#27b07a5fca9cef93bb70dba2d5feac0c6d623d95" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8d059ff902f1938963a2b78ece166784651a05ef" dependencies = [ "ahash", "arc-swap", @@ -3773,7 +3803,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "1.7.2" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#27b07a5fca9cef93bb70dba2d5feac0c6d623d95" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8d059ff902f1938963a2b78ece166784651a05ef" dependencies = [ "zenoh-collections", ] @@ -3781,7 +3811,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "1.7.2" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#27b07a5fca9cef93bb70dba2d5feac0c6d623d95" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8d059ff902f1938963a2b78ece166784651a05ef" dependencies = [ "tracing", "uhlc", @@ -3793,7 +3823,7 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "1.7.2" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#27b07a5fca9cef93bb70dba2d5feac0c6d623d95" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8d059ff902f1938963a2b78ece166784651a05ef" dependencies = [ "ahash", ] @@ -3801,7 +3831,7 @@ dependencies = [ [[package]] name = "zenoh-config" version = "1.7.2" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#27b07a5fca9cef93bb70dba2d5feac0c6d623d95" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8d059ff902f1938963a2b78ece166784651a05ef" dependencies = [ "json5", "nonempty-collections", @@ -3811,6 +3841,7 @@ dependencies = [ "serde_json", "serde_with", "serde_yaml", + "toml", "tracing", "uhlc", "validated_struct", @@ -3825,7 +3856,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "1.7.2" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#27b07a5fca9cef93bb70dba2d5feac0c6d623d95" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8d059ff902f1938963a2b78ece166784651a05ef" dependencies = [ "lazy_static", "tokio", @@ -3836,7 +3867,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "1.7.2" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#27b07a5fca9cef93bb70dba2d5feac0c6d623d95" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8d059ff902f1938963a2b78ece166784651a05ef" dependencies = [ "aes", "hmac", @@ -3849,7 +3880,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "1.7.2" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#27b07a5fca9cef93bb70dba2d5feac0c6d623d95" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8d059ff902f1938963a2b78ece166784651a05ef" dependencies = [ "async-trait", "bincode", @@ -3868,7 +3899,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "1.7.2" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#27b07a5fca9cef93bb70dba2d5feac0c6d623d95" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8d059ff902f1938963a2b78ece166784651a05ef" dependencies = [ "getrandom 0.2.17", "hashbrown 0.16.1", @@ -3883,7 +3914,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "1.7.2" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#27b07a5fca9cef93bb70dba2d5feac0c6d623d95" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8d059ff902f1938963a2b78ece166784651a05ef" dependencies = [ "zenoh-config", "zenoh-link-commons", @@ -3901,7 +3932,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "1.7.2" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#27b07a5fca9cef93bb70dba2d5feac0c6d623d95" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8d059ff902f1938963a2b78ece166784651a05ef" dependencies = [ "async-trait", "base64", @@ -3934,7 +3965,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "1.7.2" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#27b07a5fca9cef93bb70dba2d5feac0c6d623d95" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8d059ff902f1938963a2b78ece166784651a05ef" dependencies = [ "async-trait", "base64", @@ -3959,7 +3990,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic_datagram" version = "1.7.2" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#27b07a5fca9cef93bb70dba2d5feac0c6d623d95" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8d059ff902f1938963a2b78ece166784651a05ef" dependencies = [ "async-trait", "quinn", @@ -3979,7 +4010,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "1.7.2" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#27b07a5fca9cef93bb70dba2d5feac0c6d623d95" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8d059ff902f1938963a2b78ece166784651a05ef" dependencies = [ "async-trait", "socket2 0.5.10", @@ -3996,7 +4027,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "1.7.2" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#27b07a5fca9cef93bb70dba2d5feac0c6d623d95" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8d059ff902f1938963a2b78ece166784651a05ef" dependencies = [ "async-trait", "base64", @@ -4025,7 +4056,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "1.7.2" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#27b07a5fca9cef93bb70dba2d5feac0c6d623d95" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8d059ff902f1938963a2b78ece166784651a05ef" dependencies = [ "async-trait", "libc", @@ -4046,7 +4077,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "1.7.2" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#27b07a5fca9cef93bb70dba2d5feac0c6d623d95" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8d059ff902f1938963a2b78ece166784651a05ef" dependencies = [ "async-trait", "nix", @@ -4064,7 +4095,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "1.7.2" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#27b07a5fca9cef93bb70dba2d5feac0c6d623d95" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8d059ff902f1938963a2b78ece166784651a05ef" dependencies = [ "async-trait", "futures-util", @@ -4084,7 +4115,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "1.7.2" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#27b07a5fca9cef93bb70dba2d5feac0c6d623d95" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8d059ff902f1938963a2b78ece166784651a05ef" dependencies = [ "proc-macro2", "quote", @@ -4095,7 +4126,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "1.7.2" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#27b07a5fca9cef93bb70dba2d5feac0c6d623d95" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8d059ff902f1938963a2b78ece166784651a05ef" dependencies = [ "git-version", "libloading", @@ -4112,7 +4143,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "1.7.2" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#27b07a5fca9cef93bb70dba2d5feac0c6d623d95" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8d059ff902f1938963a2b78ece166784651a05ef" dependencies = [ "const_format", "rand 0.8.5", @@ -4137,7 +4168,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "1.7.2" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#27b07a5fca9cef93bb70dba2d5feac0c6d623d95" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8d059ff902f1938963a2b78ece166784651a05ef" dependencies = [ "anyhow", ] @@ -4145,7 +4176,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "1.7.2" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#27b07a5fca9cef93bb70dba2d5feac0c6d623d95" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8d059ff902f1938963a2b78ece166784651a05ef" dependencies = [ "lazy_static", "ron", @@ -4159,7 +4190,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "1.7.2" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#27b07a5fca9cef93bb70dba2d5feac0c6d623d95" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8d059ff902f1938963a2b78ece166784651a05ef" dependencies = [ "advisory-lock", "async-trait", @@ -4188,7 +4219,7 @@ dependencies = [ [[package]] name = "zenoh-stats" version = "1.7.2" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#27b07a5fca9cef93bb70dba2d5feac0c6d623d95" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8d059ff902f1938963a2b78ece166784651a05ef" dependencies = [ "ahash", "prometheus-client", @@ -4201,7 +4232,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "1.7.2" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#27b07a5fca9cef93bb70dba2d5feac0c6d623d95" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8d059ff902f1938963a2b78ece166784651a05ef" dependencies = [ "arc-swap", "event-listener", @@ -4215,7 +4246,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "1.7.2" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#27b07a5fca9cef93bb70dba2d5feac0c6d623d95" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8d059ff902f1938963a2b78ece166784651a05ef" dependencies = [ "futures", "tokio", @@ -4228,7 +4259,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "1.7.2" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#27b07a5fca9cef93bb70dba2d5feac0c6d623d95" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8d059ff902f1938963a2b78ece166784651a05ef" dependencies = [ "async-trait", "crossbeam-utils", @@ -4263,7 +4294,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "1.7.2" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#27b07a5fca9cef93bb70dba2d5feac0c6d623d95" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8d059ff902f1938963a2b78ece166784651a05ef" dependencies = [ "async-trait", "const_format", @@ -4357,6 +4388,6 @@ dependencies = [ [[package]] name = "zmij" -version = "1.0.14" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd8f3f50b848df28f887acb68e41201b5aea6bc8a8dacc00fb40635ff9a72fea" +checksum = "dfcd145825aace48cff44a8844de64bf75feec3080e0aa5cdbde72961ae51a65" diff --git a/examples/z_info.py b/examples/z_info.py index 4b3edf2c..5abbffd9 100644 --- a/examples/z_info.py +++ b/examples/z_info.py @@ -11,6 +11,8 @@ # Contributors: # ZettaScale Zenoh Team, # +import time + import zenoh @@ -24,6 +26,30 @@ def main(conf: zenoh.Config): print(f"zid: {info.zid()}") print(f"routers: {info.routers_zid()}") print(f"peers: {info.peers_zid()}") + print("transports:") + for t in info.transports(): + print(f" - {t}") + print("links:") + for l in info.links(): + print(f" - {l}") + + # listen for transport and link events using try_recv polling + transport_listener = info.declare_transport_events_listener(history=False) + link_listener = info.declare_link_events_listener(history=False) + + print("Listening for transport and link events... (press Ctrl+C to exit)") + try: + while True: + while (event := transport_listener.try_recv()) is not None: + print(f"Transport event: {event}") + while (event := link_listener.try_recv()) is not None: + print(f"Link event: {event}") + time.sleep(0.1) + except KeyboardInterrupt: + pass + + transport_listener.undeclare() + link_listener.undeclare() # --- Command line argument parsing --- --- --- --- --- --- diff --git a/src/lib.rs b/src/lib.rs index 36b64f7a..afee7e04 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -72,7 +72,10 @@ pub(crate) mod zenoh { }, sample::{Locality, Sample, SampleKind, SourceInfo}, scouting::{scout, Hello, Scout}, - session::{open, EntityGlobalId, Session, SessionInfo}, + session::{ + open, EntityGlobalId, Link, LinkEvent, LinkEventsListener, Session, SessionInfo, + Transport, TransportEvent, TransportEventsListener, + }, time::{Timestamp, TimestampId, NTP64}, ZError, }; diff --git a/src/session.rs b/src/session.rs index 7c3afac6..97a433aa 100644 --- a/src/session.rs +++ b/src/session.rs @@ -15,22 +15,23 @@ use std::time::Duration; use pyo3::{ prelude::*, - types::{PyDict, PyList, PyTuple}, + types::{PyDict, PyIterator, PyList, PyTuple}, + IntoPyObjectExt, }; use zenoh::{session::EntityId, Wait}; use crate::{ bytes::{Encoding, ZBytes}, cancellation::CancellationToken, - config::{Config, ZenohId}, + config::{Config, WhatAmI, ZenohId}, handlers::{into_handler, HandlerImpl}, key_expr::KeyExpr, liveliness::Liveliness, - macros::{build, wrapper}, + macros::{build, option_wrapper, wrapper}, pubsub::{Publisher, Subscriber}, qos::{CongestionControl, Priority, Reliability}, query::{Querier, QueryConsolidation, QueryTarget, Queryable, Reply, Selector}, - sample::{Locality, SourceInfo}, + sample::{Locality, SampleKind, SourceInfo}, time::Timestamp, utils::{duration, wait, IntoPython, MapInto}, }; @@ -307,6 +308,150 @@ pub(crate) fn open(py: Python, config: Config) -> PyResult { wrapper!(zenoh::session::SessionInfo); +wrapper!(zenoh::session::Transport); + +#[pymethods] +impl Transport { + #[getter] + fn zid(&self) -> ZenohId { + (*self.0.zid()).into() + } + + #[getter] + fn whatami(&self) -> WhatAmI { + self.0.whatami().into() + } + + #[getter] + fn is_qos(&self) -> bool { + self.0.is_qos() + } + + #[cfg(feature = "shared-memory")] + #[getter] + fn is_shm(&self) -> bool { + self.0.is_shm() + } + + #[getter] + fn is_multicast(&self) -> bool { + self.0.is_multicast() + } + + fn __eq__(&self, other: &Transport) -> bool { + self.0 == other.0 + } + + fn __repr__(&self) -> String { + format!("{:?}", self.0) + } +} + +wrapper!(zenoh::session::Link); + +#[pymethods] +impl Link { + #[getter] + fn zid(&self) -> ZenohId { + (*self.0.zid()).into() + } + + #[getter] + fn src(&self) -> String { + self.0.src().to_string() + } + + #[getter] + fn dst(&self) -> String { + self.0.dst().to_string() + } + + #[getter] + fn group(&self) -> Option { + self.0.group().map(|g| g.to_string()) + } + + #[getter] + fn mtu(&self) -> u16 { + self.0.mtu() + } + + #[getter] + fn is_streamed(&self) -> bool { + self.0.is_streamed() + } + + #[getter] + fn interfaces<'py>(&self, py: Python<'py>) -> PyResult> { + let list = PyList::empty(py); + for interface in self.0.interfaces() { + list.append(interface)?; + } + Ok(list) + } + + #[getter] + fn auth_identifier(&self) -> Option { + self.0.auth_identifier().map(|s| s.to_string()) + } + + #[getter] + fn priorities(&self) -> Option<(u8, u8)> { + self.0.priorities() + } + + #[getter] + fn reliability(&self) -> Option { + self.0.reliability().map(Into::into) + } + + fn __eq__(&self, other: &Link) -> bool { + self.0 == other.0 + } + + fn __repr__(&self) -> String { + format!("{:?}", self.0) + } +} + +wrapper!(zenoh::session::TransportEvent); + +#[pymethods] +impl TransportEvent { + #[getter] + fn kind(&self) -> SampleKind { + self.0.kind().into() + } + + #[getter] + fn transport(&self) -> Transport { + self.0.transport().clone().into() + } + + fn __repr__(&self) -> String { + format!("{:?}", self.0) + } +} + +wrapper!(zenoh::session::LinkEvent); + +#[pymethods] +impl LinkEvent { + #[getter] + fn kind(&self) -> SampleKind { + self.0.kind().into() + } + + #[getter] + fn link(&self) -> Link { + self.0.link().clone().into() + } + + fn __repr__(&self) -> String { + format!("{:?}", self.0) + } +} + #[pymethods] impl SessionInfo { fn zid(&self, py: Python) -> ZenohId { @@ -329,9 +474,145 @@ impl SessionInfo { Ok(list) } + fn transports<'py>(&self, py: Python<'py>) -> PyResult> { + let list = PyList::empty(py); + for transport in py.allow_threads(|| self.0.transports().wait()) { + list.append(transport.into_pyobject(py))?; + } + Ok(list) + } + + fn links<'py>(&self, py: Python<'py>) -> PyResult> { + let list = PyList::empty(py); + for link in py.allow_threads(|| self.0.links().wait()) { + list.append(link.into_pyobject(py))?; + } + Ok(list) + } + + #[pyo3(signature = (handler = None, *, history = None))] + fn declare_transport_events_listener( + &self, + py: Python, + handler: Option<&Bound>, + history: Option, + ) -> PyResult { + let (handler, background) = into_handler(py, handler, None)?; + let builder = build!(self.0.transport_events_listener(), history); + let mut listener = wait(py, builder.with(handler))?; + if background { + listener.set_background(true); + } + Ok(listener.into()) + } + + #[pyo3(signature = (handler = None, *, history = None))] + fn declare_link_events_listener( + &self, + py: Python, + handler: Option<&Bound>, + history: Option, + ) -> PyResult { + let (handler, background) = into_handler(py, handler, None)?; + let builder = build!(self.0.link_events_listener(), history); + let mut listener = wait(py, builder.with(handler))?; + if background { + listener.set_background(true); + } + Ok(listener.into()) + } + // TODO __repr__ } +option_wrapper!( + zenoh::session::TransportEventsListener>, + "Undeclared transport events listener" +); + +#[pymethods] +impl TransportEventsListener { + fn __enter__<'a, 'py>(this: &'a Bound<'py, Self>) -> &'a Bound<'py, Self> { + this + } + + #[pyo3(signature = (*_args, **_kwargs))] + fn __exit__( + &mut self, + py: Python, + _args: &Bound, + _kwargs: Option<&Bound>, + ) -> PyResult { + self.undeclare(py)?; + Ok(py.None()) + } + + #[getter] + fn handler(&self, py: Python) -> PyResult { + self.get_ref()?.handler().into_py_any(py) + } + + fn try_recv(&self, py: Python) -> PyResult { + self.get_ref()?.handler().try_recv(py) + } + + fn recv(&self, py: Python) -> PyResult { + self.get_ref()?.handler().recv(py) + } + + fn undeclare(&mut self, py: Python) -> PyResult<()> { + wait(py, self.take()?.undeclare()) + } + + fn __iter__<'py>(&self, py: Python<'py>) -> PyResult> { + self.handler(py)?.bind(py).try_iter() + } +} + +option_wrapper!( + zenoh::session::LinkEventsListener>, + "Undeclared link events listener" +); + +#[pymethods] +impl LinkEventsListener { + fn __enter__<'a, 'py>(this: &'a Bound<'py, Self>) -> &'a Bound<'py, Self> { + this + } + + #[pyo3(signature = (*_args, **_kwargs))] + fn __exit__( + &mut self, + py: Python, + _args: &Bound, + _kwargs: Option<&Bound>, + ) -> PyResult { + self.undeclare(py)?; + Ok(py.None()) + } + + #[getter] + fn handler(&self, py: Python) -> PyResult { + self.get_ref()?.handler().into_py_any(py) + } + + fn try_recv(&self, py: Python) -> PyResult { + self.get_ref()?.handler().try_recv(py) + } + + fn recv(&self, py: Python) -> PyResult { + self.get_ref()?.handler().recv(py) + } + + fn undeclare(&mut self, py: Python) -> PyResult<()> { + wait(py, self.take()?.undeclare()) + } + + fn __iter__<'py>(&self, py: Python<'py>) -> PyResult> { + self.handler(py)?.bind(py).try_iter() + } +} + wrapper!(zenoh::session::EntityGlobalId: Clone); #[pymethods] diff --git a/tests/test_session.py b/tests/test_session.py index 13c59e3e..14f91880 100644 --- a/tests/test_session.py +++ b/tests/test_session.py @@ -188,7 +188,7 @@ def sub_callback(sample: Sample): def test_session(): zenoh.try_init_log_from_env() - (peer01, peer02) = open_session(["tcp/127.0.0.1:17447"]) + peer01, peer02 = open_session(["tcp/127.0.0.1:17447"]) run_session_qryrep(peer01, peer02) run_session_pubsub(peer01, peer02) run_session_qrrrep(peer01, peer02) diff --git a/zenoh/__init__.pyi b/zenoh/__init__.pyi index 710644f9..364ac776 100644 --- a/zenoh/__init__.pyi +++ b/zenoh/__init__.pyi @@ -1604,6 +1604,236 @@ class SessionInfo: def peers_zid(self) -> list[ZenohId]: """Return the :class:`ZenohId` of the zenoh peers this process is currently connected to.""" + def transports(self) -> list[Transport]: + """Return the list of :class:`Transport` instances for currently open transports.""" + + def links(self) -> list[Link]: + """Return the list of :class:`Link` instances for currently open links.""" + + @overload + def declare_transport_events_listener( + self, + handler: _RustHandler[TransportEvent] | None = None, + *, + history: bool | None = None, + ) -> TransportEventsListener[Handler[TransportEvent]]: + """Declare a listener for transport events (connections opening/closing). + + :param handler: The handler for receiving transport events (see :ref:`channels-and-callbacks`). + :param history: If True, existing transports will be reported upon declaration. + :returns: A :class:`TransportEventsListener` that yields :class:`TransportEvent` instances. + """ + + @overload + def declare_transport_events_listener( + self, + handler: _PythonHandler[TransportEvent, _H], + *, + history: bool | None = None, + ) -> TransportEventsListener[_H]: ... + @overload + def declare_transport_events_listener( + self, handler: _PythonCallback[TransportEvent], *, history: bool | None = None + ) -> TransportEventsListener[None]: ... + @overload + def declare_link_events_listener( + self, + handler: _RustHandler[LinkEvent] | None = None, + *, + history: bool | None = None, + ) -> LinkEventsListener[Handler[LinkEvent]]: + """Declare a listener for link events (links being added/removed). + + :param handler: The handler for receiving link events (see :ref:`channels-and-callbacks`). + :param history: If True, existing links will be reported upon declaration. + :returns: A :class:`LinkEventsListener` that yields :class:`LinkEvent` instances. + """ + + @overload + def declare_link_events_listener( + self, handler: _PythonHandler[LinkEvent, _H], *, history: bool | None = None + ) -> LinkEventsListener[_H]: ... + @overload + def declare_link_events_listener( + self, handler: _PythonCallback[LinkEvent], *, history: bool | None = None + ) -> LinkEventsListener[None]: ... + +@final +class Transport: + """Information about a Zenoh transport connection. + + A Transport represents a connection to another Zenoh node (peer or router). + It provides information about the remote node and the transport characteristics. + """ + + @property + def zid(self) -> ZenohId: + """The :class:`ZenohId` of the remote node.""" + + @property + def whatami(self) -> WhatAmI: + """The :class:`WhatAmI` type of the remote node.""" + + @property + def is_qos(self) -> bool: + """Whether this transport supports QoS (Quality of Service).""" + + @property + def is_multicast(self) -> bool: + """Whether this is a multicast transport.""" + + def __eq__(self, other: Transport) -> bool: ... + def __repr__(self) -> str: ... + +@final +class Link: + """Information about a Zenoh link within a transport. + + A Link represents a single network connection within a transport. + Transports may have multiple links for redundancy or different network paths. + """ + + @property + def zid(self) -> ZenohId: + """The :class:`ZenohId` of the remote node.""" + + @property + def src(self) -> str: + """The source locator of this link.""" + + @property + def dst(self) -> str: + """The destination locator of this link.""" + + @property + def group(self) -> str | None: + """The multicast group this link belongs to, if any.""" + + @property + def mtu(self) -> int: + """The Maximum Transmission Unit (MTU) of this link.""" + + @property + def is_streamed(self) -> bool: + """Whether this link uses a streamed protocol (e.g., TCP) or datagram (e.g., UDP).""" + + @property + def interfaces(self) -> list[str]: + """The network interfaces used by this link.""" + + @property + def auth_identifier(self) -> str | None: + """The authentication identifier for this link, if any.""" + + @property + def priorities(self) -> tuple[int, int] | None: + """The priority range (min, max) for this link, if configured.""" + + @property + def reliability(self) -> Reliability | None: + """The reliability setting for this link, if configured.""" + + def __eq__(self, other: Link) -> bool: ... + def __repr__(self) -> str: ... + +@final +class TransportEvent: + """An event indicating a transport connection was opened or closed. + + TransportEvent is emitted by :class:`TransportEventsListener` when a transport + connection to another Zenoh node is established or terminated. + """ + + @property + def kind(self) -> SampleKind: + """The kind of event: :attr:`SampleKind.PUT` for opened, :attr:`SampleKind.DELETE` for closed.""" + + @property + def transport(self) -> Transport: + """The :class:`Transport` that was opened or closed.""" + + def __repr__(self) -> str: ... + +@final +class TransportEventsListener(Generic[_H]): + """A listener that receives notifications when transport connections open or close. + + The listener is created using :meth:`SessionInfo.declare_transport_events_listener` and + yields :class:`TransportEvent` instances when connections to other Zenoh nodes are + established or terminated. + """ + + def __enter__(self) -> Self: ... + def __exit__(self, *_args, **_kwargs): ... + @property + def handler(self) -> _H: + """The handler associated with this TransportEventsListener instance. + + See :ref:`channels-and-callbacks` for more information on handlers.""" + + def undeclare(self): + """Stop listening for transport events.""" + + def try_recv( + self: TransportEventsListener[Handler[TransportEvent]], + ) -> TransportEvent | None: + """Try to receive a :class:`TransportEvent` without blocking.""" + + def recv(self: TransportEventsListener[Handler[TransportEvent]]) -> TransportEvent: + """Receive a :class:`TransportEvent`, blocking until one is available.""" + + def __iter__( + self: TransportEventsListener[Handler[TransportEvent]], + ) -> Handler[TransportEvent]: + """Iterate over received :class:`TransportEvent` instances.""" + +@final +class LinkEvent: + """An event indicating a link was added or removed. + + LinkEvent is emitted by :class:`LinkEventsListener` when a link + within a transport is established or terminated. + """ + + @property + def kind(self) -> SampleKind: + """The kind of event: :attr:`SampleKind.PUT` for added, :attr:`SampleKind.DELETE` for removed.""" + + @property + def link(self) -> Link: + """The :class:`Link` that was added or removed.""" + + def __repr__(self) -> str: ... + +@final +class LinkEventsListener(Generic[_H]): + """A listener that receives notifications when links are added or removed. + + The listener is created using :meth:`SessionInfo.declare_link_events_listener` and + yields :class:`LinkEvent` instances when links within transports are + established or terminated. + """ + + def __enter__(self) -> Self: ... + def __exit__(self, *_args, **_kwargs): ... + @property + def handler(self) -> _H: + """The handler associated with this LinkEventsListener instance. + + See :ref:`channels-and-callbacks` for more information on handlers.""" + + def undeclare(self): + """Stop listening for link events.""" + + def try_recv(self: LinkEventsListener[Handler[LinkEvent]]) -> LinkEvent | None: + """Try to receive a :class:`LinkEvent` without blocking.""" + + def recv(self: LinkEventsListener[Handler[LinkEvent]]) -> LinkEvent: + """Receive a :class:`LinkEvent`, blocking until one is available.""" + + def __iter__(self: LinkEventsListener[Handler[LinkEvent]]) -> Handler[LinkEvent]: + """Iterate over received :class:`LinkEvent` instances.""" + @_unstable @final class SetIntersectionLevel(Enum):