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 more