pub struct ConflictDetector;Expand description
Detects file conflicts before writing
Implements requirements:
- Requirement 1.5: Detect conflicts when generated files would overwrite existing files
- Requirement 4.1: Compute diffs between old and new content
Implementations§
Source§impl ConflictDetector
impl ConflictDetector
Sourcepub fn detect(
&self,
files: &[GeneratedFile],
target_dir: &Path,
) -> Result<Vec<FileConflictInfo>, GenerationError>
pub fn detect( &self, files: &[GeneratedFile], target_dir: &Path, ) -> Result<Vec<FileConflictInfo>, GenerationError>
Detect conflicts for a set of generated files
Checks if any generated files would overwrite existing files and computes diffs.
§Arguments
files- Generated files to checktarget_dir- Target directory where files would be written
§Returns
List of detected conflicts
§Requirements
- Requirement 1.5: Detect conflicts when generated files would overwrite existing files
- Requirement 4.1: Compute diffs between old and new content
Sourcepub fn detect_single(
&self,
file_path: &Path,
new_content: &str,
) -> Result<Option<FileConflictInfo>, GenerationError>
pub fn detect_single( &self, file_path: &Path, new_content: &str, ) -> Result<Option<FileConflictInfo>, GenerationError>
Sourcepub fn is_identical(&self, old_content: &str, new_content: &str) -> bool
pub fn is_identical(&self, old_content: &str, new_content: &str) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConflictDetector
impl RefUnwindSafe for ConflictDetector
impl Send for ConflictDetector
impl Sync for ConflictDetector
impl Unpin for ConflictDetector
impl UnwindSafe for ConflictDetector
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