pub struct CompilerVersion {
pub major: u32,
pub minor: Option<u32>,
pub patch: Option<u32>,
pub raw: String,
}Expand description
Decomposed compiler / archiver version (major.minor.patch).
major is required; minor and patch are optional because
some versions only report two components. raw keeps the
original substring for diagnostics.
Fields§
§major: u32§minor: Option<u32>§patch: Option<u32>§raw: StringImplementations§
Source§impl CompilerVersion
impl CompilerVersion
Sourcepub fn parse(raw: &str) -> Option<Self>
pub fn parse(raw: &str) -> Option<Self>
Parse a major[.minor[.patch]] substring into a typed
CompilerVersion. Returns None when the leading
component is not a valid u32.
Sourcepub fn parse_with_suffix(raw: &str) -> Option<Self>
pub fn parse_with_suffix(raw: &str) -> Option<Self>
Like Self::parse, but tolerant of a non-numeric suffix
on each dotted component ("20.1.0git", "10.0.0-4ubuntu1",
"19.1.0-rc2"): a component contributes its leading ASCII
digits and must start with a digit. Banner parsers opt into
this where vendors append suffixes; Self::parse stays
strict for callers that need exact numeric tokens.
Sourcepub fn to_display_string(&self) -> String
pub fn to_display_string(&self) -> String
Formatted major.minor.patch view, omitting unset
components. Used in metadata JSON and CABIN_* env vars.
Trait Implementations§
Source§impl Clone for CompilerVersion
impl Clone for CompilerVersion
Source§fn clone(&self) -> CompilerVersion
fn clone(&self) -> CompilerVersion
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CompilerVersion
impl Debug for CompilerVersion
Source§impl<'de> Deserialize<'de> for CompilerVersion
impl<'de> Deserialize<'de> for CompilerVersion
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for CompilerVersion
impl Display for CompilerVersion
impl Eq for CompilerVersion
Source§impl PartialEq for CompilerVersion
impl PartialEq for CompilerVersion
Source§fn eq(&self, other: &CompilerVersion) -> bool
fn eq(&self, other: &CompilerVersion) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for CompilerVersion
impl Serialize for CompilerVersion
impl StructuralPartialEq for CompilerVersion
Auto Trait Implementations§
impl Freeze for CompilerVersion
impl RefUnwindSafe for CompilerVersion
impl Send for CompilerVersion
impl Sync for CompilerVersion
impl Unpin for CompilerVersion
impl UnsafeUnpin for CompilerVersion
impl UnwindSafe for CompilerVersion
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.