Trait DatabaseOperations

Source
pub trait DatabaseOperations<T> {
    // Required methods
    fn save(&self, db: &str) -> Result<(), Error>;
    fn get(id: T, db: &str) -> Result<Self, Error>
       where Self: Sized;
    fn get_all(db: &str) -> Result<Vec<Self>, Error>
       where Self: Sized;
    fn map(row: &Row<'_>) -> Result<Self, Error>
       where Self: Sized;
}

Required Methods§

Source

fn save(&self, db: &str) -> Result<(), Error>

Source

fn get(id: T, db: &str) -> Result<Self, Error>
where Self: Sized,

Source

fn get_all(db: &str) -> Result<Vec<Self>, Error>
where Self: Sized,

Source

fn map(row: &Row<'_>) -> Result<Self, Error>
where Self: Sized,

Implementors§