Rust library for handling form behavior in web applications, based on Python wtforms.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
michael 1046fe2816
updates
4 months ago
src updates 4 months ago
tests progress 4 months ago
wtforms_derive updates 4 months ago
.gitignore initial 11 months ago
Cargo.toml progress 4 months ago
LICENSE add some docs 4 months ago
README.md ... 4 months ago

README.md

wtforms

NOTE it doesn’t work yet

As the name implies, it’s heavily inspired by the Python library wtforms.

Usage

#[derive(Form, Serialize, Deserialize)]
struct RegisterForm {
    pub email: Email,
    #[validators(required, length(5, 10))]
    pub username: String,
    pub password: Password,
    #[validators(equal_to("self.password"))]
    pub confirm_password: Password,
}

Then you can RegisterForm::as_html() to generate HTML code for it.

You can also validate a RegisterForm that’s been deserialized from, for example Form<RegisterForm> in some web framework.

Caveats

Customization not supported yet.

Contact

Author: Michael Zhang

License: MIT