Trait golem_rust::Operation
source · pub trait Operation: Clone {
type In: Clone;
type Out: Clone;
type Err: Clone;
// Required methods
fn execute(&self, input: Self::In) -> Result<Self::Out, Self::Err>;
fn compensate(
&self,
input: Self::In,
result: Self::Out,
) -> Result<(), Self::Err>;
}
Expand description
Represents an atomic operation of the transaction which has a rollback action.
Implement this trait and use it within a transaction
block.
Operations can also be constructed from closures using operation
.
Required Associated Types§
Required Methods§
Object Safety§
This trait is not object safe.