#[non_exhaustive]pub enum ForwardedHeader {
XForwardedFor,
Forwarded,
}Expand description
The header trusted reverse proxies record the client’s address in.
The default is XForwardedFor. Choose the one your
proxy writes; the other is ignored, whatever it holds.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
XForwardedFor
x-forwarded-for: client, proxy1, proxy2: each proxy appends the
address of its peer. nginx ($proxy_add_x_forwarded_for), HAProxy
(option forwardfor), Envoy and the cloud load balancers write it.
Forwarded
RFC 7239 forwarded: for=client;proto=https, for="[2001:db8::1]:443":
each proxy appends one element, and its for parameter is the address
of the proxy’s peer. An element whose for is missing or unknown
names no client, and the caller is then keyed by the connection’s own
address; an obfuscated identifier (for=_hidden) is its own key.
Implementations§
Source§impl ForwardedHeader
impl ForwardedHeader
Sourcepub const fn field_name(self) -> &'static str
pub const fn field_name(self) -> &'static str
The header’s field name, lower case as the bindings record it.
Trait Implementations§
Source§impl Clone for ForwardedHeader
impl Clone for ForwardedHeader
Source§fn clone(&self) -> ForwardedHeader
fn clone(&self) -> ForwardedHeader
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ForwardedHeader
Source§impl Debug for ForwardedHeader
impl Debug for ForwardedHeader
Source§impl Default for ForwardedHeader
impl Default for ForwardedHeader
Source§fn default() -> ForwardedHeader
fn default() -> ForwardedHeader
impl Eq for ForwardedHeader
Source§impl Hash for ForwardedHeader
impl Hash for ForwardedHeader
Source§impl PartialEq for ForwardedHeader
impl PartialEq for ForwardedHeader
impl StructuralPartialEq for ForwardedHeader
Auto Trait Implementations§
impl Forget for ForwardedHeader
impl Freeze for ForwardedHeader
impl Move for ForwardedHeader
impl RefUnwindSafe for ForwardedHeader
impl Send for ForwardedHeader
impl Sync for ForwardedHeader
impl Unpin for ForwardedHeader
impl UnsafeUnpin for ForwardedHeader
impl UnwindSafe for ForwardedHeader
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].