[−][src]Struct opentracingrust::StartOptions
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 SpanReference
s 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
impl Send for StartOptions
impl Unpin for StartOptions
impl !Sync for StartOptions
impl !UnwindSafe for StartOptions
impl !RefUnwindSafe for StartOptions
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,