pub struct WireVersion {
pub major: u32,
pub minor: u32,
pub patch: u32,
}Expand description
Parsed wire protocol version with MAJOR.MINOR.PATCH components.
Use WireVersion::parse or str::parse::<WireVersion>() to create.
Use is_compatible to check whether two
nodes can cluster together.
Fields§
§major: u32Breaking wire format changes.
minor: u32New optional wire features (backward-compatible).
patch: u32Bug fixes in serialization (no format change).
Implementations§
Source§impl WireVersion
impl WireVersion
Sourcepub fn parse(s: &str) -> Result<Self, ParseWireVersionError>
pub fn parse(s: &str) -> Result<Self, ParseWireVersionError>
Parse a "MAJOR.MINOR.PATCH" string into a WireVersion.
Returns an error if the string is not exactly three dot-separated non-negative integers (no whitespace, no extra segments).
Sourcepub fn is_compatible(&self, other: &WireVersion) -> bool
pub fn is_compatible(&self, other: &WireVersion) -> bool
Check whether self is compatible with other per the dactor
wire-version policy: two versions are compatible if and only if
they share the same MAJOR version number.
Trait Implementations§
Source§impl Clone for WireVersion
impl Clone for WireVersion
Source§fn clone(&self) -> WireVersion
fn clone(&self) -> WireVersion
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 WireVersion
impl Debug for WireVersion
Source§impl Display for WireVersion
impl Display for WireVersion
Source§impl FromStr for WireVersion
impl FromStr for WireVersion
Source§impl Hash for WireVersion
impl Hash for WireVersion
Source§impl Ord for WireVersion
impl Ord for WireVersion
Source§impl PartialEq for WireVersion
impl PartialEq for WireVersion
Source§impl PartialOrd for WireVersion
impl PartialOrd for WireVersion
impl Copy for WireVersion
impl Eq for WireVersion
impl StructuralPartialEq for WireVersion
Auto Trait Implementations§
impl Freeze for WireVersion
impl RefUnwindSafe for WireVersion
impl Send for WireVersion
impl Sync for WireVersion
impl Unpin for WireVersion
impl UnsafeUnpin for WireVersion
impl UnwindSafe for WireVersion
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