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 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
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for CompilerVersion
impl Display for CompilerVersion
Source§impl PartialEq for CompilerVersion
impl PartialEq for CompilerVersion
Source§fn eq(&self, other: &CompilerVersion) -> bool
fn eq(&self, other: &CompilerVersion) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for CompilerVersion
impl Serialize for CompilerVersion
impl Eq 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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
Compare self to
key and return true if they are equal.