pub struct Cfg {
pub target_os: String,
pub target_family: Option<String>,
pub target_arch: String,
pub target_endian: String,
pub target_pointer_width: String,
pub target_env: String,
pub target_vendor: Option<String>,
pub target_has_atomic: Vec<String>,
pub target_feature: Vec<String>,
/* private fields */
}Expand description
The result of parsing the output of rustc --print cfg
Fields§
§target_os: StringEquivalent to cfg(target_os = "..")
target_family: Option<String>Equivalent to cfg(unix) or cfg(windows)
target_arch: StringEquivalent to cfg(target_arch = "..")
target_endian: StringEquivalent to cfg(target_endian = "..")
target_pointer_width: StringEquivalent to cfg(target_pointer_width = "..")
target_env: StringEquivalent to cfg(target_env = "..")
target_vendor: Option<String>Equivalent to cfg(target_vendor = "..").
target_has_atomic: Vec<String>Equivalent to cfg(target_has_atomic = "..")
target_feature: Vec<String>Equivalent to cfg(target_feature = "..")
Implementations§
Source§impl Cfg
impl Cfg
Sourcepub fn of(target: &str) -> Result<Cfg, Error>
pub fn of(target: &str) -> Result<Cfg, Error>
Runs rustc --target <target> --print cfg and returns the parsed output.
The target should be a “triple” from the list of supported rustc
targets. A list of supported rustc targets can be obtained using the
rustc --print target-list command. This should not be confused with
Cargo targets, i.e. binaries, [[bin]] and a library [lib] define in
a package’s manifest (Cargo.toml).