feat(derive): check form parser availability

Introduce FormValue as the parser-availability bound for #[slhx::form] models, blanket it for FromStr types, and add compile-fail coverage for a form field whose domain type lacks a parser.

req: form/004

req: form/006
This commit is contained in:
slhx agent
2026-05-25 23:48:56 +02:00
parent 274b8e9e55
commit 21716882ab
5 changed files with 117 additions and 4 deletions
+1 -1
View File
@@ -331,7 +331,7 @@ resources. Concrete runtime targets are addressed through `ResourceRef`
003 Handler receives `form: Form<CreateTodo>`. Validation errors target `(FormId, field_name)` or generated control ids. The runtime maps them to originating form controls via control ids derived from Surface `NodeId`, not via slot ids.
### req: form/004
004 Form compatibility checks validate field presence, optionality, multiplicity, and parser availability. Domain validation remains Rust logic (`TryFrom`, custom validators, or handler code).
004 Form compatibility checks validate field presence, optionality, multiplicity, and parser availability. Parser availability means the submitted value type implements `slhx::FormValue` (blanket-provided for `FromStr`, or explicitly implemented for custom parsers). Domain validation remains Rust logic (`TryFrom`, custom validators, or handler code).
### req: form/005
005 HTML control facts are lower bounds, not complete domain semantics.