forge_doc

Trait Preprocessor

Source
pub trait Preprocessor: Debug {
    // Required methods
    fn id(&self) -> PreprocessorId;
    fn preprocess(
        &self,
        documents: Vec<Document>,
    ) -> Result<Vec<Document>, Error>;
}
Expand description

Trait for preprocessing and/or modifying existing documents before writing the to disk.

Required Methods§

Source

fn id(&self) -> PreprocessorId

The id of the preprocessor. Used to write data to document context.

Source

fn preprocess(&self, documents: Vec<Document>) -> Result<Vec<Document>, Error>

Preprocess the collection of documents

Implementors§