Struct Forwarded
pub struct Forwarded { /* private fields */ }net only.Expand description
Forwarding information stored as a chain.
This extension (which can be stored and modified via the Extensions)
allows to keep track of the forward information. E.g. what was the original
host used by the user, by which proxy it was forwarded, what was the intended
protocol (e.g. https), etc…
Implementations§
§impl Forwarded
impl Forwarded
pub const fn new(element: ForwardedElement) -> Forwarded
pub const fn new(element: ForwardedElement) -> Forwarded
Create a new Forwarded extension for the given ForwardedElement,
the first (client-most) element of the chain.
pub fn client(
&self,
policy: &ForwardedSelectionPolicy,
) -> Option<&ForwardedElement>
pub fn client( &self, policy: &ForwardedSelectionPolicy, ) -> Option<&ForwardedElement>
The element describing the client, per policy.
pub fn record(
extensions: &Extensions,
elements: impl IntoIterator<Item = ForwardedElement>,
)
pub fn record( extensions: &Extensions, elements: impl IntoIterator<Item = ForwardedElement>, )
Record the elements a source of forwarding information found into the chain of
extensions.
Sources are read from the nearest hop outwards, such as a PROXY protocol header before the HTTP headers it carries, so these elements go before those recorded already.
pub fn prepend(
&mut self,
farther: impl IntoIterator<Item = ForwardedElement>,
) -> &mut Forwarded
pub fn prepend( &mut self, farther: impl IntoIterator<Item = ForwardedElement>, ) -> &mut Forwarded
Prepend elements written by hops farther away than this chain’s, keeping their order.
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 ForwardedElements.
pub fn iter(&self) -> impl DoubleEndedIterator
pub fn iter(&self) -> impl DoubleEndedIterator
Iterate over the ForwardedElements in this Forwarded context.
Trait Implementations§
impl Eq for Forwarded
impl Extension for Forwarded
§impl From<ForwardedElement> for Forwarded
impl From<ForwardedElement> for Forwarded
§fn from(value: ForwardedElement) -> Forwarded
fn from(value: ForwardedElement) -> Forwarded
§impl IntoIterator for Forwarded
impl IntoIterator for Forwarded
§type Item = ForwardedElement
type Item = ForwardedElement
§type IntoIter = Chain<Once<ForwardedElement>, IntoIter<ForwardedElement>>
type IntoIter = Chain<Once<ForwardedElement>, IntoIter<ForwardedElement>>
impl NetExtension 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 UnsafeUnpin 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
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§impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
fn rama_try_from(value: T) -> Result<U, <U as RamaTryFrom<T>>::Error>
§impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
type Error = <U as RamaTryFrom<T, CrateMarker>>::Error
fn rama_try_into(self) -> Result<U, <U as RamaTryFrom<T, CrateMarker>>::Error>
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.