summaryrefslogtreecommitdiffstats
path: root/third_party/rust/tokio/src/future/trace.rs
blob: 28789a604d20171037b395eb32adf81fcd929a0a (plain)
1
2
3
4
5
6
7
8
9
10
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()
    }
}