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
+4
View File
@@ -849,6 +849,10 @@ impl<I> Handle<I> {
}
}
pub trait FormValue {}
impl<T> FormValue for T where T: std::str::FromStr {}
pub trait FormModel {}
#[derive(Debug, Eq, PartialEq, Hash)]