#[non_exhaustive]pub struct CollectingEventHandler { /* private fields */ }Expand description
Event handler that collects text into a buffer.
This handler is useful when you need to capture the full response while also allowing streaming events to be processed.
§Example
use gba_core::event::CollectingEventHandler;
let mut handler = CollectingEventHandler::new();
// Use with streaming...
let collected_text = handler.text();Implementations§
Source§impl CollectingEventHandler
impl CollectingEventHandler
Sourcepub fn tools_used(&self) -> &[String]
pub fn tools_used(&self) -> &[String]
Get the list of tools that were used.
Trait Implementations§
Source§impl Debug for CollectingEventHandler
impl Debug for CollectingEventHandler
Source§impl Default for CollectingEventHandler
impl Default for CollectingEventHandler
Source§fn default() -> CollectingEventHandler
fn default() -> CollectingEventHandler
Returns the “default value” for a type. Read more
Source§impl EventHandler for CollectingEventHandler
impl EventHandler for CollectingEventHandler
Source§fn on_tool_use(&mut self, tool: &str, _input: &Value)
fn on_tool_use(&mut self, tool: &str, _input: &Value)
Called when Claude starts using a tool. Read more
Source§fn on_tool_result(&mut self, _result: &str)
fn on_tool_result(&mut self, _result: &str)
Called when a tool returns a result. Read more
Source§fn on_complete(&mut self)
fn on_complete(&mut self)
Called when the response is complete.
Auto Trait Implementations§
impl Freeze for CollectingEventHandler
impl RefUnwindSafe for CollectingEventHandler
impl Send for CollectingEventHandler
impl Sync for CollectingEventHandler
impl Unpin for CollectingEventHandler
impl UnwindSafe for CollectingEventHandler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more