pub struct Trace { /* private fields */ }Expand description
A trace event.
A trace is a collection of spans that represent a distributed trace.
Implementations§
Source§impl Trace
impl Trace
Sourcepub fn new(spans: Vec<Span>, resource_tags: impl Into<SharedTagSet>) -> Self
pub fn new(spans: Vec<Span>, resource_tags: impl Into<SharedTagSet>) -> Self
Creates a new Trace with the given spans.
Sourcepub fn spans_mut(&mut self) -> &mut [Span]
pub fn spans_mut(&mut self) -> &mut [Span]
Returns a mutable reference to the spans in this trace.
Sourcepub fn set_spans(&mut self, spans: Vec<Span>)
pub fn set_spans(&mut self, spans: Vec<Span>)
Replaces the spans in this trace with the given spans.
Sourcepub fn retain_spans<F>(&mut self, f: F) -> usize
pub fn retain_spans<F>(&mut self, f: F) -> usize
Retains only the spans specified by the predicate.
Returns the number of spans retained. If no spans match, the trace is left unchanged.
Returns the resource-level tags associated with this trace.
Sourcepub fn sampling(&self) -> Option<&TraceSampling>
pub fn sampling(&self) -> Option<&TraceSampling>
Returns a reference to the trace-level sampling metadata, if present.
Sourcepub fn set_sampling(&mut self, sampling: Option<TraceSampling>)
pub fn set_sampling(&mut self, sampling: Option<TraceSampling>)
Sets the trace-level sampling metadata.
Trait Implementations§
impl StructuralPartialEq for Trace
Auto Trait Implementations§
impl Freeze for Trace
impl RefUnwindSafe for Trace
impl Send for Trace
impl Sync for Trace
impl Unpin for Trace
impl UnwindSafe for Trace
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Track for T
impl<T> Track for T
§fn track_allocations(self, token: AllocationGroupToken) -> Tracked<Self>
fn track_allocations(self, token: AllocationGroupToken) -> Tracked<Self>
Instruments this type by attaching the given allocation group token, returning a
Tracked wrapper. Read more§fn in_current_allocation_group(self) -> Tracked<Self>
fn in_current_allocation_group(self) -> Tracked<Self>
Instruments this type by attaching the current allocation group, returning a
Tracked wrapper. Read more