Expand description
Constant expressions for your package version.
§Example
use const_pkg_version::Version;
const VERSION_FULL: Version = const_pkg_version::version!();
const VERSION_MAJOR: u32 = const_pkg_version::major!();
const VERSION_MINOR: u32 = const_pkg_version::minor!();
const VERSION_PATCH: u32 = const_pkg_version::patch!();
const VERSION_PRE: Option<&str> = const_pkg_version::pre_release!();
const BUILD_METADATA: Option<&str> = const_pkg_version::build_metadata!();§Features
debug: ImplementsDebugforVersion(enabled by default).defmt: Implements [defmt::Format] forVersion.serde: Implements [serde::Deserialize] and [serde::Serialize] forVersion.semver: ImplementsTryFrom<crate::Version>for [semver::Version].
Macros§
- build_
metadata - Get the build metadata of your package in a constant expression.
- major
- Get the major version of your package in a constant expression.
- minor
- Get the minor version of your package in a constant expression.
- patch
- Get the patch version of your package in a constant expression.
- pre_
release - Get the pre-release version of your package in a constant expression.
- version
- Get the full version information of your package in a constant expression.
Structs§
- Version
- A full package version (major, minor, patch, pre-release and build-metadata).