Skip to main content

Module contract

Module contract 

Source
Expand description

This crate’s own claim about the types it declares.

Every type this crate declares as its own is listed in declared, with the JSON Schema it emits and a canonical value of it. This is what the printobserver-types:schemas graph target generates the checked-in schemas from, and what this crate’s contract tests walk, so that a type cannot fall out of the schema set or out of the round-trip corpus by being forgotten in a list somebody maintains by hand.

Each entry carries two values rather than one: full, which carries every field the type declares, and minimal, which carries every optional field absent. The second is what proves that an absent optional serializes as absent rather than as null, a zero or an empty string.

Structs§

RangedField
One field this crate declares a plausibility range for.
TypeContract
One type this crate declares, with its schema and its canonical values.
WireField
One field as a generated schema declares it.

Constants§

PORT_OWNED_TYPES
The ten types the port crates own, which this crate declares none of.
RANGED_FIELDS
Every field this crate types as Reported<f64>, with its declared range.

Traits§

Sample
A canonical value of one type, for the schema set and the round-trip corpus.

Functions§

declared
Every type this crate declares as its own.
schema_of
The JSON Schema one type emits, under this crate’s own generator settings.
wire_fields
Every field one generated schema declares, in name order.