diff options
| author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-10-23 01:36:39 +0200 |
|---|---|---|
| committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-10-23 01:36:39 +0200 |
| commit | 7bff22756beec82b4a1470e2d325b706dc56e5f2 (patch) | |
| tree | 1566965125cfd5fbd73d654e9ee6ca8256301411 /rocie-macros/src/form/mod.rs | |
| parent | feat(form): Re-write the form macro as a proc macro (diff) | |
| download | web-client-7bff22756beec82b4a1470e2d325b706dc56e5f2.zip | |
feat(buy): Provide basic buy interface
Diffstat (limited to 'rocie-macros/src/form/mod.rs')
| -rw-r--r-- | rocie-macros/src/form/mod.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/rocie-macros/src/form/mod.rs b/rocie-macros/src/form/mod.rs index 2719826..7abd8f6 100644 --- a/rocie-macros/src/form/mod.rs +++ b/rocie-macros/src/form/mod.rs @@ -1,7 +1,7 @@ use syn::{Expr, Ident, LitStr, Type}; -mod parse; mod generate; +mod parse; pub use generate::form_impl; @@ -9,6 +9,7 @@ pub use generate::form_impl; pub struct ParsedOnSubmit { inputs: Vec<Ident>, block: Expr, + pub(crate) should_use_move: bool, } #[derive(Debug)] @@ -18,19 +19,19 @@ pub enum ParsedChild { rust_type: Type, html_type: LitStr, label: LitStr, + reactive: Option<Ident>, + auto_complete: Option<Ident>, }, Select { name: Ident, label: LitStr, rust_type: Type, - options: SelectOptions, + options: Expr, // Vec<(String, Uuid)> }, + Show { when: Expr, children: Vec<ParsedChild> }, } #[derive(Debug)] -pub struct SelectOptions(Vec<(LitStr, Expr)>); - -#[derive(Debug)] pub struct ParsedInput { on_submit: ParsedOnSubmit, children: Vec<ParsedChild>, |
