Skip to main content

ChannelFactory

Trait ChannelFactory 

Source
pub trait ChannelFactory: Send + Sync {
    // Required methods
    fn channel_type(&self) -> &str;
    fn build_review(
        &self,
        config: &Value,
    ) -> Result<Box<dyn ReviewChannel>, ReviewChannelError>;
    fn build_session(
        &self,
        config: &Value,
    ) -> Result<Box<dyn SessionChannel>, SessionChannelError>;
    fn capabilities(&self) -> ChannelCapabilitySet;
}
Expand description

Factory trait for creating channel instances.

Each channel plugin (terminal, Slack, Discord, email, webhook) implements this trait. The registry holds factories, and the routing config decides which factory handles which concern.

Required Methods§

Source

fn channel_type(&self) -> &str

Channel type name (e.g., “terminal”, “slack”, “discord”, “email”, “webhook”).

Source

fn build_review( &self, config: &Value, ) -> Result<Box<dyn ReviewChannel>, ReviewChannelError>

Create a ReviewChannel for human review interactions.

Source

fn build_session( &self, config: &Value, ) -> Result<Box<dyn SessionChannel>, SessionChannelError>

Create a SessionChannel for agent-human streaming.

Source

fn capabilities(&self) -> ChannelCapabilitySet

What this channel type supports.

Implementors§