Skip to main content

Model

Derive Macro Model 

Source
#[derive(Model)]
{
    // Attributes available to this derive:
    #[sentinel]
}
Expand description

Derive macros — #[derive(Model)], #[derive(Partial)]. Derive the Model trait for a struct.

§Example

#[derive(Model)]
#[sentinel(table = "users")]
pub struct User {
    #[sentinel(primary_key, default = "gen_random_uuid()")]
    pub id: Uuid,
    pub email: String,
}