Does anyone have an example of going from an Iterator of type Result<T, SomeError> to Iterator of type T, while handling all errors? I can see how this could be done with `for x in y` syntax, but I'm wondering if this can be done using combinators. Can it?
Hmm, at the risk of sounding like a broken record: wouldn't try_map still also have to do internal buffering? e.g. it can't return a Result until all items have been iterated over -- which means in the case of an infinite iterator it either OOMs or runs into an error.
-
-
My hope was to do it in a way without buffering, but it honestly may not be possible without terminating the chain, like with try_for_each. I'll try to take a crack at it, but just writing down the type signatures makes me wonder if it is possible (without channels, etc).
-
*nods*. I'm kind of thinking I may have to step back and zoom out beyond this problem entirely. The underlying problem I want to solve is "Copy data from a TryStream of Vec<u8> directly into an AsyncRead using combinators". Thinking generic enum error types may be an option.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.