Replying to @khuey_ @snorp
On the other hand, maybe these inscrutable errors weren't caused by what I thought they were caused by, because now that I've converted everything back to old tokio I get them again.
1
I don't yet have an intuitive sense of rust error checking stages beyond knowing that I won't get borrow checker errors until I've fixed everything else.
1
Streams and Futures are distinct things and trying to pass one of them off as the other will blow up. There's the Stream::into_future adapter to turn a Stream into a Future resolving to the next item.
1
1
If you pastebin the error message I can try to make sense of it.
1
What I was trying to do was pass the stream off to the Core or Handle to run (pump?) it to completion. I'd thought I'd done that before, but in hindsight I'd only passed the result of stream.join(future) to one elsewhere in a way that worked.
1
Ah. Pumping a Stream to the end is what `Stream::for_each` is for.
1
Yeah, I was just rereading that; I hadn't realized that Stream::for_each produced a future rather than a stream, but I realized it just before seeing your response.
1
1
rufflewind.com/img/rust-futu… is really helpful for Future but I don't know of an equivalent for Stream. Maybe I should just write it myself.
1
Curious if pastebin.mozilla.org/9081121 leads to immediate advice, though. (I'm confused, since the inner type is std::result::Result<(), std::io::Error> so I'd think the outer Error type would be std::io::Error and not ().)
1
Handle::spawn needs a future with Error=() because it doesn't know what to do with the error.
2
Replying to @khuey_
Oh, so I was reading the error message backwards, then.

Mar 28, 2018 · 7:45 PM UTC

1
Replying to @davidbaron
Honestly I think the compiler is generating the message backwards, at least compared to how any human would read this. Not the first time I've seen it either CC @ManishEarth
1