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<M> SetResponseHeaderLayer<M>
impl<M> SetResponseHeaderLayer<M>
Sourcepub fn overriding(header_name: HeaderName, make: M) -> SetResponseHeaderLayer<M>
pub fn overriding(header_name: HeaderName, make: M) -> SetResponseHeaderLayer<M>
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) -> SetResponseHeaderLayer<M>
pub fn appending(header_name: HeaderName, make: M) -> SetResponseHeaderLayer<M>
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,
) -> SetResponseHeaderLayer<M>
pub fn if_not_present( header_name: HeaderName, make: M, ) -> SetResponseHeaderLayer<M>
Create a new SetResponseHeaderLayer
.
If a previous value exists for the header, the new value is not inserted.
Trait Implementations§
Source§impl<M> Clone for SetResponseHeaderLayer<M>where
M: Clone,
impl<M> Clone for SetResponseHeaderLayer<M>where
M: Clone,
Source§fn clone(&self) -> SetResponseHeaderLayer<M>
fn clone(&self) -> SetResponseHeaderLayer<M>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§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>
The wrapped service
Auto 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
Mutably borrows from an owned value. Read more