pub struct VersionRegistry { /* private fields */ }
Expand description
Protocol version registry
Implementations§
Source§impl VersionRegistry
impl VersionRegistry
Sourcepub fn register_version(&mut self, version_info: VersionInfo)
pub fn register_version(&mut self, version_info: VersionInfo)
Register a new protocol version
Sourcepub fn is_supported(&self, version: &ProtocolVersion) -> bool
pub fn is_supported(&self, version: &ProtocolVersion) -> bool
Check if a version is supported
Sourcepub fn get_version_info(
&self,
version: &ProtocolVersion,
) -> Option<&VersionInfo>
pub fn get_version_info( &self, version: &ProtocolVersion, ) -> Option<&VersionInfo>
Get version information
Sourcepub fn get_supported_versions(&self) -> &[VersionInfo]
pub fn get_supported_versions(&self) -> &[VersionInfo]
Get all supported versions
Sourcepub fn is_feature_supported(
&self,
version: &ProtocolVersion,
feature: &str,
) -> bool
pub fn is_feature_supported( &self, version: &ProtocolVersion, feature: &str, ) -> bool
Check if a feature is supported in a version
Sourcepub fn are_compatible(&self, v1: &ProtocolVersion, v2: &ProtocolVersion) -> bool
pub fn are_compatible(&self, v1: &ProtocolVersion, v2: &ProtocolVersion) -> bool
Check if two versions are compatible
Sourcepub fn get_migration_strategy(
&self,
from: &ProtocolVersion,
to: &ProtocolVersion,
) -> Option<&MigrationStrategy>
pub fn get_migration_strategy( &self, from: &ProtocolVersion, to: &ProtocolVersion, ) -> Option<&MigrationStrategy>
Get migration strategy between versions
Sourcepub fn find_best_compatible_version(
&self,
available_versions: &[ProtocolVersion],
preferences: &VersionPreferences,
) -> Option<ProtocolVersion>
pub fn find_best_compatible_version( &self, available_versions: &[ProtocolVersion], preferences: &VersionPreferences, ) -> Option<ProtocolVersion>
Find best compatible version
Trait Implementations§
Source§impl Clone for VersionRegistry
impl Clone for VersionRegistry
Source§fn clone(&self) -> VersionRegistry
fn clone(&self) -> VersionRegistry
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for VersionRegistry
impl Debug for VersionRegistry
Auto Trait Implementations§
impl Freeze for VersionRegistry
impl !RefUnwindSafe for VersionRegistry
impl Send for VersionRegistry
impl Sync for VersionRegistry
impl Unpin for VersionRegistry
impl !UnwindSafe for VersionRegistry
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more