pub struct StreamMonitor { /* private fields */ }Expand description
Reads Claude Code’s --output-format stream-json stdout line by line,
extracting cost and result info.
Implementations§
Source§impl StreamMonitor
impl StreamMonitor
pub fn new(stdout: ChildStdout) -> Self
Sourcepub fn with_verbose(self, verbose: bool) -> Self
pub fn with_verbose(self, verbose: bool) -> Self
Enable verbose mode: print live activity as the agent works.
Sourcepub fn with_tee(self, path: Option<PathBuf>) -> Self
pub fn with_tee(self, path: Option<PathBuf>) -> Self
Tee raw stdout lines to a file (transcript capture). Best-effort: if the file can’t be opened, tee is silently skipped.
Sourcepub async fn run(&mut self) -> Result<MonitorResult>
pub async fn run(&mut self) -> Result<MonitorResult>
Read all lines until EOF. Returns aggregated result.
Auto Trait Implementations§
impl Freeze for StreamMonitor
impl RefUnwindSafe for StreamMonitor
impl Send for StreamMonitor
impl Sync for StreamMonitor
impl Unpin for StreamMonitor
impl UnsafeUnpin for StreamMonitor
impl UnwindSafe for StreamMonitor
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