Struct golem_rust::InfallibleTransaction
source · pub struct InfallibleTransaction { /* private fields */ }
Expand description
InfallibleTransaction is a sequence of operations that are executed in a way that if any of the operations or the underlying Golem executor fails, the whole transaction is going to be retried.
In addition to that, user level failures (represented by the Result::Err
value
of an operation) lead to performing the compensation actions of each already performed operation
in reverse order.
Fatal errors (panic) and external executor failures are currently cannot perform the rollback actions.
Implementations§
Trait Implementations§
source§impl<Err: Debug + Clone + 'static> Transaction<Err> for InfallibleTransaction
impl<Err: Debug + Clone + 'static> Transaction<Err> for InfallibleTransaction
fn execute<OpIn: Clone + 'static, OpOut: Clone + 'static>( &mut self, operation: impl Operation<In = OpIn, Out = OpOut, Err = Err> + 'static, input: OpIn, ) -> Result<OpOut, Err>
fn fail(&mut self, error: Err) -> Result<(), Err>
fn run<Out>( f: impl FnOnce(&mut Self) -> Result<Out, Err>, ) -> TransactionResult<Out, Err>
Auto Trait Implementations§
impl Freeze for InfallibleTransaction
impl !RefUnwindSafe for InfallibleTransaction
impl !Send for InfallibleTransaction
impl !Sync for InfallibleTransaction
impl Unpin for InfallibleTransaction
impl !UnwindSafe for InfallibleTransaction
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