🛈 Note: This is pre-release documentation for the upcoming tracing 0.2.0 ecosystem.

For the release documentation, please see docs.rs, instead.

tracing_mock::expect

Function id

Source
pub fn id() -> ExpectedId
Expand description

Returns a new, unset ExpectedId.

The ExpectedId needs to be attached to a NewSpan or an ExpectedSpan passed to MockCollector::new_span to ensure that it gets set. When the a clone of the same ExpectedSpan is attached to an ExpectedSpan and passed to any other method on MockCollector that accepts it, it will ensure that it is exactly the same span used across those distinct expectations.

For more details on how to use this struct, see the documentation on ExpectedSpan::with_id.