Documentation Index
Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
Use this file to discover all available pages before exploring further.
StreamHandler
Defined in the streaming module.
Rust AI Agent SDK
Handler for managing stream callbacks.
Fields
| Name | Type | Description |
|---|
callbacks | Vec<Box<dyn StreamCallback>> | - |
Methods
new
Create a new stream handler
add_callback
fn add_callback(&mut self, callback: impl StreamCallback + 'static) -> ()
Add a callback
Parameters:
| Name | Type |
|---|
callback | impl StreamCallback + 'static |
emit
fn emit(&self, event: &StreamEvent) -> ()
Emit an event to all callbacks
Parameters:
| Name | Type |
|---|
event | &StreamEvent |
callback_count
fn callback_count(&self) -> usize
Get callback count
Source
View on GitHub
praisonai/src/streaming/mod.rs at line 390