Skip to content

Make Continuation an associated type #873

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

Merged
merged 5 commits into from
Jun 29, 2022
Merged

Conversation

rylev
Copy link
Contributor

@rylev rylev commented Jun 29, 2022

This adds an associated type to Continuable called Continuation. This means that implementors of Continuable are in charge of specifying which type is used to indicate how they continue. This removes a bunch of run time checks that the right type of Continuation was used.

@rylev rylev requested a review from bmc-msft June 29, 2022 10:02
Comment on lines +30 to +32
pub fn new<F>(
make_request: impl Fn(Option<T::Continuation>) -> F + Clone + 'static + Send,
) -> Self
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

@bmc-msft bmc-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is much more elegant.

@rylev rylev merged commit 0c8c14b into Azure:main Jun 29, 2022
@rylev rylev deleted the type-safe-continuation branch June 29, 2022 16:50
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.

2 participants