Struct ChannelSopTopic
pub struct ChannelSopTopic;Expand description
The single authority for the channel-SOP event topic grammar
channel.alias:event_type. The producer that lifts a forge/platform event
into SOP ingress builds the topic here; the SOP engine parses it here. The
grammar lives in one place so the two sides cannot drift.
alias separates from channel with .; event_type separates from the
channel.alias head with :. A bare channel (no alias, no event type)
and the channel/alias message form are both accepted by parse so the
same matcher serves agent-loop message triggers and forge event triggers.
Implementations§
Source§impl ChannelSopTopic
impl ChannelSopTopic
Sourcepub fn build(channel: &str, alias: &str, event_type: &str) -> String
pub fn build(channel: &str, alias: &str, event_type: &str) -> String
Build a forge/platform event topic channel.alias:event_type.
Sourcepub fn parse(topic: &str) -> (&str, Option<&str>, Option<&str>)
pub fn parse(topic: &str) -> (&str, Option<&str>, Option<&str>)
Parse a channel-SOP topic into (channel, alias, event_type). The head
before the event separator yields the channel kind and optional alias;
the tail after it is the optional event type. Accepts both the forge
form (channel.alias:event_type) and the message form (channel or
channel/alias).