Struct tower_http::request_id::SetRequestIdLayer
source · pub struct SetRequestIdLayer<M> { /* private fields */ }
Available on crate feature
request-id
only.Expand description
Set request id headers and extensions on requests.
This layer applies the SetRequestId
middleware.
See the module docs and SetRequestId
for more details.
Implementations§
source§impl<M> SetRequestIdLayer<M>
impl<M> SetRequestIdLayer<M>
sourcepub fn new(header_name: HeaderName, make_request_id: M) -> Selfwhere
M: MakeRequestId,
pub fn new(header_name: HeaderName, make_request_id: M) -> Selfwhere M: MakeRequestId,
Create a new SetRequestIdLayer
.
sourcepub fn x_request_id(make_request_id: M) -> Selfwhere
M: MakeRequestId,
pub fn x_request_id(make_request_id: M) -> Selfwhere M: MakeRequestId,
Create a new SetRequestIdLayer
that uses x-request-id
as the header name.
Trait Implementations§
source§impl<M: Clone> Clone for SetRequestIdLayer<M>
impl<M: Clone> Clone for SetRequestIdLayer<M>
source§fn clone(&self) -> SetRequestIdLayer<M>
fn clone(&self) -> SetRequestIdLayer<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> Debug for SetRequestIdLayer<M>
impl<M: Debug> Debug for SetRequestIdLayer<M>
source§impl<S, M> Layer<S> for SetRequestIdLayer<M>where
M: Clone + MakeRequestId,
impl<S, M> Layer<S> for SetRequestIdLayer<M>where M: Clone + MakeRequestId,
Auto Trait Implementations§
impl<M> RefUnwindSafe for SetRequestIdLayer<M>where M: RefUnwindSafe,
impl<M> Send for SetRequestIdLayer<M>where M: Send,
impl<M> Sync for SetRequestIdLayer<M>where M: Sync,
impl<M> Unpin for SetRequestIdLayer<M>where M: Unpin,
impl<M> UnwindSafe for SetRequestIdLayer<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