[][src]Struct versionize::version_map::VersionMap

pub struct VersionMap { /* fields omitted */ }

The VersionMap API provides functionality to define the version for each type and attach them to specific root versions.

Implementations

impl VersionMap[src]

pub fn new() -> Self[src]

Create a new version map initialized at version 1.

pub fn new_version(&mut self) -> &mut Self[src]

Bumps root version by 1 to create a new root version.

pub fn set_type_version(
    &mut self,
    type_id: TypeId,
    type_version: u16
) -> &mut Self
[src]

Define a mapping between a specific type version and the latest root version.

pub fn get_type_version(&self, root_version: u16, type_id: TypeId) -> u16[src]

Returns the version of type_id corresponding to the specified root_version. If root_version is out of range returns the version of type_id at latest version.

pub fn latest_version(&self) -> u16[src]

Returns the latest version.

Trait Implementations

impl Clone for VersionMap[src]

impl Debug for VersionMap[src]

impl Default for VersionMap[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.