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_ancestry(self, ancestry: ExpectedAncestry) -> NewSpan
pub fn with_ancestry(self, ancestry: ExpectedAncestry) -> NewSpan
Configures this NewSpan to expect the specified ExpectedAncestry.
A spanโs ancestry indicates whether it has a parent or is a root span
and whether the parent is explitly or contextually assigned.
For more information and examples, see the documentation on
ExpectedSpan::with_ancestry.
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.