Struct zipkin::trace_context::Builder
source · pub struct Builder { /* private fields */ }
Expand description
A builder type for TraceContext
s.
Implementations§
source§impl Builder
impl Builder
sourcepub fn trace_id(&mut self, trace_id: TraceId) -> &mut Builder
pub fn trace_id(&mut self, trace_id: TraceId) -> &mut Builder
Sets the trace ID of this context.
sourcepub fn parent_id(&mut self, parent_id: SpanId) -> &mut Builder
pub fn parent_id(&mut self, parent_id: SpanId) -> &mut Builder
Sets the ID of the parent span of this context.
Defaults to None
.
sourcepub fn span_id(&mut self, span_id: SpanId) -> &mut Builder
pub fn span_id(&mut self, span_id: SpanId) -> &mut Builder
Sets the ID of the span of this context.
sourcepub fn sampling_flags(&mut self, flags: SamplingFlags) -> &mut Builder
pub fn sampling_flags(&mut self, flags: SamplingFlags) -> &mut Builder
Sets the sampling flags for this context.
sourcepub fn sampled(&mut self, sampled: bool) -> &mut Builder
pub fn sampled(&mut self, sampled: bool) -> &mut Builder
Sets the sampling request for this context.
Defaults to None
.
sourcepub fn debug(&mut self, debug: bool) -> &mut Builder
pub fn debug(&mut self, debug: bool) -> &mut Builder
Sets the debug flag for this request.
Defaults to false
.
sourcepub fn build(&self) -> TraceContext
pub fn build(&self) -> TraceContext
Trait Implementations§
source§impl From<TraceContext> for Builder
impl From<TraceContext> for Builder
source§fn from(c: TraceContext) -> Builder
fn from(c: TraceContext) -> Builder
Converts to this type from the input type.