Struct vergen::Git [−][src]
Configuration for the VERGEN_GIT_*
instructions
Instructions
The following instructions can be generated:
Instruction | Default |
---|---|
cargo:rustc-env=VERGEN_GIT_BRANCH=feature/git2 | * |
cargo:rustc-env=VERGEN_GIT_COMMIT_DATE=2021-02-12 | |
cargo:rustc-env=VERGEN_GIT_COMMIT_TIME=01:54:15 | |
cargo:rustc-env=VERGEN_GIT_COMMIT_TIMESTAMP=2021-02-12T01:54:15.134750+00:00 | * |
cargo:rustc-env=VERGEN_GIT_SEMVER=v3.2.0-86-g95fc0f5d | * |
cargo:rustc-env=VERGEN_GIT_SHA=95fc0f5d066710f16e0c23ce3239d6e040abca0d | * |
cargo:rerun-if-changed=/Users/yoda/projects/rust-lang/vergen/.git/HEAD | * |
cargo:rerun-if-changed=/Users/yoda/projects/rust-lang/vergen/.git/refs/heads/feature/git2 | * |
- If the
branch
field is false, theVERGEN_GIT_BRANCH
instruction will not be generated. - If the
commit_timestamp
field is false, the date/time instructions will not be generated. - If the
rerun_on_head_changed
field is false, thecargo:rerun-if-changed
instructions will not be generated. - If the
semver
field is false, theVERGEN_GIT_SEMVER
instruction will not be generated. - If the
sha
field is fale, theVERGEN_GIT_SHA
instruction will not be generated. - NOTE - The SHA defaults to the
Normal
variant, but can be changed via thesha_kind
field. - NOTE - The SemVer defaults to the
Normal
variant, but can be changed via thesemver_kind
field. - NOTE - The SemVer is only useful if you have tags on your repository. If your repository has no tags, this will default to
CARGO_PKG_VERSION
. - NOTE - The
Lightweight
variant will only differ from theNormal
variant if you use lightweight tags in your repository. - 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. - NOTE - If the
rerun_on_head_chaged
instructions are enabled, cargowill re-run the build script when either
<gitpath>/HEADor the file that
<gitpath>/HEAD` points at changes.
Example
use vergen::{vergen, Config}; use vergen::ShaKind; let mut config = Config::default(); // Change the SHA output to the short variant *config.git_mut().sha_kind_mut() = ShaKind::Short; // Generate the instructions vergen(config)?;
Implementations
impl Git
[src]
pub fn branch_mut(&mut self) -> &mut bool
[src]
Enable/Disable the VERGEN_GIT_BRANCH
instruction
pub fn commit_timestamp_mut(&mut self) -> &mut bool
[src]
Enable/Disable the VERGEN_GIT_COMMIT_DATE
, VERGEN_GIT_COMMIT_TIME
, and VERGEN_GIT_COMMIT_TIMESTAMP
instructions
pub fn commit_timestamp_timezone_mut(&mut self) -> &mut TimeZone
[src]
The timezone to use for the date/time instructions.
pub fn commit_timestamp_kind_mut(&mut self) -> &mut TimestampKind
[src]
The kind of date/time instructions to output.
pub fn rerun_on_head_change_mut(&mut self) -> &mut bool
[src]
Enable/Disable the cargo:rerun-if-changed
instructions
pub fn semver_mut(&mut self) -> &mut bool
[src]
Enable/Disable the VERGEN_GIT_SEMVER
instruction
pub fn semver_kind_mut(&mut self) -> &mut SemverKind
[src]
The kind of semver instruction to output.
pub fn sha_mut(&mut self) -> &mut bool
[src]
Enable/Disable the VERGEN_GIT_SHA
instruction
pub fn sha_kind_mut(&mut self) -> &mut ShaKind
[src]
The kind of SHA instruction to output.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Git
impl Send for Git
impl Sync for Git
impl Unpin for Git
impl UnwindSafe for Git
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
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]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,