pub struct Build { /* private fields */ }
Expand description

Configuration for the VERGEN_BUILD_* instructions

Instructions

The following instructions can be generated:

InstructionDefault
cargo:rustc-env=VERGEN_BUILD_DATE=2021-02-12
cargo:rustc-env=VERGEN_BUILD_TIME=11:22:34
cargo:rustc-env=VERGEN_BUILD_TIMESTAMP=2021-02-12T01:54:15.134750+00:00*
cargo:rustc-env=VERGEN_BUILD_SEMVER=4.2.0*
  • If the timestamp field is false, the date/time instructions will not be generated.
  • If the semver field is false, the semver instruction will not be generated.
  • NOTE - By default, the date/time related instructions will use UTC.
  • NOTE - The date/time instruction output is determined by the kind field and can be any combination of the three.

Example

use vergen::{vergen, Config};
use vergen::TimestampKind;

let mut config = Config::default();
// Generate all three date/time instructions
*config.build_mut().kind_mut() = TimestampKind::All;

// Generate the instructions
vergen(config)?;

Implementations

Enable/Disable the build output

Enable/Disable the VERGEN_BUILD_DATE, VERGEN_BUILD_TIME, and VERGEN_BUILD_TIMESTAMP instructions.

The timezone to use for the date/time instructions.

The kind of date/time instructions to output.

Enable/Disable the VERGEN_BUILD_SEMVER instruction.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

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

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.