pub trait Entity {
// Required method
fn convert(row: Row<'_>) -> Self;
// Provided methods
fn get_fields() -> Vec<&'static str> { ... }
fn get_values<'a>(
&'a self,
_: &Vec<&'static str>,
) -> BTreeMap<&'a str, &'a dyn ToSql> { ... }
fn get_table_name() -> &'static str { ... }
fn get_id(&self) -> i32 { ... }
}
Required Methods§
Provided Methods§
fn get_fields() -> Vec<&'static str>
fn get_values<'a>( &'a self, _: &Vec<&'static str>, ) -> BTreeMap<&'a str, &'a dyn ToSql>
fn get_table_name() -> &'static str
fn get_id(&self) -> i32
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.