rskit-version
Build-time version and git metadata for rskit, captured at compile time via build.rs.
Installation
[]
= { = "../rskit-version" }
Quick Start
use ;
How It Works
The build.rs script runs at compile time to capture:
| Variable | Source |
|---|---|
version |
CARGO_PKG_VERSION from Cargo.toml |
git_commit |
git rev-parse HEAD |
git_branch |
git rev-parse --abbrev-ref HEAD |
build_time |
UTC timestamp at build time (captured as Unix epoch, formatted to RFC 3339) |
rust_version |
rustc --version |
Key Types & Functions
| Name | Description |
|---|---|
VersionInfo |
Struct with version, git_commit, git_branch, build_time, rust_version, is_release |
get_version_info() |
Returns full VersionInfo |
get_short_version() |
Returns version-commit string |
get_full_version() |
Returns detailed version string with branch and build time |
is_release() |
true when version is not "dev" and does not contain "dirty" |
package_semver() |
Returns the package version parsed as SemVer |
semver |
SemVer parsing and requirement helpers backed by the semver crate |
Cross-Kit Consistency
This crate mirrors the API of:
- gokit —
version.VersionInfo/version.GetVersionInfo() - pykit —
pykit_version.VersionInfo/pykit_version.get_version_info()