[][src]Struct opentracingrust::StartOptions

pub struct StartOptions { /* fields omitted */ }

Additional options that are passed to Tracer::span.

These options specify initial attributes of a span. All values are optional.

Examples

extern crate opentracingrust;

use std::time::SystemTime;

use opentracingrust::StartOptions;
use opentracingrust::tracers::NoopTracer;


fn main() {
    let (tracer, _) = NoopTracer::new();
    let parent = tracer.span("parent");

    let now = SystemTime::now();
    let options = StartOptions::default()
        .child_of(parent.context().clone())
        .start_time(now);
    let span = tracer.span_with_options("test", options);
}

Methods

impl StartOptions[src]

pub fn child_of(self, parent: SpanContext) -> Self[src]

Declares a ChildOf relationship for the Span to be.

pub fn follows(self, parent: SpanContext) -> Self[src]

Declares a FollowsFrom relationship for the Span to be.

pub fn reference_span(self, reference: SpanReference) -> Self[src]

Declares any of the SpanReferences for the Span to be.

pub fn start_time(self, start_time: SystemTime) -> Self[src]

Sets the start time for the operation.

Trait Implementations

impl Default for StartOptions[src]

fn default() -> StartOptions[src]

Returns a default set of StartOptions.

By default the Span will:

  • Have no references, which will make it a root span.
  • Have have a start time of when Tracer::span is called.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,