pub struct VersionManager { /* private fields */ }Expand description
Version manager for catalogs
Implementations§
Source§impl VersionManager
impl VersionManager
Sourcepub fn create_version(
&mut self,
catalog_id: Uuid,
version: String,
description: Option<String>,
created_by: Option<Uuid>,
snapshot: CatalogSnapshot,
) -> CatalogVersion
pub fn create_version( &mut self, catalog_id: Uuid, version: String, description: Option<String>, created_by: Option<Uuid>, snapshot: CatalogSnapshot, ) -> CatalogVersion
Create a new version with a content snapshot.
Sourcepub fn publish_version(
&mut self,
version_id: Uuid,
) -> Result<&CatalogVersion, String>
pub fn publish_version( &mut self, version_id: Uuid, ) -> Result<&CatalogVersion, String>
Publish a version (makes it the sole active version for the catalog).
Sourcepub fn rollback_to_version(
&mut self,
version_id: Uuid,
) -> Result<&CatalogVersion, String>
pub fn rollback_to_version( &mut self, version_id: Uuid, ) -> Result<&CatalogVersion, String>
Rollback to a previous version (re-publishes it).
Sourcepub fn get_active_version(&self, catalog_id: Uuid) -> Option<&CatalogVersion>
pub fn get_active_version(&self, catalog_id: Uuid) -> Option<&CatalogVersion>
Get active version for a catalog
Sourcepub fn get_active_snapshot(&self, catalog_id: Uuid) -> Option<&CatalogSnapshot>
pub fn get_active_snapshot(&self, catalog_id: Uuid) -> Option<&CatalogSnapshot>
Get snapshot of the active catalog version.
Sourcepub fn get_versions(&self, catalog_id: Uuid) -> Vec<&CatalogVersion>
pub fn get_versions(&self, catalog_id: Uuid) -> Vec<&CatalogVersion>
Get all versions for a catalog
Sourcepub fn compare_versions(
&self,
version_id_1: Uuid,
version_id_2: Uuid,
) -> Result<VersionDiff, String>
pub fn compare_versions( &self, version_id_1: Uuid, version_id_2: Uuid, ) -> Result<VersionDiff, String>
Compare two versions (content-aware diff).
Trait Implementations§
Source§impl Default for VersionManager
impl Default for VersionManager
Source§fn default() -> VersionManager
fn default() -> VersionManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for VersionManager
impl RefUnwindSafe for VersionManager
impl Send for VersionManager
impl Sync for VersionManager
impl Unpin for VersionManager
impl UnsafeUnpin for VersionManager
impl UnwindSafe for VersionManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more