pub trait SagaTransaction {
type Err: Into<Error> + From<Error>;
// Required methods
fn get_saga<'life0, 'life1, 'async_trait>(
&'life0 mut self,
operation_id: &'life1 Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<Saga>, Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_saga_for_update<'life0, 'life1, 'async_trait>(
&'life0 mut self,
operation_id: &'life1 Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<Acquired<Saga>>, Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn add_saga<'life0, 'life1, 'async_trait>(
&'life0 mut self,
saga: &'life1 Saga,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn update_acquired_saga<'life0, 'life1, 'async_trait>(
&'life0 mut self,
saga: &'life1 mut Acquired<Saga>,
new_state: SagaStateEnum,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn update_acquired_saga_with_finalization_data<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
saga: &'life1 mut Acquired<Saga>,
new_state: SagaStateEnum,
finalization_data: Option<&'life2 MeltFinalizationData>,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn delete_saga<'life0, 'life1, 'async_trait>(
&'life0 mut self,
operation_id: &'life1 Uuid,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Saga Transaction trait
Required Associated Types§
Required Methods§
Sourcefn get_saga<'life0, 'life1, 'async_trait>(
&'life0 mut self,
operation_id: &'life1 Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<Saga>, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_saga<'life0, 'life1, 'async_trait>(
&'life0 mut self,
operation_id: &'life1 Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<Saga>, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get saga by operation_id
Sourcefn get_saga_for_update<'life0, 'life1, 'async_trait>(
&'life0 mut self,
operation_id: &'life1 Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<Acquired<Saga>>, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_saga_for_update<'life0, 'life1, 'async_trait>(
&'life0 mut self,
operation_id: &'life1 Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<Acquired<Saga>>, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get a saga by operation ID and mark it as acquired for mutation.
Implementations must lock the returned row for the lifetime of the transaction. Saga mutation methods require this marker so callers cannot update a stale snapshot loaded outside the transaction.
Sourcefn add_saga<'life0, 'life1, 'async_trait>(
&'life0 mut self,
saga: &'life1 Saga,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn add_saga<'life0, 'life1, 'async_trait>(
&'life0 mut self,
saga: &'life1 Saga,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Add saga
Sourcefn update_acquired_saga<'life0, 'life1, 'async_trait>(
&'life0 mut self,
saga: &'life1 mut Acquired<Saga>,
new_state: SagaStateEnum,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_acquired_saga<'life0, 'life1, 'async_trait>(
&'life0 mut self,
saga: &'life1 mut Acquired<Saga>,
new_state: SagaStateEnum,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Update the state of an acquired saga.
Sourcefn update_acquired_saga_with_finalization_data<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
saga: &'life1 mut Acquired<Saga>,
new_state: SagaStateEnum,
finalization_data: Option<&'life2 MeltFinalizationData>,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn update_acquired_saga_with_finalization_data<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
saga: &'life1 mut Acquired<Saga>,
new_state: SagaStateEnum,
finalization_data: Option<&'life2 MeltFinalizationData>,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Update an acquired saga state and optional finalization metadata.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".