pub struct RouteKey {
pub topic: String,
pub type_hint: Option<String>,
}Expand description
Topic plus an optional type hint.
topic is the only required coordinate. type_hint is whatever
discriminator the publishing adapter has: an OWP message name, a UCI
type, a PDU type. A subscription with type_hint: None matches every
type on that topic. A publish with no hint reaches wildcards only.
Neither field is validated. Matching is exact string equality, not a
hierarchy, even though Display
looks like a path.
Fields§
§topic: StringEngine topic. Often a UCI message name when bridging ActiveMQ.
type_hint: Option<String>Protocol discriminator. None is a wildcard subscription, or an
untyped publish.
Implementations§
Source§impl RouteKey
impl RouteKey
Sourcepub fn typed(topic: impl Into<String>, type_hint: impl Into<String>) -> Self
pub fn typed(topic: impl Into<String>, type_hint: impl Into<String>) -> Self
One type on topic. A publish with this hint also reaches
Self::topic subscribers on the same topic.
Sourcepub fn is_wildcard(&self) -> bool
pub fn is_wildcard(&self) -> bool
Whether this key has no type hint.
True for both a wildcard subscription and an untyped publish. Those two roles match different sets; this predicate does not distinguish them.