Trait Processor

Source
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§

Source

fn process<R: Read, W: Write>( &mut self, _pathname: &str, _process_type: ProcessingType, _input: &mut R, _output: &mut W, ) -> Result<()>

Handle clean/smudge operation

Source

fn schedule_process<R: Read>( &mut self, _pathname: &str, _process_type: ProcessingType, _input: &mut R, ) -> Result<()>

Schedule delayed execution

Source

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

Source

fn switch_to_wait(&mut self)

Called once all files are already scheduled/processed

Source

fn get_available(&mut self) -> Result<Vec<String>>

Get scheduled files ready for outputting

Source

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

Source

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.

Implementations on Foreign Types§

Source§

impl Processor for ()

Implementors§