pub trait Model {
const NAME: &'static str;
const COLUMNS: &'static [&'static str];
// Required methods
fn params(&self) -> Vec<&(dyn ToSql + Sync)>;
fn from_row(row: Row) -> Result<Self>
where Self: Sized;
fn get_value(&self, column: &str) -> Option<Value>;
fn sort_keys() -> Vec<String>;
// Provided method
fn cursor(&self) -> Cursor { ... }
}Required Associated Constants§
Required Methods§
fn params(&self) -> Vec<&(dyn ToSql + Sync)>
fn from_row(row: Row) -> Result<Self>where
Self: Sized,
fn get_value(&self, column: &str) -> Option<Value>
fn sort_keys() -> Vec<String>
Provided Methods§
Object Safety§
This trait is not object safe.