pub enum EditPayload {
SearchReplace {
old_string: String,
new_string: String,
},
UnifiedDiff {
diff: String,
},
WholeFile {
content: String,
},
}Expand description
One candidate edit, in the shape the LLM actually supplied it.
Why: A single tool call may carry more than one representation of the same
edit (e.g. a model hedges with both old_string/new_string and a diff);
select_and_apply needs a typed payload per format to try in preference
order.
What: Each variant carries exactly the arguments its format needs.
Test: Constructed directly in edit.rs::execute from the parsed tool-call
arguments; exercised via tests::select_and_apply_*.
Variants§
SearchReplace
old_string must appear exactly once in the file; replaced with new_string.
UnifiedDiff
A unified-diff hunk set to apply against the file’s current content.
WholeFile
The complete new content of the file.
Trait Implementations§
Source§impl Clone for EditPayload
impl Clone for EditPayload
Source§fn clone(&self) -> EditPayload
fn clone(&self) -> EditPayload
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 EditPayload
impl Debug for EditPayload
Source§impl PartialEq for EditPayload
impl PartialEq for EditPayload
impl StructuralPartialEq for EditPayload
Auto Trait Implementations§
impl Freeze for EditPayload
impl RefUnwindSafe for EditPayload
impl Send for EditPayload
impl Sync for EditPayload
impl Unpin for EditPayload
impl UnsafeUnpin for EditPayload
impl UnwindSafe for EditPayload
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 moreCreates a shared type from an unshared type.