pub trait PhaseSink: Send + Sync {
// Required methods
fn emit(
&self,
phase: &str,
item_type: &str,
item: &Value,
) -> Result<(), StreamError>;
fn phase_complete(&self, phase: &str) -> Result<(), StreamError>;
fn flush(&self) -> Result<(), StreamError>;
fn stats(&self) -> StreamStats;
}Expand description
Trait for sinks that receive generated items phase-by-phase.
Required Methods§
Sourcefn emit(
&self,
phase: &str,
item_type: &str,
item: &Value,
) -> Result<(), StreamError>
fn emit( &self, phase: &str, item_type: &str, item: &Value, ) -> Result<(), StreamError>
Emit a single generated item.
Sourcefn phase_complete(&self, phase: &str) -> Result<(), StreamError>
fn phase_complete(&self, phase: &str) -> Result<(), StreamError>
Signal that a generation phase has completed.
Sourcefn flush(&self) -> Result<(), StreamError>
fn flush(&self) -> Result<(), StreamError>
Flush any buffered data to the underlying sink.
Sourcefn stats(&self) -> StreamStats
fn stats(&self) -> StreamStats
Return current streaming statistics.