pub struct WorkflowVersionRegistry { /* private fields */ }Expand description
Registry that tracks all known workflow versions and the migrations between them.
Implementations§
Source§impl WorkflowVersionRegistry
impl WorkflowVersionRegistry
Sourcepub fn register(&mut self, version: WorkflowVersion)
pub fn register(&mut self, version: WorkflowVersion)
Register a known version.
Sourcepub fn add_migration(&mut self, migration: VersionMigration)
pub fn add_migration(&mut self, migration: VersionMigration)
Add a migration between two registered versions.
Sourcepub fn latest(&self) -> Option<&WorkflowVersion>
pub fn latest(&self) -> Option<&WorkflowVersion>
Return the highest registered version, or None if empty.
Sourcepub fn migrate(
&self,
from: &WorkflowVersion,
to: &WorkflowVersion,
) -> Option<&VersionMigration>
pub fn migrate( &self, from: &WorkflowVersion, to: &WorkflowVersion, ) -> Option<&VersionMigration>
Retrieve the migration from from to to, if registered.
Sourcepub fn all_versions(&self) -> &[WorkflowVersion]
pub fn all_versions(&self) -> &[WorkflowVersion]
All registered versions, sorted ascending.
Sourcepub fn all_migrations(&self) -> Vec<&VersionMigration>
pub fn all_migrations(&self) -> Vec<&VersionMigration>
All registered migrations.
Sourcepub fn version_count(&self) -> usize
pub fn version_count(&self) -> usize
Number of registered versions.
Trait Implementations§
Source§impl Debug for WorkflowVersionRegistry
impl Debug for WorkflowVersionRegistry
Source§impl Default for WorkflowVersionRegistry
impl Default for WorkflowVersionRegistry
Source§fn default() -> WorkflowVersionRegistry
fn default() -> WorkflowVersionRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for WorkflowVersionRegistry
impl RefUnwindSafe for WorkflowVersionRegistry
impl Send for WorkflowVersionRegistry
impl Sync for WorkflowVersionRegistry
impl Unpin for WorkflowVersionRegistry
impl UnsafeUnpin for WorkflowVersionRegistry
impl UnwindSafe for WorkflowVersionRegistry
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