Struct FollowRedirect
pub struct FollowRedirect<S, P = Standard> { /* private fields */ }
Middleware that retries requests with a Service to follow redirection responses.
See the module docs for more details.
Implementations
impl<S> FollowRedirect<S>
fn new(inner: S) -> SelfCreate a new
FollowRedirectwith aStandardredirection policy.fn layer() -> FollowRedirectLayerReturns a new
Layerthat wraps services with aFollowRedirectmiddleware.
impl<S, P> FollowRedirect<S, P>
where
P: Clone,
fn with_policy(inner: S, policy: P) -> SelfCreate a new
FollowRedirectwith the given redirectionPolicy.fn layer_with_policy(policy: P) -> FollowRedirectLayer<P>Returns a new
Layerthat wraps services with aFollowRedirectmiddleware with the given redirectionPolicy.fn get_ref(&self) -> &SGets a reference to the underlying service.
fn get_mut(&mut self) -> &mut SGets a mutable reference to the underlying service.
fn into_inner(self) -> SConsumes
self, returning the underlying service.
Trait Implementations
impl<ReqBody, ResBody, S, P> Service<Request<ReqBody>> for FollowRedirect<S, P>
where
S: Service<Request<ReqBody>, Response = Response<ResBody>> + Clone,
ReqBody: Body + Default,
P: Policy<ReqBody, S::Error> + Clone,
type Response = Response<ResBody>;type Error = <S as Service<Request<ReqBody>>>::Error;type Future = ResponseFuture<S, ReqBody, P>;fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>fn call(&mut self, req: Request<ReqBody>) -> Self::Future
impl<S: Clone, P: Clone> Clone for FollowRedirect<S, P>
fn clone(&self) -> Self
impl<S: Copy, P: Copy> Copy for FollowRedirect<S, P>
impl<S: Debug, P: Debug> Debug for FollowRedirect<S, P>
fn fmt(&self, f: &mut Formatter<'_>) -> Result