Expand description
In-memory model of a UCI schema. Enough for the OMS JSON rules; not a full XSD processor.
Build one by hand with the builder methods below, or compile the published
XSD into one with crate::xsd::compile.
Structsยง
- A named complex type: whether it is abstract, and how it is built.
- The facets in force for a type, gathered along its restriction chain.
- One element declaration: name, type, and occurrence range.
- Constraints a simple type places on a value, as written.
- A top-level element and the type it is declared as.
- A run of element declarations under one compositor.
- A pattern facet: what the XSD wrote, and the matcher it translates to.
- Enough of a UCI schema to convert and validate OMS JSON.
- A named simple type: the type it restricts, and the facets it adds.
Enumsยง
- Upper bound of an element declaration.
Self::is_arrayis what conversion uses to decide a JSON array.
Constantsยง
- MAX_
SIMPLE_ ๐DEPTH How many links of a named-simple-type chainSchema::primitivewill follow before giving up. The published schema nests three deep at most; the limit exists so a cyclic hand-built schema cannot hang the caller.
Functionsยง
- One compositor whose members are alternatives.
- Required once (
minOccurs=1,maxOccurs=1). - Zero or more (
minOccurs=0,maxOccursunbounded). - Optional once (
minOccurs=0,maxOccurs=1). - One compositor whose members stand on their own.
- stricter ๐Keep whichever bound is harder to satisfy.
- stricter_
f64 ๐ - translate ๐Rewrite an XSD pattern as an equivalent Rust regex.