Skip to main content

Crate rskit_version

Crate rskit_version 

Source
Expand description

Build-time version and git metadata for rskit.

Version, git commit, branch, and build time are captured at compile time via a build.rs script that runs git commands and emits cargo:rustc-env variables. The build timestamp is captured as a Unix epoch and formatted to RFC 3339 by the library, avoiding any external date command.

§Quick Start

use rskit_version::{get_version_info, get_short_version, get_full_version, is_release};

let info = get_version_info();
println!("{}", info.version);      // e.g. "0.1.0-alpha.1"
println!("{}", info.git_commit);   // e.g. "a1b2c3d..."
println!("{}", get_short_version()); // "0.1.0-alpha.1-a1b2c3d"
println!("{}", get_full_version()); // "0.1.0-alpha.1-a1b2c3d (built 2024-01-15T10:30:00Z)"

Modules§

schema
Schema-version compatibility gating.
semver
Semantic version parsing and requirement helpers.

Structs§

VersionInfo
Immutable snapshot of build/version metadata. Compatible with gokit and pykit VersionInfo.

Functions§

get_full_version
Returns a detailed version string with optional branch and build time.
get_short_version
Returns a concise version string: {version}[-{short_commit}].
get_version_info
Returns comprehensive version information collected at compile time.
is_release
Returns true when this build represents a release (not dev, not dirty).
package_semver
Return the Cargo package version parsed as a semantic version, if valid.
package_version
Return the Cargo package version for this crate.