Passing diesel_async to tonic service - the trait bound is not satisfied #80
-
So as the title said, i am trying to pass the pool create using diesel_async and deadpool to the service, but i got an error: The funny thing is, that if i change the type to the deadpool ones, everything works, but that require me to install deadpool crate separately.
Link to working example: Overview of the whole main.rs:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Well there is not much to say here other than that the types obviously need to match. If the compiler complains about some type mismatch you managed to mix things up by for example:
|
Beta Was this translation helpful? Give feedback.
To repeat what I've written above again:
diesel_async::pooled_connection::deadpool::Pool
anddeadpool::Pool
are differente incompatible types. You cannot use the in exactly the same position. By looking at the documentation of thediesel_async
provided type you can see that this type is a custom type def of thedeadpool
type with some changes. Most importantly it already includes theAsyncConnectionManager
part, so if you include that again if you use that type it is expected that it produces compiler error.