tower_http::follow_redirect::policy

Function redirect_fn

Source
pub fn redirect_fn<F, E>(f: F) -> RedirectFn<F>
where F: FnMut(&Attempt<'_>) -> Result<Action, E>,
Available on crate feature follow-redirect only.
Expand description

Create a new redirection Policy from a closure F: FnMut(&Attempt<'_>) -> Result<Action, E>.

redirect method of the returned Policy delegates to the wrapped closure.