Struct FormatVersion
pub struct FormatVersion {
pub major: u32,
pub minor: u32,
}Expand description
A MAJOR.MINOR wire format version.
Fields§
§major: u32Incremented by any change an older reader would misread.
minor: u32Incremented by additions: a node kind, a variant, an optional field.
Implementations§
§impl FormatVersion
impl FormatVersion
pub const fn new(major: u32, minor: u32) -> FormatVersion
pub const fn new(major: u32, minor: u32) -> FormatVersion
The version major.minor.
pub fn parse(text: &str) -> Option<FormatVersion>
pub fn parse(text: &str) -> Option<FormatVersion>
Parse "MAJOR.MINOR", two decimal integers; None for anything else.
pub const fn reads(self, payload: FormatVersion) -> bool
pub const fn reads(self, payload: FormatVersion) -> bool
Whether a reader of this version reads a payload of payload: the
same major, and a minor no newer than its own.
Trait Implementations§
§impl Clone for FormatVersion
impl Clone for FormatVersion
§fn clone(&self) -> FormatVersion
fn clone(&self) -> FormatVersion
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for FormatVersion
§impl Debug for FormatVersion
impl Debug for FormatVersion
§impl Display for FormatVersion
impl Display for FormatVersion
impl Eq for FormatVersion
§impl Hash for FormatVersion
impl Hash for FormatVersion
§impl Ord for FormatVersion
impl Ord for FormatVersion
§fn cmp(&self, other: &FormatVersion) -> Ordering
fn cmp(&self, other: &FormatVersion) -> Ordering
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
§impl PartialEq for FormatVersion
impl PartialEq for FormatVersion
§impl PartialOrd for FormatVersion
impl PartialOrd for FormatVersion
impl StructuralPartialEq for FormatVersion
Auto Trait Implementations§
impl Freeze for FormatVersion
impl RefUnwindSafe for FormatVersion
impl Send for FormatVersion
impl Sync for FormatVersion
impl Unpin for FormatVersion
impl UnsafeUnpin for FormatVersion
impl UnwindSafe for FormatVersion
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