Crate opentalk_version

Crate opentalk_version 

Source
Expand description

§opentalk-version

Collect a set of build information and make it available for printing.

§Example usage:

Add the following to your build.rs

fn main() -> anyhow::Result<()> {
    opentalk_version::collect_build_information()
}

Once this is added, you can access the build information in your crate like this:

// This adds a `build_info` module which contains a `BuildInfo` struct that
// contains all collected build information.
use build_info::BuildInfo;
use opentalk_version::InfoArgs;

opentalk_version::build_info!();

pub(super) fn print_version(args: &InfoArgs) {
    let build_info = BuildInfo::new();
    if let Some(text) = build_info.format(&args) {
        println!("{text}");
    }
}

Macros§

build_info
This macro will expand to a module build_info which contains a struct BuildInfo. The struct can be used to access build information.

Structs§

InfoArgs

Functions§

collect_build_information
Collects the information that can be used later to identify the version of this crate.