pub struct SetRequestHeaderLayer<M> { /* private fields */ }
Expand description
Layer that applies SetRequestHeader
which adds a request header.
See SetRequestHeader
for more details.
Implementations§
Source§impl<M> SetRequestHeaderLayer<M>
impl<M> SetRequestHeaderLayer<M>
Sourcepub fn overriding(header_name: HeaderName, make: M) -> Self
pub fn overriding(header_name: HeaderName, make: M) -> Self
Create a new SetRequestHeaderLayer
.
If a previous value exists for the same header, it is removed and replaced with the new header value.
Sourcepub fn appending(header_name: HeaderName, make: M) -> Self
pub fn appending(header_name: HeaderName, make: M) -> Self
Create a new SetRequestHeaderLayer
.
The new header is always added, preserving any existing values. If previous values exist, the header will have multiple values.
Sourcepub fn if_not_present(header_name: HeaderName, make: M) -> Self
pub fn if_not_present(header_name: HeaderName, make: M) -> Self
Create a new SetRequestHeaderLayer
.
If a previous value exists for the header, the new value is not inserted.
Source§impl SetRequestHeaderLayer<HeaderValue>
impl SetRequestHeaderLayer<HeaderValue>
Sourcepub fn overriding_typed<H: Header>(header: H) -> Self
pub fn overriding_typed<H: Header>(header: H) -> Self
Create a new SetRequestHeaderLayer
from a typed Header
.
See SetRequestHeaderLayer::overriding
for more details.
Sourcepub fn appending_typed<H: Header>(header: H) -> Self
pub fn appending_typed<H: Header>(header: H) -> Self
Create a new SetRequestHeaderLayer
from a typed Header
.
See SetRequestHeaderLayer::appending
for more details.
Sourcepub fn if_not_present_typed<H: Header>(header: H) -> Self
pub fn if_not_present_typed<H: Header>(header: H) -> Self
Create a new SetRequestHeaderLayer
from a typed Header
.
See SetRequestHeaderLayer::if_not_present
for more details.
Source§impl<F, A> SetRequestHeaderLayer<BoxMakeHeaderValueFn<F, A>>
impl<F, A> SetRequestHeaderLayer<BoxMakeHeaderValueFn<F, A>>
Sourcepub fn overriding_fn(header_name: HeaderName, make_fn: F) -> Self
pub fn overriding_fn(header_name: HeaderName, make_fn: F) -> Self
Create a new SetRequestHeaderLayer
from a [super::MakeHeaderValueFn
].
See SetRequestHeaderLayer::overriding
for more details.
Sourcepub fn appending_fn(header_name: HeaderName, make_fn: F) -> Self
pub fn appending_fn(header_name: HeaderName, make_fn: F) -> Self
Create a new SetRequestHeaderLayer
from a [super::MakeHeaderValueFn
].
See SetRequestHeaderLayer::appending
for more details.
Sourcepub fn if_not_present_fn(header_name: HeaderName, make_fn: F) -> Self
pub fn if_not_present_fn(header_name: HeaderName, make_fn: F) -> Self
Create a new SetRequestHeaderLayer
from a [super::MakeHeaderValueFn
].
See SetRequestHeaderLayer::if_not_present
for more details.
Trait Implementations§
Source§impl<M> Clone for SetRequestHeaderLayer<M>where
M: Clone,
impl<M> Clone for SetRequestHeaderLayer<M>where
M: Clone,
Source§impl<M> Debug for SetRequestHeaderLayer<M>
impl<M> Debug for SetRequestHeaderLayer<M>
Auto Trait Implementations§
impl<M> !Freeze for SetRequestHeaderLayer<M>
impl<M> RefUnwindSafe for SetRequestHeaderLayer<M>where
M: RefUnwindSafe,
impl<M> Send for SetRequestHeaderLayer<M>where
M: Send,
impl<M> Sync for SetRequestHeaderLayer<M>where
M: Sync,
impl<M> Unpin for SetRequestHeaderLayer<M>where
M: Unpin,
impl<M> UnwindSafe for SetRequestHeaderLayer<M>where
M: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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>
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