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) -> Self

Create a new FollowRedirect with a Standard redirection policy.

fn layer() -> FollowRedirectLayer

Returns a new Layer that wraps services with a FollowRedirect middleware.

impl<S, P> FollowRedirect<S, P> where P: Clone,

fn with_policy(inner: S, policy: P) -> Self

Create a new FollowRedirect with the given redirection Policy.

fn layer_with_policy(policy: P) -> FollowRedirectLayer<P>

Returns a new Layer that wraps services with a FollowRedirect middleware with the given redirection Policy.

fn get_ref(&self) -> &S

Gets a reference to the underlying service.

fn get_mut(&mut self) -> &mut S

Gets a mutable reference to the underlying service.

fn into_inner(self) -> S

Consumes 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) -> FollowRedirect<S, P>

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

Auto Trait Implementations

impl<S, P> Freeze for FollowRedirect<S, P> where S: Freeze, P: Freeze,

impl<S, P> RefUnwindSafe for FollowRedirect<S, P> where S: RefUnwindSafe, P: RefUnwindSafe,

impl<S, P> Send for FollowRedirect<S, P> where S: Send, P: Send,

impl<S, P> Sync for FollowRedirect<S, P> where S: Sync, P: Sync,

impl<S, P> Unpin for FollowRedirect<S, P> where S: Unpin, P: Unpin,

impl<S, P> UnsafeUnpin for FollowRedirect<S, P> where S: UnsafeUnpin, P: UnsafeUnpin,

impl<S, P> UnwindSafe for FollowRedirect<S, P> where S: UnwindSafe, P: UnwindSafe,

Blanket Implementations

impl<T> Any for FollowRedirect<S, P> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for FollowRedirect<S, P> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for FollowRedirect<S, P> where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> CloneToUninit for FollowRedirect<S, P> where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for FollowRedirect<S, P>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Instrument for FollowRedirect<S, P>

impl<T> PolicyExt for FollowRedirect<S, P> where T: ?Sized,

fn and<P, B, E>(self, other: P) -> And<T, P>
where
    T: Sized + Policy<B, E>,
    P: Policy<B, E>,
fn or<P, B, E>(self, other: P) -> Or<T, P>
where
    T: Sized + Policy<B, E>,
    P: Policy<B, E>,

impl<T> ToOwned for FollowRedirect<S, P> where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T> WithSubscriber for FollowRedirect<S, P>

impl<T, Request> ServiceExt<Request> for FollowRedirect<S, P> where T: Service<Request> + ?Sized,

impl<T, U> Into<U> for FollowRedirect<S, P> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for FollowRedirect<S, P> where U: Into<T>,

type Error = Infallible;
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto<U> for FollowRedirect<S, P> where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>