pub struct VersionManager { /* private fields */ }
Expand description
Version manager for handling protocol versions
Implementations§
Source§impl VersionManager
impl VersionManager
Sourcepub fn new(supported_versions: Vec<Version>) -> Result<Self, VersionError>
pub fn new(supported_versions: Vec<Version>) -> Result<Self, VersionError>
Create a new version manager
Sourcepub fn with_default_versions() -> Self
pub fn with_default_versions() -> Self
Create a version manager with default MCP versions
Sourcepub fn current_version(&self) -> &Version
pub fn current_version(&self) -> &Version
Get the current version
Sourcepub fn supported_versions(&self) -> &[Version]
pub fn supported_versions(&self) -> &[Version]
Get all supported versions
Sourcepub fn is_version_supported(&self, version: &Version) -> bool
pub fn is_version_supported(&self, version: &Version) -> bool
Check if a version is supported
Sourcepub fn negotiate_version(&self, client_versions: &[Version]) -> Option<Version>
pub fn negotiate_version(&self, client_versions: &[Version]) -> Option<Version>
Find the best compatible version for a client request
Sourcepub fn check_compatibility(
&self,
client_version: &Version,
server_version: &Version,
) -> VersionCompatibility
pub fn check_compatibility( &self, client_version: &Version, server_version: &Version, ) -> VersionCompatibility
Check compatibility between two versions
Sourcepub fn minimum_version(&self) -> &Version
pub fn minimum_version(&self) -> &Version
Get the minimum supported version
Sourcepub fn maximum_version(&self) -> &Version
pub fn maximum_version(&self) -> &Version
Get the maximum supported version
Sourcepub fn satisfies_requirement(
&self,
version: &Version,
requirement: &VersionRequirement,
) -> bool
pub fn satisfies_requirement( &self, version: &Version, requirement: &VersionRequirement, ) -> bool
Check if a version requirement is satisfied
Trait Implementations§
Source§impl Clone for VersionManager
impl Clone for VersionManager
Source§fn clone(&self) -> VersionManager
fn clone(&self) -> VersionManager
Returns a duplicate of the value. Read more
1.0.0 · 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 VersionManager
impl Debug for VersionManager
Auto Trait Implementations§
impl Freeze for VersionManager
impl RefUnwindSafe for VersionManager
impl Send for VersionManager
impl Sync for VersionManager
impl Unpin for VersionManager
impl UnwindSafe for VersionManager
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