pub struct Mutator { /* private fields */ }Expand description
Mutator for transaction-based code changes.
The Mutator uses the Transaction module to apply changes atomically, snapshotting files before mutation and providing rollback capability.
Implementations§
Source§impl Mutator
impl Mutator
Sourcepub async fn begin_transaction(&mut self) -> Result<()>
pub async fn begin_transaction(&mut self) -> Result<()>
Begins a new transaction.
Sourcepub async fn apply_step(&mut self, step: &PlanStep) -> Result<()>
pub async fn apply_step(&mut self, step: &PlanStep) -> Result<()>
Applies a single step in the current transaction.
Snapshots each file before mutation for rollback capability.
Sourcepub async fn rollback(&mut self) -> Result<()>
pub async fn rollback(&mut self) -> Result<()>
Rolls back the current transaction.
Takes the transaction, rolls back all changes, and returns Ok.
Sourcepub async fn commit_transaction(self) -> Result<Uuid>
pub async fn commit_transaction(self) -> Result<Uuid>
Commits the current transaction.
Takes the transaction, commits it, and returns the commit ID.
Sourcepub fn into_transaction(self) -> Result<Transaction>
pub fn into_transaction(self) -> Result<Transaction>
Extracts the transaction from the mutator.
This is used when transferring the transaction to another component (e.g., from Mutator to AgentLoop).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Mutator
impl RefUnwindSafe for Mutator
impl Send for Mutator
impl Sync for Mutator
impl Unpin for Mutator
impl UnsafeUnpin for Mutator
impl UnwindSafe for Mutator
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<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