pub struct TraceSink { /* private fields */ }Expand description
High-volume execution-order / RPC / timing sink.
The field always exists on QueryContext. Self::is_enabled is
compiled to false in release unless the query-trace feature is on, so
event construction behind query_trace! is dead-code-eliminated.
Implementations§
Source§impl TraceSink
impl TraceSink
Sourcepub fn stderr() -> Self
pub fn stderr() -> Self
Write events to stderr (still a no-op at runtime in release without
query-trace).
Sourcepub fn file(file: Arc<Mutex<File>>) -> Self
pub fn file(file: Arc<Mutex<File>>) -> Self
Append events to an already-open file (still a no-op at runtime in
release without query-trace). Share the handle with
LogSink::file to keep one interleaved debug log.
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Whether Self::emit will record anything.
In release builds without query-trace this is const false.
Sourcepub fn emit(&self, query_id: u64, event: TraceEvent)
pub fn emit(&self, query_id: u64, event: TraceEvent)
Record event when enabled.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TraceSink
impl RefUnwindSafe for TraceSink
impl Send for TraceSink
impl Sync for TraceSink
impl Unpin for TraceSink
impl UnsafeUnpin for TraceSink
impl UnwindSafe for TraceSink
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].