configloader-676 0.1.0

A library for loading configuration files (JSON, TOML, YAML) into Rust structs with environment variable overrides and validation.
Documentation
1
2
3
4
5
6
7
8
9
10
11
use crate::config::error::ConfigError;

/// Trait for custom validation rules.
pub trait Validatable {
    fn validate(&self) -> Result<(), ConfigError>;
}

/// Validates the configuration using custom rules.
pub fn validate_config<T: Validatable>(config: &T) -> Result<(), ConfigError> {
    config.validate()
}