pub struct Version {
pub major: u32,
pub minor: u32,
}Expand description
A semver-style schema version attached to every saved record.
Each crate::save::Save / crate::load::Load impl declares its
const VERSION: Version. On load, the version recorded in the manifest is compared
against the declared version to dispatch between
Load::load and
Load::load_legacy.
The framework treats versions as opaque pairs and only checks them for equality; ordering / semver semantics are entirely up to the implementing type.
The major.minor format aids code readability: a reader can tell at a glance
that, for example, version 1.0 is compatible with version 1.2.
On the wire, a Version is encoded as a single string of the form
"major.minor" (e.g. "0.0").
Fields§
§major: u32§minor: u32Implementations§
Trait Implementations§
impl Copy for Version
Source§impl<'de> Deserialize<'de> for Version
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Version
Available on crate feature
serde only.Source§fn deserialize<D: Deserializer<'de>>(de: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(de: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq 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