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:
@@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user