pub struct Builder { /* private fields */ }Expand description
A builder for Spans.
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.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Builder
impl RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnwindSafe for Builder
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