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§
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.