pub struct FileWriteOp {
pub path: PathBuf,
pub content: String,
pub is_new_file: bool,
}Expand description
File write operation with compensation
Fields§
§path: PathBufPath to the file being written.
content: StringContent to write.
is_new_file: boolWhether this creates a new file or overwrites an existing one.
Trait Implementations§
Source§impl CompensableOperation for FileWriteOp
impl CompensableOperation for FileWriteOp
Source§fn execute<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<OperationResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<OperationResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute the forward operation
Source§fn compensate<'life0, 'life1, 'async_trait>(
&'life0 self,
result: &'life1 OperationResult,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn compensate<'life0, 'life1, 'async_trait>(
&'life0 self,
result: &'life1 OperationResult,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Compensate (undo) the operation
Source§fn description(&self) -> String
fn description(&self) -> String
Get operation description for logging
Source§fn operation_type(&self) -> SagaOperationType
fn operation_type(&self) -> SagaOperationType
Get the operation type (for categorization)
Auto Trait Implementations§
impl Freeze for FileWriteOp
impl RefUnwindSafe for FileWriteOp
impl Send for FileWriteOp
impl Sync for FileWriteOp
impl Unpin for FileWriteOp
impl UnsafeUnpin for FileWriteOp
impl UnwindSafe for FileWriteOp
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