From 2df878ce76838f57140b6a0ab98080d941e99158 Mon Sep 17 00:00:00 2001 From: Luca Cominardi Date: Tue, 4 Mar 2025 15:41:59 +0100 Subject: [PATCH 1/2] Replace async-std with ZRuntime and tokio --- Cargo.lock | 384 ++---------------------------------------------- Cargo.toml | 3 +- Cargo.toml.in | 3 +- src/scouting.rs | 7 +- 4 files changed, 17 insertions(+), 380 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2d39b86e0..7c5530836 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -132,148 +132,6 @@ dependencies = [ "syn 2.0.87", ] -[[package]] -name = "async-channel" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" -dependencies = [ - "concurrent-queue", - "event-listener 2.5.3", - "futures-core", -] - -[[package]] -name = "async-channel" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" -dependencies = [ - "concurrent-queue", - "event-listener-strategy", - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "async-executor" -version = "1.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ca9a001c1e8ba5149f91a74362376cc6bc5b919d92d988668657bd570bdcec" -dependencies = [ - "async-task", - "concurrent-queue", - "fastrand 2.1.1", - "futures-lite 2.3.0", - "slab", -] - -[[package]] -name = "async-global-executor" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" -dependencies = [ - "async-channel 2.3.1", - "async-executor", - "async-io 2.3.4", - "async-lock 3.4.0", - "blocking", - "futures-lite 2.3.0", - "once_cell", -] - -[[package]] -name = "async-io" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" -dependencies = [ - "async-lock 2.8.0", - "autocfg", - "cfg-if", - "concurrent-queue", - "futures-lite 1.13.0", - "log", - "parking", - "polling 2.8.0", - "rustix 0.37.27", - "slab", - "socket2 0.4.10", - "waker-fn", -] - -[[package]] -name = "async-io" -version = "2.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "444b0228950ee6501b3568d3c93bf1176a1fdbc3b758dcd9475046d30f4dc7e8" -dependencies = [ - "async-lock 3.4.0", - "cfg-if", - "concurrent-queue", - "futures-io", - "futures-lite 2.3.0", - "parking", - "polling 3.7.3", - "rustix 0.38.37", - "slab", - "tracing", - "windows-sys 0.59.0", -] - -[[package]] -name = "async-lock" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" -dependencies = [ - "event-listener 2.5.3", -] - -[[package]] -name = "async-lock" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" -dependencies = [ - "event-listener 5.3.1", - "event-listener-strategy", - "pin-project-lite", -] - -[[package]] -name = "async-std" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" -dependencies = [ - "async-channel 1.9.0", - "async-global-executor", - "async-io 1.13.0", - "async-lock 2.8.0", - "crossbeam-utils", - "futures-channel", - "futures-core", - "futures-io", - "futures-lite 1.13.0", - "gloo-timers", - "kv-log-macro", - "log", - "memchr", - "once_cell", - "pin-project-lite", - "pin-utils", - "slab", - "wasm-bindgen-futures", -] - -[[package]] -name = "async-task" -version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" - [[package]] name = "async-trait" version = "0.1.82" @@ -285,12 +143,6 @@ dependencies = [ "syn 2.0.87", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "atty" version = "0.2.14" @@ -374,19 +226,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "blocking" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" -dependencies = [ - "async-channel 2.3.1", - "async-task", - "futures-io", - "futures-lite 2.3.0", - "piper", -] - [[package]] name = "bumpalo" version = "3.16.0" @@ -803,12 +642,6 @@ version = "11.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6aff27af350e7b53e82aac3e5ab6389abd8f280640ac034508dff0608c4c7e5" -[[package]] -name = "event-listener" -version = "2.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - [[package]] name = "event-listener" version = "5.3.1" @@ -820,25 +653,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "event-listener-strategy" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" -dependencies = [ - "event-listener 5.3.1", - "pin-project-lite", -] - -[[package]] -name = "fastrand" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - [[package]] name = "fastrand" version = "2.1.1" @@ -952,34 +766,6 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" -[[package]] -name = "futures-lite" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" -dependencies = [ - "fastrand 1.9.0", - "futures-core", - "futures-io", - "memchr", - "parking", - "pin-project-lite", - "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.1.1", - "futures-core", - "futures-io", - "parking", - "pin-project-lite", -] - [[package]] name = "futures-macro" version = "0.3.30" @@ -1070,18 +856,6 @@ dependencies = [ "syn 2.0.87", ] -[[package]] -name = "gloo-timers" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" -dependencies = [ - "futures-channel", - "futures-core", - "js-sys", - "wasm-bindgen", -] - [[package]] name = "hashbrown" version = "0.12.3" @@ -1119,12 +893,6 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" -[[package]] -name = "hermit-abi" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" - [[package]] name = "hex" version = "0.4.3" @@ -1261,17 +1029,6 @@ dependencies = [ "mach2", ] -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi 0.3.9", - "libc", - "windows-sys 0.48.0", -] - [[package]] name = "ipnetwork" version = "0.20.0" @@ -1354,15 +1111,6 @@ dependencies = [ "hashbrown 0.14.5", ] -[[package]] -name = "kv-log-macro" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" -dependencies = [ - "log", -] - [[package]] name = "lazy_static" version = "1.5.0" @@ -1410,12 +1158,6 @@ dependencies = [ "libc", ] -[[package]] -name = "linux-raw-sys" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" - [[package]] name = "linux-raw-sys" version = "0.4.14" @@ -1437,9 +1179,6 @@ name = "log" version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" -dependencies = [ - "value-bag", -] [[package]] name = "lz4_flex" @@ -1920,17 +1659,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "piper" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" -dependencies = [ - "atomic-waker", - "fastrand 2.1.1", - "futures-io", -] - [[package]] name = "pkcs1" version = "0.7.5" @@ -1984,37 +1712,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "polling" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" -dependencies = [ - "autocfg", - "bitflags 1.3.2", - "cfg-if", - "concurrent-queue", - "libc", - "log", - "pin-project-lite", - "windows-sys 0.48.0", -] - -[[package]] -name = "polling" -version = "3.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc2790cd301dec6cd3b7a025e4815cf825724a51c98dccfe6a3e55f05ffb6511" -dependencies = [ - "cfg-if", - "concurrent-queue", - "hermit-abi 0.4.0", - "pin-project-lite", - "rustix 0.38.37", - "tracing", - "windows-sys 0.59.0", -] - [[package]] name = "powerfmt" version = "0.2.0" @@ -2060,7 +1757,7 @@ dependencies = [ "quinn-udp", "rustc-hash", "rustls", - "socket2 0.5.7", + "socket2", "thiserror 1.0.63", "tokio", "tracing", @@ -2092,7 +1789,7 @@ checksum = "4fe68c2e9e1a1234e218683dbdf9f9dfcb094113c5ac2b938dfcb9bab4c4140b" dependencies = [ "libc", "once_cell", - "socket2 0.5.7", + "socket2", "tracing", "windows-sys 0.59.0", ] @@ -2307,20 +2004,6 @@ dependencies = [ "nom", ] -[[package]] -name = "rustix" -version = "0.37.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" -dependencies = [ - "bitflags 1.3.2", - "errno 0.3.9", - "io-lifetimes", - "libc", - "linux-raw-sys 0.3.8", - "windows-sys 0.48.0", -] - [[package]] name = "rustix" version = "0.38.37" @@ -2330,7 +2013,7 @@ dependencies = [ "bitflags 2.6.0", "errno 0.3.9", "libc", - "linux-raw-sys 0.4.14", + "linux-raw-sys", "windows-sys 0.52.0", ] @@ -2726,16 +2409,6 @@ version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" -[[package]] -name = "socket2" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "socket2" version = "0.5.7" @@ -2891,9 +2564,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" dependencies = [ "cfg-if", - "fastrand 2.1.1", + "fastrand", "once_cell", - "rustix 0.38.37", + "rustix", "windows-sys 0.59.0", ] @@ -3055,7 +2728,7 @@ dependencies = [ "libc", "mio 1.0.2", "pin-project-lite", - "socket2 0.5.7", + "socket2", "tokio-macros", "windows-sys 0.52.0", ] @@ -3420,12 +3093,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" -[[package]] -name = "value-bag" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a84c137d37ab0142f0f2ddfe332651fdbf252e7b7dbb4e67b6c1f1b2e925101" - [[package]] name = "vec_map" version = "0.8.2" @@ -3448,12 +3115,6 @@ dependencies = [ "nix 0.27.1", ] -[[package]] -name = "waker-fn" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" - [[package]] name = "walkdir" version = "2.5.0" @@ -3496,18 +3157,6 @@ dependencies = [ "wasm-bindgen-shared", ] -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" -dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] - [[package]] name = "wasm-bindgen-macro" version = "0.2.93" @@ -3537,16 +3186,6 @@ version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" -[[package]] -name = "web-sys" -version = "0.3.70" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - [[package]] name = "webpki-roots" version = "0.26.5" @@ -3858,7 +3497,7 @@ dependencies = [ "rustc_version", "serde", "serde_json", - "socket2 0.5.7", + "socket2", "tokio", "tokio-util", "tracing", @@ -3895,7 +3534,6 @@ dependencies = [ name = "zenoh-c" version = "1.2.1" dependencies = [ - "async-std", "cbindgen", "chrono", "const_format", @@ -4113,7 +3751,7 @@ version = "1.2.1" source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2311334ebb82378e341d350a08d0667169c7f211" dependencies = [ "async-trait", - "socket2 0.5.7", + "socket2", "tokio", "tokio-util", "tracing", @@ -4136,7 +3774,7 @@ dependencies = [ "rustls-pki-types", "rustls-webpki", "secrecy", - "socket2 0.5.7", + "socket2", "time", "tls-listener", "tokio", @@ -4159,7 +3797,7 @@ version = "1.2.1" source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2311334ebb82378e341d350a08d0667169c7f211" dependencies = [ "async-trait", - "socket2 0.5.7", + "socket2", "tokio", "tokio-util", "tracing", @@ -4341,7 +3979,7 @@ name = "zenoh-sync" version = "1.2.1" source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2311334ebb82378e341d350a08d0667169c7f211" dependencies = [ - "event-listener 5.3.1", + "event-listener", "futures", "tokio", "zenoh-buffers", diff --git a/Cargo.toml b/Cargo.toml index 181e24fca..88f434dae 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -63,7 +63,6 @@ default = [ maintenance = { status = "actively-developed" } [dependencies] -async-std = "=1.12.0" chrono = "0.4.37" json5 = "0.4.1" lazy_static = "1.4.0" @@ -75,7 +74,7 @@ tokio = "*" unwrap-infallible = "0.1.5" const_format = "0.2.32" zenoh = { version = "1.2.1", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", default-features = false, features = ["internal"] } -zenoh-ext = { version = "1.2.1", git = "https://github.com/eclipse-zenoh/zenoh.git", features=["internal"], default-features = false, branch = "main" } +zenoh-ext = { version = "1.2.1", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", default-features = false, features=["internal"] } zenoh-runtime = { version = "1.2.1", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main" } zenoh-util = { version = "1.2.1", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main" } flume = "*" diff --git a/Cargo.toml.in b/Cargo.toml.in index 1045004c4..629690da4 100644 --- a/Cargo.toml.in +++ b/Cargo.toml.in @@ -63,7 +63,6 @@ default = [ maintenance = { status = "actively-developed" } [dependencies] -async-std = "=1.12.0" chrono = "0.4.37" json5 = "0.4.1" lazy_static = "1.4.0" @@ -75,7 +74,7 @@ tokio = "*" unwrap-infallible = "0.1.5" const_format = "0.2.32" zenoh = { version = "1.2.1", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", default-features = false, features = ["internal"] } -zenoh-ext = { version = "1.2.1", git = "https://github.com/eclipse-zenoh/zenoh.git", features=["internal"], branch = "main", default-features = false } +zenoh-ext = { version = "1.2.1", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", default-features = false, features=["internal"] } zenoh-runtime = { version = "1.2.1", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main" } zenoh-util = { version = "1.2.1", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main" } flume = "*" diff --git a/src/scouting.rs b/src/scouting.rs index f0ea3fa39..fecc75fb3 100644 --- a/src/scouting.rs +++ b/src/scouting.rs @@ -13,11 +13,11 @@ // use std::mem::MaybeUninit; -use async_std::task; use zenoh::{ config::{WhatAmI, WhatAmIMatcher}, scouting::Hello, }; +use zenoh_runtime::ZRuntime; pub use crate::opaque_types::{z_loaned_hello_t, z_moved_hello_t, z_owned_hello_t}; use crate::{ @@ -199,7 +199,7 @@ pub extern "C" fn z_scout( return result::Z_EINVAL; }; - task::block_on(async move { + ZRuntime::Application.block_in_place(async move { let scout = zenoh::scout(what, config) .callback(move |h| { let mut owned_h = Some(h); @@ -209,7 +209,8 @@ pub extern "C" fn z_scout( }) .await .unwrap(); - async_std::task::sleep(std::time::Duration::from_millis(timeout)).await; + + tokio::time::sleep(std::time::Duration::from_millis(timeout)).await; std::mem::drop(scout); }); Z_OK From 701056d4b34894d6d9b007c264eb548511bcfc3a Mon Sep 17 00:00:00 2001 From: Luca Cominardi Date: Wed, 5 Mar 2025 10:02:53 +0100 Subject: [PATCH 2/2] Improve error handling in z_scout --- src/scouting.rs | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/src/scouting.rs b/src/scouting.rs index fecc75fb3..664114830 100644 --- a/src/scouting.rs +++ b/src/scouting.rs @@ -21,7 +21,7 @@ use zenoh_runtime::ZRuntime; pub use crate::opaque_types::{z_loaned_hello_t, z_moved_hello_t, z_owned_hello_t}; use crate::{ - result::{self, Z_OK}, + result, transmute::{IntoCType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, z_closure_hello_call, z_closure_hello_loan, z_id_t, z_moved_closure_hello_t, z_moved_config_t, z_owned_string_array_t, z_view_string_t, CString, CStringView, ZVector, @@ -190,8 +190,12 @@ pub extern "C" fn z_scout( ) -> result::z_result_t { let callback = callback.take_rust_type(); let options = options.cloned().unwrap_or_default(); - let what = - WhatAmIMatcher::try_from(options.what as u8).unwrap_or(WhatAmI::Router | WhatAmI::Peer); + + let Ok(what) = WhatAmIMatcher::try_from(options.what as u8) else { + tracing::error!("Invalid WhatAmIMatcher value: {:?}", options.what); + return result::Z_EINVAL; + }; + #[allow(clippy::unnecessary_cast)] // Required for multi-target let timeout = options.timeout_ms; let Some(config) = config.take_rust_type() else { @@ -200,20 +204,26 @@ pub extern "C" fn z_scout( }; ZRuntime::Application.block_in_place(async move { - let scout = zenoh::scout(what, config) + let res = zenoh::scout(what, config) .callback(move |h| { let mut owned_h = Some(h); z_closure_hello_call(z_closure_hello_loan(&callback), unsafe { owned_h.as_mut().unwrap_unchecked().as_loaned_c_type_mut() }) }) - .await - .unwrap(); - - tokio::time::sleep(std::time::Duration::from_millis(timeout)).await; - std::mem::drop(scout); - }); - Z_OK + .await; + + match res { + Ok(_) => { + tokio::time::sleep(std::time::Duration::from_millis(timeout)).await; + result::Z_OK + } + Err(e) => { + tracing::error!("{}", e); + result::Z_EGENERIC + } + } + }) } /// Constructs a non-owned non-null-terminated string from the kind of zenoh entity.