Skip to main content

ModelResultExt

Trait ModelResultExt 

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

Source

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.

Source

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.

Source

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

Implementors§

Source§

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