pub struct EventReader { /* private fields */ }Expand description
Reads new events from .ralph/events.jsonl since last read.
Implementations§
Source§impl EventReader
impl EventReader
Sourcepub fn read_new_events(&mut self) -> Result<ParseResult>
pub fn read_new_events(&mut self) -> Result<ParseResult>
Reads new events since the last read.
Returns a ParseResult containing both successfully parsed events
and information about malformed lines. This enables backpressure
validation - the caller can emit event.malformed events and
track consecutive failures.
§Errors
Returns an error if the file cannot be opened or read.
Sourcepub fn peek_new_events(&self) -> Result<ParseResult>
pub fn peek_new_events(&self) -> Result<ParseResult>
Reads new events without advancing the internal file position.
This is used by callers that need to inspect unread events before deciding whether to process them.
Sourcepub fn set_position(&mut self, position: u64)
pub fn set_position(&mut self, position: u64)
Sets the file position to a specific byte offset.
Use this to skip past entries written by the EventLogger so they
are not re-read by process_events_from_jsonl.
Auto Trait Implementations§
impl Freeze for EventReader
impl RefUnwindSafe for EventReader
impl Send for EventReader
impl Sync for EventReader
impl Unpin for EventReader
impl UnsafeUnpin for EventReader
impl UnwindSafe for EventReader
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