Skip to content

Generic update #2969

Answered by weiznich
aymanalqadhi asked this question in Q&A
Dec 6, 2021 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

This error is expected as #[derive(Identifiable)] generates the following impl:

impl<'a> Identifiable for &'a Service {
 // …
}

As the corresponding IntoUpdateTarget impl assumes that the type implements Identifiable this implies that the type must be a reference (or you must provide a manual impl of Identifiable for your type itself.) In concequence this means that the bound T: IntoUpdateTarget + AsChangeset<Target = T::Table> is not fulfilled.

As your code example is extremely incomplete it's hard to exactly tell how to solve this. You can either try to add an manual impl of Identifiable to your Service struct or try to adjust that trait bound so that at least the IntoUpdateTarget part …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@aymanalqadhi
Comment options

Answer selected by aymanalqadhi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants