Skip to main content

Crate vastlint_core

Crate vastlint_core 

Source
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:

§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.
RuleMeta
Metadata about a single rule, as exposed by the public catalog.
Summary
Counts of issues by severity.
ValidationContext
Context passed to validate_with_context. All fields have safe defaults.
ValidationResult
The full result of validating a VAST document.

Enums§

DetectedVersion
How the version was determined.
RuleLevel
Per-rule severity override. Mirrors Severity but adds Off.
Severity
Issue severity, based strictly on spec language.
VastVersion
The VAST version as declared in the version attribute 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.