Skip to main content

ChannelSopTopic

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

Source

pub fn build(channel: &str, alias: &str, event_type: &str) -> String

Build a forge/platform event topic channel.alias:event_type.

Source

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).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.