sdc4_validator/lib.rs
1//! # sdc4-validator
2//!
3//! A high-performance XML Schema validator with Semantic Data Charter (SDC4) support.
4//!
5//! ## Overview
6//!
7//! `sdc4-validator` provides fast and memory-efficient validation of XML documents
8//! against XML Schema definitions with specialized support for healthcare data quality
9//! management through the Semantic Data Charter specification.
10//!
11//! Unlike traditional validators that reject invalid data, `sdc4-validator` implements
12//! a "quarantine-and-tag" pattern that preserves problematic data while injecting
13//! ISO 21090-based `ExceptionalValue` elements.
14//!
15//! ## Quick Start (Coming in v4.0.0)
16//!
17//! ```text
18//! use sdc4_validator::{Validator, ValidationOptions};
19//!
20//! fn main() -> Result<(), Box<dyn std::error::Error>> {
21//! // Create validator with schema
22//! let validator = Validator::from_file("schema.xsd")?;
23//!
24//! // Validate XML document
25//! let xml = std::fs::read_to_string("data.xml")?;
26//! let result = validator.validate(&xml)?;
27//!
28//! if result.is_valid() {
29//! println!("Document is valid!");
30//! } else {
31//! println!("Validation errors: {:?}", result.errors());
32//! }
33//! Ok(())
34//! }
35//! ```
36//!
37//! ## Features
38//!
39//! - **High Performance**: Native Rust implementation for optimal speed
40//! - **SDC4 Compliance**: Full support for Semantic Data Charter 4.x specification
41//! - **ExceptionalValue Support**: Automatic injection of ISO 21090-based exceptional values
42//! - **Recovery Mode**: Tag and preserve invalid data rather than rejecting it
43//!
44//! ## Status
45//!
46//! **PLACEHOLDER RELEASE - NOT FUNCTIONAL**
47//!
48//! This is a v0.1.0 placeholder to reserve the package name on crates.io.
49//! The full implementation is scheduled for Q2 2026 and will be released as v4.0.0.
50//!
51//! For production use today, please see:
52//! - [sdcvalidator (Python)](https://github.com/SemanticDataCharter/sdcvalidator) - Reference implementation
53//! - [@semanticdatacharter/validator](https://www.npmjs.com/package/@semanticdatacharter/validator) - JavaScript/TypeScript
54//!
55//! This library is currently in the planning phase with implementation scheduled for Q2 2026.
56
57#![warn(missing_docs)]
58#![warn(clippy::all)]
59
60// Module declarations (to be implemented)
61// pub mod parser;
62// pub mod schema;
63// pub mod recovery;
64// pub mod errors;
65// pub mod api;
66
67// Re-exports for convenience (to be implemented)
68// pub use api::{Validator, ValidationOptions, ValidationResult};
69// pub use errors::{Error, Result};
70// pub use recovery::{RecoveryOptions, ExceptionalValueType};
71
72// Placeholder for initial development
73
74/// Returns information about this placeholder release.
75///
76/// # Placeholder Release
77///
78/// This is v0.1.0 placeholder to reserve the `sdc4-validator` name on crates.io.
79/// The functional implementation will be released as v4.0.0 in Q2 2026.
80///
81/// # Example
82///
83/// ```
84/// use sdc4_validator::placeholder_info;
85///
86/// let info = placeholder_info();
87/// println!("{}", info);
88/// ```
89pub fn placeholder_info() -> &'static str {
90 "sdc4-validator v0.1.0 - Placeholder release (Implementation planned Q2 2026)"
91}
92
93#[deprecated(
94 since = "0.1.0",
95 note = "This is a placeholder release. Functional API will be available in v4.0.0 (Q2 2026)"
96)]
97/// Placeholder function - do not use.
98pub fn placeholder() {
99 println!("sdc4-validator - Planning phase (Q2 2026)");
100}
101
102#[cfg(test)]
103mod tests {
104 use super::*;
105
106 #[test]
107 fn test_placeholder() {
108 placeholder();
109 }
110}