#[repr(i32)]pub enum RedirectPolicy {
Forward = 0,
Permanent = 1,
Unauthorized = 2,
Found = 3,
PermanentRedirect = 4,
}Expand description
Frontend-level redirect policy. Mirrors HAProxy’s
http-request redirect|deny|auth directives.
FORWARD routes to the backend (default).
PERMANENT returns 301 with a Location header derived from
redirect_scheme, optional rewrite_* fields, and cluster.https_redirect_port.
FOUND returns 302 — a temporary redirect (RFC 9110 §15.4.3); user agents may
rewrite POST to GET on follow.
PERMANENT_REDIRECT returns 308 — a permanent redirect (RFC 9110 §15.4.9); the
HTTP method MUST be preserved on follow (no GET-rewrite on POST).
UNAUTHORIZED returns 401 with WWW-Authenticate: Basic realm=...
using cluster.www_authenticate; suitable for blanket deny-by-default
routes that still want to surface a login prompt.
Variants§
Implementations§
Source§impl RedirectPolicy
impl RedirectPolicy
Sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
Sourcepub fn from_str_name(value: &str) -> Option<Self>
pub fn from_str_name(value: &str) -> Option<Self>
Creates an enum from field names used in the ProtoBuf definition.
Trait Implementations§
Source§impl Clone for RedirectPolicy
impl Clone for RedirectPolicy
Source§fn clone(&self) -> RedirectPolicy
fn clone(&self) -> RedirectPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RedirectPolicy
impl Debug for RedirectPolicy
Source§impl Default for RedirectPolicy
impl Default for RedirectPolicy
Source§fn default() -> RedirectPolicy
fn default() -> RedirectPolicy
Source§impl<'de> Deserialize<'de> for RedirectPolicy
impl<'de> Deserialize<'de> for RedirectPolicy
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<RedirectPolicy> for i32
impl From<RedirectPolicy> for i32
Source§fn from(value: RedirectPolicy) -> i32
fn from(value: RedirectPolicy) -> i32
Source§impl Hash for RedirectPolicy
impl Hash for RedirectPolicy
Source§impl Ord for RedirectPolicy
impl Ord for RedirectPolicy
Source§fn cmp(&self, other: &RedirectPolicy) -> Ordering
fn cmp(&self, other: &RedirectPolicy) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for RedirectPolicy
impl PartialEq for RedirectPolicy
Source§fn eq(&self, other: &RedirectPolicy) -> bool
fn eq(&self, other: &RedirectPolicy) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for RedirectPolicy
impl PartialOrd for RedirectPolicy
Source§impl Serialize for RedirectPolicy
impl Serialize for RedirectPolicy
Source§impl TryFrom<i32> for RedirectPolicy
impl TryFrom<i32> for RedirectPolicy
Source§type Error = UnknownEnumValue
type Error = UnknownEnumValue
Source§fn try_from(value: i32) -> Result<RedirectPolicy, UnknownEnumValue>
fn try_from(value: i32) -> Result<RedirectPolicy, UnknownEnumValue>
impl Copy for RedirectPolicy
impl Eq for RedirectPolicy
impl StructuralPartialEq for RedirectPolicy
Auto Trait Implementations§
impl Freeze for RedirectPolicy
impl RefUnwindSafe for RedirectPolicy
impl Send for RedirectPolicy
impl Sync for RedirectPolicy
impl Unpin for RedirectPolicy
impl UnsafeUnpin for RedirectPolicy
impl UnwindSafe for RedirectPolicy
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.