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 stable() -> Self
pub fn stable() -> Self
Get the stable MCP protocol version (2025-06-18)
This version is widely compatible with MCP clients including Claude Code. Use this as the default for maximum compatibility.
Sourcepub fn current() -> Self
👎Deprecated since 2.4.0: Use stable() or latest() instead
pub fn current() -> Self
stable() or latest() insteadAlias for stable() for backwards compatibility
Sourcepub fn latest() -> Self
pub fn latest() -> Self
Get the latest MCP protocol version (2025-11-25)
This is the current official MCP specification version. Note: Some clients like Claude Code may not support this version yet.
Sourcepub fn draft() -> Self
👎Deprecated since 2.4.0: Use latest() instead - 2025-11-25 is now official
pub fn draft() -> Self
latest() instead - 2025-11-25 is now officialAlias for latest() for backwards compatibility
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>,
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
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
key and return true if they are equal.