pub struct MetricsBuilder { /* private fields */ }Expand description
Immutable file/type selection for metrics extraction.
Implementations§
Source§impl MetricsBuilder
impl MetricsBuilder
Sourcepub fn with_name(self, pattern: impl Into<PatternSpec>) -> Self
pub fn with_name(self, pattern: impl Into<PatternSpec>) -> Self
Keeps source files whose final path segment matches pattern.
Sourcepub fn in_folder(self, pattern: impl Into<PatternSpec>) -> Self
pub fn in_folder(self, pattern: impl Into<PatternSpec>) -> Self
Keeps source files whose containing folder matches pattern.
Sourcepub fn in_path(self, pattern: impl Into<PatternSpec>) -> Self
pub fn in_path(self, pattern: impl Into<PatternSpec>) -> Self
Keeps source files whose normalized project path matches pattern.
Sourcepub fn for_types_matching(self, pattern: impl Into<PatternSpec>) -> Self
pub fn for_types_matching(self, pattern: impl Into<PatternSpec>) -> Self
Keeps Rust type declarations whose unqualified name matches pattern.
When present, files without a matching type are omitted. File-level type and trait counts describe only the retained declarations; source-wide counts such as lines and imports remain properties of the containing file.
Sourcepub fn analyze(&self) -> Result<ProjectMetricsInfo, ArchUnitError>
pub fn analyze(&self) -> Result<ProjectMetricsInfo, ArchUnitError>
Extracts the selected information model with production-source defaults.
Sourcepub fn analyze_with(
&self,
check_options: &CheckOptions,
) -> Result<ProjectMetricsInfo, ArchUnitError>
pub fn analyze_with( &self, check_options: &CheckOptions, ) -> Result<ProjectMetricsInfo, ArchUnitError>
Extracts the selected information model with explicit source-target options.
Sourcepub fn count(self) -> CountMetricsBuilder
pub fn count(self) -> CountMetricsBuilder
Enters the built-in count metric family.
Sourcepub fn lcom(self) -> LcomMetricsBuilder
pub fn lcom(self) -> LcomMetricsBuilder
Enters the lack-of-cohesion metric family for eligible Rust structs.
Sourcepub fn distance(self) -> DistanceMetricsBuilder
pub fn distance(self) -> DistanceMetricsBuilder
Enters the file-component distance metric family.
Sourcepub fn custom_metric<Calculation>(
self,
name: impl Into<String>,
description: impl Into<String>,
calculation: Calculation,
) -> CustomMetricSelection<Calculation>
pub fn custom_metric<Calculation>( self, name: impl Into<String>, description: impl Into<String>, calculation: Calculation, ) -> CustomMetricSelection<Calculation>
Defines a reusable numeric metric over every selected Rust type.
The calculation receives an immutable TypeInfo and is invoked once per type on each
execution. Panics from the user callback propagate normally.
Sourcepub fn project_path(&self) -> Option<&Path>
pub fn project_path(&self) -> Option<&Path>
Returns the explicit discovery path, or None for automatic discovery.
Trait Implementations§
Source§impl Clone for MetricsBuilder
impl Clone for MetricsBuilder
Source§fn clone(&self) -> MetricsBuilder
fn clone(&self) -> MetricsBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more