Struct tracing_mock::span::NewSpan
source · pub struct NewSpan { /* private fields */ }
Expand description
A mock new span.
Note: This struct contains expectations that can only be asserted
on when expecting a new span via MockCollector::new_span
. They
cannot be validated on MockCollector::enter
,
MockCollector::exit
, or any other method on MockCollector
that takes an ExpectedSpan
.
For more details on how to use this struct, see the documentation
on the collector
module.
Implementations§
source§impl NewSpan
impl NewSpan
sourcepub fn with_explicit_parent(self, parent: Option<&str>) -> NewSpan
pub fn with_explicit_parent(self, parent: Option<&str>) -> NewSpan
Configures this ExpectedSpan
to expect an explicit parent
span or to be an explicit root.
For more information and examples, see the documentation on
ExpectedSpan::with_explicit_parent
.
sourcepub fn with_contextual_parent(self, parent: Option<&str>) -> NewSpan
pub fn with_contextual_parent(self, parent: Option<&str>) -> NewSpan
Configures this NewSpan
to expect a
contextually-determined parent span, or to be a contextual
root.
For more information and examples, see the documentation on
ExpectedSpan::with_contextual_parent
.
sourcepub fn with_fields<I>(self, fields: I) -> NewSpanwhere
I: Into<ExpectedFields>,
pub fn with_fields<I>(self, fields: I) -> NewSpanwhere
I: Into<ExpectedFields>,
Adds fields to expect when matching a span.
For more information and examples, see the documentation on
ExpectedSpan::with_fields
.