pub struct ValidationConfig {
pub required_fields: Vec<String>,
pub field_types: HashMap<String, String>,
pub min_values: HashMap<String, f64>,
pub max_values: HashMap<String, f64>,
pub patterns: HashMap<String, String>,
}Expand description
Validation configuration for parsed events.
Fields§
§required_fields: Vec<String>Required fields that must be present
field_types: HashMap<String, String>Field type constraints
min_values: HashMap<String, f64>Minimum values for numeric fields
max_values: HashMap<String, f64>Maximum values for numeric fields
patterns: HashMap<String, String>Regex patterns for string fields
Implementations§
Source§impl ValidationConfig
impl ValidationConfig
Sourcepub fn with_required(self, field: String) -> Self
pub fn with_required(self, field: String) -> Self
Add a required field
Sourcepub fn with_range(self, field: String, min: f64, max: f64) -> Self
pub fn with_range(self, field: String, min: f64, max: f64) -> Self
Add a numeric range constraint
Sourcepub fn with_pattern(self, field: String, pattern: String) -> Self
pub fn with_pattern(self, field: String, pattern: String) -> Self
Add a regex pattern constraint
Trait Implementations§
Source§impl Clone for ValidationConfig
impl Clone for ValidationConfig
Source§impl Debug for ValidationConfig
impl Debug for ValidationConfig
Source§impl Default for ValidationConfig
impl Default for ValidationConfig
Source§impl<'de> Deserialize<'de> for ValidationConfig
impl<'de> Deserialize<'de> for ValidationConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ValidationConfig
impl RefUnwindSafe for ValidationConfig
impl Send for ValidationConfig
impl Sync for ValidationConfig
impl Unpin for ValidationConfig
impl UnsafeUnpin for ValidationConfig
impl UnwindSafe for ValidationConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more