The thing I'm working on depends on crates (like hyper) that depend on the old stuff, which means I can't use *any* of the new stuff, or things blow up ("what do you mean, that stream type doesn't implement Future?").
2
Things are kind of a mess right now. We're not even using tokio but we can't upgrade `futures` because `futures_cpupool` hasn't updated.
1
1
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
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
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 ().)
Mar 28, 2018 · 7:41 PM UTC
1

