diff options
Diffstat (limited to 'third_party/rust/tokio/src/future/trace.rs')
-rw-r--r-- | third_party/rust/tokio/src/future/trace.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/third_party/rust/tokio/src/future/trace.rs b/third_party/rust/tokio/src/future/trace.rs new file mode 100644 index 0000000000..28789a604d --- /dev/null +++ b/third_party/rust/tokio/src/future/trace.rs @@ -0,0 +1,11 @@ +use std::future::Future; + +pub(crate) trait InstrumentedFuture: Future { + fn id(&self) -> Option<tracing::Id>; +} + +impl<F: Future> InstrumentedFuture for tracing::instrument::Instrumented<F> { + fn id(&self) -> Option<tracing::Id> { + self.span().id() + } +} |