Skip to main content

validate

Function validate 

Source
pub fn validate(vars: &EnvroVars, schema: &Schema) -> Result<(), EnvroError>
Expand description

Validate an arbitrary EnvroVars map against a schema.

This function is completely decoupled from any I/O: vars can come from load_dotenv, a CLI, a config service, test fixtures, or anywhere else that produces a HashMap<String, String>.

Collects every failing rule across every field before returning. Unknown keys in vars (not in the schema) are ignored.

See validate_env to validate the live process environment directly.