pub trait UpdateAndFetchResults<Changes, Output>: AsyncConnectionwhere
Changes: Identifiable + HasTable,{
// Required method
fn update_and_fetch<'life0, 'async_trait>(
&'life0 mut self,
changeset: Changes,
) -> Pin<Box<dyn Future<Output = QueryResult<Output>> + Send + 'async_trait>>
where Changes: 'async_trait,
Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
A trait defining how to update a record and fetch the updated entry on a certain backend.
The only case where it is required to work with this trait is while
implementing a new connection type.
Otherwise use SaveChangesDsl
For implementing this trait for a custom backend:
- The
Changes
generic parameter represents the changeset that should be stored - The
Output
generic parameter represents the type of the response.
Required Methods§
Sourcefn update_and_fetch<'life0, 'async_trait>(
&'life0 mut self,
changeset: Changes,
) -> Pin<Box<dyn Future<Output = QueryResult<Output>> + Send + 'async_trait>>where
Changes: 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
fn update_and_fetch<'life0, 'async_trait>(
&'life0 mut self,
changeset: Changes,
) -> Pin<Box<dyn Future<Output = QueryResult<Output>> + Send + 'async_trait>>where
Changes: 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
See the traits documentation.
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§
impl<'b, Changes, Output> UpdateAndFetchResults<Changes, Output> for AsyncMysqlConnectionwhere
Output: Send,
Changes: Copy + Identifiable + Send + AsChangeset<Target = <Changes as HasTable>::Table> + IntoUpdateTarget,
Changes::Table: FindDsl<Changes::Id> + Send,
Changes::WhereClause: Send,
Changes::Changeset: Send,
Changes::Id: Send,
Update<Changes, Changes>: ExecuteDsl<AsyncMysqlConnection>,
Find<Changes::Table, Changes::Id>: LoadQuery<'b, AsyncMysqlConnection, Output> + Send + 'b,
<Changes::Table as Table>::AllColumns: ValidGrouping<()>,
<<Changes::Table as Table>::AllColumns as ValidGrouping<()>>::IsAggregate: MixedAggregates<No, Output = No>,
<Changes::Table as QuerySource>::FromClause: Send,
Available on crate feature
mysql
only.impl<'b, Changes, Output, Tab, V> UpdateAndFetchResults<Changes, Output> for AsyncPgConnectionwhere
Output: Send,
Changes: Copy + AsChangeset<Target = Tab> + Send + Identifiable<Table = Tab>,
Tab: Table + FindDsl<Changes::Id> + 'b,
Find<Tab, Changes::Id>: IntoUpdateTarget<Table = Tab, WhereClause = V>,
UpdateStatement<Tab, V, Changes::Changeset>: AsQuery,
Update<Changes, Changes>: LoadQuery<'b, Self, Output>,
V: Send + 'b,
Changes::Changeset: Send + 'b,
Tab::FromClause: Send,
Available on crate feature
postgres
only.impl<Changes, Output, Conn> UpdateAndFetchResults<Changes, Output> for Connwhere
Conn: DerefMut + Send,
Changes: Identifiable + HasTable + Send,
Conn::Target: UpdateAndFetchResults<Changes, Output>,
Available on crate feature
pool
only.