Struct versionize::version_map::VersionMap
source · pub struct VersionMap { /* private fields */ }Expand description
The VersionMap API provides functionality to define the version for each type and attach them to specific root versions.
Implementations§
source§impl VersionMap
impl VersionMap
sourcepub fn with_filter(filter: Arc<dyn VersionFilter + Send + Sync>) -> Self
pub fn with_filter(filter: Arc<dyn VersionFilter + Send + Sync>) -> Self
Create a new version map with specified version filter.
sourcepub fn new_version(&mut self) -> &mut Self
pub fn new_version(&mut self) -> &mut Self
Bumps root version by 1 to create a new root version.
sourcepub fn set_type_version(
&mut self,
type_id: TypeId,
type_version: u16
) -> &mut Self
pub fn set_type_version( &mut self, type_id: TypeId, type_version: u16 ) -> &mut Self
Define a mapping between a specific type version and the latest root version.
sourcepub fn get_type_version(&self, root_version: u16, type_id: TypeId) -> u16
pub fn get_type_version(&self, root_version: u16, type_id: TypeId) -> u16
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.
sourcepub fn latest_version(&self) -> u16
pub fn latest_version(&self) -> u16
Returns the latest version.
sourcepub fn is_supported(&self, version: u16) -> bool
pub fn is_supported(&self, version: u16) -> bool
Check whether the version is supported by the version map.
Trait Implementations§
source§impl Clone for VersionMap
impl Clone for VersionMap
source§fn clone(&self) -> VersionMap
fn clone(&self) -> VersionMap
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more