Expand description
Struct↔schema contracts and value bridging for the opt-in formars-derive crate.
Struct↔schema contracts and value bridging used by the opt-in
formars-derive crate — macro-free, dependency-free additions to core.
Two small traits with disjoint duties:
FormSchemaconnects a Rust struct to its companion schema (nesting). It lives in core because proc-macro crates cannot export runtime items.FormBridgeconnects a Rust value to the erasedValuetree in both directions (typed-parse bridging), so plain primitives can participate in derived reconstruction without deriving anything.
Traits§
- Form
Bridge - Lossless Rust-value ↔
Valuebridging used by generated typed parses:to_form_valuefeeds the composed object schema;from_validatedreconstructs fields from validated output. Total on validated outputs — returnsNoneonly on an invariant breach or wrong-variant input. - Form
Schema - Connects a Rust struct to its companion schema.