fluvio_future/
lib.rs

1#[cfg(unix)]
2pub mod file_slice;
3
4#[cfg(feature = "fs")]
5#[cfg(not(target_arch = "wasm32"))]
6pub mod fs;
7
8#[cfg(feature = "io")]
9#[cfg(not(target_arch = "wasm32"))]
10pub mod io;
11
12#[cfg(feature = "task")]
13pub mod task;
14
15#[cfg(feature = "timer")]
16pub mod timer;
17
18#[cfg(feature = "retry")]
19pub mod retry;
20
21#[cfg(any(test, feature = "fixture"))]
22mod test_util;
23
24#[cfg(any(test, feature = "fixture"))]
25pub use fluvio_future_derive::test_async;
26
27#[cfg(any(test, feature = "fixture"))]
28pub use fluvio_future_derive::test;
29
30#[cfg(all(unix, feature = "zero_copy"))]
31pub mod zero_copy;
32
33#[cfg(feature = "net")]
34pub mod net;
35
36#[cfg(all(any(unix, windows), feature = "rust_tls"))]
37pub mod rust_tls;
38
39#[cfg(all(any(unix, windows), feature = "rust_tls", not(feature = "native_tls")))]
40pub use rust_tls as tls;
41
42#[cfg(all(any(unix, windows), feature = "native_tls"))]
43pub mod native_tls;
44
45#[cfg(all(any(unix, windows), feature = "native_tls", not(feature = "rust_tls")))]
46pub use crate::native_tls as tls;
47
48#[cfg(feature = "openssl_tls")]
49#[cfg(not(target_arch = "wasm32"))]
50pub mod openssl;
51
52#[cfg(feature = "sync")]
53pub mod sync;
54
55#[cfg(feature = "future")]
56pub mod future;
57
58#[cfg(feature = "subscriber")]
59pub mod subscriber {
60    use tracing_subscriber::EnvFilter;
61
62    pub fn init_logger() {
63        init_tracer(None);
64    }
65
66    pub fn init_tracer(level: Option<tracing::Level>) {
67        let _ = tracing_subscriber::fmt()
68            .with_max_level(level.unwrap_or(tracing::Level::DEBUG))
69            .with_env_filter(EnvFilter::from_default_env())
70            .with_writer(std::io::stderr)
71            .try_init();
72    }
73}
74
75#[cfg(feature = "doomsday")]
76#[cfg(not(target_arch = "wasm32"))]
77pub mod doomsday;
78
79#[cfg(feature = "attributes")]
80pub use fluvio_future_derive::main_async;
81
82/// re-export tracing
83pub mod tracing {
84
85    pub use tracing::*;
86}