1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//! Key expression format handling for hiroz.
//!
//! This crate provides key expression generation for mapping ROS 2 entities
//! (nodes, topics, services, actions) to Zenoh key expressions.
//!
//! # Formats
//!
//! hiroz supports multiple key expression formats:
//!
//! - **RmwZenoh** (default): Compatible with `rmw_zenoh_cpp`, the official
//! ROS 2 RMW implementation using Zenoh. Uses `strip_slashes()` for topic
//! key expressions and mangling for liveliness tokens.
//!
//! - **Ros2Dds**: Compatible with `zenoh-plugin-ros2dds`, useful for bridging
//! between Zenoh and DDS networks.
//!
//! # no_std Support
//!
//! This crate is `no_std` compatible with `alloc`:
//!
//! ```toml
//! [dependencies]
//! hiroz-protocol = { version = "0.1", default-features = false }
//! ```
//!
//! # Example
//!
//! ```rust
//! use hiroz_protocol::{KeyExprFormat, entity::*};
//!
//! let format = KeyExprFormat::default(); // RmwZenoh
//! let zid: zenoh::session::ZenohId = "1234567890abcdef1234567890abcdef".parse().unwrap();
//! let node = NodeEntity::new(0, zid, 0, "my_node".to_string(), "/".to_string(), String::new());
//!
//! let entity = EndpointEntity {
//! id: 1,
//! node: Some(node),
//! kind: EndpointKind::Publisher,
//! topic: "/chatter".to_string(),
//! type_info: None,
//! qos: Default::default(),
//! };
//!
//! // Generate topic key expression
//! let topic_ke = format.topic_key_expr(&entity).unwrap();
//! ```
extern crate alloc;
pub use ;
pub use RmwZenohFormatter;
pub use Ros2DdsFormatter;
pub use ;