diff options
Diffstat (limited to 'src/future/trace.rs')
-rw-r--r-- | src/future/trace.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/future/trace.rs b/src/future/trace.rs new file mode 100644 index 0000000..28789a6 --- /dev/null +++ b/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() + } +} |