pub struct SkipIfGenerator;Expand description
Default skip_if pattern generator for injection templates.
Implementations§
Source§impl SkipIfGenerator
impl SkipIfGenerator
Sourcepub fn generate_exact_match(content: &str) -> String
pub fn generate_exact_match(content: &str) -> String
Generate a default skip_if pattern for exact substring match.
This creates a regex pattern that will match if the injection content already exists in the target file.
Sourcepub fn content_exists_in_file(content: &str, file_path: &Path) -> Result<bool>
pub fn content_exists_in_file(content: &str, file_path: &Path) -> Result<bool>
Check if content already exists in target file using exact substring match.
Sourcepub fn generate_idempotent_pattern(content: &str) -> String
pub fn generate_idempotent_pattern(content: &str) -> String
Generate a default skip_if for idempotent injection.
This is more sophisticated than exact match - it looks for content that has already been injected by checking for rgen-specific markers or patterns.
Auto Trait Implementations§
impl Freeze for SkipIfGenerator
impl RefUnwindSafe for SkipIfGenerator
impl Send for SkipIfGenerator
impl Sync for SkipIfGenerator
impl Unpin for SkipIfGenerator
impl UnwindSafe for SkipIfGenerator
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