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<Forwarded> for Forwarded
impl PartialEq<Forwarded> for Forwarded
source§impl PartialOrd<Forwarded> for Forwarded
impl PartialOrd<Forwarded> 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 StructuralEq for Forwarded
impl StructuralPartialEq for Forwarded
Auto Trait Implementations§
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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.