Struct ruplacer::DirectoryPatcher[][src]

pub struct DirectoryPatcher<'a> { /* fields omitted */ }
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

Performs the conversion.

Performs the conversion.

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.