Skip to main content

Extractor

Trait Extractor 

Source
pub trait Extractor:
    Send
    + Sync
    + Debug {
    // Required method
    fn extract(
        &self,
        bytes: &[u8],
        mime_type: Option<&str>,
        file_name: &str,
    ) -> Result<String, RagError>;
}
Expand description

Turns raw document bytes into text for ingestion (PDF, DOCX, … extractors plug in here).

Required Methods§

Source

fn extract( &self, bytes: &[u8], mime_type: Option<&str>, file_name: &str, ) -> Result<String, RagError>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§