Struct vergen::EmitBuilder

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

Build the vergen configuration to enable specific cargo instruction output

Implementations§

source§

impl EmitBuilder

source

pub fn builder() -> Self

Instantiate the builder to configure the cargo instruction emits

source

pub fn idempotent(&mut self) -> &mut Self

Enable the idempotent feature

NOTE - This feature can also be enabled via the VERGEN_IDEMPOTENT environment variable.

When this feature is enabled, certain vergen output (i.e. timestamps, sysinfo) will be set to an idempotent default. This will allow systems that depend on deterministic builds to override user requested vergen impurities. This will mainly allow for package maintainers to build packages that depend on vergen in a deterministic manner.

See this issue for more details

VariableSample
VERGEN_BUILD_DATEVERGEN_IDEMPOTENT_OUTPUT
VERGEN_BUILD_TIMESTAMPVERGEN_IDEMPOTENT_OUTPUT
Example
EmitBuilder::builder().idempotent().all_build().emit()?;
// or
env::set_var("VERGEN_IDEMPOTENT", "true");
EmitBuilder::builder().all_build().emit()?;
source

pub fn fail_on_error(&mut self) -> &mut Self

Enable the fail_on_error feature

By default vergen will emit the instructions you requested. If for some reason those instructions cannot be generated correctly, placeholder values will be used instead. vergen will also emit cargo:warning instructions notifying you this has happened.

For example, if you configure vergen to emit VERGEN_GIT_* instructions and you run a build from a source tarball with no .git directory, the instructions will be populated with placeholder values, rather than information gleaned through git.

You can turn off this behavior by enabling fail_on_error.

Example
EmitBuilder::builder().fail_on_error().all_build().emit()?;
source

pub fn custom_build_rs(&mut self, path: &'static str) -> &mut Self

Set a custom build.rs path if you are using a non-standard path

By default vergen will use build.rs as the build path for the cargo:rerun-if-changed emit. You can specify a custom build.rs path here if you have changed this default

Example
EmitBuilder::builder().custom_build_rs("my/custom/build.rs").all_build().emit()?;
source

pub fn quiet(&mut self) -> &mut Self

Enable the quiet feature

Suppress the emission of the cargo:warning instructions.

Example
EmitBuilder::builder().quiet().all_build().emit()?;
source

pub fn disable_build(&mut self) -> &mut Self

Disable the build output, even when the build feature is enabled.

Example
EmitBuilder::builder().all_build().disable_build().emit()?;
source

pub fn disable_cargo(&mut self) -> &mut Self

Disable the cargo output, even when the cargo feature is enabled.

Example
EmitBuilder::builder().all_cargo().disable_cargo().emit()?;
source

pub fn disable_git(&mut self) -> &mut Self

Disable the git output, even when the git feature is enabled.

Example
EmitBuilder::builder().all_git().disable_git().emit()?;
source

pub fn disable_rustc(&mut self) -> &mut Self

Disable the rustc output, even when the rustc feature is enabled.

Example
EmitBuilder::builder().all_rustc().disable_rustc().emit()?;
source

pub fn disable_sysinfo(&mut self) -> &mut Self

Disable the sysinfo output, even when the sysinfo feature is enabled.

Example
EmitBuilder::builder().all_sysinfo().disable_sysinfo().emit()?;
source

pub fn emit(self) -> Result<()>

Emit cargo instructions from your build script

Errors
Example
EmitBuilder::builder()
  .all_build()
  .all_cargo()
  .all_git()
  .all_rustc()
  .all_sysinfo()
  .emit()?;
Sample Output

NOTE - You won’t see this output unless you invoke cargo with the -vv flag. The instruction output is not displayed by default.

cargo:rustc-env=VERGEN_BUILD_DATE=2023-01-04
cargo:rustc-env=VERGEN_BUILD_TIMESTAMP=2023-01-04T15:38:11.097507114Z
cargo:rustc-env=VERGEN_CARGO_DEBUG=true
cargo:rustc-env=VERGEN_CARGO_FEATURES=build,git
cargo:rustc-env=VERGEN_CARGO_OPT_LEVEL=1
cargo:rustc-env=VERGEN_CARGO_TARGET_TRIPLE=x86_64-unknown-linux-gnu
cargo:rustc-env=VERGEN_GIT_BRANCH=feature/version8
cargo:rustc-env=VERGEN_GIT_COMMIT_AUTHOR_EMAIL=your@email.com
cargo:rustc-env=VERGEN_GIT_COMMIT_AUTHOR_NAME=Yoda
cargo:rustc-env=VERGEN_GIT_COMMIT_COUNT=476
cargo:rustc-env=VERGEN_GIT_COMMIT_DATE=2023-01-03
cargo:rustc-env=VERGEN_GIT_COMMIT_MESSAGE=The best message
cargo:rustc-env=VERGEN_GIT_COMMIT_TIMESTAMP=2023-01-03T14:08:12.000000000-05:00
cargo:rustc-env=VERGEN_GIT_DESCRIBE=7.4.4-103-g53ae8a6
cargo:rustc-env=VERGEN_GIT_SHA=53ae8a69ab7917a2909af40f2e5d015f5b29ae28
cargo:rustc-env=VERGEN_RUSTC_CHANNEL=nightly
cargo:rustc-env=VERGEN_RUSTC_COMMIT_DATE=2023-01-03
cargo:rustc-env=VERGEN_RUSTC_COMMIT_HASH=c7572670a1302f5c7e245d069200e22da9df0316
cargo:rustc-env=VERGEN_RUSTC_HOST_TRIPLE=x86_64-unknown-linux-gnu
cargo:rustc-env=VERGEN_RUSTC_LLVM_VERSION=15.0
cargo:rustc-env=VERGEN_RUSTC_SEMVER=1.68.0-nightly
cargo:rustc-env=VERGEN_SYSINFO_NAME=Arch Linux
cargo:rustc-env=VERGEN_SYSINFO_OS_VERSION=Linux  Arch Linux
cargo:rustc-env=VERGEN_SYSINFO_USER=jozias
cargo:rustc-env=VERGEN_SYSINFO_TOTAL_MEMORY=31 GiB
cargo:rustc-env=VERGEN_SYSINFO_CPU_VENDOR=AuthenticAMD
cargo:rustc-env=VERGEN_SYSINFO_CPU_CORE_COUNT=8
cargo:rustc-env=VERGEN_SYSINFO_CPU_NAME=cpu0,cpu1,cpu2,cpu3,cpu4,cpu5,cpu6,cpu7
cargo:rustc-env=VERGEN_SYSINFO_CPU_BRAND=AMD Ryzen Threadripper 1900X 8-Core Processor
cargo:rustc-env=VERGEN_SYSINFO_CPU_FREQUENCY=3792
cargo:rerun-if-changed=.git/HEAD
cargo:rerun-if-changed=.git/refs/heads/feature/version8
cargo:rerun-if-changed=build.rs
cargo:rerun-if-env-changed=VERGEN_IDEMPOTENT
cargo:rerun-if-env-changed=SOURCE_DATE_EPOCH
source

pub fn emit_and_set(self) -> Result<()>

Emit cargo instructions from your build script and set environment variables for use in build.rs

Errors
Example
EmitBuilder::builder()
  .all_build()
  .all_cargo()
  .all_git()
  .all_rustc()
  .all_sysinfo()
  .emit_and_set()?;
source§

impl EmitBuilder

The VERGEN_BUILD_* configuration features

VariableSample
VERGEN_BUILD_DATE2021-02-25
VERGEN_BUILD_TIMESTAMP2021-02-25T23:28:39.493201+00:00

Example

Emit all of the build instructions

EmitBuilder::builder().all_build().emit()?;

Emit some of the build instructions

EmitBuilder::builder().build_timestamp().emit()?;

Override output with your own value

env::set_var("VERGEN_BUILD_DATE", "this is the date I want output");
EmitBuilder::builder().build_date().emit()?;

Example

This feature can also be used in conjuction with the SOURCE_DATE_EPOCH environment variable to generate deterministic timestamps based off the last modification time of the source/package

env::set_var("SOURCE_DATE_EPOCH", "1671809360");
EmitBuilder::builder().all_build().emit()?;

The above will always generate the following output for the timestamp related instructions

cargo:rustc-env=VERGEN_BUILD_DATE=2022-12-23
cargo:rustc-env=VERGEN_BUILD_TIMESTAMP=2022-12-23T15:29:20.000000000Z

Example

This feature also recognizes the idempotent flag.

NOTE - SOURCE_DATE_EPOCH takes precedence over the idempotent flag. If you use both, the output will be based off SOURCE_DATE_EPOCH. This would still be deterministic.

EmitBuilder::builder().idempotent().all_build().emit()?;

The above will always generate the following output for the timestamp related instructions

cargo:rustc-env=VERGEN_BUILD_DATE=VERGEN_IDEMPOTENT_OUTPUT
cargo:rustc-env=VERGEN_BUILD_TIMESTAMP=VERGEN_IDEMPOTENT_OUTPUT
cargo:warning=VERGEN_BUILD_DATE set to default
cargo:warning=VERGEN_BUILD_TIMESTAMP set to default
cargo:rerun-if-changed=build.rs
cargo:rerun-if-env-changed=VERGEN_IDEMPOTENT
cargo:rerun-if-env-changed=SOURCE_DATE_EPOCH
source

pub fn all_build(&mut self) -> &mut Self

Available on crate feature build only.

Enable all of the VERGEN_BUILD_* options

source

pub fn build_date(&mut self) -> &mut Self

Available on crate feature build only.

Enable the VERGEN_BUILD_DATE date output

source

pub fn build_timestamp(&mut self) -> &mut Self

Available on crate feature build only.

Enable the VERGEN_BUILD_TIMESTAMP date output

source

pub fn use_local_build(&mut self) -> &mut Self

Available on crate feature build only.

Enable local offset date/timestamp output

source§

impl EmitBuilder

Copnfigure the emission of VERGEN_CARGO_* instructions

NOTE - All cargo instructions are considered deterministic. If you change the version of cargo you are compiling with, these values should change if being used in the generated binary.

VariableSample
VERGEN_CARGO_DEBUGtrue
VERGEN_CARGO_FEATURESgit,build
VERGEN_CARGO_OPT_LEVEL1
VERGEN_CARGO_TARGET_TRIPLEx86_64-unknown-linux-gnu

Example

Emit all of the cargo instructions

EmitBuilder::builder().all_cargo().emit()?;

Emit some of the cargo instructions

EmitBuilder::builder().cargo_debug().cargo_opt_level().emit()?;

Override output with your own value

env::set_var("VERGEN_CARGO_DEBUG", "this is the debug I want output");
EmitBuilder::builder().all_cargo().emit()?;
source

pub fn all_cargo(&mut self) -> &mut Self

Available on crate feature cargo only.

Emit all of the VERGEN_CARGO_* instructions

source

pub fn cargo_debug(&mut self) -> &mut Self

Available on crate feature cargo only.

Emit the DEBUG value set by cargo

cargo:rustc-env=VERGEN_CARGO_DEBUG=true|false
source

pub fn cargo_features(&mut self) -> &mut Self

Available on crate feature cargo only.

Emit the CARGO_FEATURE_* values set by cargo

cargo:rustc-env=VERGEN_CARGO_FEATURES=<features>
source

pub fn cargo_opt_level(&mut self) -> &mut Self

Available on crate feature cargo only.

Emit the OPT_LEVEL value set by cargo

cargo:rustc-env=VERGEN_CARGO_OPT_LEVEL=<opt_level>
source

pub fn cargo_target_triple(&mut self) -> &mut Self

Available on crate feature cargo only.

Emit the TARGET value set by cargo

cargo:rustc-env=VERGEN_CARGO_TARGET_TRIPLE=<target_triple>
source§

impl EmitBuilder

The VERGEN_GIT_* configuration features

VariableSample
VERGEN_GIT_BRANCHfeature/fun
VERGEN_GIT_COMMIT_AUTHOR_EMAILjanedoe@email.com
VERGEN_GIT_COMMIT_AUTHOR_NAMEJane Doe
VERGEN_GIT_COMMIT_COUNT330
VERGEN_GIT_COMMIT_DATE2021-02-24
VERGEN_GIT_COMMIT_MESSAGEfeat: add commit messages
VERGEN_GIT_COMMIT_TIMESTAMP2021-02-24T20:55:21+00:00
VERGEN_GIT_DESCRIBE5.0.0-2-gf49246c
VERGEN_GIT_SHAf49246ce334567bff9f950bfd0f3078184a2738a

Example

Emit all of the git instructions

EmitBuilder::builder().all_git().emit()?;

Emit some of the git instructions

EmitBuilder::builder().git_describe(true, false, None).emit()?;

Override output with your own value

env::set_var("VERGEN_GIT_BRANCH", "this is the branch I want output");
EmitBuilder::builder().all_git().emit()?;

Example

This feature can also be used in conjuction with the SOURCE_DATE_EPOCH environment variable to generate deterministic timestamps based off the last modification time of the source/package

env::set_var("SOURCE_DATE_EPOCH", "1671809360");
EmitBuilder::builder().all_git().emit()?;

The above will always generate the following output for the timestamp related instructions

...
cargo:rustc-env=VERGEN_GIT_COMMIT_DATE=2022-12-23
...
cargo:rustc-env=VERGEN_GIT_COMMIT_TIMESTAMP=2022-12-23T15:29:20.000000000Z
...

Example

This feature also recognizes the idempotent flag.

NOTE - SOURCE_DATE_EPOCH takes precedence over the idempotent flag. If you use both, the output will be based off SOURCE_DATE_EPOCH. This would still be deterministic.

Example

EmitBuilder::builder().idempotent().all_git().emit()?;

The above will always generate the following instructions

cargo:rustc-env=VERGEN_GIT_BRANCH=VERGEN_IDEMPOTENT_OUTPUT
cargo:rustc-env=VERGEN_GIT_COMMIT_AUTHOR_EMAIL=VERGEN_IDEMPOTENT_OUTPUT
cargo:rustc-env=VERGEN_GIT_COMMIT_AUTHOR_NAME=VERGEN_IDEMPOTENT_OUTPUT
cargo:rustc-env=VERGEN_GIT_COMMIT_COUNT=VERGEN_IDEMPOTENT_OUTPUT
cargo:rustc-env=VERGEN_GIT_COMMIT_DATE=VERGEN_IDEMPOTENT_OUTPUT
cargo:rustc-env=VERGEN_GIT_COMMIT_MESSAGE=VERGEN_IDEMPOTENT_OUTPUT
cargo:rustc-env=VERGEN_GIT_COMMIT_TIMESTAMP=VERGEN_IDEMPOTENT_OUTPUT
cargo:rustc-env=VERGEN_GIT_DESCRIBE=VERGEN_IDEMPOTENT_OUTPUT
cargo:rustc-env=VERGEN_GIT_SHA=VERGEN_IDEMPOTENT_OUTPUT
cargo:warning=VERGEN_GIT_BRANCH set to default
cargo:warning=VERGEN_GIT_COMMIT_AUTHOR_EMAIL set to default
cargo:warning=VERGEN_GIT_COMMIT_AUTHOR_NAME set to default
cargo:warning=VERGEN_GIT_COMMIT_COUNT set to default
cargo:warning=VERGEN_GIT_COMMIT_DATE set to default
cargo:warning=VERGEN_GIT_COMMIT_MESSAGE set to default
cargo:warning=VERGEN_GIT_COMMIT_TIMESTAMP set to default
cargo:warning=VERGEN_GIT_DESCRIBE set to default
cargo:warning=VERGEN_GIT_SHA set to default
cargo:rerun-if-changed=build.rs
cargo:rerun-if-env-changed=VERGEN_IDEMPOTENT
cargo:rerun-if-env-changed=SOURCE_DATE_EPOCH
source

pub fn all_git(&mut self) -> &mut Self

Available on crate feature git only.

Emit all of the VERGEN_GIT_* instructions

source

pub fn git_branch(&mut self) -> &mut Self

Available on crate feature git only.

Emit the current git branch

cargo:rustc-env=VERGEN_GIT_BRANCH=<BRANCH_NAME>

The value is determined with the following command

git rev-parse --abbrev-ref --symbolic-full-name HEAD
source

pub fn git_commit_author_email(&mut self) -> &mut Self

Available on crate feature git only.

Emit the author email of the most recent commit

cargo:rustc-env=VERGEN_GIT_COMMIT_AUTHOR_EMAIL=<AUTHOR_EMAIL>

The value is determined with the following command

git log -1 --pretty=format:'%ae'
source

pub fn git_commit_author_name(&mut self) -> &mut Self

Available on crate feature git only.

Emit the author name of the most recent commit

cargo:rustc-env=VERGEN_GIT_COMMIT_AUTHOR_NAME=<AUTHOR_NAME>

The value is determined with the following command

git log -1 --pretty=format:'%an'
source

pub fn git_commit_count(&mut self) -> &mut Self

Available on crate feature git only.

Emit the total commit count to HEAD

cargo:rustc-env=VERGEN_GIT_COMMIT_COUNT=<COUNT>

The value is determined with the following command

git rev-list --count HEAD
source

pub fn git_commit_date(&mut self) -> &mut Self

Available on crate feature git only.

Emit the commit date of the latest commit

cargo:rustc-env=VERGEN_GIT_COMMIT_DATE=<YYYY-MM-DD>

The value is determined with the following command

git log -1 --pretty=format:'%cs'
source

pub fn git_commit_message(&mut self) -> &mut Self

Available on crate feature git only.

Emit the commit message of the latest commit

cargo:rustc-env=VERGEN_GIT_COMMIT_MESSAGE=<MESSAGE>

The value is determined with the following command

git log -1 --format=%s
source

pub fn git_commit_timestamp(&mut self) -> &mut Self

Available on crate feature git only.

Emit the commit timestamp of the latest commit

cargo:rustc-env=VERGEN_GIT_COMMIT_TIMESTAMP=<YYYY-MM-DDThh:mm:ssZ>

The value is determined with the following command

git log -1 --pretty=format:'%cI'
source

pub fn git_describe( &mut self, dirty: bool, tags: bool, match_pattern: Option<&'static str> ) -> &mut Self

Available on crate feature git only.

Emit the describe output

cargo:rustc-env=VERGEN_GIT_DESCRIBE=<DESCRIBE>

The value is determined with the following command

git describe --always

Optionally, add the dirty, tags, or match flag to describe. See git describe for more details

source

pub fn git_sha(&mut self, short: bool) -> &mut Self

Available on crate feature git only.

Emit the SHA of the latest commit

cargo:rustc-env=VERGEN_GIT_SHA=<SHA>

The value is determined with the following command

git rev-parse HEAD

Optionally, add the short flag to rev-parse. See git rev-parse for more details.

source

pub fn git_cmd(&mut self, cmd: Option<&'static str>) -> &mut Self

Available on crate feature git only.

Set the command used to test if git exists on the path. Defaults to git --version if not set explicitly.

source

pub fn use_local_git(&mut self) -> &mut Self

Available on crate feature git only.

Enable local offset date/timestamp output

source§

impl EmitBuilder

The VERGEN_RUSTC_* configuration features

NOTE - All rustc instructions are considered deterministic. If you change the version of rustc you are compiling with, these values should change if being used in the generated binary.

VariableSample
VERGEN_RUSTC_CHANNELnightly
VERGEN_RUSTC_COMMIT_DATE2021-02-24
VERGEN_RUSTC_COMMIT_HASHa8486b64b0c87dabd045453b6c81500015d122d6
VERGEN_RUSTC_HOST_TRIPLEx86_64-apple-darwin
VERGEN_RUSTC_LLVM_VERSION11.0
VERGEN_RUSTC_SEMVER1.52.0-nightly

Example

Emit all of the rustc instructions

EmitBuilder::builder().all_rustc().emit()?;

Emit some of the rustc instructions

EmitBuilder::builder()
    .rustc_channel()
    .rustc_semver()
    .emit()?;

Override output with your own value

env::set_var("VERGEN_RUSTC_CHANNEL", "this is the channel I want output");
EmitBuilder::builder().all_rustc().emit()?;
source

pub fn all_rustc(&mut self) -> &mut Self

Available on crate feature rustc only.

Enable all of the VERGEN_RUSTC_* options

source

pub fn rustc_channel(&mut self) -> &mut Self

Available on crate feature rustc only.

Enable the rustc channel

source

pub fn rustc_commit_date(&mut self) -> &mut Self

Available on crate feature rustc only.

Enable the rustc commit date

source

pub fn rustc_commit_hash(&mut self) -> &mut Self

Available on crate feature rustc only.

Enable the rustc SHA

source

pub fn rustc_host_triple(&mut self) -> &mut Self

Available on crate feature rustc only.

Enable rustc host triple

source

pub fn rustc_llvm_version(&mut self) -> &mut Self

Available on crate feature rustc only.

Enable rustc LLVM version

source

pub fn rustc_semver(&mut self) -> &mut Self

Available on crate feature rustc only.

Enable the rustc semver

source§

impl EmitBuilder

The VERGEN_SYSINFO_* configuration features

VariableSample
VERGEN_SYSINFO_NAMEManjaro Linux
VERGEN_SYSINFO_OS_VERSIONLinux Manjaro Linux
VERGEN_SYSINFO_USERYoda
VERGEN_SYSINFO_TOTAL_MEMORY33 GB
VERGEN_SYSINFO_CPU_VENDORAuthentic AMD
VERGEN_SYSINFO_CPU_CORE_COUNT8
VERGEN_SYSINFO_CPU_NAMEcpu0,cpu1,cpu2,cpu3,cpu4,cpu5,cpu6,cpu7
VERGEN_SYSINFO_CPU_BRANDAMD Ryzen Threadripper 1900X 8-Core Processor
VERGEN_SYSINFO_CPU_FREQUENCY3792

Example

Emit all sysinfo instructions

EmitBuilder::builder().all_sysinfo().emit()?;

Emit some of the sysinfo instructions

EmitBuilder::builder()
    .sysinfo_os_version()
    .sysinfo_cpu_core_count()
    .emit()?;

Override output with your own value

env::set_var("VERGEN_SYSINFO_NAME", "this is the name I want output");
EmitBuilder::builder().all_sysinfo().emit()?;

Example

This feature also recognizes the idempotent flag.

EmitBuilder::builder().idempotent().all_sysinfo().emit()?;

The above will always generate the following output

cargo:rustc-env=VERGEN_SYSINFO_NAME=VERGEN_IDEMPOTENT_OUTPUT
cargo:rustc-env=VERGEN_SYSINFO_OS_VERSION=VERGEN_IDEMPOTENT_OUTPUT
cargo:rustc-env=VERGEN_SYSINFO_USER=VERGEN_IDEMPOTENT_OUTPUT
cargo:rustc-env=VERGEN_SYSINFO_TOTAL_MEMORY=VERGEN_IDEMPOTENT_OUTPUT
cargo:rustc-env=VERGEN_SYSINFO_CPU_VENDOR=VERGEN_IDEMPOTENT_OUTPUT
cargo:rustc-env=VERGEN_SYSINFO_CPU_CORE_COUNT=VERGEN_IDEMPOTENT_OUTPUT
cargo:rustc-env=VERGEN_SYSINFO_CPU_NAME=VERGEN_IDEMPOTENT_OUTPUT
cargo:rustc-env=VERGEN_SYSINFO_CPU_BRAND=VERGEN_IDEMPOTENT_OUTPUT
cargo:rustc-env=VERGEN_SYSINFO_CPU_FREQUENCY=VERGEN_IDEMPOTENT_OUTPUT
cargo:warning=VERGEN_SYSINFO_NAME set to default
cargo:warning=VERGEN_SYSINFO_OS_VERSION set to default
cargo:warning=VERGEN_SYSINFO_USER set to default
cargo:warning=VERGEN_SYSINFO_TOTAL_MEMORY set to default
cargo:warning=VERGEN_SYSINFO_CPU_VENDOR set to default
cargo:warning=VERGEN_SYSINFO_CPU_CORE_COUNT set to default
cargo:warning=VERGEN_SYSINFO_CPU_NAME set to default
cargo:warning=VERGEN_SYSINFO_CPU_BRAND set to default
cargo:warning=VERGEN_SYSINFO_CPU_FREQUENCY set to default
cargo:rerun-if-changed=build.rs
cargo:rerun-if-env-changed=VERGEN_IDEMPOTENT
cargo:rerun-if-env-changed=SOURCE_DATE_EPOCH
source

pub fn all_sysinfo(&mut self) -> &mut Self

Available on crate feature si only.

Enable all of the VERGEN_SYSINFO_* options

source

pub fn sysinfo_name(&mut self) -> &mut Self

Available on crate feature si only.

Enable the sysinfo name

source

pub fn sysinfo_os_version(&mut self) -> &mut Self

Available on crate feature si only.

Enable the sysinfo OS version

source

pub fn sysinfo_user(&mut self) -> &mut Self

Available on crate feature si only.

Enable sysinfo user

source

pub fn sysinfo_memory(&mut self) -> &mut Self

Available on crate feature si only.

Enable sysinfo memory

source

pub fn sysinfo_cpu_vendor(&mut self) -> &mut Self

Available on crate feature si only.

Enable sysinfo cpu vendor

source

pub fn sysinfo_cpu_core_count(&mut self) -> &mut Self

Available on crate feature si only.

Enable sysinfo cpu core count

source

pub fn sysinfo_cpu_name(&mut self) -> &mut Self

Available on crate feature si only.

Enable sysinfo cpu name

source

pub fn sysinfo_cpu_brand(&mut self) -> &mut Self

Available on crate feature si only.

Enable sysinfo cpu brand

source

pub fn sysinfo_cpu_frequency(&mut self) -> &mut Self

Available on crate feature si only.

Enable sysinfo cpu frequency

Trait Implementations§

source§

impl Clone for EmitBuilder

source§

fn clone(&self) -> EmitBuilder

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 EmitBuilder

source§

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

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

impl Copy for EmitBuilder

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,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

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.
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.
source§

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

Performs the conversion.