Skip to main content

ModelResultExt

Trait ModelResultExt 

Source
pub trait ModelResultExt<DB>: Model<DB>
where DB: SqlDialect + Database, for<'r> Self: FromRow<'r, DB::Row>,
{ // Required methods fn save_result<'a, E>( &'a mut self, executor: E, ) -> impl Future<Output = PremixResult<()>> where E: IntoExecutor<'a, DB = DB>; fn update_result<'a, E>( &'a mut self, executor: E, ) -> impl Future<Output = PremixResult<UpdateResult>> where E: IntoExecutor<'a, DB = DB>; fn delete_result<'a, E>( &'a mut self, executor: E, ) -> impl Future<Output = PremixResult<()>> where E: IntoExecutor<'a, DB = DB>; }
Expand description

Convenience helpers that map sqlx errors into PremixError.

Required Methods§

Source

fn save_result<'a, E>( &'a mut self, executor: E, ) -> impl Future<Output = PremixResult<()>>
where E: IntoExecutor<'a, DB = DB>,

Save the model and return PremixError on failure.

Source

fn update_result<'a, E>( &'a mut self, executor: E, ) -> impl Future<Output = PremixResult<UpdateResult>>
where E: IntoExecutor<'a, DB = DB>,

Update the model and return PremixError on failure.

Source

fn delete_result<'a, E>( &'a mut self, executor: E, ) -> impl Future<Output = PremixResult<()>>
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", so this trait is not object safe.

Implementors§

Source§

impl<T, DB> ModelResultExt<DB> for T
where DB: SqlDialect, for<'r> T: Model<DB> + FromRow<'r, DB::Row>,