Skip to main content

Module model

Module model 

Source
Expand description

Building blocks used by #[derive(Validate)] for structs with named fields. They are public so hand-written models can use them too; the reference model in this module’s tests shows the exact shape the derive generates.

Structs§

FieldSpec
Static description of one field of a model.

Enums§

Constraint
A field constraint checked on the (already coerced) raw value.

Functions§

check
Apply constraint to value, reporting at the current location.
prepare_object
Prepare a model object: installs config, checks the input is an object, resolves aliases, reports missing and extra keys, and calls field for each present field with the location set to the key the client sent.