pub struct Version {
    pub year: u16,
    pub month: u8,
    pub day: u8,
}Expand description
Semantic version representation
Fields§
§year: u16Year component
month: u8Month component
day: u8Day component
Implementations§
Source§impl Version
 
impl Version
Sourcepub fn new(year: u16, month: u8, day: u8) -> Result<Self, VersionError>
 
pub fn new(year: u16, month: u8, day: u8) -> Result<Self, VersionError>
Create a new version
§Errors
Returns VersionError::InvalidMonth if month is not in range 1-12.
Returns VersionError::InvalidDay if day is invalid for the given month.
Sourcepub fn is_newer_than(&self, other: &Version) -> bool
 
pub fn is_newer_than(&self, other: &Version) -> bool
Check if this version is newer than another
Sourcepub fn is_older_than(&self, other: &Version) -> bool
 
pub fn is_older_than(&self, other: &Version) -> bool
Check if this version is older than another
Sourcepub fn is_compatible_with(&self, other: &Version) -> bool
 
pub fn is_compatible_with(&self, other: &Version) -> bool
Check if this version is compatible with another
Sourcepub fn to_date_string(&self) -> String
 
pub fn to_date_string(&self) -> String
Get version as a date string (YYYY-MM-DD)
Sourcepub fn from_date_string(s: &str) -> Result<Self, VersionError>
 
pub fn from_date_string(s: &str) -> Result<Self, VersionError>
Parse version from date string
§Errors
Returns VersionError if the string is not in YYYY-MM-DD format
or contains invalid date components.
Sourcepub fn known_versions() -> Vec<Version>
 
pub fn known_versions() -> Vec<Version>
Get all known MCP versions
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Version
 
impl<'de> Deserialize<'de> for Version
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 Ord for Version
 
impl Ord for Version
Source§impl PartialOrd for Version
 
impl PartialOrd for Version
impl Eq for Version
impl StructuralPartialEq for Version
Auto Trait Implementations§
impl Freeze for Version
impl RefUnwindSafe for Version
impl Send for Version
impl Sync for Version
impl Unpin for Version
impl UnwindSafe for Version
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> Comparable<K> for Q
 
impl<Q, K> Comparable<K> for Q
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§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.