[][src]Trait pui_arena::version::Version

pub unsafe trait Version: Copy {
    type Save: Copy;

    pub const EMPTY: Self;

    pub unsafe fn mark_empty(self) -> Option<Self>;
pub unsafe fn mark_full(self) -> Self;
pub fn is_full(self) -> bool;
pub unsafe fn save(self) -> Self::Save;
pub fn equals_saved(self, saved: Self::Save) -> bool; pub fn is_empty(self) -> bool { ... } }

The versioning strategy

Associated Types

type Save: Copy[src]

Represents a full version

Loading content...

Associated Constants

pub const EMPTY: Self[src]

The initial empty version

Loading content...

Required methods

pub unsafe fn mark_empty(self) -> Option<Self>[src]

Convert an full version to a empty version

returns None if there are no more versions

Safety

mark_empty can only be called on a full version

pub unsafe fn mark_full(self) -> Self[src]

Convert an empty version to a full version

Safety

mark_full can only be called on a empty version

pub fn is_full(self) -> bool[src]

Check if the version is full

pub unsafe fn save(self) -> Self::Save[src]

Save the current version

Safety

save can only be called on a full version

pub fn equals_saved(self, saved: Self::Save) -> bool[src]

Check if the saved version matches the current version

In particular, this can only be true if the current version is full and may not be true if there was a call to mark_empty in since the save was created.

Loading content...

Provided methods

pub fn is_empty(self) -> bool[src]

Check if the version is empty

Loading content...

Implementors

impl Version for Unversioned[src]

type Save = UnversionedFull

impl Version for DefaultVersion[src]

type Save = SavedDefaultVersion

impl Version for TinyVersion[src]

type Save = SavedTinyVersion

Loading content...