Struct actix_web_correlation_id::Correlation
source · pub struct Correlation { /* private fields */ }
Implementations§
source§impl Correlation
impl Correlation
sourcepub fn request_header_name<T>(self, header_name: T) -> Selfwhere
T: Into<HeaderName>,
pub fn request_header_name<T>(self, header_name: T) -> Selfwhere T: Into<HeaderName>,
Sets the name of the header from which the Correlation ID is read from the request.
sourcepub fn enforce_request_header(self, enforce: bool) -> Self
pub fn enforce_request_header(self, enforce: bool) -> Self
Enforce the inclusion of the correlation ID request header.
If true
and the supposed correlation ID header is not included, the
request will fail with a 400 Bad Request response.
sourcepub fn response_header_name<T>(self, header_name: T) -> Selfwhere
T: Into<HeaderName>,
pub fn response_header_name<T>(self, header_name: T) -> Selfwhere T: Into<HeaderName>,
The name of the header to which the correlation ID is written for the response.
sourcepub fn include_in_response(self, include_in_response: bool) -> Self
pub fn include_in_response(self, include_in_response: bool) -> Self
Controls whether the correlation ID is returned in the response headers.
sourcepub fn with_id_generator(
self,
id_generator: Box<dyn CorrelationIdGenerator>
) -> Self
pub fn with_id_generator( self, id_generator: Box<dyn CorrelationIdGenerator> ) -> Self
Use the provided generator for creating a CorrelationId
instead of
the default one.
Trait Implementations§
source§impl Default for Correlation
impl Default for Correlation
source§impl<S, B> Transform<S, ServiceRequest> for Correlationwhere
S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error>,
S::Future: 'static,
B: 'static,
impl<S, B> Transform<S, ServiceRequest> for Correlationwhere S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error>, S::Future: 'static, B: 'static,
§type Response = ServiceResponse<B>
type Response = ServiceResponse<B>
Responses produced by the service.
§type Transform = CorrelationMiddleware<S>
type Transform = CorrelationMiddleware<S>
The
TransformService
value created by this factory§type Future = Ready<Result<<Correlation as Transform<S, ServiceRequest>>::Transform, <Correlation as Transform<S, ServiceRequest>>::InitError>>
type Future = Ready<Result<<Correlation as Transform<S, ServiceRequest>>::Transform, <Correlation as Transform<S, ServiceRequest>>::InitError>>
The future response value.
source§fn new_transform(&self, service: S) -> Self::Future
fn new_transform(&self, service: S) -> Self::Future
Creates and returns a new Transform component, asynchronously
Auto Trait Implementations§
impl !RefUnwindSafe for Correlation
impl !Send for Correlation
impl !Sync for Correlation
impl Unpin for Correlation
impl !UnwindSafe for Correlation
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