pub struct FileEditTask { /* private fields */ }Expand description
Task that edits a file (stub for Phase 11).
Demonstrates the Saga compensation pattern with undo functionality. In Phase 11, this will be implemented with actual file editing.
Implementations§
Source§impl FileEditTask
impl FileEditTask
Sourcepub fn new(
id: TaskId,
name: String,
file_path: PathBuf,
original_content: String,
new_content: String,
) -> Self
pub fn new( id: TaskId, name: String, file_path: PathBuf, original_content: String, new_content: String, ) -> Self
Creates a new FileEditTask.
§Arguments
id- Task identifiername- Human-readable task namefile_path- Path to the file to editoriginal_content- Original content (for rollback)new_content- New content to write
Sourcepub fn original_content(&self) -> &str
pub fn original_content(&self) -> &str
Gets the original content.
Sourcepub fn new_content(&self) -> &str
pub fn new_content(&self) -> &str
Gets the new content.
Trait Implementations§
Source§impl WorkflowTask for FileEditTask
impl WorkflowTask for FileEditTask
Source§fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
_context: &'life1 TaskContext,
) -> Pin<Box<dyn Future<Output = Result<TaskResult, TaskError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
_context: &'life1 TaskContext,
) -> Pin<Box<dyn Future<Output = Result<TaskResult, TaskError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Executes the task with the provided context. Read more
Source§fn compensation(&self) -> Option<CompensationAction>
fn compensation(&self) -> Option<CompensationAction>
Returns the compensation action for this task (if any). Read more
Auto Trait Implementations§
impl Freeze for FileEditTask
impl RefUnwindSafe for FileEditTask
impl Send for FileEditTask
impl Sync for FileEditTask
impl Unpin for FileEditTask
impl UnsafeUnpin for FileEditTask
impl UnwindSafe for FileEditTask
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> 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