|
1 | 1 | //! # Jaeger JSON file Exporter |
2 | 2 | //! |
3 | 3 |
|
4 | | -use async_trait::async_trait; |
5 | 4 | use futures_core::future::BoxFuture; |
6 | 5 | use futures_util::FutureExt; |
7 | 6 | use opentelemetry::trace::SpanId; |
@@ -205,16 +204,18 @@ fn opentelemetry_value_to_json(value: &opentelemetry::Value) -> (&str, serde_jso |
205 | 204 | /// Jaeger Json Runtime is an extension to [`RuntimeChannel`]. |
206 | 205 | /// |
207 | 206 | /// [`RuntimeChannel`]: opentelemetry_sdk::runtime::RuntimeChannel |
208 | | -#[async_trait] |
209 | 207 | pub trait JaegerJsonRuntime: RuntimeChannel + std::fmt::Debug { |
210 | 208 | /// Create a new directory if the given path does not exist yet |
211 | | - async fn create_dir(&self, path: &Path) -> OTelSdkResult; |
| 209 | + fn create_dir(&self, path: &Path) -> impl std::future::Future<Output = OTelSdkResult> + Send; |
212 | 210 | /// Write the provided content to a new file at the given path |
213 | | - async fn write_to_file(&self, path: &Path, content: &[u8]) -> OTelSdkResult; |
| 211 | + fn write_to_file( |
| 212 | + &self, |
| 213 | + path: &Path, |
| 214 | + content: &[u8], |
| 215 | + ) -> impl std::future::Future<Output = OTelSdkResult> + Send; |
214 | 216 | } |
215 | 217 |
|
216 | 218 | #[cfg(feature = "rt-tokio")] |
217 | | -#[async_trait] |
218 | 219 | impl JaegerJsonRuntime for opentelemetry_sdk::runtime::Tokio { |
219 | 220 | async fn create_dir(&self, path: &Path) -> OTelSdkResult { |
220 | 221 | if tokio::fs::metadata(path).await.is_err() { |
@@ -244,7 +245,6 @@ impl JaegerJsonRuntime for opentelemetry_sdk::runtime::Tokio { |
244 | 245 | } |
245 | 246 |
|
246 | 247 | #[cfg(feature = "rt-tokio-current-thread")] |
247 | | -#[async_trait] |
248 | 248 | impl JaegerJsonRuntime for opentelemetry_sdk::runtime::TokioCurrentThread { |
249 | 249 | async fn create_dir(&self, path: &Path) -> OTelSdkResult { |
250 | 250 | if tokio::fs::metadata(path).await.is_err() { |
@@ -274,7 +274,6 @@ impl JaegerJsonRuntime for opentelemetry_sdk::runtime::TokioCurrentThread { |
274 | 274 | } |
275 | 275 |
|
276 | 276 | #[cfg(feature = "rt-async-std")] |
277 | | -#[async_trait] |
278 | 277 | impl JaegerJsonRuntime for opentelemetry_sdk::runtime::AsyncStd { |
279 | 278 | async fn create_dir(&self, path: &Path) -> OTelSdkResult { |
280 | 279 | if async_std::fs::metadata(path).await.is_err() { |
|
0 commit comments