pub struct CustomMetricSelection<Calculation> { /* private fields */ }Expand description
A user-defined type metric that can be measured or turned into a predicate rule.
Implementations§
Source§impl<Calculation> CustomMetricSelection<Calculation>
impl<Calculation> CustomMetricSelection<Calculation>
Sourcepub fn should_be_below(self, threshold: f64) -> MetricThresholdCondition<Self>
pub fn should_be_below(self, threshold: f64) -> MetricThresholdCondition<Self>
Requires every measured value to be strictly below threshold.
Sourcepub fn should_be_above(self, threshold: f64) -> MetricThresholdCondition<Self>
pub fn should_be_above(self, threshold: f64) -> MetricThresholdCondition<Self>
Requires every measured value to be strictly above threshold.
Sourcepub fn should_be(self, threshold: f64) -> MetricThresholdCondition<Self>
pub fn should_be(self, threshold: f64) -> MetricThresholdCondition<Self>
Requires every measured value to equal threshold exactly.
Sourcepub fn should_be_below_or_equal(
self,
threshold: f64,
) -> MetricThresholdCondition<Self>
pub fn should_be_below_or_equal( self, threshold: f64, ) -> MetricThresholdCondition<Self>
Requires every measured value to be below or equal to threshold.
Sourcepub fn should_be_above_or_equal(
self,
threshold: f64,
) -> MetricThresholdCondition<Self>
pub fn should_be_above_or_equal( self, threshold: f64, ) -> MetricThresholdCondition<Self>
Requires every measured value to be above or equal to threshold.
Sourcepub fn measure(&self) -> Result<Vec<MetricMeasurement>, ArchUnitError>
pub fn measure(&self) -> Result<Vec<MetricMeasurement>, ArchUnitError>
Extracts and measures selected production-source types.
Panics from the custom calculation propagate normally.
Sourcepub fn measure_with(
&self,
check_options: &CheckOptions,
) -> Result<Vec<MetricMeasurement>, ArchUnitError>
pub fn measure_with( &self, check_options: &CheckOptions, ) -> Result<Vec<MetricMeasurement>, ArchUnitError>
Extracts and measures selected types with explicit source-target options.
Panics from the custom calculation propagate normally.
Sourcepub fn should_satisfy<Predicate>(
self,
predicate: Predicate,
) -> CustomMetricCondition<Calculation, Predicate>
pub fn should_satisfy<Predicate>( self, predicate: Predicate, ) -> CustomMetricCondition<Calculation, Predicate>
Creates a reusable rule whose predicate receives the value and the same type evidence.
Panics from either callback propagate normally.
Sourcepub fn description(&self) -> &str
pub fn description(&self) -> &str
Returns the user-defined metric description.
Trait Implementations§
Source§impl<Calculation: Clone> Clone for CustomMetricSelection<Calculation>
impl<Calculation: Clone> Clone for CustomMetricSelection<Calculation>
Source§fn clone(&self) -> CustomMetricSelection<Calculation>
fn clone(&self) -> CustomMetricSelection<Calculation>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more