1 2 3 4 5 6 7 8 9 10 11
use diesel::prelude::*; pub trait Model: Sized { type Table: Table; type PrimaryKeyType: Copy; type InsertType; fn table() -> Self::Table; fn id(&self) -> Self::PrimaryKeyType; }