pub trait ModelInterface {
    type Entity: Serialize + DeserializeOwned + Sync + Send;
    type Database;

    // Required methods
    fn new(database: Self::Database) -> Self
       where Self: Sized;
    fn database(&self) -> &Self::Database;
    fn table() -> &'static str;
}

Required Associated Types§

source

type Entity: Serialize + DeserializeOwned + Sync + Send

Entité du modèle.

source

type Database

Required Methods§

source

fn new(database: Self::Database) -> Selfwhere Self: Sized,

Crée une instance du model.

source

fn database(&self) -> &Self::Database

source

fn table() -> &'static str

Nom de la table du model, correspondant à un nom de table d’une base de données.

Implementors§