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