Struct vergen::Rustc

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

Configuration for the VERGEN_RUSTC_* instructions

Instructions

The following instructions can be generated:

InstructionDefault
cargo:rustc-env=VERGEN_RUSTC_CHANNEL=nightly*
cargo:rustc-env=VERGEN_RUSTC_COMMIT_DATE=2021-02-10*
cargo:rustc-env=VERGEN_RUSTC_COMMIT_HASH=07194ffcd25b0871ce560b9f702e52db27ac9f77*
cargo:rustc-env=VERGEN_RUSTC_HOST_TRIPLE=x86_64-apple-darwin*
cargo:rustc-env=VERGEN_RUSTC_LLVM_VERSION=11.0*
cargo:rustc-env=VERGEN_RUSTC_SEMVER=1.52.0-nightly*
  • If the channel field is false, the VERGEN_RUSTC_CHANNEL instruction will not be generated.
  • If the commit_date field is false, the VERGEN_RUSTC_COMMIT_DATE instruction will not be generated.
  • If the host_triple field is false, the VERGEN_RUSTC_HOST_TRIPLE instruction will not be generated.
  • If the llvm_version field is false, the VERGEN_RUSTC_LLVM_VERSION instruction will not be generated.
  • If the semver field is false, the VERGEN_RUSTC_SEMVER instruction will not be generated.
  • If the sha field is false, the VERGEN_RUSTC_COMMIT_HASH instruction will not be generated.
  • NOTE - The commit_date filed is only a date, as we are restricted to the output from rustc_version
  • NOTE - The VERGEN_RUSTC_LLVM_VERSION instruction will only be generated on the nightly channel, regardless of the llvm_version field.
  • NOTE - To keep processing other sections if an Error occurs in this one, set Rustc::skip_if_error to true.

Example

use vergen::{vergen, Config};

let mut config = Config::default();
// Turn off the LLVM instruction
*config.rustc_mut().llvm_version_mut() = false;

// Generate the instructions
vergen(config)?;

Implementations§

source§

impl Rustc

source

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

Enable/Disable the rustc output

source

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

Enable/Disable the VERGEN_RUSTC_CHANNEL instruction

source

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

Enable/Disable the VERGEN_RUSTC_COMMIT_DATE instruction

source

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

Enable/Disable the VERGEN_RUSTC_HOST_TRIPLE instruction

source

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

Enable/Disable the VERGEN_RUSTC_LLVM_VERSION instruction

source

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

Enable/Disable the VERGEN_RUSTC_SEMVER instruction

source

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

Enable/Disable the VERGEN_RUSTC_COMMIT_HASH instruction

source

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

Enable/Disable skipping Rustc if an Error occurs. Use option_env! to read the generated environment variables.

Trait Implementations§

source§

impl Clone for Rustc

source§

fn clone(&self) -> Rustc

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 Rustc

source§

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

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

impl Default for Rustc

source§

fn default() -> Self

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

impl Copy for Rustc

Auto Trait Implementations§

§

impl RefUnwindSafe for Rustc

§

impl Send for Rustc

§

impl Sync for Rustc

§

impl Unpin for Rustc

§

impl UnwindSafe for Rustc

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.