pub struct AtifTrajectoryBuilder { /* private fields */ }Expand description
Stateful collector that converts a live ThreadEvent stream into an
ATIF-compliant Trajectory.
Feed events via process_event (timestamps at
observation time) or process_event_at
(deterministic timestamps for tests). Call finish to
produce the final trajectory.
Implementations§
Source§impl AtifTrajectoryBuilder
impl AtifTrajectoryBuilder
Sourcepub fn set_session_id(&mut self, id: impl Into<String>)
pub fn set_session_id(&mut self, id: impl Into<String>)
Set the session ID explicitly. If not set, it will be derived from
ThreadStarted or ThreadCompleted events.
Sourcepub fn process_event(&mut self, event: &ThreadEvent)
pub fn process_event(&mut self, event: &ThreadEvent)
Process a thread event using the current wall-clock time.
Sourcepub fn process_event_at(&mut self, event: &ThreadEvent, ts: DateTime<Utc>)
pub fn process_event_at(&mut self, event: &ThreadEvent, ts: DateTime<Utc>)
Process a thread event with an explicit timestamp (for deterministic tests).
Sourcepub fn finish(self, override_metrics: Option<FinalMetrics>) -> Trajectory
pub fn finish(self, override_metrics: Option<FinalMetrics>) -> Trajectory
Consume the builder and produce the final ATIF trajectory.
Pass optional FinalMetrics to override the accumulated values.
If None, final metrics are derived from observed events.
Sourcepub fn step_count(&self) -> usize
pub fn step_count(&self) -> usize
Returns the number of steps collected so far.
Trait Implementations§
Source§impl EventEmitter for AtifTrajectoryBuilder
impl EventEmitter for AtifTrajectoryBuilder
Source§fn emit(&mut self, event: &ThreadEvent)
fn emit(&mut self, event: &ThreadEvent)
Invoked for each event emitted by the automation runtime.
Auto Trait Implementations§
impl Freeze for AtifTrajectoryBuilder
impl RefUnwindSafe for AtifTrajectoryBuilder
impl Send for AtifTrajectoryBuilder
impl Sync for AtifTrajectoryBuilder
impl Unpin for AtifTrajectoryBuilder
impl UnsafeUnpin for AtifTrajectoryBuilder
impl UnwindSafe for AtifTrajectoryBuilder
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