pub struct MetadataWriter { /* private fields */ }Expand description
Thread-safe metadata writer that records extraction results to JSONL and CSV files, and tracks statistics.
Implementations§
Source§impl MetadataWriter
impl MetadataWriter
Sourcepub fn new(output_dir: &Path, build_name: &str, product: &str) -> Result<Self>
pub fn new(output_dir: &Path, build_name: &str, product: &str) -> Result<Self>
Create a new writer, creating the .casc-meta/ directory and opening
index files. Writes the CSV header row.
Sourcepub fn record(&self, entry: &MetadataEntry) -> Result<()>
pub fn record(&self, entry: &MetadataEntry) -> Result<()>
Record a single extraction result. Thread-safe.
Sourcepub fn stats(&self) -> ExtractionStats
pub fn stats(&self) -> ExtractionStats
Get a snapshot of the current stats.
Sourcepub fn finish(self) -> Result<ExtractionStats>
pub fn finish(self) -> Result<ExtractionStats>
Finalize: flush files and write summary.json.
Auto Trait Implementations§
impl !Freeze for MetadataWriter
impl RefUnwindSafe for MetadataWriter
impl Send for MetadataWriter
impl Sync for MetadataWriter
impl Unpin for MetadataWriter
impl UnsafeUnpin for MetadataWriter
impl UnwindSafe for MetadataWriter
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more