Expand description
Construct expectations for traces which should be received
This module contains constructors for expectations defined
in the event
, span
, and field
modules.
§Examples
use tracing_mock::{collector, expect};
let (collector, handle) = collector::mock()
// Expect an event with message
.event(expect::event().with_fields(expect::msg("message")))
.only()
.run_with_handle();
tracing::collect::with_default(collector, || {
tracing::info!("message");
});
handle.assert_finished();
Functions§
- Create a new
ExpectedEvent
. - Construct a new
ExpectedField
. - Convenience function that returns
ExpectedAncestry::HasContextualParent
with provided name. - Convenience function that returns
ExpectedAncestry::HasExplicitParent
with provided name. - Returns a new, unset
ExpectedId
. - Convenience function that returns
ExpectedAncestry::IsContextualRoot
. - Convenience function that returns
ExpectedAncestry::IsExplicitRoot
. - Construct a new message
ExpectedField
. - Construct a new
ExpectedSpan
.