Skip to main content

FormatVersion

Trait FormatVersion 

Source
pub trait FormatVersion {
    const VERSION: u32;

    // Required method
    fn format_version(&self) -> u32;
}
Expand description

A value that carries the version of the format it was written in.

A field added within a version takes #[serde(default)], so a value written before the field existed still loads in a self-describing format such as JSON. A change an older value cannot be read under bumps VERSION. An implementer whose value holds another versioned value must bump its own version whenever the inner one’s rises, so that its version alone says whether it reads: nothing checks this for it.

Required Associated Constants§

Source

const VERSION: u32

The format version this release writes, and the only one it reads.

Required Methods§

Source

fn format_version(&self) -> u32

The format version this value was written in.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§