pub struct Span<T: TraceData> {Show 16 fields
pub service: T::Text,
pub name: T::Text,
pub resource: T::Text,
pub type: T::Text,
pub span_id: u64,
pub parent_id: u64,
pub start: i64,
pub duration: i64,
pub error: bool,
pub span_kind: SpanKind,
pub env: T::Text,
pub version: T::Text,
pub component: T::Text,
pub attributes: VecMap<T::Text, AttributeValue<T>>,
pub span_links: ThinVec<SpanLink<T>>,
pub span_events: ThinVec<SpanEvent<T>>,
}Expand description
The generic representation of a V1 span.
T: TraceData carries the associated text type T::Text used for every string field in the
span; T::Text can be either owned (e.g. BytesString) or
borrowed (e.g. &str). To define a generic function taking any Span<T> you can use the
TraceData trait:
use libdd_trace_utils::span::{v1::Span, TraceData};
fn foo<T: TraceData>(span: Span<T>) {
let _ = span.attributes.get("foo");
}Fields§
§service: T::Text§name: T::Text§resource: T::Text§type: T::Text§span_id: u64§parent_id: u64§start: i64§duration: i64§error: bool§span_kind: SpanKind§env: T::Text§version: T::Text§component: T::Text§attributes: VecMap<T::Text, AttributeValue<T>>§span_links: ThinVec<SpanLink<T>>§span_events: ThinVec<SpanEvent<T>>Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Span<T>
impl<T> RefUnwindSafe for Span<T>
impl<T> Send for Span<T>
impl<T> Sync for Span<T>
impl<T> Unpin for Span<T>
impl<T> UnsafeUnpin for Span<T>
impl<T> UnwindSafe for Span<T>
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