pub struct WorkflowVersionStore { /* private fields */ }Expand description
Workflow version storage layer
Implementations§
Source§impl WorkflowVersionStore
impl WorkflowVersionStore
Sourcepub fn new(pool: DatabasePool) -> Self
pub fn new(pool: DatabasePool) -> Self
Create a new workflow version store
Sourcepub async fn save_version(
&self,
workflow: &Workflow,
description: Option<String>,
created_by: Option<String>,
) -> Result<Uuid>
pub async fn save_version( &self, workflow: &Workflow, description: Option<String>, created_by: Option<String>, ) -> Result<Uuid>
Save a new version of a workflow
Sourcepub async fn get_versions(
&self,
workflow_id: &WorkflowId,
) -> Result<Vec<WorkflowVersion>>
pub async fn get_versions( &self, workflow_id: &WorkflowId, ) -> Result<Vec<WorkflowVersion>>
Get version history for a workflow
Sourcepub async fn get_version(
&self,
workflow_id: &WorkflowId,
version: i32,
) -> Result<Option<WorkflowVersion>>
pub async fn get_version( &self, workflow_id: &WorkflowId, version: i32, ) -> Result<Option<WorkflowVersion>>
Get a specific version of a workflow
Sourcepub async fn get_latest_version(
&self,
workflow_id: &WorkflowId,
) -> Result<Option<i32>>
pub async fn get_latest_version( &self, workflow_id: &WorkflowId, ) -> Result<Option<i32>>
Get the latest version number for a workflow
Sourcepub async fn delete_all_versions(&self, workflow_id: &WorkflowId) -> Result<u64>
pub async fn delete_all_versions(&self, workflow_id: &WorkflowId) -> Result<u64>
Delete all versions for a workflow
Sourcepub async fn compare_versions(
&self,
workflow_id: &WorkflowId,
version1: i32,
version2: i32,
) -> Result<Option<VersionComparison>>
pub async fn compare_versions( &self, workflow_id: &WorkflowId, version1: i32, version2: i32, ) -> Result<Option<VersionComparison>>
Compare two versions of a workflow
Sourcepub async fn rollback_to_version(
&self,
workflow_id: &WorkflowId,
target_version: i32,
rollback_description: Option<String>,
rolled_back_by: Option<String>,
) -> Result<bool>
pub async fn rollback_to_version( &self, workflow_id: &WorkflowId, target_version: i32, rollback_description: Option<String>, rolled_back_by: Option<String>, ) -> Result<bool>
Rollback a workflow to a specific version This updates the main workflow definition and creates a new version record Returns true if the rollback was successful
Sourcepub async fn delete_versions_before(
&self,
workflow_id: &WorkflowId,
before_version: i32,
) -> Result<u64>
pub async fn delete_versions_before( &self, workflow_id: &WorkflowId, before_version: i32, ) -> Result<u64>
Delete versions older than the specified version Useful for cleaning up old version history Returns the number of versions deleted
Trait Implementations§
Source§impl Clone for WorkflowVersionStore
impl Clone for WorkflowVersionStore
Source§fn clone(&self) -> WorkflowVersionStore
fn clone(&self) -> WorkflowVersionStore
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for WorkflowVersionStore
impl !RefUnwindSafe for WorkflowVersionStore
impl Send for WorkflowVersionStore
impl Sync for WorkflowVersionStore
impl Unpin for WorkflowVersionStore
impl !UnwindSafe for WorkflowVersionStore
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more