Trait dojo_orm::Model

source ·
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§

source

const NAME: &'static str

source

const COLUMNS: &'static [&'static str]

Required Methods§

source

fn params(&self) -> Vec<&(dyn ToSql + Sync)>

source

fn from_row(row: Row) -> Result<Self>
where Self: Sized,

source

fn get_value(&self, column: &str) -> Option<Value>

source

fn sort_keys() -> Vec<String>

Provided Methods§

source

fn cursor(&self) -> Cursor

Object Safety§

This trait is not object safe.

Implementors§