pub trait Model:
Sized
+ Send
+ Sync {
const MODEL_NAME: &'static str;
const TABLE_NAME: &'static str;
const PRIMARY_KEY: &'static [&'static str];
const COLUMNS: &'static [&'static str];
}Expand description
A model that can be queried.
Required Associated Constants§
Sourceconst MODEL_NAME: &'static str
const MODEL_NAME: &'static str
The name of the model (used for table name).
Sourceconst TABLE_NAME: &'static str
const TABLE_NAME: &'static str
The name of the database table.
Sourceconst PRIMARY_KEY: &'static [&'static str]
const PRIMARY_KEY: &'static [&'static str]
The primary key column name(s).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.