Struct vergen::Sysinfo

source ·
pub struct Sysinfo { /* private fields */ }
Expand description

Configuration for the VERGEN_SYSINFO_* instructions

Instructions

The following instructions can be generated:

InstructionDefault
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, the VERGEN_SYSINFO_NAME instruction will not be generated.
  • If the os_version field is false, the VERGEN_SYSINFO_OS_VERSION instruction will not be generated.
  • If the user field is false, the VERGEN_SYSINFO_USER instruction will not be generated.
  • If the memory field is false, the VERGEN_SYSINFO_TOTAL_MEMORY instruction will not be generated.
  • If the cpu_vendor field is false, the VERGEN_SYSINFO_CPU_VENDOR instruction will not be generated.
  • If the cpu_core_count field is false, the VERGEN_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

source

pub fn enabled_mut(&mut self) -> &mut bool

Enable/Disable the sysinfo output

source

pub fn name_mut(&mut self) -> &mut bool

Enable/Disable the VERGEN_SYSINFO_NAME instruction

source

pub fn os_version_mut(&mut self) -> &mut bool

Enable/Disable the VERGEN_SYSINFO_OS_VERSION instruction

source

pub fn user_mut(&mut self) -> &mut bool

Enable/Disable the VERGEN_SYSINFO_USER instruction

source

pub fn memory_mut(&mut self) -> &mut bool

Enable/Disable the VERGEN_SYSINFO_TOTAL_MEMORY instruction

source

pub fn cpu_vendor_mut(&mut self) -> &mut bool

Enable/Disable the VERGEN_SYSINFO_CPU_VENDOR instruction

source

pub fn cpu_core_count_mut(&mut self) -> &mut bool

Enable/Disable the VERGEN_SYSINFO_CPU_CORE_COUNT instruction

source

pub fn cpu_name_mut(&mut self) -> &mut bool

Enable/Disable the VERGEN_SYSINFO_CPU_NAME instruction

source

pub fn cpu_brand_mut(&mut self) -> &mut bool

Enable/Disable the VERGEN_SYSINFO_CPU_BRAND instruction

source

pub fn cpu_frequency_mut(&mut self) -> &mut bool

Enable/Disable the VERGEN_SYSINFO_CPU_FREQUENCY instruction

source

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.

Trait Implementations§

source§

impl Clone for Sysinfo

source§

fn clone(&self) -> Sysinfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Sysinfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Sysinfo

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Copy for Sysinfo

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere
T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere
T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere
T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere
U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere
T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere
U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere
U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.