Struct actix_web_lab::header::Forwarded
source · pub struct Forwarded { /* private fields */ }
Expand description
Forwarded
header, defined in RFC 7239.
Also see the Forwarded header’s MDN docs for field semantics.
Implementations§
source§impl Forwarded
impl Forwarded
sourcepub fn new(
by: impl Into<Option<String>>,
for: impl Into<Vec<String>>,
host: impl Into<Option<String>>,
proto: impl Into<Option<String>>,
) -> Self
pub fn new( by: impl Into<Option<String>>, for: impl Into<Vec<String>>, host: impl Into<Option<String>>, proto: impl Into<Option<String>>, ) -> Self
Constructs new Forwarded
header from parts.
sourcepub fn new_for(for: impl Into<String>) -> Self
pub fn new_for(for: impl Into<String>) -> Self
Constructs new Forwarded
header from a single “for” identifier.
sourcepub fn for_client(&self) -> Option<&str>
pub fn for_client(&self) -> Option<&str>
Returns first “for” parameter which is typically the client’s identifier.
sourcepub fn for_chain(&self) -> impl Iterator<Item = &str>
pub fn for_chain(&self) -> impl Iterator<Item = &str>
Returns iterator over the “for” chain.
The first item yielded will match for_client
and the rest will be
proxy identifiers, in the order the request passed through them.
sourcepub fn by(&self) -> Option<&str>
pub fn by(&self) -> Option<&str>
Returns the “by” identifier, if set.
The interface where the request came in to the proxy server.
sourcepub fn host(&self) -> Option<&str>
pub fn host(&self) -> Option<&str>
Returns the “host” identifier, if set.
Should equal the Host
request header field as received by the proxy.
Trait Implementations§
source§impl Header for Forwarded
impl Header for Forwarded
source§fn name() -> HeaderName
fn name() -> HeaderName
Returns the name of the header field.
source§fn parse<M: HttpMessage>(msg: &M) -> Result<Self, ParseError>
fn parse<M: HttpMessage>(msg: &M) -> Result<Self, ParseError>
Parse the header from a HTTP message.
source§impl Ord for Forwarded
impl Ord for Forwarded
source§impl PartialEq for Forwarded
impl PartialEq for Forwarded
source§impl PartialOrd for Forwarded
impl PartialOrd for Forwarded
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl TryIntoHeaderValue for Forwarded
impl TryIntoHeaderValue for Forwarded
§type Error = InvalidHeaderValue
type Error = InvalidHeaderValue
The type returned in the event of a conversion error.
source§fn try_into_value(self) -> Result<HeaderValue, Self::Error>
fn try_into_value(self) -> Result<HeaderValue, Self::Error>
Try to convert value to a HeaderValue.
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§
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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
Compare self to
key
and return true
if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§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>
Converts
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>
Converts
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