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

Expose RedirectAttempt and RedirectAction types #105

Closed
dtolnay opened this Issue May 31, 2017 · 0 comments

Comments

Projects
None yet
2 participants
@dtolnay
Copy link

dtolnay commented May 31, 2017

These are used in the signature of RedirectPolicy::custom. They are not currently exposed in a way that crates depending on reqwest can name them. That means custom must be called with a closure relying on type inference:

client.redirect(RedirectPolicy::custom(|attempt| {
    /* ... */
}));

It is not possible to factor the logic out into a function:

use reqwest::/* ??? */::{RedirectAttempt, RedirectAction};

fn my_policy(attempt: RedirectAttempt) -> RedirectAction {
    /* ... */
}

client.redirect(RedirectPolicy::custom(my_policy))

Let's expose RedirectAttempt and RedirectAction to make it possible to write such a function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.