pub struct EventParser { /* private fields */ }Expand description
Parser for extracting events from CLI output.
Implementations§
Source§impl EventParser
impl EventParser
Sourcepub fn with_source(self, source: impl Into<HatId>) -> Self
pub fn with_source(self, source: impl Into<HatId>) -> Self
Sets the source hat for parsed events.
Sourcepub fn parse(&self, output: &str) -> Vec<Event>
pub fn parse(&self, output: &str) -> Vec<Event>
Parses events from CLI output text.
Returns a list of parsed events.
Sourcepub fn parse_backpressure_evidence(
payload: &str,
) -> Option<BackpressureEvidence>
pub fn parse_backpressure_evidence( payload: &str, ) -> Option<BackpressureEvidence>
Parses backpressure evidence from build.done event payload.
Expected format:
tests: pass
lint: pass
typecheck: passNote: ANSI escape codes are stripped before parsing to handle colorized CLI output.
Sourcepub fn contains_promise(output: &str, promise: &str) -> bool
pub fn contains_promise(output: &str, promise: &str) -> bool
Checks if output contains the completion promise.
Per spec: The promise must appear in the agent’s final output,
not inside an <event> tag payload. This function:
- Returns false if the promise appears inside ANY event tag (prevents accidental completion when agents discuss the promise)
- Otherwise, checks for the promise in the stripped output
Checks if the promise appears inside any event tag payload.
Trait Implementations§
Source§impl Debug for EventParser
impl Debug for EventParser
Source§impl Default for EventParser
impl Default for EventParser
Source§fn default() -> EventParser
fn default() -> EventParser
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for EventParser
impl RefUnwindSafe for EventParser
impl Send for EventParser
impl Sync for EventParser
impl Unpin for EventParser
impl UnsafeUnpin for EventParser
impl UnwindSafe for EventParser
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