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
sourceimpl 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
sourceimpl Header for Forwarded
impl Header for Forwarded
sourcefn name() -> HeaderName
fn name() -> HeaderName
Returns the name of the header field.
sourcefn parse<M: HttpMessage>(msg: &M) -> Result<Self, ParseError>
fn parse<M: HttpMessage>(msg: &M) -> Result<Self, ParseError>
Parse the header from a HTTP message.
sourceimpl Ord for Forwarded
impl Ord for Forwarded
1.21.0 · sourceconst fn max(self, other: Self) -> Self
const fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourceconst fn min(self, other: Self) -> Self
const fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourceconst fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
const fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<Forwarded> for Forwarded
impl PartialOrd<Forwarded> for Forwarded
sourcefn partial_cmp(&self, other: &Forwarded) -> Option<Ordering>
fn partial_cmp(&self, other: &Forwarded) -> Option<Ordering>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
const 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 moresourceimpl TryIntoHeaderValue for Forwarded
impl TryIntoHeaderValue for Forwarded
type Error = InvalidHeaderValue
type Error = InvalidHeaderValue
The type returned in the event of a conversion error.
sourcefn 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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<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,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.