pub struct Sysinfo { /* private fields */ }
Expand description
Configuration for the VERGEN_SYSINFO_*
instructions
Instructions
The following instructions can be generated:
Instruction | Default |
---|---|
cargo:rustc-env=VERGEN_SYSINFO_NAME=Darwin | * |
cargo:rustc-env=VERGEN_SYSINFO_OS_VERSION=MacOS 10.15.7 Catalina | * |
cargo:rustc-env=VERGEN_SYSINFO_USER=yoda | * |
cargo:rustc-env=VERGEN_SYSINFO_TOTAL_MEMORY=16 GB | * |
cargo:rustc-env=VERGEN_SYSINFO_CPU_VENDOR=Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz | * |
cargo:rustc-env=VERGEN_SYSINFO_CPU_CORE_COUNT=4 | * |
- If the
name
field is false, theVERGEN_SYSINFO_NAME
instruction will not be generated. - If the
os_version
field is false, theVERGEN_SYSINFO_OS_VERSION
instruction will not be generated. - If the
user
field is false, theVERGEN_SYSINFO_USER
instruction will not be generated. - If the
memory
field is false, theVERGEN_SYSINFO_TOTAL_MEMORY
instruction will not be generated. - If the
cpu_vendor
field is false, theVERGEN_SYSINFO_CPU_VENDOR
instruction will not be generated. - If the
cpu_core_count
field is false, theVERGEN_SYSINFO_CPU_CORE_COUNT
instruction will not be generated. - NOTE - To keep processing other sections if an Error occurs in this one, set
Sysinfo::skip_if_error
to true.
Example
use vergen::{vergen, Config};
let mut config = Config::default();
// Turn off the name instruction
*config.sysinfo_mut().name_mut() = false;
// Generate the instructions
vergen(config)?;
Implementations§
source§impl Sysinfo
impl Sysinfo
sourcepub fn enabled_mut(&mut self) -> &mut bool
pub fn enabled_mut(&mut self) -> &mut bool
Enable/Disable the sysinfo output
sourcepub fn os_version_mut(&mut self) -> &mut bool
pub fn os_version_mut(&mut self) -> &mut bool
Enable/Disable the VERGEN_SYSINFO_OS_VERSION
instruction
sourcepub fn memory_mut(&mut self) -> &mut bool
pub fn memory_mut(&mut self) -> &mut bool
Enable/Disable the VERGEN_SYSINFO_TOTAL_MEMORY
instruction
sourcepub fn cpu_vendor_mut(&mut self) -> &mut bool
pub fn cpu_vendor_mut(&mut self) -> &mut bool
Enable/Disable the VERGEN_SYSINFO_CPU_VENDOR
instruction
sourcepub fn cpu_core_count_mut(&mut self) -> &mut bool
pub fn cpu_core_count_mut(&mut self) -> &mut bool
Enable/Disable the VERGEN_SYSINFO_CPU_CORE_COUNT
instruction
sourcepub fn cpu_name_mut(&mut self) -> &mut bool
pub fn cpu_name_mut(&mut self) -> &mut bool
Enable/Disable the VERGEN_SYSINFO_CPU_NAME
instruction
sourcepub fn cpu_brand_mut(&mut self) -> &mut bool
pub fn cpu_brand_mut(&mut self) -> &mut bool
Enable/Disable the VERGEN_SYSINFO_CPU_BRAND
instruction
sourcepub fn cpu_frequency_mut(&mut self) -> &mut bool
pub fn cpu_frequency_mut(&mut self) -> &mut bool
Enable/Disable the VERGEN_SYSINFO_CPU_FREQUENCY
instruction
sourcepub fn skip_if_error_mut(&mut self) -> &mut bool
pub fn skip_if_error_mut(&mut self) -> &mut bool
Enable/Disable skipping Sysinfo
if an Error occurs.
Use option_env!
to read the generated environment variables.