Struct vergen::Cargo

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

Configuration for the VERGEN_CARGO_* instructions

Instructions

The following instructions can be generated:

InstructionDefault
cargo:rustc-env=VERGEN_CARGO_TARGET_TRIPLE=x86_64-unknown-linux-gnu*
cargo:rustc-env=VERGEN_CARGO_PROFILE=debug*
cargo:rustc-env=VERGEN_CARGO_FEATURES=git,build*
  • If the features field is false, the features instruction will not be generated.
  • If the profile field is false, the profile instruction will not be generated.
  • If the target_triple field is false, the target triple instruction will not be generated.
  • NOTE - the target_triple instruction can differ from the host_triple instruction, i.e. during cross compilation

Example

use vergen::{vergen, Config};

let mut config = Config::default();
// Turn off the features instruction
*config.cargo_mut().features_mut() = false;

// Generate the instructions
vergen(config)?;

Implementations§

source§

impl Cargo

source

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

Enable/Disable the cargo output

source

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

Enable/Disable the VERGEN_CARGO_FEATURES instruction

source

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

Enable/Disable the VERGEN_CARGO_PROFILE instruction

source

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

Enable/Disable the VERGEN_CARGO_TARGET_TRIPLE instruction

Trait Implementations§

source§

impl Clone for Cargo

source§

fn clone(&self) -> Cargo

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 Cargo

source§

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

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

impl Default for Cargo

source§

fn default() -> Self

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

impl Copy for Cargo

Auto Trait Implementations§

§

impl RefUnwindSafe for Cargo

§

impl Send for Cargo

§

impl Sync for Cargo

§

impl Unpin for Cargo

§

impl UnwindSafe for Cargo

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.