Struct CargoBuilder

Source
pub struct CargoBuilder { /* private fields */ }
Available on crate feature cargo only.
Expand description

Builder for Cargo.

Implementations§

Source§

impl CargoBuilder

Source

pub fn debug(&mut self, value: bool) -> &mut CargoBuilder

Emit the DEBUG value set by cargo

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

pub fn features(&mut self, value: bool) -> &mut CargoBuilder

Emit the CARGO_FEATURE_* values set by cargo

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

pub fn opt_level(&mut self, value: bool) -> &mut CargoBuilder

Emit the OPT_LEVEL value set by cargo

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

pub fn target_triple(&mut self, value: bool) -> &mut CargoBuilder

Emit the TARGET value set by cargo

cargo:rustc-env=VERGEN_CARGO_TARGET_TRIPLE=<target_triple>
Source

pub fn dependencies(&mut self, value: bool) -> &mut CargoBuilder

Emit the dependencies value derived from Cargo.toml

cargo:rustc-env=VERGEN_CARGO_DEPENDENCIES=<dependencies>
Source

pub fn name_filter<VALUE>(&mut self, value: VALUE) -> &mut CargoBuilder
where VALUE: Into<Option<&'static str>>,

Add a name Regex filter for cargo dependencies

cargo:rustc-env=VERGEN_CARGO_DEPENDENCIES=<deps_filtered_by_name>
Source

pub fn dep_kind_filter<VALUE>(&mut self, value: VALUE) -> &mut CargoBuilder
where VALUE: Into<Option<DependencyKind>>,

Add a DependencyKind filter for cargo dependencies

cargo:rustc-env=VERGEN_CARGO_DEPENDENCIES=<deps_filtered_by_kind>
Source

pub fn build(&self) -> Result<Cargo, CargoBuilderError>

Builds a new Cargo.

§Errors

If a required field has not been initialized.

Source§

impl CargoBuilder

Source

pub fn all_cargo() -> Result<Cargo, Error>

Emit all of the VERGEN_CARGO_* instructions

§Errors

The underlying build function can error.

Trait Implementations§

Source§

impl Clone for CargoBuilder

Source§

fn clone(&self) -> CargoBuilder

Returns a duplicate 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 Default for CargoBuilder

Source§

fn default() -> CargoBuilder

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

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 T
where 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 T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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

impl<T> ErasedDestructor for T
where T: 'static,