pub struct EditResult {
pub path: String,
pub original_content: String,
pub new_content: String,
pub diff: String,
pub applied: bool,
pub changed: bool,
pub action: &'static str,
pub dest_path: Option<String>,
pub match_count: usize,
pub removed: usize,
}Expand description
The result of an editing operation.
Fields§
§path: StringPath to the affected file (as provided by the caller).
original_content: StringThe original file content before the edit.
new_content: StringThe new content after the edit.
diff: StringA unified diff between original and new content.
applied: boolWhether the file was actually written to disk.
changed: boolWhether the content changed.
action: &'static strAction/kind of the edit (e.g. “append”, “create”, “replace”, “rename”, “doc.set”). Helps consumers (like Bline) distinguish cross-file or op type without parsing path.
dest_path: Option<String>For cross-file operations (e.g. file_rename, md_move_section with to),
the destination path if different from path.
match_count: usizeNumber of times the search pattern matched in the original content.
Only meaningful for replace operations; defaults to 0 for other
operation types (doc, md, file, patch, tidy).
removed: usizeNumber of items removed by the operation (keys, array elements, etc.).
Meaningful for doc.delete and doc.delete_where (including
idempotent no-ops where removed == 0 and changed == false).
Defaults to 0 for other operation types. Mirrors MCP/tx JSON
mutation summaries so embedders can report delete outcomes without
re-reading the file or parsing diffs (#1459 / #1439).
Trait Implementations§
Source§impl Clone for EditResult
impl Clone for EditResult
Source§fn clone(&self) -> EditResult
fn clone(&self) -> EditResult
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for EditResult
impl RefUnwindSafe for EditResult
impl Send for EditResult
impl Sync for EditResult
impl Unpin for EditResult
impl UnsafeUnpin for EditResult
impl UnwindSafe for EditResult
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
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>
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>
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