pub struct EventWriter { /* private fields */ }Expand description
Writer for appending events to a JSONL file
Implementations§
Source§impl EventWriter
impl EventWriter
pub fn new(project_root: &Path, session_id: &str) -> Result<Self>
Sourcepub fn session_file(&self) -> PathBuf
pub fn session_file(&self) -> PathBuf
Get the path to the session event file
Sourcepub fn write(&self, event: &AgentEvent) -> Result<()>
pub fn write(&self, event: &AgentEvent) -> Result<()>
Write an event to the session log
Sourcepub fn write_with_task_log(&self, event: &AgentEvent) -> Result<()>
pub fn write_with_task_log(&self, event: &AgentEvent) -> Result<()>
Write an event to both session and task-specific logs
Sourcepub fn log_spawned(&self, task_id: &str) -> Result<()>
pub fn log_spawned(&self, task_id: &str) -> Result<()>
Log a spawn event
Auto Trait Implementations§
impl Freeze for EventWriter
impl RefUnwindSafe for EventWriter
impl Send for EventWriter
impl Sync for EventWriter
impl Unpin for EventWriter
impl UnwindSafe for EventWriter
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more