Skip to main content

require_min

Function require_min 

Source
pub fn require_min(field: &str, value: i64, min: i64) -> Option<ValidationError>
Expand description

A numeric knob must be at least min — the shared one-liner behind every Option<u32> count / Option<i64> bytes-per-second field (e.g. RepositoryReplication.spec.sync.parallel), so the rule and its message shape are written once instead of re-derived per field. field names the exact path for the message (e.g. "RepositoryReplication spec.sync.parallel"). Callers only invoke this for a Some value — an absent knob is always valid and never reaches this helper.