Trait Entity

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

Source

fn convert(row: Row<'_>) -> Self

Provided Methods§

Source

fn get_fields() -> Vec<&'static str>

Source

fn get_values<'a>( &'a self, _: &Vec<&'static str>, ) -> BTreeMap<&'a str, &'a dyn ToSql>

Source

fn get_table_name() -> &'static str

Source

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.

Implementors§

Source§

impl<T: FromSql> Entity for T