pub struct SetResponseHeaderLayer<M> { /* private fields */ }Expand description
Layer that applies SetResponseHeader which adds a response header.
See SetResponseHeader for more details.
Implementations§
Source§impl SetResponseHeaderLayer<HeaderValue>
impl SetResponseHeaderLayer<HeaderValue>
Sourcepub fn overriding_typed<H: Header>(header: H) -> Self
pub fn overriding_typed<H: Header>(header: H) -> Self
Create a new SetResponseHeaderLayer from a typed Header.
See SetResponseHeaderLayer::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 SetResponseHeaderLayer from a typed Header.
See SetResponseHeaderLayer::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 SetResponseHeaderLayer from a typed Header.
See SetResponseHeaderLayer::if_not_present for more details.
Source§impl<M> SetResponseHeaderLayer<M>
impl<M> SetResponseHeaderLayer<M>
Sourcepub fn overriding(header_name: HeaderName, make: M) -> Self
pub fn overriding(header_name: HeaderName, make: M) -> Self
Create a new SetResponseHeaderLayer.
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 SetResponseHeaderLayer.
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 SetResponseHeaderLayer.
If a previous value exists for the header, the new value is not inserted.
Source§impl<F, A> SetResponseHeaderLayer<BoxMakeHeaderValueFactoryFn<F, A>>
impl<F, A> SetResponseHeaderLayer<BoxMakeHeaderValueFactoryFn<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 SetResponseHeaderLayer from a [super::MakeHeaderValueFn].
See SetResponseHeaderLayer::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 SetResponseHeaderLayer from a [super::MakeHeaderValueFn].
See SetResponseHeaderLayer::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 SetResponseHeaderLayer from a [super::MakeHeaderValueFn].
See SetResponseHeaderLayer::if_not_present for more details.
Trait Implementations§
Source§impl<M> Clone for SetResponseHeaderLayer<M>where
M: Clone,
impl<M> Clone for SetResponseHeaderLayer<M>where
M: Clone,
Source§impl<M> Debug for SetResponseHeaderLayer<M>
impl<M> Debug for SetResponseHeaderLayer<M>
Source§impl<S, M> Layer<S> for SetResponseHeaderLayer<M>where
M: Clone,
impl<S, M> Layer<S> for SetResponseHeaderLayer<M>where
M: Clone,
Source§type Service = SetResponseHeader<S, M>
type Service = SetResponseHeader<S, M>
Source§fn layer(&self, inner: S) -> Self::Service
fn layer(&self, inner: S) -> Self::Service
Source§fn into_layer(self, inner: S) -> Self::Service
fn into_layer(self, inner: S) -> Self::Service
layer but consuming self after the service was created. Read moreAuto Trait Implementations§
impl<M> !Freeze for SetResponseHeaderLayer<M>
impl<M> RefUnwindSafe for SetResponseHeaderLayer<M>where
M: RefUnwindSafe,
impl<M> Send for SetResponseHeaderLayer<M>where
M: Send,
impl<M> Sync for SetResponseHeaderLayer<M>where
M: Sync,
impl<M> Unpin for SetResponseHeaderLayer<M>where
M: Unpin,
impl<M> UnwindSafe for SetResponseHeaderLayer<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