The compiler complains when calling AsyncSaveChangesDsl::save_changes_async that borrowed value does not live long enough, this indicates that the type T is in fact &User here.
This turned out to be true and is due because the postgres UpdateAndFetchResults implementation, which is used by the SaveChangesDsl requires the Changes to be Copy, and Changes would be &User in this case.
There is also the problem that the derive Identifiable implements impl<'ident> Identifiable for &'ident User
The compiler complains when calling
AsyncSaveChangesDsl::save_changes_async
thatborrowed value does not live long enough
, this indicates that the typeT
is in fact&User
here.This turned out to be true and is due because the postgres
UpdateAndFetchResults
implementation, which is used by theSaveChangesDsl
requires theChanges
to beCopy
, andChanges
would be&User
in this case.There is also the problem that the derive
Identifiable
implementsimpl<'ident> Identifiable for &'ident User