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§
Sourceasync fn send_message(&self, msg: &OutgoingMessage) -> Result<String>
async fn send_message(&self, msg: &OutgoingMessage) -> Result<String>
Send a message to a channel.
Sourceasync fn send_approval(
&self,
channel_id: &str,
request: &ApprovalRequest,
) -> Result<String>
async fn send_approval( &self, channel_id: &str, request: &ApprovalRequest, ) -> Result<String>
Send an approval request with interactive buttons.
Sourceasync fn update_message(
&self,
channel_id: &str,
message_id: &str,
text: &str,
) -> Result<()>
async fn update_message( &self, channel_id: &str, message_id: &str, text: &str, ) -> Result<()>
Update an existing message.
Sourceasync fn add_reaction(
&self,
channel_id: &str,
message_id: &str,
emoji: &str,
) -> Result<()>
async fn add_reaction( &self, channel_id: &str, message_id: &str, emoji: &str, ) -> Result<()>
React to a message with an emoji.
Sourceasync fn send_progress(
&self,
channel_id: &str,
thread_id: &str,
progress: &ProgressUpdate,
) -> Result<String>
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.
Sourceasync fn send_notification(
&self,
channel_id: &str,
thread_id: Option<&str>,
notification: &WorkflowNotification,
) -> Result<String>
async fn send_notification( &self, channel_id: &str, thread_id: Option<&str>, notification: &WorkflowNotification, ) -> Result<String>
Send a workflow completion/failure notification.
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.