background_hang_monitor/
lib.rs

1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
5#![deny(unsafe_code)]
6
7pub mod background_hang_monitor;
8mod sampler;
9#[cfg(all(
10    feature = "sampler",
11    target_os = "linux",
12    not(any(
13        target_arch = "arm",
14        target_arch = "aarch64",
15        target_env = "ohos",
16        target_env = "musl"
17    ))
18))]
19mod sampler_linux;
20#[cfg(all(feature = "sampler", target_os = "android"))]
21mod sampler_linux;
22#[cfg(all(feature = "sampler", target_os = "macos"))]
23mod sampler_mac;
24#[cfg(all(feature = "sampler", target_os = "windows"))]
25mod sampler_windows;
26
27pub use self::background_hang_monitor::*;
28#[cfg(any(
29    not(feature = "sampler"),
30    all(
31        target_os = "linux",
32        any(
33            target_arch = "arm",
34            target_arch = "aarch64",
35            target_env = "ohos",
36            target_env = "musl"
37        )
38    ),
39))]
40pub use crate::sampler::DummySampler as SamplerImpl;
41#[cfg(all(
42    feature = "sampler",
43    target_os = "linux",
44    not(any(
45        target_arch = "arm",
46        target_arch = "aarch64",
47        target_env = "ohos",
48        target_env = "musl"
49    ))
50))]
51pub use crate::sampler_linux::LinuxSampler as SamplerImpl;
52#[cfg(all(feature = "sampler", target_os = "android"))]
53pub use crate::sampler_linux::LinuxSampler as SamplerImpl;
54#[cfg(all(feature = "sampler", target_os = "macos"))]
55pub use crate::sampler_mac::MacOsSampler as SamplerImpl;
56#[cfg(all(
57    feature = "sampler",
58    target_os = "windows",
59    any(target_arch = "x86_64", target_arch = "x86")
60))]
61pub use crate::sampler_windows::WindowsSampler as SamplerImpl;