pub struct FrameworkVersion { /* private fields */ }Expand description
The framework train one binary was built from, and therefore the whole of what it claims about compatibility.
Its canonical wire spelling is the SemVer string itself, e.g. 0.56.2:
three decimal segments, no prefix, no padding, no pre-release or build
metadata. Equality is exact, so provenance and diagnostics always name the
precise train; compatibility is Self::is_compatible_with, which asks
whether two versions share a CompatibilityLine.
Implementations§
Source§impl FrameworkVersion
impl FrameworkVersion
Sourcepub const CURRENT_SPELLING: &'static str = "0.62.0"
pub const CURRENT_SPELLING: &'static str = "0.62.0"
The canonical spelling of the train this binary was built from.
The crate version is the workspace train version: [workspace.package] version sets it and exact = pins keep every internal dependency on
the same train.
Sourcepub const CURRENT: Self
pub const CURRENT: Self
The train this binary was built from.
Parsed from Self::CURRENT_SPELLING during const evaluation, so a
crate version this type cannot represent fails the build rather than
reaching a process boundary.
Sourcepub const fn new(major: u16, minor: u16, patch: u16) -> Self
pub const fn new(major: u16, minor: u16, patch: u16) -> Self
Construct one exact framework version.
Sourcepub const fn compatibility_line(self) -> CompatibilityLine
pub const fn compatibility_line(self) -> CompatibilityLine
The SemVer line this version belongs to: pre-1.0 trains break on every minor, and a released major breaks only on the major.
The line is what decides compatibility, through
Self::is_compatible_with. The version stays exact so a record or a
diagnostic can still name the train a binary was built from.
Sourcepub const fn is_compatible_with(self, other: Self) -> bool
pub const fn is_compatible_with(self, other: Self) -> bool
Whether a peer built from other speaks this version’s contracts.
Two trains interoperate exactly when they share a
CompatibilityLine, so this is the comparison every validator makes:
a launch, a bundle admission, and a client attachment all ask this
question and never for equality. The exact version remains available
for provenance and diagnostics.
The promise is truthful because the compatibility CI enforces it at release: the gates prove each candidate’s wire and process surfaces against the trains already published on its line, and refuse a version too small for what its contracts changed. A patch train therefore cannot carry a surface change that a peer on the same line would fail to speak.
Trait Implementations§
Source§impl Clone for FrameworkVersion
impl Clone for FrameworkVersion
Source§fn clone(&self) -> FrameworkVersion
fn clone(&self) -> FrameworkVersion
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more