pub struct SpanLink { /* private fields */ }Expand description
A link between spans describing a causal relationship.
Implementations§
Source§impl SpanLink
impl SpanLink
Sourcepub fn new(trace_id: u64, span_id: u64) -> Self
pub fn new(trace_id: u64, span_id: u64) -> Self
Creates a new span link for the provided identifiers.
Sourcepub fn with_trace_id(self, trace_id: u64) -> Self
pub fn with_trace_id(self, trace_id: u64) -> Self
Sets the trace identifier.
Sourcepub fn with_trace_id_high(self, trace_id_high: u64) -> Self
pub fn with_trace_id_high(self, trace_id_high: u64) -> Self
Sets the high bits of the trace identifier.
Sourcepub fn with_span_id(self, span_id: u64) -> Self
pub fn with_span_id(self, span_id: u64) -> Self
Sets the span identifier.
Sourcepub fn with_attributes(
self,
attributes: impl Into<Option<FastHashMap<MetaString, AttributeValue>>>,
) -> Self
pub fn with_attributes( self, attributes: impl Into<Option<FastHashMap<MetaString, AttributeValue>>>, ) -> Self
Replaces the attributes map.
Sourcepub fn with_tracestate(self, tracestate: impl Into<MetaString>) -> Self
pub fn with_tracestate(self, tracestate: impl Into<MetaString>) -> Self
Sets the W3C tracestate value.
Sourcepub fn with_flags(self, flags: u32) -> Self
pub fn with_flags(self, flags: u32) -> Self
Sets the W3C trace flags.
Sourcepub fn trace_id_high(&self) -> u64
pub fn trace_id_high(&self) -> u64
Returns the high bits of the trace identifier.
Sourcepub fn attributes(&self) -> &FastHashMap<MetaString, AttributeValue>
pub fn attributes(&self) -> &FastHashMap<MetaString, AttributeValue>
Returns the attributes map.
Sourcepub fn tracestate(&self) -> &str
pub fn tracestate(&self) -> &str
Returns the W3C tracestate value.
Trait Implementations§
Source§impl Attributes for SpanLink
impl Attributes for SpanLink
type Text = MetaString
type Bytes = Vec<u8>
type Values = SalukiValues
Source§fn attribute_str(&self, key: &str) -> Option<&str>
fn attribute_str(&self, key: &str) -> Option<&str>
Get the string value of the attribute for a given key,
None if it is missing or not a
string.Source§fn attribute_f64(&self, key: &str) -> Option<f64>
fn attribute_f64(&self, key: &str) -> Option<f64>
Get the numeric value of the attribute for a given key,
None if it is missing or not a
number. Integers are converted to f64.Source§impl AttributesIter for SpanLink
impl AttributesIter for SpanLink
Source§fn attributes(
&self,
) -> impl Iterator<Item = (&str, AttributeRef<'_, SalukiValues>)>
fn attributes( &self, ) -> impl Iterator<Item = (&str, AttributeRef<'_, SalukiValues>)>
Iterate over all
(key, value) attribute pairs, each key at most onceSource§impl AttributesMut for SpanLink
impl AttributesMut for SpanLink
Source§fn retain_attributes(
&mut self,
f: impl FnMut(&str, &mut AttributeValue) -> bool,
)
fn retain_attributes( &mut self, f: impl FnMut(&str, &mut AttributeValue) -> bool, )
Keep only the attributes for which
f returns true; f may mutate the values it keeps.
Like [AttributesIter::attributes], f sees each key once.Source§fn attribute_mut(&mut self, key: &str) -> Option<&mut AttributeValue>
fn attribute_mut(&mut self, key: &str) -> Option<&mut AttributeValue>
Get a mutable reference to the value for a given key,
None if it is missingSource§fn set_attribute(&mut self, key: MetaString, value: AttributeValue)
fn set_attribute(&mut self, key: MetaString, value: AttributeValue)
Set the attribute for
key, replacing any existing value for that keySource§fn remove_attribute(&mut self, key: &str) -> Option<AttributeValue>
fn remove_attribute(&mut self, key: &str) -> Option<AttributeValue>
Remove the attribute for
key, returning its value if it was presentSource§impl SpanLink for SpanLink
impl SpanLink for SpanLink
Source§fn tracestate(&self) -> &str
fn tracestate(&self) -> &str
The W3C tracestate of the linked span, empty if unset
impl StructuralPartialEq for SpanLink
Auto Trait Implementations§
impl Freeze for SpanLink
impl RefUnwindSafe for SpanLink
impl Send for SpanLink
impl Sync for SpanLink
impl Unpin for SpanLink
impl UnsafeUnpin for SpanLink
impl UnwindSafe for SpanLink
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_resources(self, token: ResourceGroupToken) -> Tracked<Self>
fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self>
Instruments this type by attaching the given resource group token, returning a
Tracked wrapper. Read more§fn in_current_resource_group(self) -> Tracked<Self>
fn in_current_resource_group(self) -> Tracked<Self>
Instruments this type by attaching the current resource group, returning a
Tracked wrapper. Read more