Struct vergen::Rustc[][src]

pub struct Rustc { /* fields omitted */ }
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.

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

impl Rustc[src]

pub fn enabled_mut(&mut self) -> &mut bool[src]

Enable/Disable the rustc output

pub fn channel_mut(&mut self) -> &mut bool[src]

Enable/Disable the VERGEN_RUSTC_CHANNEL instruction

pub fn commit_date_mut(&mut self) -> &mut bool[src]

Enable/Disable the VERGEN_RUSTC_COMMIT_DATE instruction

pub fn host_triple_mut(&mut self) -> &mut bool[src]

Enable/Disable the VERGEN_RUSTC_HOST_TRIPLE instruction

pub fn llvm_version_mut(&mut self) -> &mut bool[src]

Enable/Disable the VERGEN_RUSTC_LLVM_VERSION instruction

pub fn semver_mut(&mut self) -> &mut bool[src]

Enable/Disable the VERGEN_RUSTC_SEMVER instruction

pub fn sha_mut(&mut self) -> &mut bool[src]

Enable/Disable the VERGEN_RUSTC_COMMIT_HASH instruction

Trait Implementations

impl Clone for Rustc[src]

fn clone(&self) -> Rustc[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Rustc[src]

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

Formats the value using the given formatter. Read more

impl Default for Rustc[src]

fn default() -> Self[src]

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

impl Copy for Rustc[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.