use std::collections::HashMap;
#[derive(Debug, Clone)]
pub struct ValidationContext {
_options: ValidationOptions,
setter_names: HashMap<String, String>,
}
#[derive(Debug, Clone)]
pub struct ValidationOptions {
pub _strict_mode: bool,
pub _detailed_errors: bool,
pub _exhaustive_attribute_validation: bool,
}
impl Default for ValidationOptions {
fn default() -> Self {
Self {
_strict_mode: true,
_detailed_errors: true,
_exhaustive_attribute_validation: true,
}
}
}
impl ValidationContext {
pub fn new() -> Self {
Self {
_options: ValidationOptions::default(),
setter_names: HashMap::new(),
}
}
pub fn record_setter_name(
&mut self,
setter_name: String,
field_name: String,
) -> Option<String> {
self.setter_names.insert(setter_name, field_name)
}
pub fn clear_setter_names(&mut self) {
self.setter_names.clear();
}
}
impl Default for ValidationContext {
fn default() -> Self {
Self::new()
}
}