Expand description
§vastlint-core
A zero-I/O VAST XML validation library. Takes a VAST XML
string and returns a structured ValidationResult listing every issue
found, the detected VAST version, and a summary of error/warning/info counts.
The entire public surface is two functions and a handful of types:
validate– validate with default settings (most callers want this)validate_with_context– validate with rule overrides or wrapper depthall_rules– list the full 108-rule catalog
§Quick start
let xml = r#"<VAST version="2.0">
<Ad><InLine>
<AdSystem>Demo</AdSystem>
<AdTitle>Ad</AdTitle>
<Impression>https://t.example.com/imp</Impression>
<Creatives>
<Creative>
<Linear>
<Duration>00:00:15</Duration>
<MediaFiles>
<MediaFile delivery="progressive" type="video/mp4"
width="640" height="360">
https://cdn.example.com/ad.mp4
</MediaFile>
</MediaFiles>
</Linear>
</Creative>
</Creatives>
</InLine></Ad>
</VAST>"#;
let result = vastlint_core::validate(xml);
assert_eq!(result.summary.errors, 0);§Design constraints
The library has no I/O, no logging, no global state, and no async runtime. It can be embedded in a CLI, HTTP server, WASM module, or FFI binding without pulling in any platform-specific dependencies.
Three crate dependencies: quick-xml (XML parsing), url (RFC 3986),
and phf (compile-time hash maps).
Structs§
- Issue
- A single validation finding.
- Rule
Meta - Metadata about a single rule, as exposed by the public catalog.
- Summary
- Counts of issues by severity.
- Validation
Context - Context passed to validate_with_context. All fields have safe defaults.
- Validation
Result - The full result of validating a VAST document.
Enums§
- Detected
Version - How the version was determined.
- Rule
Level - Per-rule severity override. Mirrors Severity but adds Off.
- Severity
- Issue severity, based strictly on spec language.
- Vast
Version - The VAST version as declared in the
versionattribute or inferred from document structure.
Functions§
- all_
rules - Returns the full catalog of known rules in definition order.
- validate
- Validate a VAST XML string using default settings.
- validate_
with_ context - Validate a VAST XML string with caller-supplied context.