DocumentReader

Trait DocumentReader 

Source
pub trait DocumentReader: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn supports(&self, hint: &ReaderHint<'_>) -> bool;
    fn extract(
        &self,
        bytes: &[u8],
        hint: &ReaderHint<'_>,
    ) -> Result<ReaderOutput>;
}
Expand description

Trait implemented by document readers that can extract text from supported formats.

Required Methods§

Source

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

Human-readable name used for diagnostics (e.g., “document_processor”, “pdfium”).

Source

fn supports(&self, hint: &ReaderHint<'_>) -> bool

Return true if this reader is a good match for the provided hint.

Source

fn extract(&self, bytes: &[u8], hint: &ReaderHint<'_>) -> Result<ReaderOutput>

Extract text and metadata from the provided bytes.

Implementors§