Struct ruplacer::DirectoryPatcher
source · [−]pub struct DirectoryPatcher<'a> { /* private fields */ }
Expand description
Used to run replacement query on every text file present in a given path
use ruplacer::{DirectoryPatcher, Query, Settings, Stats};
use std::path::PathBuf;
let settings = Settings{
dry_run: true,
.. Default::default()
};
let path = PathBuf::from("tests/data");
let mut directory_patcher = DirectoryPatcher::new(&path, &settings);
let query = Query::substring("old", "new");
directory_patcher.run(&query).unwrap();
let stats = directory_patcher.stats();
println!("Found {} matching lines", stats.matching_lines());
Implementations
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for DirectoryPatcher<'a>
impl<'a> Send for DirectoryPatcher<'a>
impl<'a> Sync for DirectoryPatcher<'a>
impl<'a> Unpin for DirectoryPatcher<'a>
impl<'a> UnwindSafe for DirectoryPatcher<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more