#[cfg(target_family = "wasm")]
pub struct WasmSpan(pub tracing::Span);
#[cfg(target_family = "wasm")]
#[macro_export]
macro_rules! info_span {
($($args:tt)*) => {
$crate::tracing_wasm::WasmSpan(tracing::Span::none())
};
}
#[cfg(not(target_family = "wasm"))]
#[macro_export]
macro_rules! info_span {
($($args:tt)*) => {
tracing::info_span!($($args)*)
};
}
#[cfg(target_family = "wasm")]
pub trait WasmInstrument: std::future::Future + Sized {
fn instrument(self, _span: WasmSpan) -> Self {
self
}
}
#[cfg(target_family = "wasm")]
impl<F: std::future::Future> WasmInstrument for F {}