pub trait Processor {
// Provided methods
fn process<R: Read, W: Write>(
&mut self,
_pathname: &str,
_process_type: ProcessingType,
_input: &mut R,
_output: &mut W,
) -> Result<()> { ... }
fn schedule_process<R: Read>(
&mut self,
_pathname: &str,
_process_type: ProcessingType,
_input: &mut R,
) -> Result<()> { ... }
fn get_scheduled<W: Write>(
&mut self,
_pathname: &str,
_process_type: ProcessingType,
_output: &mut W,
) -> Result<()> { ... }
fn switch_to_wait(&mut self) { ... }
fn get_available(&mut self) -> Result<Vec<String>> { ... }
fn should_delay(
&self,
_pathname: &str,
_process_type: ProcessingType,
) -> bool { ... }
fn supports_processing(&self, _process_type: ProcessingType) -> bool { ... }
}
Expand description
This trait is used for user-defined logic of git-filter-server Typically git talks with processor via stdio, so better do not use it inside
Provided Methods§
Sourcefn process<R: Read, W: Write>(
&mut self,
_pathname: &str,
_process_type: ProcessingType,
_input: &mut R,
_output: &mut W,
) -> Result<()>
fn process<R: Read, W: Write>( &mut self, _pathname: &str, _process_type: ProcessingType, _input: &mut R, _output: &mut W, ) -> Result<()>
Handle clean/smudge operation
Sourcefn schedule_process<R: Read>(
&mut self,
_pathname: &str,
_process_type: ProcessingType,
_input: &mut R,
) -> Result<()>
fn schedule_process<R: Read>( &mut self, _pathname: &str, _process_type: ProcessingType, _input: &mut R, ) -> Result<()>
Schedule delayed execution
Sourcefn get_scheduled<W: Write>(
&mut self,
_pathname: &str,
_process_type: ProcessingType,
_output: &mut W,
) -> Result<()>
fn get_scheduled<W: Write>( &mut self, _pathname: &str, _process_type: ProcessingType, _output: &mut W, ) -> Result<()>
Get data for file, previously scheduled via schedule_process
Sourcefn switch_to_wait(&mut self)
fn switch_to_wait(&mut self)
Called once all files are already scheduled/processed
Sourcefn get_available(&mut self) -> Result<Vec<String>>
fn get_available(&mut self) -> Result<Vec<String>>
Get scheduled files ready for outputting
Sourcefn should_delay(&self, _pathname: &str, _process_type: ProcessingType) -> bool
fn should_delay(&self, _pathname: &str, _process_type: ProcessingType) -> bool
Should processing of file be delayed? Only use it for long-running tasks, i.e file downloading, which would be better parallelized
Sourcefn supports_processing(&self, _process_type: ProcessingType) -> bool
fn supports_processing(&self, _process_type: ProcessingType) -> bool
Does this filter supports clean/smudge?
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.