pub struct Environment { /* private fields */ }
Expand description
A description of the current build environment
Implementations§
Source§impl Environment
impl Environment
Sourcepub fn new() -> Result<Environment, EnvironmentError>
pub fn new() -> Result<Environment, EnvironmentError>
Construct a new build configuration structure, or die trying.
Sourcepub fn features(&self) -> HashSetIter<'_, String>
pub fn features(&self) -> HashSetIter<'_, String>
Get a reference to a hash set of enabled cargo features (as
lower-kebab-case
strings)
Sourcepub fn feature(&self, feature: &str) -> bool
pub fn feature(&self, feature: &str) -> bool
Get whether a feature is enabled or not.
Feature names are normalized into lower-kebab-case
(as opposed to
UPPER_SNAKE_CASE
).
Sourcepub fn depvars(&self) -> HashMapIter<'_, String, String>
pub fn depvars(&self) -> HashMapIter<'_, String, String>
Get a reference to a hash map of variables injected by the current crate’s dependencies
Sourcepub fn depvar(&self, var: &str) -> Option<&str>
pub fn depvar(&self, var: &str) -> Option<&str>
Get the contents of a particular depvar, if one is provided.
Sourcepub fn version_major(&self) -> u64
pub fn version_major(&self) -> u64
Get the package version major number
Sourcepub fn version_minor(&self) -> u64
pub fn version_minor(&self) -> u64
Get the package version minor number
Sourcepub fn version_patch(&self) -> u64
pub fn version_patch(&self) -> u64
Get the package version patch number
Sourcepub fn version_pre(&self) -> Option<String>
pub fn version_pre(&self) -> Option<String>
Get the package version pre-release number
Get a reference to a hash set of package author strings
Sourcepub fn description(&self) -> &str
pub fn description(&self) -> &str
Get the description of the current package
Sourcepub fn repository(&self) -> &str
pub fn repository(&self) -> &str
Get the repository of the current package
Sourcepub fn debug_assertions(&self) -> bool
pub fn debug_assertions(&self) -> bool
Get whether or not debug assertions are enabled in this build
Sourcepub fn proc_macro(&self) -> bool
pub fn proc_macro(&self) -> bool
Get whether or not proc macros are enabled in this build
Sourcepub fn target_arch(&self) -> &str
pub fn target_arch(&self) -> &str
Get the target architecture
Sourcepub fn target_endian(&self) -> Endianness
pub fn target_endian(&self) -> Endianness
Get the endianness
Sourcepub fn target_env(&self) -> &str
pub fn target_env(&self) -> &str
Get the target environment
Sourcepub fn target_family(&self) -> TargetFamily
pub fn target_family(&self) -> TargetFamily
Get the target architecture family
Sourcepub fn target_features(&self) -> &HashSet<String>
pub fn target_features(&self) -> &HashSet<String>
Get a reference to the target feature set
Sourcepub fn target_has_atomic(&self) -> &HashSet<String>
pub fn target_has_atomic(&self) -> &HashSet<String>
Get a list of types which support atomic operations on the target platform
Sourcepub fn target_has_atomic_load_store(&self) -> &HashSet<String>
pub fn target_has_atomic_load_store(&self) -> &HashSet<String>
Get a list of types which support atomic load and store
Sourcepub fn target_pointer_width(&self) -> usize
pub fn target_pointer_width(&self) -> usize
Get the target pointer width
Sourcepub fn target_thread_local(&self) -> bool
pub fn target_thread_local(&self) -> bool
Get whether thread-local storage is available
Sourcepub fn target_vendor(&self) -> &str
pub fn target_vendor(&self) -> &str
Get the target triple vendor
Sourcepub fn target_dir(&self) -> &Path
pub fn target_dir(&self) -> &Path
Get the target directory (i.e. the --target-dir
flag)
Sourcepub fn profile_target_dir(&self) -> &Path
pub fn profile_target_dir(&self) -> &Path
Get the profile target directory
Trait Implementations§
Source§impl Clone for Environment
impl Clone for Environment
Source§fn clone(&self) -> Environment
fn clone(&self) -> Environment
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read more