pub struct Version {
pub major: u32,
pub minor: u32,
pub patch: u32,
pub build: Option<NonZeroU32>,
}Fields§
§major: u32§minor: u32§patch: u32§build: Option<NonZeroU32>The monotonic build number, if known. None for a base version that
only carries major.minor.patch.
Implementations§
Source§impl Version
impl Version
pub fn from_client_exe(version: &str) -> Version
Sourcepub fn try_from_client_exe(version: &str) -> Option<Version>
pub fn try_from_client_exe(version: &str) -> Option<Version>
Fallible variant of Version::from_client_exe that returns None
instead of panicking when the version string is malformed (e.g. read
from a corrupt or truncated replay).
Sourcepub fn build_number(&self) -> Option<u32>
pub fn build_number(&self) -> Option<u32>
The numeric build, if known.
pub fn to_path(&self) -> String
Sourcepub const fn base(major: u32, minor: u32, patch: u32) -> Version
pub const fn base(major: u32, minor: u32, patch: u32) -> Version
A base version (major, minor, patch) with no build component (build
is None). Useful for keying version-gated tables, where entries take
effect at a friendly version regardless of build. Compare against a full
version with Self::is_at_least, which ignores the build field.
Sourcepub fn base_eq(&self, other: &Version) -> bool
pub fn base_eq(&self, other: &Version) -> bool
Whether the base major.minor.patch versions are equal, ignoring the build
entirely. Unlike Self::matches, two different concrete builds of the same
base version compare equal here. Pairs with Self::base; use it to test
friendly-version equality when the builds may legitimately differ.
Sourcepub fn matches(&self, other: &Version) -> bool
pub fn matches(&self, other: &Version) -> bool
Whether this version matches other for relaxed version-gating, where the build
is an optional refinement of the friendly major.minor.patch. The friendly parts
must be equal; the build narrows the match only when BOTH sides specify one:
15.4.0 build N matches 15.4.0 with no build (and vice versa), but two different
concrete builds of the same friendly version do not match. Not transitive - use ==
for strict equality.