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: String
Equivalent to cfg(target_os = "..")
target_family: Option<String>
Equivalent to cfg(unix)
or cfg(windows)
target_arch: String
Equivalent to cfg(target_arch = "..")
target_endian: String
Equivalent to cfg(target_endian = "..")
target_pointer_width: String
Equivalent to cfg(target_pointer_width = "..")
target_env: String
Equivalent 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
sourceimpl 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).
Auto Trait Implementations
impl RefUnwindSafe for Cfg
impl Send for Cfg
impl Sync for Cfg
impl Unpin for Cfg
impl UnwindSafe for Cfg
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more