Struct Forwarded
pub struct Forwarded(/* private fields */);
Expand description
Typed header wrapper for rama_net::forwarded::Forwarded
;
Implementations§
§impl Forwarded
impl Forwarded
pub fn into_inner(self) -> Forwarded
pub fn into_inner(self) -> Forwarded
Return the inner Forwarded
.
Methods from Deref<Target = Forwarded>§
pub fn client_host(&self) -> Option<&ForwardedAuthority>
pub fn client_host(&self) -> Option<&ForwardedAuthority>
Return the client host of this Forwarded
context,
if there is one defined.
It is assumed that only the first element can be described as client information.
pub fn client_socket_addr(&self) -> Option<SocketAddr>
pub fn client_socket_addr(&self) -> Option<SocketAddr>
Return the client SocketAddr
of this Forwarded
context,
if both an Ip and a port are defined.
You can try to fallback to Self::client_ip
,
in case this method returns None
.
pub fn client_port(&self) -> Option<u16>
pub fn client_port(&self) -> Option<u16>
Return the client port of this Forwarded
context,
if there is one defined.
pub fn client_ip(&self) -> Option<IpAddr>
pub fn client_ip(&self) -> Option<IpAddr>
Return the client Ip of this Forwarded
context,
if there is one defined.
This method may return None because there is no forwarded “for” information for the client element or because the IP is obfuscated.
It is assumed that only the first element can be described as client information.
pub fn client_proto(&self) -> Option<ForwardedProtocol>
pub fn client_proto(&self) -> Option<ForwardedProtocol>
Return the client protocol of this Forwarded
context,
if there is one defined.
pub fn client_version(&self) -> Option<ForwardedVersion>
pub fn client_version(&self) -> Option<ForwardedVersion>
Return the client protocol version of this Forwarded
context,
if there is one defined.
pub fn append(&mut self, element: ForwardedElement) -> &mut Forwarded
pub fn append(&mut self, element: ForwardedElement) -> &mut Forwarded
Append a ForwardedElement
to this Forwarded
context.
pub fn extend(
&mut self,
elements: impl IntoIterator<Item = ForwardedElement>,
) -> &mut Forwarded
pub fn extend( &mut self, elements: impl IntoIterator<Item = ForwardedElement>, ) -> &mut Forwarded
Extend this Forwarded
context with the given ForwardedElement
s.
pub fn iter(&self) -> impl Iterator<Item = &ForwardedElement>
pub fn iter(&self) -> impl Iterator<Item = &ForwardedElement>
Iterate over the ForwardedElement
s in this Forwarded
context.
Trait Implementations§
§impl ForwardHeader for Forwarded
impl ForwardHeader for Forwarded
§fn try_from_forwarded<'a, I>(input: I) -> Option<Forwarded>where
I: IntoIterator<Item = &'a ForwardedElement>,
fn try_from_forwarded<'a, I>(input: I) -> Option<Forwarded>where
I: IntoIterator<Item = &'a ForwardedElement>,
ForwardedElement
into the header. Read more§impl HeaderDecode for Forwarded
impl HeaderDecode for Forwarded
§impl HeaderEncode for Forwarded
impl HeaderEncode for Forwarded
§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) -> HeaderValue
fn encode_to_value(&self) -> HeaderValue
HeaderValue
.§impl IntoIterator for Forwarded
impl IntoIterator for Forwarded
§impl TypedHeader for Forwarded
impl TypedHeader for Forwarded
§fn name() -> &'static HeaderName
fn name() -> &'static HeaderName
impl Eq for Forwarded
impl StructuralPartialEq for Forwarded
Auto Trait Implementations§
impl Freeze for Forwarded
impl RefUnwindSafe for Forwarded
impl Send for Forwarded
impl Sync for Forwarded
impl Unpin for Forwarded
impl UnwindSafe for Forwarded
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
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
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> 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