pub struct DataVersion {
pub major: u64,
pub minor: u64,
}Expand description
A data version: one version for the value encoding, the Tool protocol
and the history format together, written "major.minor".
Minors only add, so a reader of one minor reads every earlier minor of the same major; a change of meaning takes a new major.
Fields§
§major: u64What a change of meaning moves.
minor: u64What an addition moves.
Implementations§
Source§impl DataVersion
impl DataVersion
Sourcepub fn parse(text: &str) -> Option<DataVersion>
pub fn parse(text: &str) -> Option<DataVersion>
The version text writes as "major.minor", each a number in its
one decimal spelling: no sign, no leading zero, nothing else. None
for any other text.
Sourcepub fn reads(&self, other: &DataVersion) -> bool
pub fn reads(&self, other: &DataVersion) -> bool
Whether a reader of this version reads data written in other: the
same major, and a minor no newer than this one’s.
Sourcepub fn speaks_with(&self, other: &DataVersion) -> bool
pub fn speaks_with(&self, other: &DataVersion) -> bool
Whether a peer of this version and one of other speak the Tool
process protocol to each other: the same major, whatever their
minors (abi.md, The Tool process protocol).
Trait Implementations§
Source§impl Clone for DataVersion
impl Clone for DataVersion
impl Copy for DataVersion
Source§impl Debug for DataVersion
impl Debug for DataVersion
Source§impl Declared for DataVersion
impl Declared for DataVersion
Source§impl Display for DataVersion
impl Display for DataVersion
impl Eq for DataVersion
Source§impl Hash for DataVersion
impl Hash for DataVersion
Source§impl Ord for DataVersion
impl Ord for DataVersion
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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for DataVersion
impl PartialEq for DataVersion
Source§impl PartialOrd for DataVersion
impl PartialOrd for DataVersion
Source§impl Shaped for DataVersion
impl Shaped for DataVersion
Source§fn write_at(
&self,
out: &mut ValueWriter<'_, '_>,
ty: &Type,
) -> Result<(), EncodeError>
fn write_at( &self, out: &mut ValueWriter<'_, '_>, ty: &Type, ) -> Result<(), EncodeError>
Source§fn read_at(
input: &mut ValueReader<'_, '_, '_>,
ty: &Type,
) -> Result<Self, DecodeError>
fn read_at( input: &mut ValueReader<'_, '_, '_>, ty: &Type, ) -> Result<Self, DecodeError>
impl StructuralPartialEq for DataVersion
Source§impl Wire for DataVersion
impl Wire for DataVersion
Source§fn write_head<'a>(&'a self, _: &mut Vec<u8>, parts: &mut Vec<&'a dyn AnyWire>)
fn write_head<'a>(&'a self, _: &mut Vec<u8>, parts: &mut Vec<&'a dyn AnyWire>)
Appends the bytes it writes before its parts to
out, and pushes
its parts to parts in the order they are written after them.Source§fn open(_: &mut Reader<'_>) -> Result<Opened, DecodeError>
fn open(_: &mut Reader<'_>) -> Result<Opened, DecodeError>
Reads its head at
reader: the value itself when it has no parts,
else its parts to read and what joins them. Read moreSource§fn write(&self, out: &mut Vec<u8>)
fn write(&self, out: &mut Vec<u8>)
Appends its bytes to
out: its head, and then each part’s bytes in
order, written over a stack on the heap, so a value nested however
deep is written on a native stack of fixed size.Auto Trait Implementations§
impl Forget for DataVersion
impl Freeze for DataVersion
impl Move for DataVersion
impl RefUnwindSafe for DataVersion
impl Send for DataVersion
impl Sync for DataVersion
impl Unpin for DataVersion
impl UnsafeUnpin for DataVersion
impl UnwindSafe for DataVersion
Blanket Implementations§
Source§impl<T> AnyWire for Twhere
T: Wire,
impl<T> AnyWire for Twhere
T: Wire,
Source§fn write_head<'a>(&'a self, out: &mut Vec<u8>, parts: &mut Vec<&'a dyn AnyWire>)
fn write_head<'a>(&'a self, out: &mut Vec<u8>, parts: &mut Vec<&'a dyn AnyWire>)
As
Wire::write_head.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