pub struct Version {
pub major: u16,
pub minor: u16,
}Expand description
A major.minor protocol version.
Serialized as a string, for example "0.1". Patch numbers do not exist here: the
protocol only changes in ways that matter at the minor level or above.
Fields§
§major: u16Breaking-change generation. A mismatch is unrecoverable.
minor: u16Additive revision within a major. Higher minors stay readable by lower ones.
Implementations§
Source§impl Version
impl Version
Sourcepub const fn is_compatible_with(self, other: Version) -> bool
pub const fn is_compatible_with(self, other: Version) -> bool
Whether a peer speaking self can be understood by an implementation of other.
Majors must match exactly. Minors may differ in either direction, because unknown fields are ignored and changes within a major are additive.
Trait Implementations§
impl Copy for Version
Source§impl<'de> Deserialize<'de> for Version
impl<'de> Deserialize<'de> for Version
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Version
Source§impl Ord for Version
impl Ord for Version
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
Source§impl PartialOrd for Version
impl PartialOrd for Version
impl StructuralPartialEq for Version
Auto Trait Implementations§
impl Freeze for Version
impl RefUnwindSafe for Version
impl Send for Version
impl Sync for Version
impl Unpin for Version
impl UnsafeUnpin for Version
impl UnwindSafe for Version
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