pub trait KeyExprFormatter {
const ESCAPE_CHAR: char;
const ADMIN_SPACE: &'static str;
// Required methods
fn topic_key_expr(entity: &EndpointEntity) -> Result<TopicKE>;
fn liveliness_key_expr(
entity: &EndpointEntity,
zid: &ZenohId,
) -> Result<LivelinessKE>;
fn node_liveliness_key_expr(entity: &NodeEntity) -> Result<LivelinessKE>;
fn parse_liveliness(ke: &KeyExpr<'_>) -> Result<Entity>;
fn encode_qos(qos: &QosProfile, keyless: bool) -> String;
fn decode_qos(s: &str) -> Result<(bool, QosProfile)>;
// Provided methods
fn mangle_name(name: &str) -> String { ... }
fn demangle_name(name: &str) -> String { ... }
}Expand description
Trait for key expression format implementations.
This trait abstracts the differences between key expression formats used by different Zenoh-ROS bridges.
Required Associated Constants§
Sourceconst ESCAPE_CHAR: char
const ESCAPE_CHAR: char
Escape character used to replace slashes in key expressions.
Sourceconst ADMIN_SPACE: &'static str
const ADMIN_SPACE: &'static str
Admin space prefix for liveliness tokens.
Required Methods§
Sourcefn topic_key_expr(entity: &EndpointEntity) -> Result<TopicKE>
fn topic_key_expr(entity: &EndpointEntity) -> Result<TopicKE>
Generate topic key expression for data publication/subscription.
Sourcefn liveliness_key_expr(
entity: &EndpointEntity,
zid: &ZenohId,
) -> Result<LivelinessKE>
fn liveliness_key_expr( entity: &EndpointEntity, zid: &ZenohId, ) -> Result<LivelinessKE>
Generate liveliness token for endpoint entity discovery.
Sourcefn node_liveliness_key_expr(entity: &NodeEntity) -> Result<LivelinessKE>
fn node_liveliness_key_expr(entity: &NodeEntity) -> Result<LivelinessKE>
Generate liveliness token for node entity discovery.
Sourcefn parse_liveliness(ke: &KeyExpr<'_>) -> Result<Entity>
fn parse_liveliness(ke: &KeyExpr<'_>) -> Result<Entity>
Parse liveliness token back to entity.
Sourcefn encode_qos(qos: &QosProfile, keyless: bool) -> String
fn encode_qos(qos: &QosProfile, keyless: bool) -> String
Encode QoS for liveliness token.
Sourcefn decode_qos(s: &str) -> Result<(bool, QosProfile)>
fn decode_qos(s: &str) -> Result<(bool, QosProfile)>
Decode QoS from liveliness token.
Provided Methods§
Sourcefn mangle_name(name: &str) -> String
fn mangle_name(name: &str) -> String
Mangle a name (replace slashes with escape char).
Sourcefn demangle_name(name: &str) -> String
fn demangle_name(name: &str) -> String
Demangle a name (restore slashes from escape char).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".