Skip to main content

Extractor

Trait Extractor 

Source
pub trait Extractor {
    // Required methods
    fn name(&self) -> &'static str;
    fn supports(&self, path: &Path, sniff: &Sniff) -> bool;
    fn extract(&self, path: &Path, opts: &ExtractOpts) -> Result<Document>;
}
Expand description

Anything that can turn a file of some format into a Document.

Required Methods§

Source

fn name(&self) -> &'static str

Stable name, used in logs and error messages.

Source

fn supports(&self, path: &Path, sniff: &Sniff) -> bool

Whether this extractor handles the given file.

Source

fn extract(&self, path: &Path, opts: &ExtractOpts) -> Result<Document>

Read and parse the file. The impure edge.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§