pub struct SpanLink { /* private fields */ }Expand description
A link between two spans in potentially different traces.
A link belongs to a span, and contains the TraceId and SpanId of the span being linked to.
Links are usually created on the downstream span.
Links relate spans outside of the normal parent-child hierarchy. Links are largely informative and may not be understood by downstream consumers. In order to create a generic DAG out of span links, the spans would need to belong to separate traces, since the parent-child relationship is still required.
Implementations§
Source§impl SpanLink
impl SpanLink
Sourcepub const fn new(trace_id: TraceId, span_id: SpanId) -> Self
pub const fn new(trace_id: TraceId, span_id: SpanId) -> Self
Create a new link to the target span.
Sourcepub fn try_from_str(s: &str) -> Result<Self, ParseLinkError>
pub fn try_from_str(s: &str) -> Result<Self, ParseLinkError>
Try parse a span link from a formatted representation.
Sourcepub fn parse(s: impl Display) -> Result<Self, ParseLinkError>
pub fn parse(s: impl Display) -> Result<Self, ParseLinkError>
Try parse a span link from a formatted representation.
Trait Implementations§
impl Copy for SpanLink
impl Eq for SpanLink
Source§impl<'a> Extend<SpanLink> for SpanLinkSet
impl<'a> Extend<SpanLink> for SpanLinkSet
Source§fn extend<I: IntoIterator<Item = SpanLink>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = SpanLink>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<'a> FromIterator<SpanLink> for SpanLinkSet
impl<'a> FromIterator<SpanLink> for SpanLinkSet
Source§impl<'v> FromValue<'v> for SpanLink
impl<'v> FromValue<'v> for SpanLink
Source§fn from_value(value: Value<'v>) -> Option<Self>
fn from_value(value: Value<'v>) -> Option<Self>
Perform the conversion.
Source§impl Ord for SpanLink
impl Ord for SpanLink
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for SpanLink
impl PartialOrd for SpanLink
impl StructuralPartialEq for SpanLink
Source§impl Value for SpanLink
Available on crate feature sval only.
impl Value for SpanLink
Available on crate feature
sval only.Source§fn stream<'sval, S: Stream<'sval> + ?Sized>(
&'sval self,
stream: &mut S,
) -> Result
fn stream<'sval, S: Stream<'sval> + ?Sized>( &'sval self, stream: &mut S, ) -> Result
Stream this value through a
Stream.Source§fn to_f32(&self) -> Option<f32>
fn to_f32(&self) -> Option<f32>
Try convert this value into a 32bit binary floating point number.
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