TableGateway

Trait TableGateway 

Source
pub trait TableGateway: Gateway {
    type Model;
    type Params;
    type Error;

    // Required methods
    fn create_table(&self) -> Result<(), Self::Error>;
    fn drop_table(&self) -> Result<(), Self::Error>;
    fn insert(&self, params: &Self::Params) -> Result<i64, Self::Error>;
    fn find(&self, params: &Self::Params) -> Option<Self::Model>;
    fn update(&self, params: &Self::Params) -> Result<(), Self::Error>;
    fn delete(&self, params: &Self::Params) -> Result<(), Self::Error>;
}
Expand description

Table Gateway An object that acts as a Gateway to a database table. One instance handles all the rows in the table.

Required Associated Types§

Required Methods§

Source

fn create_table(&self) -> Result<(), Self::Error>

Source

fn drop_table(&self) -> Result<(), Self::Error>

Source

fn insert(&self, params: &Self::Params) -> Result<i64, Self::Error>

Source

fn find(&self, params: &Self::Params) -> Option<Self::Model>

Source

fn update(&self, params: &Self::Params) -> Result<(), Self::Error>

Source

fn delete(&self, params: &Self::Params) -> Result<(), Self::Error>

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§