#[non_exhaustive]pub struct ReportContext<'a> {
pub result: &'a AnalysisResult,
pub root: &'a Path,
pub threshold: f64,
pub summary: Summary,
pub tool_version: &'static str,
pub metrics: Option<&'a ExecutionMetrics>,
}Expand description
Shared, precomputed input passed to every report renderer.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.result: &'a AnalysisResultComplete analysis result, including suppressed findings.
root: &'a PathRepository root used to relativize source locations.
threshold: f64Configured duplication percentage threshold.
summary: SummaryAggregate counts shared across report formats.
tool_version: &'static strVersion of CukeDedup that produced the report.
metrics: Option<&'a ExecutionMetrics>Optional CLI execution measurements.
Implementations§
Source§impl<'a> ReportContext<'a>
impl<'a> ReportContext<'a>
Sourcepub fn new(result: &'a AnalysisResult, root: &'a Path, threshold: f64) -> Self
pub fn new(result: &'a AnalysisResult, root: &'a Path, threshold: f64) -> Self
Creates a context and computes its shared summary once.
Sourcepub fn with_metrics(
result: &'a AnalysisResult,
root: &'a Path,
threshold: f64,
metrics: &'a ExecutionMetrics,
) -> Self
pub fn with_metrics( result: &'a AnalysisResult, root: &'a Path, threshold: f64, metrics: &'a ExecutionMetrics, ) -> Self
Creates a report context containing measured CLI execution phases.
Auto Trait Implementations§
impl<'a> Freeze for ReportContext<'a>
impl<'a> RefUnwindSafe for ReportContext<'a>
impl<'a> Send for ReportContext<'a>
impl<'a> Sync for ReportContext<'a>
impl<'a> Unpin for ReportContext<'a>
impl<'a> UnsafeUnpin for ReportContext<'a>
impl<'a> UnwindSafe for ReportContext<'a>
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