Struct XForwardedHost
pub struct XForwardedHost(/* private fields */);http and std only.Expand description
The X-Forwarded-Host (XFH) header is a de-facto standard header for identifying the original host requested by the client in the Host HTTP request header.
It is recommended to use the Forwarded header instead if you can.
More info can be found at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host.
§Syntax
X-Forwarded-Host: <host>Proxies that append keep one host per hop, on one line or several, nearest last: every one
is kept, and the accessors read the nearest, as the default
ForwardedSelectionPolicy does.
§Example values
id42.example-cdn.comid42.example-cdn.com:443203.0.113.195203.0.113.195:802001:db8:85a3:8d3:1319:8a2e:370:7348[2001:db8:85a3:8d3:1319:8a2e:370:7348]:8080
Implementations§
§impl XForwardedHost
impl XForwardedHost
pub fn host(&self) -> &Host
pub fn host(&self) -> &Host
Get a reference to the Host of the nearest hop of this XForwardedHost.
pub fn port(&self) -> Option<u16>
pub fn port(&self) -> Option<u16>
Get a copy of the port of the nearest hop of this XForwardedHost if it is set.
Empty (: with no digits) maps to None along with truly absent.
pub fn inner(&self) -> &ForwardedAuthority
pub fn inner(&self) -> &ForwardedAuthority
The nearest hop’s host.
pub fn hosts(&self) -> &NonEmptyVec<ForwardedAuthority>
pub fn hosts(&self) -> &NonEmptyVec<ForwardedAuthority>
Every hop’s host, nearest last.
pub fn into_inner(self) -> NonEmptyVec<ForwardedAuthority>
pub fn into_inner(self) -> NonEmptyVec<ForwardedAuthority>
Consume this header into every hop’s host, nearest last.
Trait Implementations§
§impl Clone for XForwardedHost
impl Clone for XForwardedHost
§fn clone(&self) -> XForwardedHost
fn clone(&self) -> XForwardedHost
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for XForwardedHost
impl Debug for XForwardedHost
impl Eq for XForwardedHost
§impl ForwardHeader for XForwardedHost
impl ForwardHeader for XForwardedHost
§fn try_from_forwarded<'a, I>(input: I) -> Option<XForwardedHost>where
I: IntoIterator<Item = &'a ForwardedElement>,
fn try_from_forwarded<'a, I>(input: I) -> Option<XForwardedHost>where
I: IntoIterator<Item = &'a ForwardedElement>,
ForwardedElement into the header. Read more§impl HeaderDecode for XForwardedHost
impl HeaderDecode for XForwardedHost
§fn decode<'i, I>(values: &mut I) -> Result<XForwardedHost, Error>where
I: Iterator<Item = &'i HeaderValue>,
fn decode<'i, I>(values: &mut I) -> Result<XForwardedHost, Error>where
I: Iterator<Item = &'i HeaderValue>,
HeaderValues.§impl HeaderEncode for XForwardedHost
impl HeaderEncode for XForwardedHost
§fn encode<E>(&self, values: &mut E)where
E: Extend<HeaderValue>,
fn encode<E>(&self, values: &mut E)where
E: Extend<HeaderValue>,
HeaderValue, and add it to a container
which has HeaderValue type as each element. Read more§fn encode_to_value(&self) -> Option<HeaderValue>
fn encode_to_value(&self) -> Option<HeaderValue>
HeaderValue. Read more§impl IntoIterator for XForwardedHost
impl IntoIterator for XForwardedHost
§type Item = ForwardedElement
type Item = ForwardedElement
§fn into_iter(self) -> <XForwardedHost as IntoIterator>::IntoIter
fn into_iter(self) -> <XForwardedHost as IntoIterator>::IntoIter
§impl PartialEq for XForwardedHost
impl PartialEq for XForwardedHost
impl StructuralPartialEq for XForwardedHost
§impl TypedHeader for XForwardedHost
impl TypedHeader for XForwardedHost
§fn name() -> &'static HeaderName
fn name() -> &'static HeaderName
Auto Trait Implementations§
impl !Freeze for XForwardedHost
impl RefUnwindSafe for XForwardedHost
impl Send for XForwardedHost
impl Sync for XForwardedHost
impl Unpin for XForwardedHost
impl UnsafeUnpin for XForwardedHost
impl UnwindSafe for XForwardedHost
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<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<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 rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more