New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Receiver::Error should be something like Never or Nothing #476
Comments
BTW, |
... and Currently it has signature
Which gives user false sense that it is OK to return error. While it is not, error must be handled inside the future. |
FWIW Elm uses |
When it's eventually stable, the never type ( |
I wrote in #554: Right now there's a number of locations in this library where
I've also heard of this being common enough throughout the ecosystem that I think we should provide a solution to this! I think we'll want to not "just add a enum Void {}
Void::into(self) -> T
Future<Item=T, Error=Void>::poll_ok(&mut self) -> Async<T>
Future<Item=T, Error=Void>::wait_ok(self) -> T And maybe more! I'm curious to hear what others think about adding such APIs. |
I wouldn't mind trying to game this out before an 0.2 release. We can't change existing types but we could add the type for external libraries to use, as well as the extra goodies on the |
Is there no hope of the never type being stabilized in a time frame that would make it reasonable to just wait on this issue rather than introduce a futures-specific void type? |
AFAIK yeah, the stabilization story for |
@alexcrichton Are you saying you would consider a PR adding |
Certainly! Unfortunately we can't land a breaking change right now so we can't change the |
@jimmycuadra I havent looked to deep into
I was looking at a not up-to-date version of v0.2, the changes are there by now. |
This has been done for 0.2. |
To clearly state that poll never fails.
The text was updated successfully, but these errors were encountered: