Skip to main content

FrameworkVersion

Struct FrameworkVersion 

Source
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

Source

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.

Source

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.

Source

pub const fn new(major: u16, minor: u16, patch: u16) -> Self

Construct one exact framework version.

Source

pub const fn major(self) -> u16

The version’s major component.

Source

pub const fn minor(self) -> u16

The version’s minor component.

Source

pub const fn patch(self) -> u16

The version’s patch component.

Source

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.

Source

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

Source§

fn clone(&self) -> FrameworkVersion

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for FrameworkVersion

Source§

impl Debug for FrameworkVersion

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl DescribeWire for FrameworkVersion

Source§

fn wire_schema() -> WireSchema

The shape a value of this type puts on the wire.
Source§

impl<'de> Deserialize<'de> for FrameworkVersion

Source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for FrameworkVersion

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for FrameworkVersion

Source§

impl FromStr for FrameworkVersion

Source§

type Err = FrameworkVersionError

The associated error which can be returned from parsing.
Source§

fn from_str(value: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl Hash for FrameworkVersion

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for FrameworkVersion

Source§

fn eq(&self, other: &FrameworkVersion) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for FrameworkVersion

Source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for FrameworkVersion

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.