rpo 0.1.0-beta.4

Git contribution analysis: commits, file changes, and per-line authorship over time as polars DataFrames
//! Streaming output sinks for blame_over_time_streaming. Each sink receives
//! one DataFrame per snapshot plus a `finish` call at the end.

use polars::prelude::DataFrame;

use crate::RpoError;

#[cfg(feature = "sink-duckdb")]
pub mod duckdb;
pub mod parquet;

#[cfg(feature = "sink-duckdb")]
pub use duckdb::{DuckDbSink, DuckDbWriteMode};
pub use parquet::{ParquetDirSink, ParquetSink};

/// Receives blame frames one snapshot at a time.
///
/// Implement this to stream a blame-over-time run somewhere other than
/// memory. See [`Builder::blame_over_time_streaming`](crate::Builder::blame_over_time_streaming).
pub trait FrameSink: Send {
    /// Write one snapshot's frame.
    fn write_snapshot(&mut self, frame: DataFrame) -> Result<(), RpoError>;
    /// Flush and close. Called once, after the final snapshot.
    fn finish(&mut self) -> Result<(), RpoError>;
}