pub trait BaseModel: Serialize + DeserializeOwned {
const NAME: &'static str;
// Required methods
fn columns(prefix: Option<&str>) -> BTreeMap<&'static str, CompactString>;
fn map(prefix: Option<&str>, row: &PgRow) -> Result<Self, DatabaseError>;
// Provided method
fn columns_sql(prefix: Option<&str>) -> CompactString { ... }
}Required Associated Constants§
Required Methods§
fn columns(prefix: Option<&str>) -> BTreeMap<&'static str, CompactString>
fn map(prefix: Option<&str>, row: &PgRow) -> Result<Self, DatabaseError>
Provided Methods§
fn columns_sql(prefix: Option<&str>) -> CompactString
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.