mirror of
https://github.com/tokio-rs/tracing.git
synced 2025-10-02 15:24:47 +00:00

Adds the possibility for the client code to access a pinned projection of the wrapped types in `Instrumented` and `WithDispatch`. As suggested in #386. I added this after seeing the suggestion, it compiles fine, but be warned I have not actually tried to use this for anything. Let me know if you want to see any tests added. The main thing I see this enabling is calling `poll` directly on a wrapped future, which would disable the functionality from the wrappers. I'm not sure of the use case, but that's not a reason to make it impossible I suppose. I got stuck a bit wondering how sound it is to give access to both a `&mut` and a `Pin<&mut>` for the same field, but haven't been able to find any way to break anything without unsafe code.
tracing-futures
Utilities for instrumenting futures-based code with tracing
.
Overview
tracing
is a framework for instrumenting Rust programs to collect
structured, event-based diagnostic information. This crate provides utilities
for using tracing
to instrument asynchronous code written using futures and
async/await.
The crate provides the following traits:
-
Instrument
allows atracing
span to be attached to a future, sink, stream, or executor. -
WithSubscriber
allows atracing
Subscriber
to be attached to a future, sink, stream, or executor.
License
This project is licensed under the MIT license.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Tracing by you, shall be licensed as MIT, without any additional terms or conditions.