pub trait ModelResultExt<DB>: Model<DB> + for<'r> FromRow<'r, <DB as Database>::Row>where
DB: Database + SqlDialect,{
// Required methods
fn save_result<'a, E>(
&'a mut self,
executor: E,
) -> impl Future<Output = Result<(), PremixError>>
where E: IntoExecutor<'a, DB = DB>;
fn update_result<'a, E>(
&'a mut self,
executor: E,
) -> impl Future<Output = Result<UpdateResult, PremixError>>
where E: IntoExecutor<'a, DB = DB>;
fn delete_result<'a, E>(
&'a mut self,
executor: E,
) -> impl Future<Output = Result<(), PremixError>>
where E: IntoExecutor<'a, DB = DB>;
}Expand description
Convenience helpers that map sqlx errors into PremixError.
Required Methods§
Sourcefn save_result<'a, E>(
&'a mut self,
executor: E,
) -> impl Future<Output = Result<(), PremixError>>where
E: IntoExecutor<'a, DB = DB>,
fn save_result<'a, E>(
&'a mut self,
executor: E,
) -> impl Future<Output = Result<(), PremixError>>where
E: IntoExecutor<'a, DB = DB>,
Save the model and return PremixError on failure.
Sourcefn update_result<'a, E>(
&'a mut self,
executor: E,
) -> impl Future<Output = Result<UpdateResult, PremixError>>where
E: IntoExecutor<'a, DB = DB>,
fn update_result<'a, E>(
&'a mut self,
executor: E,
) -> impl Future<Output = Result<UpdateResult, PremixError>>where
E: IntoExecutor<'a, DB = DB>,
Update the model and return PremixError on failure.
Sourcefn delete_result<'a, E>(
&'a mut self,
executor: E,
) -> impl Future<Output = Result<(), PremixError>>where
E: IntoExecutor<'a, DB = DB>,
fn delete_result<'a, E>(
&'a mut self,
executor: E,
) -> impl Future<Output = Result<(), PremixError>>where
E: IntoExecutor<'a, DB = DB>,
Delete the model and return PremixError on failure.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".