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, io, 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, format_throughput, parse_bytes,
38 parse_count, parse_duration, shorten_function_name, OutputDestination, ProfilingMode,
39 MAX_LOG_LEN,
40};
41
42#[cfg(feature = "hotpath-meta")]
43pub(crate) mod output_on;
44
45#[cfg(feature = "hotpath-meta")]
46pub(crate) mod metrics_server;
47
48#[cfg(feature = "hotpath-mcp-meta")]
49pub(crate) mod mcp_server;
50
51#[allow(dead_code)]
52#[cfg(any(feature = "hotpath-meta", feature = "tui"))]
53pub mod json;
54#[cfg(any(feature = "hotpath-meta", feature = "tui"))]
55pub use json::Route;
56
57#[cfg(feature = "hotpath-meta")]
58#[doc(hidden)]
59pub mod instant;
60#[cfg(feature = "hotpath-meta")]
61pub(crate) mod tid;
62
63#[cfg(not(feature = "hotpath-meta"))]
64#[doc(inline)]
65pub use lib_off::*;
66#[cfg(not(feature = "hotpath-meta"))]
67mod lib_off;
68
69#[cfg(not(feature = "hotpath-meta"))]
70pub use lib_off::{channels, futures, streams, threads};
71
72pub mod wrap {
76 pub mod std {
77 pub mod sync {
78 #[cfg(not(feature = "hotpath-meta"))]
79 pub use crate::lib_off::{
80 mutexes::{Mutex, MutexGuard},
81 rw_locks::{RwLock, RwLockReadGuard, RwLockWriteGuard},
82 };
83 #[cfg(feature = "hotpath-meta")]
84 pub use crate::lib_on::{
85 mutexes::wrapper::std::{Mutex, MutexGuard},
86 rw_locks::wrapper::std::{RwLock, RwLockReadGuard, RwLockWriteGuard},
87 };
88
89 pub mod mpsc {
95 #[cfg(feature = "hotpath-meta")]
96 pub use crate::lib_on::channels::wrapper::std_wrap::{
97 Receiver, Sender, SyncSender,
98 };
99 #[cfg(not(feature = "hotpath-meta"))]
100 pub use std::sync::mpsc::{Receiver, Sender, SyncSender};
101 }
102 }
103 }
104
105 #[cfg(feature = "tokio")]
111 pub mod tokio {
112 pub mod sync {
113 pub mod mpsc {
114 #[cfg(feature = "hotpath-meta")]
115 pub use crate::lib_on::channels::wrapper::tokio_wrap::{
116 Receiver, Sender, UnboundedReceiver, UnboundedSender, WeakSender,
117 WeakUnboundedSender,
118 };
119 #[cfg(not(feature = "hotpath-meta"))]
120 pub use tokio::sync::mpsc::{
121 Receiver, Sender, UnboundedReceiver, UnboundedSender, WeakSender,
122 WeakUnboundedSender,
123 };
124 }
125 }
126 }
127
128 #[cfg(feature = "crossbeam")]
133 pub mod crossbeam {
134 #[cfg(feature = "hotpath-meta")]
135 pub use crate::lib_on::channels::wrapper::crossbeam_wrap::{Receiver, Sender};
136 #[cfg(not(feature = "hotpath-meta"))]
137 pub use crossbeam_channel::{Receiver, Sender};
138 }
139
140 #[cfg(feature = "flume")]
145 pub mod flume {
146 #[cfg(feature = "hotpath-meta")]
147 pub use crate::lib_on::channels::wrapper::flume_wrap::{Receiver, Sender};
148 #[cfg(not(feature = "hotpath-meta"))]
149 pub use flume::{Receiver, Sender};
150 }
151
152 #[cfg(feature = "async-channel")]
157 pub mod async_channel {
158 #[cfg(feature = "hotpath-meta")]
159 pub use crate::lib_on::channels::wrapper::asc_wrap::{Receiver, Sender};
160 #[cfg(not(feature = "hotpath-meta"))]
161 pub use async_channel::{Receiver, Sender};
162 }
163}
164
165mod shared;
166pub use shared::{env_flag, Format, IntoF64, Section};
167
168#[doc(hidden)]
169pub mod dev_logging;