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() }