Available on crate features
http and validation only.Expand description
Declaring a resource once.
Without this, the same field list is written four times: the
Schema, the Resource impl
that serializes it, the FromRequest impl
that reads a body back, and the JSON Schema those attributes must satisfy.
Four copies that have to agree, with nothing checking that they do —
rename a field and the compiler stays happy while requests fail at
runtime.
resource! takes the list once and writes all four.
Functions§
- read_
attribute - Read one attribute out of a validated document.
- read_
relationship - Read one relationship’s id out of a validated document.
- read_
relationships - Read a to-many relationship’s ids out of a validated document.