Skip to main content

BenchResultWriter

Struct BenchResultWriter 

Source
pub struct BenchResultWriter { /* private fields */ }

Implementations§

Source§

impl BenchResultWriter

Source

pub fn new(out_dir: &Path, run_id: &str) -> Result<Self, ZerError>

Create a new writer. out_dir is created if it does not yet exist.

Source

pub fn write_pairs(&self, pairs: &[PairRecord]) -> Result<(), ZerError>

Write a streaming NDJSON pairs file. One JSON object per line.

Source

pub fn write_summary( &self, summary: &BenchBatchSummary, accuracy: Option<&AccuracyMetrics>, ) -> Result<(), ZerError>

Write a single-row summary CSV in the shared cross-library format.

Accuracy columns (true_pos, false_pos, etc.) are left empty when accuracy is None, suitable for runs without a ground-truth file. Uses "zer" as the library name. Call Self::write_summary_with_library when a different name is needed (e.g. "zer+judge").

Source

pub fn write_summary_with_library( &self, summary: &BenchBatchSummary, accuracy: Option<&AccuracyMetrics>, library: &str, ) -> Result<(), ZerError>

Like Self::write_summary but lets the caller set the library column.

Use "zer" for the FS-only pipeline and "zer+judge" when the MiniLM neural judge is enabled, so the comparison table distinguishes both operating points.

Source

pub fn write_scored_pairs_csv( &self, pairs: &[(f32, bool)], ) -> Result<(), ZerError>

Write a scored-pairs CSV file sorted by score descending.

The file is named <run_id>_scored_pairs.csv and contains two columns: score (f32) and is_match (0 or 1). Separating this from the benchmark JSON keeps the JSON small and allows millions of rows without memory cost.

Source

pub fn run_id(&self) -> &str

Source

pub fn out_dir(&self) -> &Path

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.