pub struct TargetConfiguration {
pub arch: String,
pub feature: String,
pub os: String,
pub family: String,
pub env: String,
pub endian: String,
pub pointer_width: String,
pub vendor: String,
}
Expand description
Information about the compilation target.
These parameters are derived from the CARGO_TARGET_CFG_*
environment
variables, which must be used to obtain correct results when
cross-compiling a build.rs
script. The configuration values are
uppercased when they’re loaded, to allow for case-insensitive comparisons
later.
Fields§
§arch: String
§feature: String
§os: String
§family: String
§env: String
§endian: String
§pointer_width: String
§vendor: String
Implementations§
Source§impl TargetConfiguration
impl TargetConfiguration
Sourcepub fn target_arch(&self, arch: &str) -> bool
pub fn target_arch(&self, arch: &str) -> bool
Test whether the target architecture exactly matches the argument, in case-insensitive fashion.
Sourcepub fn target_os(&self, os: &str) -> bool
pub fn target_os(&self, os: &str) -> bool
Test whether the target OS exactly matches the argument, in case-insensitive fashion.
Sourcepub fn target_family(&self, family: &str) -> bool
pub fn target_family(&self, family: &str) -> bool
Test whether the target family exactly matches the argument, in case-insensitive fashion.
Sourcepub fn target_env(&self, env: &str) -> bool
pub fn target_env(&self, env: &str) -> bool
Test whether the target “environment” exactly matches the argument, in case-insensitive fashion.
Sourcepub fn target_endian(&self, endian: &str) -> bool
pub fn target_endian(&self, endian: &str) -> bool
Test whether the target endianness exactly matches the argument, in case-insensitive fashion.
Sourcepub fn target_pointer_width(&self, pointer_width: &str) -> bool
pub fn target_pointer_width(&self, pointer_width: &str) -> bool
Test whether the target pointer width exactly matches the argument, in case-insensitive fashion.
Sourcepub fn target_vendor(&self, vendor: &str) -> bool
pub fn target_vendor(&self, vendor: &str) -> bool
Test whether the target vendor exactly matches the argument, in case-insensitive fashion.
Trait Implementations§
Source§impl Clone for TargetConfiguration
impl Clone for TargetConfiguration
Source§fn clone(&self) -> TargetConfiguration
fn clone(&self) -> TargetConfiguration
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for TargetConfiguration
impl Debug for TargetConfiguration
Source§impl Default for TargetConfiguration
impl Default for TargetConfiguration
Source§fn default() -> Self
fn default() -> Self
Creates a TargetConfiguration from the CARGO_CFG_TARGET_*
environment variables