macro_rules! vergen_session {
    () => { ... };
}
Expand description

Generate session object automatically by extracting data from environment variables provided by Cargo and vergen

This requires setting up a suitable build script that enables VERGEN_BUILD_TIMESTAMP (see the examples folder). If the git feature is set, the version number will also contain the short SHA hash of the current commit (this requires VERGEN_GIT_SHA).

The following build script can be used to set up the required configuration:

use vergen::EmitBuilder;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    println!("cargo:rerun-if-changed=build.rs");
    EmitBuilder::builder()
        .build_timestamp()
        .git_sha(true)
        .emit()?;
    Ok(())
}