pub struct CompensationAction {
pub action_type: CompensationType,
pub description: String,
}Expand description
Compensation action that undoes task side effects.
Describes how to compensate a task during workflow rollback using the Saga pattern. This is a simplified version for use in TaskResult. The full implementation with undo functions is in the rollback module.
Fields§
§action_type: CompensationTypeType of compensation action
description: StringHuman-readable description of the compensation
Implementations§
Source§impl CompensationAction
impl CompensationAction
Sourcepub fn new(
action_type: CompensationType,
description: impl Into<String>,
) -> Self
pub fn new( action_type: CompensationType, description: impl Into<String>, ) -> Self
Creates a new CompensationAction.
Sourcepub fn skip(description: impl Into<String>) -> Self
pub fn skip(description: impl Into<String>) -> Self
Creates a Skip compensation (no undo needed).
Trait Implementations§
Source§impl Clone for CompensationAction
impl Clone for CompensationAction
Source§fn clone(&self) -> CompensationAction
fn clone(&self) -> CompensationAction
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 moreSource§impl Debug for CompensationAction
impl Debug for CompensationAction
Source§impl<'de> Deserialize<'de> for CompensationAction
impl<'de> Deserialize<'de> for CompensationAction
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<CompensationAction> for ToolCompensation
impl From<CompensationAction> for ToolCompensation
Source§fn from(action: CompensationAction) -> Self
fn from(action: CompensationAction) -> Self
Converts to this type from the input type.
Source§impl From<ExecutableCompensation> for CompensationAction
impl From<ExecutableCompensation> for CompensationAction
Source§fn from(exec: ExecutableCompensation) -> Self
fn from(exec: ExecutableCompensation) -> Self
Converts to this type from the input type.
Source§impl PartialEq for CompensationAction
impl PartialEq for CompensationAction
Source§impl Serialize for CompensationAction
impl Serialize for CompensationAction
impl Eq for CompensationAction
impl StructuralPartialEq for CompensationAction
Auto Trait Implementations§
impl Freeze for CompensationAction
impl RefUnwindSafe for CompensationAction
impl Send for CompensationAction
impl Sync for CompensationAction
impl Unpin for CompensationAction
impl UnsafeUnpin for CompensationAction
impl UnwindSafe for CompensationAction
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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