#[cfg(windows)]
pub(crate) mod win;
#[cfg(target_os = "macos")]
mod mac;
#[cfg(any(target_os = "linux", test))]
pub(crate) mod linux;
#[cfg(any(target_os = "macos", target_os = "ios", test))]
pub(crate) mod proxy_dict;
#[cfg(any(target_os = "macos", target_os = "ios"))]
mod cf_dict;
#[cfg(target_os = "ios")]
mod ios;
#[cfg(any(target_os = "android", test))]
pub(crate) mod proxy_info;
#[cfg(target_os = "android")]
pub(crate) mod android;
#[cfg(any(target_os = "android", target_os = "ios", test))]
#[cfg_attr(not(any(target_os = "android", target_os = "ios")), allow(dead_code))]
mod poll;
#[cfg(not(any(
windows,
target_os = "macos",
target_os = "linux",
target_os = "android",
target_os = "ios"
)))]
mod stub;
#[cfg(windows)]
pub(crate) use self::win::{Watch, read_config};
#[cfg(target_os = "macos")]
pub(crate) use self::mac::{Watch, read_config};
#[cfg(target_os = "linux")]
pub(crate) use self::linux::Watch;
#[cfg(target_os = "android")]
pub(crate) use self::android::{Watch, read_config};
#[cfg(target_os = "ios")]
pub(crate) use self::ios::{Watch, read_config};
#[cfg(not(any(
windows,
target_os = "macos",
target_os = "linux",
target_os = "android",
target_os = "ios"
)))]
pub(crate) use self::stub::{Watch, read_config};
#[cfg(target_os = "linux")]
pub(crate) use self::linux::Env;
#[cfg(target_os = "linux")]
pub(crate) fn read_config_in(
_options: &crate::watch::WatchOptions,
env: &Env,
) -> Result<crate::config::ProxyConfig, crate::error::Error> {
self::linux::read_config_in(env)
}
#[cfg(target_os = "linux")]
pub(crate) fn armed_in(
options: &crate::watch::WatchOptions,
env: &Env,
) -> Result<Watch, crate::error::Error> {
Watch::armed(options, env)
}
#[cfg(not(target_os = "linux"))]
#[derive(Clone)]
pub(crate) struct Env;
#[cfg(not(target_os = "linux"))]
impl Env {
pub(crate) fn capture() -> Self {
Self
}
}
#[cfg(not(target_os = "linux"))]
pub(crate) fn read_config_in(
options: &crate::watch::WatchOptions,
_env: &Env,
) -> Result<crate::config::ProxyConfig, crate::error::Error> {
read_config(options)
}
#[cfg(not(target_os = "linux"))]
pub(crate) fn armed_in(
options: &crate::watch::WatchOptions,
_env: &Env,
) -> Result<Watch, crate::error::Error> {
Watch::armed(options)
}