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,
Source§type Response = ServiceResponse<B>
type Response = ServiceResponse<B>
Responses produced by the service.
Source§type Transform = CorrelationMiddleware<S>
type Transform = CorrelationMiddleware<S>
The
TransformService
value created by this factorySource§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 Freeze for Correlation
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