1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
//! Validator traits and common types.
//!
//! This module defines the core traits (`Validator`, `FileValidator`,
//! `CompoundValidator`) that all rule implementations must conform to.
//! It also provides the `ValidationReport` struct, which is the standard
//! return type for all validators.
//!
//! Submodules:
//! - `column`: column-level validators (NotNull, Unique, Pattern, etc.)
//! - `file`: file-level validators (RowCount, Completeness, etc.)
//! - `compound`: multi-column validators (CompoundUnique, etc.)
//!
//! The engine (`engine/validation.rs`) dispatches to these traits based
//! on the `ContractType` enum. Each validator is responsible for
//! implementing its own logic against a Polars `DataFrame`.
use crateValidationResult;
use *;
// -----------------------------------------------------------------------------
// Sub-modules for different validator categories
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// Common types
// -----------------------------------------------------------------------------
/// Standardized result of a validation check.
///
/// - `status`: one of `"pass"`, `"fail"`, or `"skipped"`.
/// - `details`: optional human-readable explanation (e.g., failure reason).
///
/// This struct is converted into a `RuleResult` for audit logging.
// -----------------------------------------------------------------------------
// Core traits
// -----------------------------------------------------------------------------
/// Trait for all **column-level validators**.
///
/// Implementors validate a single column of a DataFrame against a rule.
/// Example: `NotNullValidator`, `PatternValidator`.
/// Trait for all **file-level validators**.
///
/// Implementors validate properties of the entire DataFrame.
/// Example: `RowCountValidator`, `FileCompletenessValidator`.
/// Trait for all **compound (multi-column) validators**.
///
/// Implementors validate relationships across multiple columns.
/// Example: `CompoundUniqueValidator`.