Trait aversion::Versioned[][src]

pub trait Versioned {
    type Base: Versioned;

    const VER: u16;
}
Expand description

A data structure that has a version number.

A Versioned data structure is part of a family of data structures, with the expectation that each new version can be deterministically created from the older version using the FromVersion or IntoVersion traits.

Associated Types

The data structure base type.

The Base type is the latest version of the data structure. The Base type is the one that will implement [UpgradeLatest] and [MessageId]. Those two traits should not be needed on older versions.

Associated Constants

The data structure version.

The version field should start at 1, and be incremented each time a change is made to the data structure. FromVersion should be implemented for each new version, to allow automatic upgrading from the previous version.

The [UpgradeLatest] trait can be derived, to automatically upgrade from any old version to the latest version.

Implementors