Skip to main content

DocumentParser

Trait DocumentParser 

Source
pub trait DocumentParser: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn supported_extensions(&self) -> &[&str];
    fn parse(&self, path: &Path) -> Result<String>;

    // Provided methods
    fn signature(&self) -> String { ... }
    fn parse_extracted(&self, path: &Path) -> Result<ExtractedDocument> { ... }
    fn can_parse(&self, path: &Path) -> bool { ... }
    fn max_file_size(&self) -> u64 { ... }
}

Required Methods§

Source

fn name(&self) -> &str

Source

fn supported_extensions(&self) -> &[&str]

Source

fn parse(&self, path: &Path) -> Result<String>

Provided Methods§

Source

fn signature(&self) -> String

Source

fn parse_extracted(&self, path: &Path) -> Result<ExtractedDocument>

Source

fn can_parse(&self, path: &Path) -> bool

Source

fn max_file_size(&self) -> u64

Implementors§