Closed grantperry closed 3 years ago
Hmmm. Maybe I've made a bit too much noise without thinking. I'm finally understanding how the macro works. Its supertrait is Db
which makes more sense.
The real question I have is what does my error actually mean? I'm going to sleep on this. My original comment seems invalid now?
The error looks correct to me. You are trying to collect a stream of ??
into a Vec<Self>
where ??
is whatever anonymous future type the async move
block in map
evaluates to, and is definitely not the same type as Self
. Probably you didn't mean to put an async block there.
Thanks. Yep you were right. Barking up the wrong tree...
G'Day!
I'm having an issue using futures::StreamExt and friends. I think the issue I have is due to the expanded macro having
Context
I'm deserialising objects from a DB. The method in my example returns a collection of itself
Vec<Self>
The macro expansion seems to turn this intoVec<AsyncTrait>
. I included the error at the bottom even though I don't think its quite relevant. What is more relevant is the macro expansion.Code
Expanded macro
This is where things don't go as I would expect. The outer signature looks fine but the async fn defined inside has the return signature of
Vec<AsyncTrait>
which is my problem.Source
I'm going to make a wild accusation and say that this behaviour comes from here but I don't know much about macros and TokenStreams and such. This looks like it might replace
Self
withAsyncTrait
Error
Hopefully I've just made a silly mistake and you can point that out. Thanks for this awesome crate!
Grant