pub struct ProtocolVersion(/* private fields */);Expand description
Protocol version wrapper with validation.
Provides structured version checking as an alternative to comparing
against PROTOCOL_VERSION directly. The engine currently validates
versions inline, but consumers that prefer a typed wrapper can use this.
Implementations§
Source§impl ProtocolVersion
impl ProtocolVersion
Sourcepub fn is_compatible(&self) -> bool
pub fn is_compatible(&self) -> bool
Check if this version is compatible with the current protocol. Accepts any version in the range [MIN_PROTOCOL_VERSION, PROTOCOL_VERSION].
Trait Implementations§
Source§impl Clone for ProtocolVersion
impl Clone for ProtocolVersion
Source§fn clone(&self) -> ProtocolVersion
fn clone(&self) -> ProtocolVersion
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 ProtocolVersion
impl Debug for ProtocolVersion
Source§impl From<ProtocolVersion> for u32
impl From<ProtocolVersion> for u32
Source§fn from(version: ProtocolVersion) -> Self
fn from(version: ProtocolVersion) -> Self
Converts to this type from the input type.
Source§impl From<u32> for ProtocolVersion
impl From<u32> for ProtocolVersion
Source§impl PartialEq for ProtocolVersion
impl PartialEq for ProtocolVersion
impl Copy for ProtocolVersion
impl Eq 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