Function vergen::vergen [] [src]

pub fn vergen(flags: OutputFns) -> Result<(), VergenError>

Create the version.rs file in OUT_DIR, and write three functions into it.

now

fn now() -> &'static str {
    // RFC3339 formatted string representing now (UTC)
    "2015-02-13 11:24:23.613994142-0500"
}

short_now

fn short_now() -> &'static str {
    // Short string representing now (UTC)
    "2015-04-07"
}

sha

fn sha() -> &'static str {
    // Output of the system cmd 'git rev-parse HEAD'
    "002735cb66437b96cee2a948fcdfc79d9bf96c94"
}

short_sha

fn short_sha() -> &'static str {
    // Output of the system cmd 'git rev-parse --short HEAD'
    "002735c"
}

commit_date

fn commit_date() -> &'static str {
    // Output of the system cmd
    // 'git log --pretty=format:"%ad" -n1 --date=short'
    "2015-04-07"
}

target

fn target() -> &'static str {
    // env::var("TARGET"), set by cargo
    "x86_64-unknown-linux-gnu"
}

semver

fn semver() -> &'static str {
    // Output of the system cmd 'git describe'
    // Note this works best if you create a tag
    // at each version bump named 'vX.X.X-pre'
    // and a tag at release named 'vX.X.X'
    "v0.0.1-pre-24-g002735c"
}