FileAnalyzer

Trait FileAnalyzer 

Source
pub trait FileAnalyzer: Send + Sync {
    // Required methods
    fn analyze_file<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        file_path: &'life1 Path,
        config: &'life2 Config,
    ) -> Pin<Box<dyn Future<Output = Result<FileInfo>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn analyze_content<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        file_info: &'life1 mut FileInfo,
        config: &'life2 Config,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn name(&self) -> &'static str;
    fn version(&self) -> &'static str;

    // Provided method
    fn analyze_batch<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        files: Vec<&'life1 Path>,
        config: &'life2 Config,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<FileInfo>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
}
Expand description

Core trait for file analysis implementations

Required Methods§

Source

fn analyze_file<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, file_path: &'life1 Path, config: &'life2 Config, ) -> Pin<Box<dyn Future<Output = Result<FileInfo>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Analyze a single file and return metadata

Source

fn analyze_content<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, file_info: &'life1 mut FileInfo, config: &'life2 Config, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Load and analyze file content

Source

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

Get analyzer name/version for caching

Source

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

Get analyzer version for cache invalidation

Provided Methods§

Source

fn analyze_batch<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, files: Vec<&'life1 Path>, config: &'life2 Config, ) -> Pin<Box<dyn Future<Output = Result<Vec<FileInfo>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Batch analyze multiple files for efficiency

Implementors§