Crate dade_derive
source · [−]Expand description
If you want to write a model definition, this crate is needed. You need usage and more information, check this document dade
.
use dade::Model;
use dade_derive::model;
#[model]
struct User {
#[field(ge = 1)]
id: u64,
#[field(min_length = 1, max_length = 100)]
name: String,
#[field(default = "en")]
lang: String,
#[field(min_length = 1, max_length = 255, default = null)]
url: Option<String>,
#[field(default = false)]
verified: bool,
}
Attribute Macros
This macro is to define a model.