[][src]Trait orma::DbData

pub trait DbData: Serialize + DeserializeOwned {
    fn table_name() -> &'static str;
fn id(&self) -> Option<Uuid>;
fn version(&self) -> Option<i32>;
fn set_id(&mut self, uuid: Uuid);
fn set_version(&mut self, version: i32); fn table_name1(&self) -> &'static str { ... }
fn select_part() -> String { ... }
fn select_part1(&self) -> String { ... } }

This trait is maps data in a data table and it's used along with DbEntity structure

Required methods

fn table_name() -> &'static str

The name of the db table where the implementing struct is mapped to.

fn id(&self) -> Option<Uuid>

returns the "id" column of the db row (same as DbEntity::id). If the DbData is not connected to the db, then result is None

fn version(&self) -> Option<i32>

returns the "version" column of the db row (same as DbEntity::version). If the DbData is not connected to the db, then result is None

fn set_id(&mut self, uuid: Uuid)

fn set_version(&mut self, version: i32)

Loading content...

Provided methods

fn table_name1(&self) -> &'static str

Table name from instance

fn select_part() -> String

Convenience function that returns the select part for the associated db table.

fn select_part1(&self) -> String

Select part from instance

Loading content...

Implementors

Loading content...