pub struct FollowRedirectLayer<P = And<Limited, FilterCredentials>> { /* private fields */ }Available on crate feature
tower only.Expand description
Layer for retrying requests with a Service to follow redirection responses.
See the module docs for more details.
Implementations§
Source§impl FollowRedirectLayer
impl FollowRedirectLayer
Sourcepub fn new() -> FollowRedirectLayer
pub fn new() -> FollowRedirectLayer
Create a new FollowRedirectLayer with a Standard redirection policy.
Source§impl<P> FollowRedirectLayer<P>
impl<P> FollowRedirectLayer<P>
Sourcepub fn with_policy(policy: P) -> FollowRedirectLayer<P>
pub fn with_policy(policy: P) -> FollowRedirectLayer<P>
Create a new FollowRedirectLayer with the given redirection Policy.
Sourcepub fn preserve_extensions(self, preserve: bool) -> FollowRedirectLayer<P>
pub fn preserve_extensions(self, preserve: bool) -> FollowRedirectLayer<P>
Whether request Extensions are carried over to redirected requests. Defaults to true.
Setting this to false drops all extensions on redirected requests. When preserved, the
policy still filters them via Policy::on_request; the Standard policy drops
extensions cross-origin (see FilterCredentials).
Trait Implementations§
Source§impl<P> Clone for FollowRedirectLayer<P>where
P: Clone,
impl<P> Clone for FollowRedirectLayer<P>where
P: Clone,
Source§fn clone(&self) -> FollowRedirectLayer<P>
fn clone(&self) -> FollowRedirectLayer<P>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<P> Copy for FollowRedirectLayer<P>where
P: Copy,
Source§impl<P> Debug for FollowRedirectLayer<P>where
P: Debug,
impl<P> Debug for FollowRedirectLayer<P>where
P: Debug,
Source§impl<P> Default for FollowRedirectLayer<P>where
P: Default,
impl<P> Default for FollowRedirectLayer<P>where
P: Default,
Source§fn default() -> FollowRedirectLayer<P>
fn default() -> FollowRedirectLayer<P>
Returns the “default value” for a type. Read more
Source§impl<S, P> Layer<S> for FollowRedirectLayer<P>
impl<S, P> Layer<S> for FollowRedirectLayer<P>
Source§type Service = FollowRedirect<S, P>
type Service = FollowRedirect<S, P>
The wrapped service
Auto Trait Implementations§
impl<P> Freeze for FollowRedirectLayer<P>where
P: Freeze,
impl<P> RefUnwindSafe for FollowRedirectLayer<P>where
P: RefUnwindSafe,
impl<P> Send for FollowRedirectLayer<P>where
P: Send,
impl<P> Sync for FollowRedirectLayer<P>where
P: Sync,
impl<P> Unpin for FollowRedirectLayer<P>where
P: Unpin,
impl<P> UnsafeUnpin for FollowRedirectLayer<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for FollowRedirectLayer<P>where
P: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more