pub struct SetRequestHeaderLayer<M> { /* private fields */ }
Available on crate feature
set-header
only.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.
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
Mutably borrows from an owned value. Read more