#[derive(Validate)]
{
// Attributes available to this derive:
#[validate]
}
Expand description
Derive macro for implementing Validate and AsyncValidate traits
§Example
ⓘ
use rustapi_macros::Validate;
#[derive(Validate)]
struct CreateUser {
#[validate(email, message = "Invalid email format")]
email: String,
#[validate(length(min = 3, max = 50))]
username: String,
#[validate(range(min = 18, max = 120))]
age: u8,
#[validate(async_unique(table = "users", column = "email"))]
email: String,
}