pub trait Model {
// Required methods
fn table_name() -> &'static str;
fn columns() -> &'static [Column<'static>];
fn count_columns() -> usize;
fn get_id(&self) -> i64;
fn id_column() -> Column<'static>;
fn column_value(
&self,
column: &'static Column<'static>,
) -> Option<Box<dyn ToSql>>;
fn parse_rows(
rows: Rows<'_>,
offset: usize,
joins: &Vec<String>,
) -> Vec<Self>
where Self: Sized;
fn parse_row(row: &Row<'_>, offset: usize, joins: &Vec<String>) -> Self
where Self: Sized;
}
Expand description
Required Methods§
fn table_name() -> &'static str
fn columns() -> &'static [Column<'static>]
fn count_columns() -> usize
fn get_id(&self) -> i64
fn id_column() -> Column<'static>
fn column_value( &self, column: &'static Column<'static>, ) -> Option<Box<dyn ToSql>>
fn parse_rows(rows: Rows<'_>, offset: usize, joins: &Vec<String>) -> Vec<Self>where
Self: Sized,
fn parse_row(row: &Row<'_>, offset: usize, joins: &Vec<String>) -> Selfwhere
Self: Sized,
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.