pub trait FormatHandler: Send + Sync {
// Required methods
fn extract_content(
&self,
data: &[u8],
config: &ContentExtractionConfig,
) -> Result<ExtractedContent>;
fn can_handle(&self, data: &[u8]) -> bool;
fn supported_extensions(&self) -> Vec<&'static str>;
}Expand description
Trait for format-specific content handlers
Required Methods§
Sourcefn extract_content(
&self,
data: &[u8],
config: &ContentExtractionConfig,
) -> Result<ExtractedContent>
fn extract_content( &self, data: &[u8], config: &ContentExtractionConfig, ) -> Result<ExtractedContent>
Extract content from document bytes
Sourcefn can_handle(&self, data: &[u8]) -> bool
fn can_handle(&self, data: &[u8]) -> bool
Check if this handler can process the given data
Sourcefn supported_extensions(&self) -> Vec<&'static str>
fn supported_extensions(&self) -> Vec<&'static str>
Get supported file extensions
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl FormatHandler for AudioHandler
Available on crate feature
content-processing only.impl FormatHandler for CsvHandler
Available on crate feature
content-processing only.impl FormatHandler for DocxHandler
Available on crate feature
content-processing only.impl FormatHandler for FallbackHandler
Available on crate feature
content-processing only.impl FormatHandler for HtmlHandler
Available on crate feature
content-processing only.impl FormatHandler for ImageHandler
Available on crate feature
content-processing only.impl FormatHandler for JsonHandler
Available on crate feature
content-processing only.impl FormatHandler for MarkdownHandler
Available on crate feature
content-processing only.impl FormatHandler for PdfHandler
Available on crate feature
content-processing only.impl FormatHandler for PlainTextHandler
Available on crate feature
content-processing only.impl FormatHandler for PptxHandler
Available on crate feature
content-processing only.impl FormatHandler for VideoHandler
Available on crate feature
content-processing only.impl FormatHandler for XlsxHandler
Available on crate feature
content-processing only.impl FormatHandler for XmlHandler
Available on crate feature
content-processing only.