pub struct ReportBuilder { /* private fields */ }Expand description
Thread-safe builder that accumulates per-file results and produces
a final SanitizeReport.
Designed for concurrent use: wrap in Arc and share across threads.
The internal Mutex is held only for the duration of a single
Vec::push, so contention is negligible even at high thread counts.
Implementations§
Source§impl ReportBuilder
impl ReportBuilder
Sourcepub fn new(metadata: ReportMetadata) -> Self
pub fn new(metadata: ReportMetadata) -> Self
Create a new builder with the given metadata.
The wall-clock timer starts now.
Sourcepub fn record_file(&self, file_report: FileReport)
pub fn record_file(&self, file_report: FileReport)
Record the result for a single file. Thread-safe.
Sourcepub fn record_files(&self, reports: impl IntoIterator<Item = FileReport>)
pub fn record_files(&self, reports: impl IntoIterator<Item = FileReport>)
Record multiple file results at once (e.g., from archive processing).
Sourcepub fn finish(self) -> SanitizeReport
pub fn finish(self) -> SanitizeReport
Consume the builder and produce the final report.
The duration is measured from builder creation to this call.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ReportBuilder
impl RefUnwindSafe for ReportBuilder
impl Send for ReportBuilder
impl Sync for ReportBuilder
impl Unpin for ReportBuilder
impl UnsafeUnpin for ReportBuilder
impl UnwindSafe for ReportBuilder
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> 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