pub trait Model:
Sized
+ Default
+ Send
+ Sync {
type Key: FromValue + Into<Value> + Clone + Send + Sync + Debug;
const TABLE: &'static str;
const PRIMARY_KEY: &'static str;
const COLUMNS: &'static str;
// Required methods
fn from_row(row: &Row) -> Result<Self>;
fn key(&self) -> Self::Key;
fn set_key(&mut self, key: Self::Key);
fn values(&self) -> Vec<(&'static str, Value)>;
}Expand description
Implemented by #[derive(Model)]; not written by hand.
Required Associated Constants§
Required Associated Types§
Required Methods§
fn from_row(row: &Row) -> Result<Self>
fn key(&self) -> Self::Key
fn set_key(&mut self, key: Self::Key)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".