Struct apalis_core::layers::tracing::TraceLayer
source · pub struct TraceLayer<MakeSpan = DefaultMakeSpan, OnRequest = DefaultOnRequest, OnResponse = DefaultOnResponse, OnFailure = DefaultOnFailure> { /* private fields */ }Available on crate feature
trace only.Expand description
Layer that adds high level tracing to a Job.
See the module docs for more details.
Implementations§
source§impl TraceLayer
impl TraceLayer
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new TraceLayer.
source§impl<MakeSpan, OnRequest, OnResponse, OnFailure> TraceLayer<MakeSpan, OnRequest, OnResponse, OnFailure>
impl<MakeSpan, OnRequest, OnResponse, OnFailure> TraceLayer<MakeSpan, OnRequest, OnResponse, OnFailure>
sourcepub fn on_request<NewOnRequest>(
self,
new_on_request: NewOnRequest
) -> TraceLayer<MakeSpan, NewOnRequest, OnResponse, OnFailure>
pub fn on_request<NewOnRequest>(
self,
new_on_request: NewOnRequest
) -> TraceLayer<MakeSpan, NewOnRequest, OnResponse, OnFailure>
Customize what to do when a request is received.
NewOnRequest is expected to implement OnRequest.
sourcepub fn on_response<NewOnResponse>(
self,
new_on_response: NewOnResponse
) -> TraceLayer<MakeSpan, OnRequest, NewOnResponse, OnFailure>
pub fn on_response<NewOnResponse>(
self,
new_on_response: NewOnResponse
) -> TraceLayer<MakeSpan, OnRequest, NewOnResponse, OnFailure>
Customize what to do when a response has been produced.
NewOnResponse is expected to implement OnResponse.
sourcepub fn on_failure<NewOnFailure>(
self,
new_on_failure: NewOnFailure
) -> TraceLayer<MakeSpan, OnRequest, OnResponse, NewOnFailure>
pub fn on_failure<NewOnFailure>(
self,
new_on_failure: NewOnFailure
) -> TraceLayer<MakeSpan, OnRequest, OnResponse, NewOnFailure>
Customize what to do when a response has been classified as a failure.
NewOnFailure is expected to implement OnFailure.
sourcepub fn make_span_with<NewMakeSpan>(
self,
new_make_span: NewMakeSpan
) -> TraceLayer<NewMakeSpan, OnRequest, OnResponse, OnFailure>
pub fn make_span_with<NewMakeSpan>(
self,
new_make_span: NewMakeSpan
) -> TraceLayer<NewMakeSpan, OnRequest, OnResponse, OnFailure>
Trait Implementations§
source§impl<MakeSpan: Clone, OnRequest: Clone, OnResponse: Clone, OnFailure: Clone> Clone for TraceLayer<MakeSpan, OnRequest, OnResponse, OnFailure>
impl<MakeSpan: Clone, OnRequest: Clone, OnResponse: Clone, OnFailure: Clone> Clone for TraceLayer<MakeSpan, OnRequest, OnResponse, OnFailure>
source§fn clone(&self) -> TraceLayer<MakeSpan, OnRequest, OnResponse, OnFailure>
fn clone(&self) -> TraceLayer<MakeSpan, OnRequest, OnResponse, OnFailure>
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