1#![allow(dead_code)]
10
11#[cfg(all(
12 feature = "hotpath-cpu-meta",
13 not(any(target_os = "macos", target_os = "linux"))
14))]
15compile_error!("the `hotpath-cpu-meta` feature is only supported on macOS and Linux");
16
17#[cfg(feature = "hotpath-meta")]
18#[doc(inline)]
19pub use lib_on::*;
20#[cfg(feature = "hotpath-meta")]
21mod lib_on;
22
23#[cfg(all(feature = "hotpath-meta", feature = "threads"))]
24pub use lib_on::threads;
25#[cfg(all(feature = "hotpath-meta", feature = "tokio"))]
26pub use lib_on::tokio_runtime;
27#[cfg(feature = "hotpath-meta")]
28pub use lib_on::{channels, futures, http, mutexes, sql, streams};
29
30#[cfg(any(feature = "hotpath-meta", feature = "tui"))]
31pub(crate) mod output;
32#[cfg(feature = "hotpath-meta")]
33pub use output::format_debug_truncated;
34#[cfg(any(feature = "hotpath-meta", feature = "tui"))]
35pub use output::{
36 ceil_char_boundary, floor_char_boundary, format_bytes, format_count, format_duration,
37 format_percentile_header, format_percentile_key, format_rate, parse_bytes, parse_count,
38 parse_duration, shorten_function_name, OutputDestination, ProfilingMode, MAX_LOG_LEN,
39};
40
41#[cfg(feature = "hotpath-meta")]
42pub(crate) mod output_on;
43
44#[cfg(feature = "hotpath-meta")]
45pub(crate) mod metrics_server;
46
47#[cfg(feature = "hotpath-mcp-meta")]
48pub(crate) mod mcp_server;
49
50#[allow(dead_code)]
51#[cfg(any(feature = "hotpath-meta", feature = "tui"))]
52pub mod json;
53#[cfg(any(feature = "hotpath-meta", feature = "tui"))]
54pub use json::Route;
55
56#[cfg(feature = "hotpath-meta")]
57#[doc(hidden)]
58pub mod instant;
59#[cfg(feature = "hotpath-meta")]
60pub(crate) mod tid;
61
62#[cfg(not(feature = "hotpath-meta"))]
63#[doc(inline)]
64pub use lib_off::*;
65#[cfg(not(feature = "hotpath-meta"))]
66mod lib_off;
67
68#[cfg(not(feature = "hotpath-meta"))]
69pub use lib_off::{channels, futures, streams, threads};
70
71pub mod wrap {
75 pub mod std {
76 pub mod sync {
77 #[cfg(not(feature = "hotpath-meta"))]
78 pub use crate::lib_off::{
79 mutexes::{Mutex, MutexGuard},
80 rw_locks::{RwLock, RwLockReadGuard, RwLockWriteGuard},
81 };
82 #[cfg(feature = "hotpath-meta")]
83 pub use crate::lib_on::{
84 mutexes::wrapper::std::{Mutex, MutexGuard},
85 rw_locks::wrapper::std::{RwLock, RwLockReadGuard, RwLockWriteGuard},
86 };
87
88 pub mod mpsc {
94 #[cfg(feature = "hotpath-meta")]
95 pub use crate::lib_on::channels::wrapper::std_wrap::{
96 Receiver, Sender, SyncSender,
97 };
98 #[cfg(not(feature = "hotpath-meta"))]
99 pub use std::sync::mpsc::{Receiver, Sender, SyncSender};
100 }
101 }
102 }
103
104 #[cfg(feature = "tokio")]
110 pub mod tokio {
111 pub mod sync {
112 pub mod mpsc {
113 #[cfg(feature = "hotpath-meta")]
114 pub use crate::lib_on::channels::wrapper::tokio_wrap::{
115 Receiver, Sender, UnboundedReceiver, UnboundedSender, WeakSender,
116 WeakUnboundedSender,
117 };
118 #[cfg(not(feature = "hotpath-meta"))]
119 pub use tokio::sync::mpsc::{
120 Receiver, Sender, UnboundedReceiver, UnboundedSender, WeakSender,
121 WeakUnboundedSender,
122 };
123 }
124 }
125 }
126
127 #[cfg(feature = "crossbeam")]
132 pub mod crossbeam {
133 #[cfg(feature = "hotpath-meta")]
134 pub use crate::lib_on::channels::wrapper::crossbeam_wrap::{Receiver, Sender};
135 #[cfg(not(feature = "hotpath-meta"))]
136 pub use crossbeam_channel::{Receiver, Sender};
137 }
138
139 #[cfg(feature = "flume")]
144 pub mod flume {
145 #[cfg(feature = "hotpath-meta")]
146 pub use crate::lib_on::channels::wrapper::flume_wrap::{Receiver, Sender};
147 #[cfg(not(feature = "hotpath-meta"))]
148 pub use flume::{Receiver, Sender};
149 }
150
151 #[cfg(feature = "async-channel")]
156 pub mod async_channel {
157 #[cfg(feature = "hotpath-meta")]
158 pub use crate::lib_on::channels::wrapper::asc_wrap::{Receiver, Sender};
159 #[cfg(not(feature = "hotpath-meta"))]
160 pub use async_channel::{Receiver, Sender};
161 }
162}
163
164mod shared;
165pub use shared::{env_flag, Format, IntoF64, Section};
166
167#[doc(hidden)]
168pub mod dev_logging;