pub trait Processor {
// Required methods
fn name(&self) -> &str;
fn filter(&self, path: &Path) -> Result<bool>;
fn process(&self, path: &Path) -> Result<ProcessResult>;
// Provided method
fn initialize(&mut self) -> Result<()> { ... }
}Required Methods§
fn name(&self) -> &str
Sourcefn filter(&self, path: &Path) -> Result<bool>
fn filter(&self, path: &Path) -> Result<bool>
Return true if the given path looks like it should be processed.
Sourcefn process(&self, path: &Path) -> Result<ProcessResult>
fn process(&self, path: &Path) -> Result<ProcessResult>
Process file and indicate whether modifications were made.
Provided Methods§
Sourcefn initialize(&mut self) -> Result<()>
fn initialize(&mut self) -> Result<()>
Optionally, do “global” setup of the processor.