pub trait NotificationHandler {
Show 15 methods
// Required methods
fn get_outgoing_channel(&self) -> &Option<Sender<Notification>>;
fn get_channel_name(&self) -> &String;
// Provided methods
async fn notify(&self, content: NotificationContent) -> bool { ... }
fn forward_notifications(&self, from_channel: Receiver<Notification>) { ... }
fn forward_multiple_notifications<I>(&self, channels: I)
where I: IntoIterator<Item = Receiver<Notification>> { ... }
async fn notify_done(&self, success: Success, resp: Response) -> bool { ... }
async fn notify_prompt_request(&self, req: ChatRequest) -> bool { ... }
async fn notify_poompt_success(&self, resp: ChatResponse) -> bool { ... }
async fn notify_prompt_error(&self, error_message: String) -> bool { ... }
async fn notify_tool_request(&self, tool_call: ToolCall) -> bool { ... }
async fn notify_tool_success(&self, tool_result: String) -> bool { ... }
async fn notify_tool_error(&self, error_message: String) -> bool { ... }
async fn notify_token(&self, token: Token) -> bool { ... }
async fn notify_mcp_tool_notification(&self, notification: String) -> bool { ... }
async fn notify_custom(&self, custom_val: Value) -> bool { ... }
}
Required Methods§
fn get_outgoing_channel(&self) -> &Option<Sender<Notification>>
fn get_channel_name(&self) -> &String
Provided Methods§
Sourceasync fn notify(&self, content: NotificationContent) -> bool
async fn notify(&self, content: NotificationContent) -> bool
Send a notification with the given content.
Returns true
if successfully delivered, false
otherwise.
Sourcefn forward_notifications(&self, from_channel: Receiver<Notification>)
fn forward_notifications(&self, from_channel: Receiver<Notification>)
Forward notifications from an external receiver into this agent’s notification output channel.
Sourcefn forward_multiple_notifications<I>(&self, channels: I)
fn forward_multiple_notifications<I>(&self, channels: I)
Merge any number of Receiver<Notification>
streams into one,
and forward all messages into this agent’s notification output channel.
async fn notify_done(&self, success: Success, resp: Response) -> bool
async fn notify_prompt_request(&self, req: ChatRequest) -> bool
async fn notify_poompt_success(&self, resp: ChatResponse) -> bool
async fn notify_prompt_error(&self, error_message: String) -> bool
async fn notify_tool_request(&self, tool_call: ToolCall) -> bool
async fn notify_tool_success(&self, tool_result: String) -> bool
async fn notify_tool_error(&self, error_message: String) -> bool
async fn notify_token(&self, token: Token) -> bool
async fn notify_mcp_tool_notification(&self, notification: String) -> bool
async fn notify_custom(&self, custom_val: Value) -> bool
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.