#[non_exhaustive]pub struct Link {
pub trace_id: String,
pub span_id: String,
pub type: Type,
pub attributes: Option<Attributes>,
/* private fields */
}Expand description
A pointer from the current span to another span in the same trace or in a different trace. For example, this can be used in batching operations, where a single batch handler processes multiple requests from different traces or when the handler receives a request from a different project.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.trace_id: StringThe [TRACE_ID] for a trace within a project.
span_id: StringThe [SPAN_ID] for a span within a trace.
type: TypeThe relationship of the current span relative to the linked span.
attributes: Option<Attributes>A set of attributes on the link. Up to 32 attributes can be specified per link.
Implementations§
Source§impl Link
impl Link
pub fn new() -> Self
Sourcepub fn set_trace_id<T: Into<String>>(self, v: T) -> Self
pub fn set_trace_id<T: Into<String>>(self, v: T) -> Self
Sets the value of trace_id.
Sourcepub fn set_span_id<T: Into<String>>(self, v: T) -> Self
pub fn set_span_id<T: Into<String>>(self, v: T) -> Self
Sets the value of span_id.
Sourcepub fn set_attributes<T>(self, v: T) -> Selfwhere
T: Into<Attributes>,
pub fn set_attributes<T>(self, v: T) -> Selfwhere
T: Into<Attributes>,
Sets the value of attributes.
Sourcepub fn set_or_clear_attributes<T>(self, v: Option<T>) -> Selfwhere
T: Into<Attributes>,
pub fn set_or_clear_attributes<T>(self, v: Option<T>) -> Selfwhere
T: Into<Attributes>,
Sets or clears the value of attributes.
Trait Implementations§
impl StructuralPartialEq for Link
Auto Trait Implementations§
impl Freeze for Link
impl RefUnwindSafe for Link
impl Send for Link
impl Sync for Link
impl Unpin for Link
impl UnwindSafe for Link
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