oa_gateway_uci

Module schema

Source
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ยง

Constantsยง

  • MAX_SIMPLE_DEPTH ๐Ÿ”’
    How many links of a named-simple-type chain Schema::primitive will 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, maxOccurs unbounded).
  • 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.