Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
attributes: permit
#[instrument(follows_from = …)]
(tokio-rs#2093)
This PR extends the `#[instrument]` attribute to accept an optional `follows_from = …` argument that supplies any number of `Span::follows_from` relationships to the generated `Span`. ## Motivation This PR resolves tokio-rs#879. ## Solution This PR largely follows the implementation strategy articulated by @hawkw: tokio-rs#879 (comment) In that comment, @hawkw suggests taking one of two approaches: 1. each `follows_from` relationship is supplied with a distinct `follows_from` argument 2. the `follows_from` argument is provided once, and its value is a **list** of indirect causes I take the second approach, since it is slightly more flexible: it allows for the number of indirect causes to vary at runtime. This addition is complemented by changes to `tracing-mock` to permit making `follows_from` assertions for testing purposes.
- Loading branch information