pub trait Model {
// Required methods
fn table_name() -> &'static str;
fn columns() -> Vec<ColumnInfo>;
fn active_columns() -> Vec<&'static str>;
fn to_map(&self) -> HashMap<String, String>;
}Expand description
Required Methods§
Sourcefn table_name() -> &'static str
fn table_name() -> &'static str
Returns the table name associated with this model. usually converted from CamelCase struct name to snake_case.
Sourcefn columns() -> Vec<ColumnInfo>
fn columns() -> Vec<ColumnInfo>
Returns the list of column definitions for this model.
Sourcefn active_columns() -> Vec<&'static str>
fn active_columns() -> Vec<&'static str>
Returns the names of active columns (struct fields).
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.