Expand description
Payload typing: what values a payload type may carry, and what the specification says it means.
The Alliance publishes six enumeration files as JSON Schema; cargo xtask codegen compiles them
into this module, and CI fails when the pinned files and the table differ. Four describe a
valuesMap — event interval payloads, report payloads, programme attributes, VEN and resource
attributes — and become PayloadSpecs keyed by PayloadGroup. Two constrain a descriptor
field and become units and reading_types.
Each PayloadSpec::description is the definition’s own text, so a converter can refuse a
payload in the specification’s words. The enumeration files are © OpenADR Alliance, released
under the Apache License 2.0.
Validation is not mandatory: the Definitions leave content validation to the client, and private
payload types are legal. An unknown type is Validity::Unknown, never an error, and a VTN
chooses its own Policy.
Structs§
- Payload
Spec - What the specification says about one payload type.
- Value
Kinds - The set of JSON value kinds a payload accepts, as a bit set.
Enums§
- Payload
Group - Which family a payload type belongs to.
- Payload
Violation - A single way in which a payload contradicts its specification.
- Policy
- How strictly a VTN enforces payload typing.
- Validity
- The outcome of checking a payload.
Functions§
- all
- Every known payload specification.
- lookup
- Look up a payload type by name.
- reading_
types - Every reading type
reportPayloadDescriptor.readingTypeenumerates. - subinterval_
count - How many sub-intervals a payload implies.
- units
- Every unit of measure
eventPayloadDescriptor.unitsenumerates. - validate
- Check one payload against its specification.
- validate_
all - Check a list of payloads, collecting every violation.