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

Run the given query on the selected files in self.path

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.