pub struct ProtocolVersion(/* private fields */);Expand description
A dated MCP protocol version, e.g. 2026-07-28.
Dated versions are YYYY-MM-DD, so byte ordering is chronological ordering
and comparison needs no date parsing. That only holds for well-formed values,
which is why ProtocolVersion::parse validates the shape rather than
accepting any string.
Implementations§
Source§impl ProtocolVersion
impl ProtocolVersion
Sourcepub fn parse(raw: &str) -> Option<Self>
pub fn parse(raw: &str) -> Option<Self>
Parse a dated version string, returning None if it is not YYYY-MM-DD.
Non-dated labels such as draft are rejected. They carry no
ordering, so admitting them would make the comparison below meaningless.
Sourcepub fn requires_header_validation(&self) -> bool
pub fn requires_header_validation(&self) -> bool
Whether this revision obliges the origin to validate headers against the body, and therefore whether an intermediary may price on those headers.
Trait Implementations§
Source§impl Clone for ProtocolVersion
impl Clone for ProtocolVersion
Source§impl Debug for ProtocolVersion
impl Debug for ProtocolVersion
Source§impl Display for ProtocolVersion
impl Display for ProtocolVersion
impl Eq for ProtocolVersion
Source§impl Hash for ProtocolVersion
impl Hash for ProtocolVersion
Source§impl Ord for ProtocolVersion
impl Ord for ProtocolVersion
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for ProtocolVersion
impl PartialEq for ProtocolVersion
Source§impl PartialOrd for ProtocolVersion
impl PartialOrd for ProtocolVersion
impl StructuralPartialEq for ProtocolVersion
Auto Trait Implementations§
impl Freeze for ProtocolVersion
impl RefUnwindSafe for ProtocolVersion
impl Send for ProtocolVersion
impl Sync for ProtocolVersion
impl Unpin for ProtocolVersion
impl UnsafeUnpin for ProtocolVersion
impl UnwindSafe for ProtocolVersion
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