pub const UNIX: bool = cfg!(target_family="unix");
pub const WINDOWS: bool = cfg!(target_family="windows");
pub const WASM: bool = cfg!(target_family="wasm");
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
pub struct cfg_target_family_info {
pub unix: bool,
pub windows: bool,
pub wasm: bool,
}
pub const ALL_INFO: cfg_target_family_info = all_info();
pub const fn all_info() -> cfg_target_family_info {
cfg_target_family_info {
unix: UNIX,
windows: WINDOWS,
wasm: WASM,
}
}
#[cfg(feature = "json")]
impl cfg_target_family_info {
pub fn to_json(&self) -> serde_json::Value {
serde_json::json!({
"unix": self.unix,
"windows": self.windows,
"wasm": self.wasm,
})
}
}