pub struct Builder { /* private fields */ }
Expand description
A builder for Span
s.
Implementations§
source§impl Builder
impl Builder
sourcepub fn name(&mut self, name: &str) -> &mut Builder
pub fn name(&mut self, name: &str) -> &mut Builder
Sets the name of the span.
Defaults to None
.
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 span’s parent.
Defaults to None
.
sourcepub fn kind(&mut self, kind: Kind) -> &mut Builder
pub fn kind(&mut self, kind: Kind) -> &mut Builder
Sets the kind of the span.
Defaults to None
.
sourcepub fn timestamp(&mut self, timestamp: SystemTime) -> &mut Builder
pub fn timestamp(&mut self, timestamp: SystemTime) -> &mut Builder
Sets the time of the beginning of the span.
Defaults to None
.
sourcepub fn duration(&mut self, duration: Duration) -> &mut Builder
pub fn duration(&mut self, duration: Duration) -> &mut Builder
Sets the duration of the span.
Defaults to None
.
sourcepub fn debug(&mut self, debug: bool) -> &mut Builder
pub fn debug(&mut self, debug: bool) -> &mut Builder
Sets the debug state of the span.
Defaults to false
.
Sets the shared state of the span.
Defaults to false
.
sourcepub fn local_endpoint(&mut self, local_endpoint: Endpoint) -> &mut Builder
pub fn local_endpoint(&mut self, local_endpoint: Endpoint) -> &mut Builder
Sets the local endpoint of the span.
Defaults to None
.
sourcepub fn remote_endpoint(&mut self, remote_endpoint: Endpoint) -> &mut Builder
pub fn remote_endpoint(&mut self, remote_endpoint: Endpoint) -> &mut Builder
Sets the remote endpoint of the span.
Defaults to None
.
sourcepub fn annotation(&mut self, annotation: Annotation) -> &mut Builder
pub fn annotation(&mut self, annotation: Annotation) -> &mut Builder
Adds an annotation to the span.
sourcepub fn annotations<I>(&mut self, annotations: I) -> &mut Builderwhere
I: IntoIterator<Item = Annotation>,
pub fn annotations<I>(&mut self, annotations: I) -> &mut Builderwhere
I: IntoIterator<Item = Annotation>,
Adds multiple annotations to the span.
As multiple tags to the span.