pub struct ContentReplacer { /* private fields */ }Expand description
Content replacer that applies regex find-and-replace across files
Implementations§
Source§impl ContentReplacer
impl ContentReplacer
Sourcepub fn new(options: ReplaceOptions) -> Result<Self>
pub fn new(options: ReplaceOptions) -> Result<Self>
Creates a new replacer with the given options. Returns an error if any regex pattern is invalid.
Sourcepub fn replace_file(&self, path: &Path) -> Result<usize>
pub fn replace_file(&self, path: &Path) -> Result<usize>
Apply all patterns to a single file. Returns number of replacements made.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ContentReplacer
impl RefUnwindSafe for ContentReplacer
impl Send for ContentReplacer
impl Sync for ContentReplacer
impl Unpin for ContentReplacer
impl UnsafeUnpin for ContentReplacer
impl UnwindSafe for ContentReplacer
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