Crates.io | formy |
lib.rs | formy |
version | 0.2.2 |
source | src |
created_at | 2021-02-05 16:18:07.088893 |
updated_at | 2021-02-15 16:40:03.972924 |
description | Provides a derive macro to turn structs into html forms. |
homepage | |
repository | https://github.com/edg-l/formy |
max_upload_size | |
id | 351169 |
size | 3,118 |
A derive macro to generate HTML forms from structs.
Currently in early development, only input with all its attributes is handled right now.
Docs: https://docs.rs/formy/
use formy::Form;
#[derive(Form)]
struct UserLogin {
#[input(pattern = r"[\w]+")]
#[label = "Username:"]
username: String,
#[input(type = "email", name = "real_email", class="py-4", id = "email")]
email: String,
#[input(type = "password")]
#[label = "Password:"]
password: String,
some_field: String,
}
let form = UserLogin::to_html();
License: MIT