Enum treemux::RedirectBehavior [−][src]
Sets the behavior when the router redirects the request to the
canonical version of the requested URL using redirect_trailing_slash
or redirect_clean
.
The default behavior is to return a 301 status, redirecting the browser to the version
of the URL that matches the given pattern.
On a POST request, most browsers that receive a 301 will submit a GET request to
the redirected URL, meaning that any data will likely be lost. If you want to handle
and avoid this behavior, you may use TEMPORARY_REDIRECT
(307), which causes most browsers to
resubmit the request using the original method and request body.
Since 307 is supposed to be a temporary redirect, the new 308 status code has been proposed, which is treated the same, except it indicates correctly that the redirection is permanent. The big caveat here is that the RFC is relatively recent, and older browsers will not know what to do with it. Therefore its use is not recommended unless you really know what you're doing.
Variants
Trait Implementations
impl Clone for RedirectBehavior
[src]
fn clone(&self) -> RedirectBehavior
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for RedirectBehavior
[src]
impl Debug for RedirectBehavior
[src]
impl Display for RedirectBehavior
[src]
impl Eq for RedirectBehavior
[src]
impl PartialEq<RedirectBehavior> for RedirectBehavior
[src]
fn eq(&self, other: &RedirectBehavior) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for RedirectBehavior
[src]
impl StructuralPartialEq for RedirectBehavior
[src]
Auto Trait Implementations
impl RefUnwindSafe for RedirectBehavior
[src]
impl Send for RedirectBehavior
[src]
impl Sync for RedirectBehavior
[src]
impl Unpin for RedirectBehavior
[src]
impl UnwindSafe for RedirectBehavior
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,