Trait Versioned

Source
pub trait Versioned<Err: Error>: Sized {
    type Output;

    const VERSION: u32;
}
Expand description

Versioned trait This trait is meant to be implemented either by the struct itself or by a version container.

The default methods do not need to be changed unelss you want to customize the behaviour of how versions are treated.

E defines the error type for the versioning process and encoding and decoding.

Output defines the type of the data that is being versioned.

Version defines the version of the data that is being versioned.

Required Associated Constants§

Source

const VERSION: u32

The version tag of this data

Required Associated Types§

Source

type Output

The type that the versioned data is encoding

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<Latest, Prior, Err> Versioned<Err> for Upgrade<Latest, Prior, Err>
where Err: Error, Prior: Versioned<Err>, Latest: Versioned<Err>, Latest::Output: TryFrom<Prior::Output>,

Source§

const VERSION: u32 = Latest::VERSION

Source§

type Output = <Latest as Versioned<Err>>::Output