Struct mc_build_rs::Environment
source · 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§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more