pub struct FormatVersion {
pub major: u32,
pub minor: u32,
pub patch: u32,
}Expand description
A table format version, MAJOR.MINOR.PATCH. What a bump means for an older Timelake:
| Bump | Reads the table | Writes the table |
|---|---|---|
| patch (0.2.0 → 0.2.1, 1.2.0 → 1.2.1) | yes | yes |
| minor from 1.0 (1.2 → 1.3) | yes | no |
| major from 1.0, minor before (0.2 → 0.3, 1.x → 2.0) | no | no |
Before 1.0 the minor version is the breaking one, as Cargo treats 0.y crates.
Fields§
§major: u32A newer major (from 1.0) breaks older readers.
minor: u32A newer minor breaks older writers (from 1.0), or older readers and writers (before 1.0).
patch: u32A newer patch is compatible both ways.
Implementations§
Source§impl FormatVersion
impl FormatVersion
Sourcepub const UNVERSIONED: Self
pub const UNVERSIONED: Self
Tables written by Timelake 0.1 and 0.2, which recorded no version.
Sourcepub fn readable_by(self, known: Self) -> bool
pub fn readable_by(self, known: Self) -> bool
Whether a Timelake that knows format known reads a table of this format correctly.
Sourcepub fn writable_by(self, known: Self) -> bool
pub fn writable_by(self, known: Self) -> bool
Whether a Timelake that knows format known may write to a table of this format without
breaking what it relies on.
Trait Implementations§
Source§impl Clone for FormatVersion
impl Clone for FormatVersion
impl Copy for FormatVersion
Source§impl Debug for FormatVersion
impl Debug for FormatVersion
Source§impl Display for FormatVersion
impl Display for FormatVersion
impl Eq for FormatVersion
Source§impl FromStr for FormatVersion
impl FromStr for FormatVersion
Source§impl Hash for FormatVersion
impl Hash for FormatVersion
Source§impl Ord for FormatVersion
impl Ord for FormatVersion
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 FormatVersion
impl PartialEq for FormatVersion
Source§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