pub struct UndoStack { /* private fields */ }Expand description
Stack of undo entries, one per turn.
Implementations§
Source§impl UndoStack
impl UndoStack
Sourcepub fn snapshot(&mut self, path: &Path)
pub fn snapshot(&mut self, path: &Path)
Snapshot a file before mutation. Call before Write/Edit/Delete.
Only snapshots the first time per file per turn (preserves original state).
Sourcepub fn commit_turn(&mut self)
pub fn commit_turn(&mut self)
Finalize the current turn’s snapshots into an undo entry.
Call at the end of each inference turn (after all tool calls complete). Does nothing if no mutations were snapshotted.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for UndoStack
impl RefUnwindSafe for UndoStack
impl Send for UndoStack
impl Sync for UndoStack
impl Unpin for UndoStack
impl UnsafeUnpin for UndoStack
impl UnwindSafe for UndoStack
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