Skip to content
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

sync: expand oneshot docs and TryRecvError #1874

Merged
merged 1 commit into from
Dec 1, 2019
Merged

Conversation

carllerche
Copy link
Member

oneshot::Receiver::try_recv does not provide any information as to the
reason why receiving failed. The two cases are that the channel is
empty or that the channel closed.

TryRecvError is changed to be an enum of those two cases. This is
backwards compatible as TryRecvError was an opaque struct.

This also expands on oneshot API documentation, adding details and
examples.

Closes #1872

cc @bIgBV

`oneshot::Receiver::try_recv` does not provide any information as to the
reason **why** receiving failed. The two cases are that the channel is
empty or that the channel closed.

`TryRecvError` is changed to be an enum of those two cases. This is
backwards compatible as `TryRecvError` was an opaque struct.

This also expands on `oneshot` API documentation, adding details and
examples.

Closes #1872
@carllerche carllerche merged commit af07f5b into master Dec 1, 2019
@carllerche carllerche deleted the oneshot-polish branch December 2, 2019 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tokio-sync oneshot channel's return type is ambiguous.
2 participants