silk.trace.context.

The trace identifiers and flags that cross process and execution boundaries.

Import as SpanContext with import silk.trace.context { SpanContext }.

Public declarations: 4.

SpanContext#

silk
pub struct SpanContext

The 128-bit trace ID, 64-bit span ID and W3C trace flags of one span.

Field traceHigh#

silk
pub traceHigh: u64

High half of the trace identifier in network byte order.

Field traceLow#

silk
pub traceLow: u64

Low half of the trace identifier in network byte order.

Field span#

silk
pub span: u64

The span identifier, nonzero for a valid context.

Field flags#

silk
pub flags: u8

The W3C trace flags. Bit zero is the sampled flag.

Implementation Copy for SpanContext#

silk
impl Copy for SpanContext

Traceparent#

silk
pub struct Traceparent

An owned version 00 W3C traceparent header value.

Implementation Traceparent#

silk
impl Traceparent

Method view#

silk
pub fn view(self: &Self) -> string

Borrows the header as lowercase ASCII text.

traceparent#

silk
pub fn traceparent(context: &SpanContext) -> Traceparent

Encodes a valid context into the 55 bytes of a version 00 traceparent.

parseTraceparent#

silk
pub fn parseTraceparent(text: string) -> Option<SpanContext>

Parses a W3C traceparent header. A later version may append fields after a hyphen.

Profiles: aarch64-apple-darwin, aarch64-unknown-linux-gnu, aarch64-unknown-linux-gnu-no-libc, x86_64-unknown-linux-gnu, x86_64-unknown-linux-gnu-no-libc, wasm32-unknown-unknown, wasm32-wasip1, wasm32-wasip2, x86_64-pc-windows-msvc, wasm64-unknown-unknown.

View the source of this page