pub struct Reporter { /* private fields */ }Expand description
Stateful reporter that can also act as a streaming sink for partial flushes.
Implementations§
Source§impl Reporter
impl Reporter
Sourcepub fn new(cfg: ReportConfig) -> Result<Self>
pub fn new(cfg: ReportConfig) -> Result<Self>
Create a new reporter, opening the output file (truncating) if needed.
pub fn stream_enabled(&self) -> bool
Sourcepub fn write_run_result(&self, result: &RunResult)
pub fn write_run_result(&self, result: &RunResult)
Serialise and write a completed run. Always returns Ok — errors are
logged via tracing rather than propagated (non-fatal for the scan).
Sourcepub fn flush_finding(&self, finding: &Finding)
pub fn flush_finding(&self, finding: &Finding)
Append a single Finding immediately (NDJSON only).
Useful when scanners emit findings progressively rather than waiting for
the full run to complete. In Pretty mode this is a no-op (the full
document must be written atomically).
Sourcepub fn start_stream(&self, meta: &ReportMeta)
pub fn start_stream(&self, meta: &ReportMeta)
Emit a streaming header (NDJSON only).
Auto Trait Implementations§
impl Freeze for Reporter
impl RefUnwindSafe for Reporter
impl Send for Reporter
impl Sync for Reporter
impl Unpin for Reporter
impl UnsafeUnpin for Reporter
impl UnwindSafe for Reporter
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