Skip to main content

ChatPlatform

Trait ChatPlatform 

Source
pub trait ChatPlatform: Send + Sync {
    // Required methods
    async fn send_message(&self, msg: &OutgoingMessage) -> Result<String>;
    async fn send_approval(
        &self,
        channel_id: &str,
        request: &ApprovalRequest,
    ) -> Result<String>;
    async fn update_message(
        &self,
        channel_id: &str,
        message_id: &str,
        text: &str,
    ) -> Result<()>;
    async fn add_reaction(
        &self,
        channel_id: &str,
        message_id: &str,
        emoji: &str,
    ) -> Result<()>;
    async fn send_progress(
        &self,
        channel_id: &str,
        thread_id: &str,
        progress: &ProgressUpdate,
    ) -> Result<String>;
    async fn send_notification(
        &self,
        channel_id: &str,
        thread_id: Option<&str>,
        notification: &WorkflowNotification,
    ) -> Result<String>;
    async fn start_thread(
        &self,
        channel_id: &str,
        execution_id: &str,
        workflow_id: &str,
        total_steps: usize,
        shadow: bool,
    ) -> Result<String>;
}
Expand description

Chat platform interface.

Required Methods§

Source

async fn send_message(&self, msg: &OutgoingMessage) -> Result<String>

Send a message to a channel.

Source

async fn send_approval( &self, channel_id: &str, request: &ApprovalRequest, ) -> Result<String>

Send an approval request with interactive buttons.

Source

async fn update_message( &self, channel_id: &str, message_id: &str, text: &str, ) -> Result<()>

Update an existing message.

Source

async fn add_reaction( &self, channel_id: &str, message_id: &str, emoji: &str, ) -> Result<()>

React to a message with an emoji.

Source

async fn send_progress( &self, channel_id: &str, thread_id: &str, progress: &ProgressUpdate, ) -> Result<String>

Send a progress update (step started/completed) in a thread.

Source

async fn send_notification( &self, channel_id: &str, thread_id: Option<&str>, notification: &WorkflowNotification, ) -> Result<String>

Send a workflow completion/failure notification.

Source

async fn start_thread( &self, channel_id: &str, execution_id: &str, workflow_id: &str, total_steps: usize, shadow: bool, ) -> Result<String>

Start a new thread for a workflow execution. Returns the thread ID (message timestamp for Slack).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§