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
sourceimpl TraceLayer
impl TraceLayer
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new TraceLayer.
sourceimpl<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
sourceimpl<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>
sourcefn 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 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl<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>
sourceimpl Default for TraceLayer
impl Default for TraceLayer
sourceimpl<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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more