pub trait FileProcessor:
Send
+ Sync
+ Debug {
// Required methods
fn process<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<ProcessingResult, ProcessingError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn supports_mime_type(&self, mime_type: &str) -> bool;
fn provider_name(&self) -> &'static str;
}Expand description
Trait for file processing providers.
Implementors of this trait can extract text content from various document formats. Each provider may support different file types and have different requirements (API keys, network access, etc.).
Required Methods§
Sourcefn process<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<ProcessingResult, ProcessingError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn process<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<ProcessingResult, ProcessingError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Process a file and extract text content.
§Arguments
path- Path to the file to process
§Returns
A ProcessingResult containing the extracted content, or an error.
Sourcefn supports_mime_type(&self, mime_type: &str) -> bool
fn supports_mime_type(&self, mime_type: &str) -> bool
Sourcefn provider_name(&self) -> &'static str
fn provider_name(&self) -> &'static str
Get the provider name for logging and debugging.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".