Skip to main content

entrenar/monitor/inference/collector/
traits.rs

1//! Trace collector trait definition
2
3use super::super::path::DecisionPath;
4use super::super::trace::DecisionTrace;
5
6/// Strategy for collecting decision traces
7pub trait TraceCollector<P: DecisionPath>: Send + Sync {
8    /// Record a decision trace
9    fn record(&mut self, trace: DecisionTrace<P>);
10
11    /// Flush any buffered traces
12    fn flush(&mut self) -> std::io::Result<()>;
13
14    /// Number of traces recorded
15    fn len(&self) -> usize;
16
17    /// Check if empty
18    fn is_empty(&self) -> bool {
19        self.len() == 0
20    }
21}