Struct hrpc::common::layer::trace::TraceLayer [−][src]
pub struct TraceLayer<SpanFn, OnRequestFn, OnSuccessFn, OnErrorFn> { /* fields omitted */ }
Expand description
Layer for layering hRPC services with Trace
.
Implementations
impl<SpanFn, OnRequestFn, OnSuccessFn, OnErrorFn> TraceLayer<SpanFn, OnRequestFn, OnSuccessFn, OnErrorFn> where
SpanFn: Fn(&BoxRequest) -> Span,
OnRequestFn: Fn(&BoxRequest, &Span),
OnSuccessFn: Fn(&BoxResponse, &Span),
OnErrorFn: Fn(&BoxResponse, &Span, &HrpcError),
impl<SpanFn, OnRequestFn, OnSuccessFn, OnErrorFn> TraceLayer<SpanFn, OnRequestFn, OnSuccessFn, OnErrorFn> where
SpanFn: Fn(&BoxRequest) -> Span,
OnRequestFn: Fn(&BoxRequest, &Span),
OnSuccessFn: Fn(&BoxResponse, &Span),
OnErrorFn: Fn(&BoxResponse, &Span, &HrpcError),
Create a new trace layer.
pub fn span_fn<NewSpanFn>(
self,
span_fn: NewSpanFn
) -> TraceLayer<NewSpanFn, OnRequestFn, OnSuccessFn, OnErrorFn> where
NewSpanFn: Fn(&BoxRequest) -> Span,
pub fn span_fn<NewSpanFn>(
self,
span_fn: NewSpanFn
) -> TraceLayer<NewSpanFn, OnRequestFn, OnSuccessFn, OnErrorFn> where
NewSpanFn: Fn(&BoxRequest) -> Span,
Change the span function that will be used.
pub fn on_request<NewOnRequestFn>(
self,
on_request: NewOnRequestFn
) -> TraceLayer<SpanFn, NewOnRequestFn, OnSuccessFn, OnErrorFn> where
NewOnRequestFn: Fn(&BoxRequest, &Span),
pub fn on_request<NewOnRequestFn>(
self,
on_request: NewOnRequestFn
) -> TraceLayer<SpanFn, NewOnRequestFn, OnSuccessFn, OnErrorFn> where
NewOnRequestFn: Fn(&BoxRequest, &Span),
Change the on request function that will be used.
pub fn on_success<NewOnSuccessFn>(
self,
on_success: NewOnSuccessFn
) -> TraceLayer<SpanFn, OnRequestFn, NewOnSuccessFn, OnErrorFn> where
NewOnSuccessFn: Fn(&BoxResponse, &Span),
pub fn on_success<NewOnSuccessFn>(
self,
on_success: NewOnSuccessFn
) -> TraceLayer<SpanFn, OnRequestFn, NewOnSuccessFn, OnErrorFn> where
NewOnSuccessFn: Fn(&BoxResponse, &Span),
Change the on success function that will be used.
pub fn on_error<NewOnErrorFn>(
self,
on_error: NewOnErrorFn
) -> TraceLayer<SpanFn, OnRequestFn, OnSuccessFn, NewOnErrorFn> where
NewOnErrorFn: Fn(&BoxResponse, &Span, &HrpcError),
pub fn on_error<NewOnErrorFn>(
self,
on_error: NewOnErrorFn
) -> TraceLayer<SpanFn, OnRequestFn, OnSuccessFn, NewOnErrorFn> where
NewOnErrorFn: Fn(&BoxResponse, &Span, &HrpcError),
Change the on error function that will be used.
impl TraceLayer<fn(_: &BoxRequest) -> Span, fn(_: &BoxRequest, _: &Span), fn(_: &BoxResponse, _: &Span), fn(_: &BoxResponse, _: &Span, _: &HrpcError)>
impl TraceLayer<fn(_: &BoxRequest) -> Span, fn(_: &BoxRequest, _: &Span), fn(_: &BoxResponse, _: &Span), fn(_: &BoxResponse, _: &Span, _: &HrpcError)>
Create a trace layer with a default configuration that logs on the info
level of tracing
. Errors are logged with error level.
Create a trace layer with a default configuration that logs on the debug
level of tracing
. Errors are logged with error level.
Trait Implementations
impl<S, SpanFn, OnRequestFn, OnSuccessFn, OnErrorFn> Layer<S> for TraceLayer<SpanFn, OnRequestFn, OnSuccessFn, OnErrorFn> where
SpanFn: Fn(&BoxRequest) -> Span + Clone,
OnRequestFn: Fn(&BoxRequest, &Span) + Clone,
OnSuccessFn: Fn(&BoxResponse, &Span) + Clone,
OnErrorFn: Fn(&BoxResponse, &Span, &HrpcError) + Clone,
impl<S, SpanFn, OnRequestFn, OnSuccessFn, OnErrorFn> Layer<S> for TraceLayer<SpanFn, OnRequestFn, OnSuccessFn, OnErrorFn> where
SpanFn: Fn(&BoxRequest) -> Span + Clone,
OnRequestFn: Fn(&BoxRequest, &Span) + Clone,
OnSuccessFn: Fn(&BoxResponse, &Span) + Clone,
OnErrorFn: Fn(&BoxResponse, &Span, &HrpcError) + Clone,
Auto Trait Implementations
impl<SpanFn, OnRequestFn, OnSuccessFn, OnErrorFn> RefUnwindSafe for TraceLayer<SpanFn, OnRequestFn, OnSuccessFn, OnErrorFn> where
OnErrorFn: RefUnwindSafe,
OnRequestFn: RefUnwindSafe,
OnSuccessFn: RefUnwindSafe,
SpanFn: RefUnwindSafe,
impl<SpanFn, OnRequestFn, OnSuccessFn, OnErrorFn> Send for TraceLayer<SpanFn, OnRequestFn, OnSuccessFn, OnErrorFn> where
OnErrorFn: Send,
OnRequestFn: Send,
OnSuccessFn: Send,
SpanFn: Send,
impl<SpanFn, OnRequestFn, OnSuccessFn, OnErrorFn> Sync for TraceLayer<SpanFn, OnRequestFn, OnSuccessFn, OnErrorFn> where
OnErrorFn: Sync,
OnRequestFn: Sync,
OnSuccessFn: Sync,
SpanFn: Sync,
impl<SpanFn, OnRequestFn, OnSuccessFn, OnErrorFn> Unpin for TraceLayer<SpanFn, OnRequestFn, OnSuccessFn, OnErrorFn> where
OnErrorFn: Unpin,
OnRequestFn: Unpin,
OnSuccessFn: Unpin,
SpanFn: Unpin,
impl<SpanFn, OnRequestFn, OnSuccessFn, OnErrorFn> UnwindSafe for TraceLayer<SpanFn, OnRequestFn, OnSuccessFn, OnErrorFn> where
OnErrorFn: UnwindSafe,
OnRequestFn: UnwindSafe,
OnSuccessFn: UnwindSafe,
SpanFn: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
Notable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
Notable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
pub fn vzip(self) -> V
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
Notable traits for WithDispatch<T>
impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
fn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
fn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
Notable traits for WithDispatch<T>
impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more