pub struct TransformResult {
pub file_path: PathBuf,
pub match_count: usize,
pub applied_count: usize,
pub diff: String,
pub original_content: String,
pub new_content: String,
}Expand description
Result of a transformation applied to a single file.
Contains both the diff and the full original/new content so that the caller can preview changes, persist them, or roll them back.
Fields§
§file_path: PathBufPath of the transformed file.
match_count: usizeNumber of pattern matches found in the file.
applied_count: usizeNumber of transformations successfully applied.
diff: StringUnified diff of the changes (suitable for display or patch files).
original_content: StringOriginal file content (for rollback).
new_content: StringNew file content after transformation.
Implementations§
Source§impl TransformResult
impl TransformResult
Sourcepub fn has_changes(&self) -> bool
pub fn has_changes(&self) -> bool
Returns true if at least one transformation was applied.
Trait Implementations§
Source§impl Clone for TransformResult
impl Clone for TransformResult
Source§fn clone(&self) -> TransformResult
fn clone(&self) -> TransformResult
Returns a duplicate of the value. Read more
1.0.0 · 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 TransformResult
impl Debug for TransformResult
Source§impl<'de> Deserialize<'de> for TransformResult
impl<'de> Deserialize<'de> for TransformResult
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TransformResult
impl RefUnwindSafe for TransformResult
impl Send for TransformResult
impl Sync for TransformResult
impl Unpin for TransformResult
impl UnsafeUnpin for TransformResult
impl UnwindSafe for TransformResult
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> 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