Module range_validator

Module range_validator 

Source
Expand description

Numeric range validation functions

This module provides functions to validate numeric values according to [ValidationRule::Range] constraints.

§Functions

§Example

use dynamic_cli::validator::range_validator::validate_range;

// Validate value is between 0 and 100
validate_range(50.0, "percentage", Some(0.0), Some(100.0))?;

// Validate value is at least 0
validate_range(5.0, "count", Some(0.0), None)?;

// Validate value is at most 1.0
validate_range(0.5, "probability", None, Some(1.0))?;

Functions§

validate_range
Validate that a numeric value is within specified bounds