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 moresource§impl<MakeSpan: Debug, OnRequest: Debug, OnResponse: Debug, OnFailure: Debug> Debug for TraceLayer<MakeSpan, OnRequest, OnResponse, OnFailure>
impl<MakeSpan: Debug, OnRequest: Debug, OnResponse: Debug, OnFailure: Debug> Debug for TraceLayer<MakeSpan, OnRequest, OnResponse, OnFailure>
source§impl Default for TraceLayer
impl Default for TraceLayer
source§impl<S, MakeSpan, OnRequest, OnResponse, OnFailure> Layer<S> for TraceLayer<MakeSpan, OnRequest, OnResponse, OnFailure>where
MakeSpan: Clone,
OnRequest: Clone,
OnResponse: Clone,
OnFailure: Clone,
impl<S, MakeSpan, OnRequest, OnResponse, OnFailure> Layer<S> for TraceLayer<MakeSpan, OnRequest, OnResponse, OnFailure>where MakeSpan: Clone, OnRequest: Clone, OnResponse: Clone, OnFailure: Clone,
impl<MakeSpan: Copy, OnRequest: Copy, OnResponse: Copy, OnFailure: Copy> Copy for TraceLayer<MakeSpan, OnRequest, OnResponse, OnFailure>
Auto Trait Implementations§
impl<MakeSpan, OnRequest, OnResponse, OnFailure> RefUnwindSafe for TraceLayer<MakeSpan, OnRequest, OnResponse, OnFailure>where MakeSpan: RefUnwindSafe, OnFailure: RefUnwindSafe, OnRequest: RefUnwindSafe, OnResponse: RefUnwindSafe,
impl<MakeSpan, OnRequest, OnResponse, OnFailure> Send for TraceLayer<MakeSpan, OnRequest, OnResponse, OnFailure>where MakeSpan: Send, OnFailure: Send, OnRequest: Send, OnResponse: Send,
impl<MakeSpan, OnRequest, OnResponse, OnFailure> Sync for TraceLayer<MakeSpan, OnRequest, OnResponse, OnFailure>where MakeSpan: Sync, OnFailure: Sync, OnRequest: Sync, OnResponse: Sync,
impl<MakeSpan, OnRequest, OnResponse, OnFailure> Unpin for TraceLayer<MakeSpan, OnRequest, OnResponse, OnFailure>where MakeSpan: Unpin, OnFailure: Unpin, OnRequest: Unpin, OnResponse: Unpin,
impl<MakeSpan, OnRequest, OnResponse, OnFailure> UnwindSafe for TraceLayer<MakeSpan, OnRequest, OnResponse, OnFailure>where MakeSpan: UnwindSafe, OnFailure: UnwindSafe, OnRequest: UnwindSafe, OnResponse: 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