pub trait Model: Send + Sync {
type Output: Serialize + Send;
Show 13 methods
// Required methods
fn new() -> Self;
fn schema_view<'a>(
&'a self,
pool: &'a Pool<Postgres>,
) -> impl Future<Output = SchemaView> + Send + 'a;
// Provided methods
fn keyword(&self) -> String { ... }
fn push_filter_conditions<'args>(
&self,
_qb: &mut QueryBuilder<'args, Postgres>,
_filters: &HashMap<String, String>,
) -> Result<(), Error> { ... }
fn push_conditions<'args>(
&self,
qb: &mut QueryBuilder<'args, Postgres>,
params: &ModelListParams,
) -> Result<(), Error> { ... }
fn insert<'a>(
&'a self,
_pool: &'a Pool<Postgres>,
_params: Value,
) -> impl Future<Output = Result<u64, Error>> + Send + 'a { ... }
fn get_by_id<'a>(
&'a self,
_pool: &'a Pool<Postgres>,
_id: u64,
) -> impl Future<Output = Result<Option<Self::Output>, Error>> + Send + 'a { ... }
fn delete_by_id<'a>(
&'a self,
_pool: &'a Pool<Postgres>,
_id: u64,
) -> impl Future<Output = Result<(), Error>> + Send + 'a { ... }
fn update_by_id<'a>(
&'a self,
_pool: &'a Pool<Postgres>,
_id: u64,
_params: Value,
) -> impl Future<Output = Result<(), Error>> + Send + 'a { ... }
fn count<'a>(
&'a self,
_pool: &'a Pool<Postgres>,
_params: &'a ModelListParams,
) -> impl Future<Output = Result<i64, Error>> + Send + 'a { ... }
fn list<'a>(
&'a self,
_pool: &'a Pool<Postgres>,
_params: &'a ModelListParams,
) -> impl Future<Output = Result<Vec<Self::Output>, Error>> + Send + 'a { ... }
fn list_and_count<'a>(
&'a self,
pool: &'a Pool<Postgres>,
count: bool,
params: &'a ModelListParams,
) -> impl Future<Output = Result<Value, Error>> + Send + 'a { ... }
fn search_options<'a>(
&'a self,
_pool: &'a Pool<Postgres>,
_keyword: Option<String>,
) -> impl Future<Output = Result<Vec<SchemaOption>, Error>> + Send + 'a { ... }
}Required Associated Types§
Required Methods§
fn new() -> Self
fn schema_view<'a>( &'a self, pool: &'a Pool<Postgres>, ) -> impl Future<Output = SchemaView> + Send + 'a
Provided Methods§
fn keyword(&self) -> String
fn push_filter_conditions<'args>( &self, _qb: &mut QueryBuilder<'args, Postgres>, _filters: &HashMap<String, String>, ) -> Result<(), Error>
fn push_conditions<'args>( &self, qb: &mut QueryBuilder<'args, Postgres>, params: &ModelListParams, ) -> Result<(), Error>
fn insert<'a>( &'a self, _pool: &'a Pool<Postgres>, _params: Value, ) -> impl Future<Output = Result<u64, Error>> + Send + 'a
fn get_by_id<'a>( &'a self, _pool: &'a Pool<Postgres>, _id: u64, ) -> impl Future<Output = Result<Option<Self::Output>, Error>> + Send + 'a
fn delete_by_id<'a>( &'a self, _pool: &'a Pool<Postgres>, _id: u64, ) -> impl Future<Output = Result<(), Error>> + Send + 'a
fn update_by_id<'a>( &'a self, _pool: &'a Pool<Postgres>, _id: u64, _params: Value, ) -> impl Future<Output = Result<(), Error>> + Send + 'a
fn count<'a>( &'a self, _pool: &'a Pool<Postgres>, _params: &'a ModelListParams, ) -> impl Future<Output = Result<i64, Error>> + Send + 'a
fn list<'a>( &'a self, _pool: &'a Pool<Postgres>, _params: &'a ModelListParams, ) -> impl Future<Output = Result<Vec<Self::Output>, Error>> + Send + 'a
fn list_and_count<'a>( &'a self, pool: &'a Pool<Postgres>, count: bool, params: &'a ModelListParams, ) -> impl Future<Output = Result<Value, Error>> + Send + 'a
fn search_options<'a>( &'a self, _pool: &'a Pool<Postgres>, _keyword: Option<String>, ) -> impl Future<Output = Result<Vec<SchemaOption>, Error>> + Send + 'a
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.